diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php
index 5e50bdbfc..7d194cbef 100644
--- a/e107_admin/update_routines.php
+++ b/e107_admin/update_routines.php
@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
-| ©Steve Dunstan 2001-2002
+| �Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
@@ -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.44 $
-| $Date: 2009-08-17 18:42:20 $
+| $Revision: 1.45 $
+| $Date: 2009-09-01 02:00:55 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -31,7 +31,7 @@ require_once(e_HANDLER.'db_table_admin_class.php');
// To do - how do we handle multi-language tables?
// If following line uncommented, enables a test routine
-//define('TEST_UPDATE',TRUE);
+// define('TEST_UPDATE',TRUE);
$update_debug = FALSE; // TRUE gives extra messages in places
//$update_debug = TRUE; // TRUE gives extra messages in places
if (defined('TEST_UPDATE')) $update_debug = TRUE;
@@ -178,8 +178,9 @@ function update_check()
require_once(e_HANDLER."e_upgrade_class.php");
$upg = new e_upgrade;
- $upg->checkSiteTheme();
- $upg->checkAllPlugins();
+ //TODO Enable this before release!!
+// $upg->checkSiteTheme();
+ // $upg->checkAllPlugins();
//--------------------------------------------
@@ -284,28 +285,32 @@ function update_706_to_800($type='')
global $sysprefs, $eArrayStorage, $tp;
$notify_prefs = $sysprefs -> get('notify_prefs');
$notify_prefs = $eArrayStorage -> ReadArray($notify_prefs);
+
$nt_changed = 0;
- foreach ($notify_prefs['event'] as $e => $d)
+ if(vartrue($notify_prefs['event']))
{
- if (isset($d['type']))
+ foreach ($notify_prefs['event'] as $e => $d)
{
- if ($just_check) return update_needed('Notify pref: '.$e.' outdated');
- switch ($d['type'])
+ if (isset($d['type']))
{
- case 'main' :
- $notify_prefs['event'][$e]['class'] = e_UC_MAINADMIN;
- break;
- case 'class' : // Should already have class defined
- break;
- case 'email' :
- $notify_prefs['event'][$e]['class'] = 'email';
- break;
- case 'off' : // Need to disable
- default :
- $notify_prefs['event'][$e]['class'] = e_UC_NOBODY; // Just disable if we don't know what else to do
+ if ($just_check) return update_needed('Notify pref: '.$e.' outdated');
+ switch ($d['type'])
+ {
+ case 'main' :
+ $notify_prefs['event'][$e]['class'] = e_UC_MAINADMIN;
+ break;
+ case 'class' : // Should already have class defined
+ break;
+ case 'email' :
+ $notify_prefs['event'][$e]['class'] = 'email';
+ break;
+ case 'off' : // Need to disable
+ default :
+ $notify_prefs['event'][$e]['class'] = e_UC_NOBODY; // Just disable if we don't know what else to do
+ }
+ $nt_changed++;
+ unset($notify_prefs['event'][$e]['type']);
}
- $nt_changed++;
- unset($notify_prefs['event'][$e]['type']);
}
}
if ($nt_changed)
@@ -953,8 +958,9 @@ function catch_error(&$target)
function get_default_prefs()
{
- require(e_FILE."def_e107_prefs.php");
- return $pref;
+ $xmlArray = e107::getSingleton('xmlClass')->loadXMLfile(e_FILE."default_install.xml",'advanced');
+ $pref = e107::getSingleton('xmlClass')->e107ImportPrefs($xmlArray,'core');
+ return $pref;
}
diff --git a/e107_files/default_install.xml b/e107_files/default_install.xml
index 6d61890ed..4b8eab6ae 100644
--- a/e107_files/default_install.xml
+++ b/e107_files/default_install.xml
@@ -606,7 +606,7 @@ City, State, Country
1
0
- login_menu
+ login_menu/
@@ -617,7 +617,7 @@ City, State, Country
0
0
- online
+ online/
@@ -628,7 +628,7 @@ City, State, Country
0
0
- blogcalendar_menu
+ blogcalendar_menu/
@@ -639,7 +639,7 @@ City, State, Country
0
0
- tree_menu
+ tree_menu/
@@ -650,7 +650,7 @@ City, State, Country
0
0
- search_menu
+ search_menu/
@@ -661,7 +661,7 @@ City, State, Country
0
0
- siteinfo_menu
+ siteinfo_menu/
@@ -672,7 +672,7 @@ City, State, Country
0
0
- user_menu
+ user_menu/
@@ -683,7 +683,7 @@ City, State, Country
2
0
- siteinfo_menu
+ siteinfo_menu/
@@ -694,7 +694,7 @@ City, State, Country
0
0
- banner_menu
+ banner_menu/
@@ -705,7 +705,7 @@ City, State, Country
0
0
- clock_menu
+ clock_menu/
@@ -716,7 +716,7 @@ City, State, Country
0
0
- siteinfo_menu
+ siteinfo_menu/
@@ -727,7 +727,7 @@ City, State, Country
0
0
- comment_menu
+ comment_menu/
@@ -738,7 +738,7 @@ City, State, Country
0
0
- online
+ online/
@@ -749,7 +749,7 @@ City, State, Country
0
0
- other_news_menu
+ other_news_menu/
@@ -760,7 +760,7 @@ City, State, Country
0
0
- other_news_menu
+ other_news_menu/
@@ -771,7 +771,7 @@ City, State, Country
0
0
- admin_menu
+ admin_menu/
diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php
index db891ad70..0bc64cd1c 100644
--- a/e107_handlers/xml_class.php
+++ b/e107_handlers/xml_class.php
@@ -9,8 +9,8 @@
* Simple XML Parser
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/xml_class.php,v $
- * $Revision: 1.19 $
- * $Date: 2009-08-31 13:12:03 $
+ * $Revision: 1.20 $
+ * $Date: 2009-09-01 02:00:56 $
* $Author: e107coders $
*/
@@ -617,6 +617,34 @@ class xmlClass
}
}
+ /**
+ * Return an Array of core preferences from e107 XML Dump data
+ * @param object $XMLData Raw XML e107 Export Data
+ * @param object $prefType [optional] the type of core pref: core|emote|ipool|menu etc.
+ * @return preference array equivalent to the old $pref global;
+ */
+ public function e107ImportPrefs($XMLData,$prefType='core')
+ {
+ if(!vartrue($XMLData['prefs'][$prefType]))
+ {
+ return;
+ }
+
+ $pref = array();
+ foreach($XMLData['prefs'][$prefType] as $val)
+ {
+ $value = (substr($val['@value'],0,7) == "array (") ? e107::getArrayStorage()->ReadArray($val['@value']) : $val['@value'];
+ $name = $val['@attributes']['name'];
+ $pref[$name] = $value;
+ }
+
+ return $pref;
+ }
+
+
+
+
+
/**
* Import an e107 XML file into site preferences and DB tables
* @param path $file - e107 XML file path
@@ -642,14 +670,13 @@ class xmlClass
{
foreach($xmlArray['prefs'] as $type=>$array)
{
- foreach ($array as $val)
+ $pArray = $this->e107ImportPrefs($xmlArray,$type);
+ e107::getConfig($type)->setPref($pArray);
+
+ if($debug == FALSE)
{
- $value = (substr($val['@value'],0,7) == "array (") ? e107::getArrayStorage()->ReadArray($val['@value']) : $val['@value'];
- e107::getConfig($type)->set($val['@attributes']['name'], $value);
-
- }
-
- e107::getConfig($type)->save(FALSE);
+ e107::getConfig($type)->save(FALSE,TRUE);
+ }
}
}
@@ -683,6 +710,8 @@ class xmlClass
return $ret;
}
+
+
}
diff --git a/install_.php b/install_.php
index 34f2862a8..1cdd3a041 100644
--- a/install_.php
+++ b/install_.php
@@ -9,8 +9,8 @@
* Installation file
*
* $Source: /cvs_backup/e107_0.8/install_.php,v $
-* $Revision: 1.31 $
-* $Date: 2009-08-31 14:37:24 $
+* $Revision: 1.32 $
+* $Date: 2009-09-01 02:00:56 $
* $Author: e107coders $
*
*/
@@ -965,8 +965,10 @@ class e_install
$this->previous_steps['prefs']['replyto_name'] = $this->previous_steps['admin']['display'];
$this->previous_steps['prefs']['replyto_email'] = $this->previous_steps['admin']['email'];
-
+ $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); //FIXME - pref class issues.