[Openfirst-cvscommit] base/config first.php,1.8,1.9
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-27 23:47:43
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1:/tmp/cvs-serv16789 Modified Files: first.php Log Message: Add navigation menu generation to globals.php, fix various errors in the generated globals.php scripts Index: first.php =================================================================== RCS file: /cvsroot/openfirst/base/config/first.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** first.php 27 Jun 2003 14:36:35 -0000 1.8 --- first.php 27 Jun 2003 23:47:40 -0000 1.9 *************** *** 81,113 **** ! session_start(); ! include(\'auth.php\'); mysql_select_db(\$sqldatabase, \$sqlconnection); \$incl = mysql_query(\"SELECT * FROM ofirst_config\"); if(mysql_errno() == 0) { ! while(\$module = mysql_fetch_object(\$incl)) { ! if( (bool) \$module->active == true) { ! if(! \$module->includes == \"\"){ ! \$inclist = explode(\",\",\$module->includes); ! if(count(\$inclist) >= 2){ ! foreach(\$inclist As \$inc){ ! include(\"\$basepath/\$module->modulename/\$inc\"); ! } ! } else { ! include(\"\$fbasepath/\$module->modulename/\$module->includes\"); ! } ! } ! if( (bool) \$module->showonmenu == true) { ! \$headers .= \" » <a class=\'menu\' ! href=\'\$basepath/\$module->modulename/\'>\".ucwords(\$module->modulename).\"</a> |\"; ! } - if (\$currentmodule = \$module->modulename){ - \$adminnav = \$module->adminnavigation; - \$subnav = \$module->modulenavigation; - } - } - } - } session_write_close(); ?>"); --- 81,135 ---- ! session_start(); ! include('auth.php'); ! session_write_close(); ! ! \$headers = \"\"; ! mysql_select_db(\$sqldatabase, \$sqlconnection); \$incl = mysql_query(\"SELECT * FROM ofirst_config\"); + + // If there is no error then run the module add feature if(mysql_errno() == 0) { ! // Begin to loop through modules from the databaes ! while(\$module = mysql_fetch_object(\$incl)) { ! // Check if the value is try, if it is then run an include ! if( (bool) \$module->active == true) { ! // Check if there are includes that need to be included ! if(! \$module->includes == \"\"){ ! // If the list is not empty then explode the value and put it into inclist ! \$inclist = explode(\",\",\$module->includes); ! // This is to remove an error that you have if you don't check if there are more then 2 ! if(count(\$inclist) >= 2){ ! ! // Loop through the inclist and add them according to their paths ! foreach(\$inclist As \$inc){ ! include(\"\$fbasepath/\$module->modulename/\$inc\"); ! } ! } else { ! // If there is only 1 include available then use this line to include it instead ! include(\"$fbasepath/\$module->modulename/\$module->includes\"); ! } ! } ! ! // If the module has requested to be shown on the menu then add it ! if( (bool) \$module->showonmenu == true) { ! // If it is the current module then color the item ! if (\$currentmodule == \$module->modulename){ ! \$headers .= \" » <font color='red'><b><a class='menu' href='\$basepath/\$module->modulename'>\".ucwords(\$module->modulename).\"</a></b></font> |\"; ! ! // Declare important variables so that headers can pick them up and preview them ! ! \$adminnav = str_replace(\"\$basepath\", \$basepath, \$module->adminnavigation); ! \$subnav = str_replace(\"\$basepath\", \$basepath, \$module->modulenavigation); ! ! }else{ ! \$headers .= \" » <a class='menu' href='\$basepath/\$module->modulename'>\".ucwords(\$module->modulename).\"</a> |\"; ! } ! } ! } ! } ! } session_write_close(); ?>"); |