From: Ken N. <ke...@co...> - 2005-10-12 12:00:29
|
Hey Everyone, I am putting the final touches on the v0.2.0 update to my Nakes module (Business / Organization Listings). I added a layout box so I could have a random business / organization show on the front page. This is not a problem for an original install, but was giving me problems with an update because there was no set way to update mod_layout_box. Following is the code which will do just that... And oddly enough, it works! ********** $themeList = PHPWS_Layout::get_themes(); foreach ($themeList as $theme){ if(!$_SESSION["OBJ_layout"]->_addBox($theme, '*mod_title*', '*content_var*', '*theme_var*', 0)) { $status = 0; } } if (isset($_SESSION["OBJ_layout"])){ $_SESSION["OBJ_layout"]->initializeLayout(); $_SESSION["OBJ_layout"]->loadBoxInfo(); } ********** *mod_title*, *content_var*, and *theme_var* above are not literal, you will have to use variables or hard code the appropriate names. For my purposes, I hard coded mod_title, content_var, and theme_var. The next logical step would be to have a way to synchronize the box locations for all themes using a specific theme. For example, I just spent an hour or so arranging the boxes for one theme, then install a new theme and do not want to go through the process again... I can just synchronize the themes. HTH, Ken |