diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 4af3b4460..b5c8d9be8 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/admin.php,v $ -| $Revision: 1.14 $ -| $Date: 2009-08-31 13:12:02 $ +| $Revision: 1.15 $ +| $Date: 2009-09-06 20:04:02 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -355,7 +355,7 @@ function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb') { include(e_PLUGIN.$plugin_path."/plugin.php"); } - if ($eplug_conffile) + if (varset($eplug_conffile)) { $eplug_name = $tp->toHTML($eplug_name,FALSE,"defs, emotes_off"); $plugin_icon = $eplug_icon_small ? "" : E_16_PLUGIN; diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 71a8c56a5..a85814432 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $ -| $Revision: 1.47 $ -| $Date: 2009-09-04 15:24:40 $ +| $Revision: 1.48 $ +| $Date: 2009-09-06 20:04:02 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -965,7 +965,7 @@ function addIndexToTable($target, $indexSpec, $just_check, &$updateMessages, $op function catch_error(&$target) { - if ($target->mySQLlastErrText != '' && E107_DEBUG_LEVEL != 0) + if (vartrue($target->mySQLlastErrText) && E107_DEBUG_LEVEL != 0) { $tmp2 = debug_backtrace(); $tmp = $target->mySQLlastErrText; diff --git a/e107_handlers/menu_class.php b/e107_handlers/menu_class.php index 2e7cbcb10..cace10b47 100644 --- a/e107_handlers/menu_class.php +++ b/e107_handlers/menu_class.php @@ -9,8 +9,8 @@ * e107 Menu Class * * $Source: /cvs_backup/e107_0.8/e107_handlers/menu_class.php,v $ - * $Revision: 1.12 $ - * $Date: 2009-09-04 14:35:01 $ + * $Revision: 1.13 $ + * $Date: 2009-09-06 20:04:03 $ * $Author: e107coders $ */ @@ -232,7 +232,7 @@ class e_menu ob_start(); } - if($error_handler->debug == true) + if(vartrue($error_handler->debug)) { echo "\n\n"; } diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index e89b57536..3f9dec66f 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -9,8 +9,8 @@ * mySQL Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $ - * $Revision: 1.47 $ - * $Date: 2009-09-05 23:02:23 $ + * $Revision: 1.48 $ + * $Date: 2009-09-06 20:04:03 $ * $Author: e107coders $ */ @@ -61,7 +61,7 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s * MySQL Abstraction class * * @package e107 -* @version $Revision: 1.47 $ +* @version $Revision: 1.48 $ * @author $Author: e107coders $ */ class db { @@ -529,7 +529,8 @@ class db { $arg = $new_data .(isset($arg['WHERE']) ? ' WHERE '. $arg['WHERE'] : ''); } - if ($result = $this->mySQLresult = $this->db_Query('UPDATE '.$this->mySQLPrefix.$table.' SET '.$arg, NULL, 'db_Update', $debug, $log_type, $log_remark)) + $query = 'UPDATE '.$this->mySQLPrefix.$table.' SET '.$arg; + if ($result = $this->mySQLresult = $this->db_Query($query, NULL, 'db_Update', $debug, $log_type, $log_remark)) { $result = mysql_affected_rows($this->mySQLaccess); $this->dbError('db_Update'); diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index c9b91a27c..3586f38f8 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ -| $Revision: 1.78 $ -| $Date: 2009-09-03 22:27:32 $ +| $Revision: 1.79 $ +| $Date: 2009-09-06 20:04:03 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -124,12 +124,10 @@ class e107plugin $sql = e107::getDb(); $sql2 = e107::getDb('sql2'); $tp = e107::getParser(); + $fl = e107::getFile(); global $mySQLprefix, $menu_pref, $pref; - require_once(e_HANDLER.'file_class.php'); - - $fl = new e_file; $pluginList = $fl->get_files(e_PLUGIN, "^plugin\.(php|xml)$", "standard", 1); $sp = FALSE; @@ -298,6 +296,7 @@ class e107plugin $sql = e107::getDb(); $tp = e107::getParser(); + $fl = e107::getFile(); $query = "SELECT * FROM #plugin WHERE plugin_installflag =0 ORDER BY plugin_path ASC"; $sql->db_Select_gen($query); @@ -311,9 +310,6 @@ class e107plugin $reject_plugin[] = $val['plugin_path']."/images"; } - require_once(e_HANDLER."file_class.php"); - $fl = new e_file; - $filesrch = implode("|",array("_16.png","_16.PNG","_32.png","_32.PNG","_48.png","_48.PNG","_64.png","_64.PNG","_128.png","_128.png")); if($plugin_icons = $fl->get_files(e_PLUGIN,$filesrch,$reject_plugin,2)) @@ -363,12 +359,7 @@ class e107plugin $iconpool[$key][] = $tp->createConstants($file['path'],1).$file['fname']; } - // TODO Review pref-class method used below (a new function?), to simply add or update existing prefs. (without a global $pref) - foreach($iconpool as $key=>$val) - { - e107::getConfig('ipool')->set($key,$val); - } - + e107::getConfig('ipool')->setPref($iconpool); return (e107::getConfig('ipool')->save(FALSE)) ? TRUE : FALSE; } @@ -600,10 +591,9 @@ class e107plugin } } - - // e107::getConfig('core')->save(FALSE); - // save_prefs(); //FIXME doesn't work from install.php - e107::getConfig()->loadData($pref, false)->save(false, true); + e107::getConfig('core')->setPref($pref)->save(); + +// e107::getConfig()->loadData($pref, false)->save(false, true); } @@ -682,7 +672,7 @@ class e107plugin // Handle prefs from arrays (mostly 0.7 stuff, possibly apart from the special cases) function manage_plugin_prefs($action, $prefname, $plugin_folder, $varArray = '') { // These prefs are 'cumulative' - several plugins may contribute an array element - global $pref; + // global $pref; /* if ($prefname == 'plug_sc' || $prefname == 'plug_bb') { // Special cases - shortcodes and bbcodes - each plugin may contribute several elements @@ -721,8 +711,12 @@ class e107plugin { $pref[$prefname] = substr($pref[$prefname], 1); } + + e107::getConfig('core')->setPref($pref); + e107::getConfig('core')->save(); + // save_prefs(); //FIXME - should be a better way to do this. - e107::getConfig()->loadData($pref, false)->save(false, true); + // e107::getConfig()->loadData($pref, false)->save(false, true); } @@ -784,10 +778,9 @@ class e107plugin { unset($search_prefs['comments_handlers'][$eplug_folder]); } - // $tmp = addslashes(serialize($search_prefs)); - $tmp = e107::getArrayStorage()->WriteArray($search_prefs); - //TODO Use preference class instead of this. - $sql->db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = 'search_prefs' "); + + e107::getConfig('search')->setPref($search_prefs)->save(); + } function manage_notify($action, $eplug_folder) @@ -1272,11 +1265,7 @@ class e107plugin } } - - -// save_prefs(); //FIXME replace with pref-class equivalent - e107::getConfig()->loadData($pref, false)->save(false, true); - + e107::getConfig()->setPref($pref)->save(false); if ($canContinue) { // Let's call any custom post functions defined in section @@ -1514,8 +1503,7 @@ class e107plugin function save_addon_prefs() // scan the plugin table and create path-array-prefs for each addon. { $sql = e107::getDb(); - - $addpref = array(); + $core = e107::getConfig('core'); // $query = "SELECT * FROM #plugin WHERE plugin_installflag = 1 AND plugin_addons !='' ORDER BY plugin_path ASC"; $query = "SELECT * FROM #plugin WHERE plugin_addons !='' ORDER BY plugin_path ASC"; @@ -1534,7 +1522,8 @@ class e107plugin { if(strpos($val, 'e_') === 0) { - $addpref[$val."_list"][$path] = $path; + // $addpref[$val."_list"][$path] = $path; + $core->setPref($val.'_list/'.$path,$path); } } } @@ -1562,11 +1551,12 @@ class e107plugin { $bb_name = substr($adds, 0,-3); // remove the .bb $bb_array[$bb_name] = "0"; // default userclass. + } if($is_installed && (substr($adds,-4) == "_sql")) { - $addpref['e_sql_list'][$path] = $adds; + $core->setPref('e_sql_list/'.$path,$adds); } } @@ -1574,27 +1564,19 @@ class e107plugin if(count($bb_array) > 0) { ksort($bb_array); - $addpref['bbcode_list'][$path] = $bb_array; - + $core->setPref('bbcode_list/'.$path,$sc_array); } // Build shortcode list - do if uninstalled as well if(count($sc_array) > 0) { ksort($sc_array); - $addpref['shortcode_list'][$path] = $sc_array; + $core->setPref('shortcode_list/'.$path,$sc_array); } } } - // TODO Review pref-class method used below (a new function?), to simply add or update existing prefs. (without a global $pref) - - foreach($addpref as $key=>$val) - { - e107::getConfig('core')->set($key,$val); - } - - e107::getConfig('core')->save(FALSE); + $core->save(FALSE); if($this->manage_icons()) { @@ -1612,11 +1594,9 @@ class e107plugin // $debug = 'check' - checks each file found for php tags - prints 'pass' or 'fail' function getAddons($plugin_path, $debug=FALSE) { - global $fl; - if(!is_object($fl)){ - require_once(e_HANDLER.'file_class.php'); - $fl = new e_file; - } + $fl = e107::getFile(); + + $p_addons = array(); $addonlist = $fl->get_files(e_PLUGIN.$plugin_path, "^e_.*\.php$", "standard", 1); // print_a($addonlist); diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index b49b89d5b..59f10977f 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -1,7 +1,7 @@ template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_021); $this->template->SetTag("stage_title", LANINS_022); + $this->template->SetTag("onload", "document.getElementById('name').focus()"); $page_info = nl2br(LANINS_023); $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); $output = " -

+
+

@@ -335,8 +337,9 @@ class e_install
".LANINS_034."
+

-

\n"; + \n"; $e_forms->add_plain_html($output); $this->finish_form(); $e_forms->add_button("submit", LANINS_035); @@ -353,6 +356,9 @@ class e_install $this->template->SetTag("installation_heading", LANINS_001); $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_036); + $this->template->SetTag("onload", "document.getElementById('name').focus()"); + + $this->previous_steps['mysql']['server'] = trim($_POST['server']); $this->previous_steps['mysql']['user'] = trim($_POST['name']); $this->previous_steps['mysql']['password'] = $_POST['password']; @@ -367,7 +373,7 @@ class e_install $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); $head = LANINS_039."

\n"; $output = " -

+
@@ -377,7 +383,7 @@ class e_install - + @@ -402,8 +408,9 @@ class e_install } $output .= "
".LANINS_031."
+

-

\n"; + \n"; $e_forms->add_plain_html($output); $e_forms->add_button("submit", LANINS_035); $this->template->SetTag("stage_title", LANINS_040); @@ -596,6 +603,9 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_046); $this->template->SetTag("stage_title", LANINS_047); + $this->template->SetTag("onload", "document.getElementById('u_name').focus()"); + + $e_forms->start_form("admin_info", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); $output = "
@@ -626,8 +636,9 @@ class e_install ".LANINS_081." +

-

\n"; + \n"; $e_forms->add_plain_html($output); $this->finish_form(); $e_forms->add_button("submit", LANINS_035); @@ -708,6 +719,7 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_056); $this->template->SetTag("stage_title", LANINS_117); // Website Preferences; + $this->template->SetTag("onload", "document.getElementById('sitename').focus()"); $e_forms->start_form("pref_info", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); @@ -725,7 +737,7 @@ class e_install -
".LANINS_110." +
".LANINS_110." @@ -928,11 +940,22 @@ class e_install define("e_LANGUAGE", $this->previous_steps['language']); define('e_SELF', 'http://'.$_SERVER['HTTP_HOST']) . ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']); + $themeImportFile = array(); + $themeImportFile[0] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme']."/install.xml"; + $themeImportFile[1] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme']."/install/install.xml"; + $themeImportFile[3] = $this->e107->e107_dirs['FILES_DIRECTORY']. "default_install.xml"; - $themeImportFile = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme']."/install.xml"; - if($this->previous_steps['generate_content']==1 && is_readable($themeImportFile)) + + if($this->previous_steps['generate_content']==1) { - $XMLImportfile = $themeImportFile; + foreach($themeImportFile as $file) + { + if(is_readable($file)) + { + $XMLImportfile = $file; + break; + } + } } else { @@ -985,12 +1008,7 @@ class e_install $cookiename = str_replace(" ","_",$this->previous_steps['prefs']['sitename']); $this->previous_steps['prefs']['cookie_name'] = substr($cookiename,0,5)."cookie"; - - // foreach($this->previous_steps['prefs'] as $key=>$val) - // { - // e107::getConfig('core')->set($key,$val); - // } - + e107::getConfig('core')->setPref($this->previous_steps['prefs']); e107::getConfig('core')->save(FALSE); // save preferences made during install. @@ -1531,7 +1549,7 @@ function template_data() - +

{installation_heading}