diff --git a/class2.php b/class2.php
index 2f2b04c59..00188d055 100644
--- a/class2.php
+++ b/class2.php
@@ -9,9 +9,9 @@
* General purpose file
*
* $Source: /cvs_backup/e107_0.8/class2.php,v $
-* $Revision: 1.95 $
-* $Date: 2009-05-26 20:17:57 $
-* $Author: e107steved $
+* $Revision: 1.96 $
+* $Date: 2009-07-04 13:36:14 $
+* $Author: e107coders $
*
*/
//
@@ -1323,8 +1323,10 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
}
else
{
- $_user_pref = $tp -> toDB($user_pref);
- $tmp=addslashes(serialize($_user_pref));
+ // $_user_pref = $tp -> toDB($user_pref);
+ // $tmp=addslashes(serialize($_user_pref));
+ $_user_pref = $tp->toDB($user_pref, true, true);
+ $tmp = $eArrayStorage->WriteArray($_user_pref);
$sql->db_Update('user', "user_prefs='$tmp' WHERE user_id=".intval($uid));
return $tmp;
}
@@ -1383,7 +1385,7 @@ function init_session()
# - return boolean
# - scope public
*/
- global $sql, $pref, $user_pref, $tp, $currentUser, $e107, $_E107;
+ global $sql, $pref, $user_pref, $tp, $currentUser, $e107, $_E107, $eArrayStorage;
define('USERIP', $e107->getip());
@@ -1476,20 +1478,26 @@ function init_session()
exit;
}
- $user_pref = ($result['user_prefs'] ? unserialize($result['user_prefs']) : '');
-
- if (check_class(varset($pref['allow_theme_select'],FALSE)))
- { // User can set own theme
- if (isset($_POST['settheme']))
+ if($result['user_prefs'])
{
+ $user_pref = (substr($result['user_prefs'],0,5) == "array") ? $eArrayStorage->ReadArray($result['user_prefs']) : unserialize($result['user_prefs']);
+ }
+
+
+
+
+ if (check_class(varset($pref['allow_theme_select'],FALSE))) // This check doesn't work, because it relies on the definitions for USER, ADMIN, USERCLASS_LIST etc that haven't been defined yet..
+ { // User can set own theme
+ if (isset($_POST['settheme']))
+ {
$user_pref['sitetheme'] = ($pref['sitetheme'] == $_POST['sitetheme'] ? "" : $_POST['sitetheme']);
- save_prefs('user');
- }
- }
- elseif (isset($user_pref['sitetheme']))
- { // User obviously no longer allowed his own theme - clear it
- unset($user_pref['sitetheme']);
- save_prefs('user');
+ save_prefs('user');
+ }
+ }
+ elseif (isset($user_pref['sitetheme']))
+ { // User obviously no longer allowed his own theme - clear it
+ unset($user_pref['sitetheme']);
+ save_prefs('user');
}
@@ -1520,7 +1528,7 @@ function init_session()
}
}
- define('USERCLASS_LIST', class_list());
+ define('USERCLASS_LIST', class_list());
define('e_CLASS_REGEXP', '(^|,)('.str_replace(',', '|', USERCLASS_LIST).')(,|$)');
define('e_NOBODY_REGEXP', '(^|,)'.e_UC_NOBODY.'(,|$)');
}
diff --git a/e107_admin/admin.php b/e107_admin/admin.php
index b9bab6e35..e6bf074b2 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.10 $
-| $Date: 2009-07-04 03:08:03 $
+| $Revision: 1.11 $
+| $Date: 2009-07-04 13:36:15 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -223,6 +223,26 @@ function render_clean()
$newarray = asortbyindex($array_functions, 1);
+$array_functions_assoc = convert_core_icons($newarray);
+
+
+
+function convert_core_icons($newarray) // Put core button array in the same format as plugin button array.
+{
+ foreach($newarray as $val)
+ {
+ $key = "e-".basename($val[0],".php");
+ $val['icon'] = $val[5];
+ $val['icon_32'] = $val[6];
+ $val['title'] = $val[1];
+ $val['link'] = $val[0];
+ $val['caption'] = $val['2'];
+ $val['perms'] = $val['4'];
+ $array_functions_assoc[$key] = $val;
+ }
+ return $array_functions_assoc;
+}
+
require_once(e_ADMIN.'includes/'.$pref['adminstyle'].'.php');
@@ -335,21 +355,16 @@ function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb')
if ($eplug_conffile)
{
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs, emotes_off");
- if ($iconSize == E_16_PLUGMANAGER)
- {
- $plugin_icon = $eplug_icon_small ? "
" : E_16_PLUGIN;
- }
- else
- {
- $plugin_icon = $eplug_icon ? "
" : E_32_PLUGIN;
- }
- $plugin_array[$plugin_path] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
+ $plugin_icon = $eplug_icon_small ? "
" : E_16_PLUGIN;
+ $plugin_icon_32 = $eplug_icon ? "
" : E_32_PLUGIN;
+
+ $plugin_array['p-'.$plugin_path] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon, 'icon_32' => $plugin_icon_32);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
}
}
- ksort($plugin_array, SORT_STRING);
+ ksort($plugin_array, SORT_STRING); // To FIX, without changing the current key format, sort by 'title'
if($linkStyle == "array")
{
@@ -358,7 +373,8 @@ function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb')
foreach ($plugin_array as $plug_key => $plug_value)
{
- $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], $linkStyle);
+ $the_icon = ($iconSize == E_16_PLUGMANAGER) ? $plug_value['icon'] : $plug_value['icon_32'];
+ $text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $the_icon, $linkStyle);
}
return $text;
}
diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php
index c385881e3..d3b4fc1a0 100644
--- a/e107_admin/includes/infopanel.php
+++ b/e107_admin/includes/infopanel.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $
-| $Revision: 1.1 $
-| $Date: 2009-07-04 03:08:03 $
+| $Revision: 1.2 $
+| $Date: 2009-07-04 13:36:15 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -24,6 +24,13 @@ $emessage = &eMessage::getInstance();
require_once(e_HANDLER."form_handler.php");
$frm = new e_form(true); //enable inner tabindex counter
+if(isset($_POST['submit-mye107']))
+{
+ $user_pref['core-infopanel-mye107'] = $_POST['e-mye107'];
+ save_prefs('user');
+}
+
+
$text = "
@@ -54,16 +61,16 @@ attribute 5 = category
attribute 6 = 16 x 16 image
attribute 7 = 32 x 32 image
*/
- $buts = "";
+ /* $buts = "";
- while (list($key, $funcinfo) = each($newarray))
+ while (list($key, $funcinfo) = each($array_functions_assoc))
{
- $iconlist[] = array("title"=>$funcinfo[1],"icon"=>$funcinfo[5]); // , $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
+ $iconlist[$key] = array("title"=>$funcinfo[1],"icon"=>$funcinfo[5]); // , $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
$buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
- }
+ }*/
+ $iconlist = array_merge($array_functions_assoc,getPluginLinks(E_16_PLUGMANAGER, "array"));
- $pluglist = getPluginLinks(E_16_PLUGMANAGER, "array");
$text .= "
@@ -80,7 +87,15 @@ attribute 7 = 32 x 32 image
";
- $text .= getPluginLinks(E_32_PLUGMANAGER, "div");
+ // Rendering the saved configuration.
+
+ foreach($iconlist as $key=>$val)
+ {
+ if(in_array($key,$user_pref['core-infopanel-mye107']))
+ {
+ $text .= render_links($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div");
+ }
+ }
$text .="
@@ -182,24 +197,24 @@ $text .= "
// Customizer ------------------------------------------
$text .= "
-
diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php
index b8dd375e5..f22188e26 100644
--- a/e107_admin/newspost.php
+++ b/e107_admin/newspost.php
@@ -9,8 +9,8 @@
* News Administration
*
* $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $
- * $Revision: 1.41 $
- * $Date: 2009-07-03 06:48:43 $
+ * $Revision: 1.42 $
+ * $Date: 2009-07-04 13:36:15 $
* $Author: e107coders $
*/
require_once("../class2.php");
@@ -580,14 +580,14 @@ class admin_newspost
function _observe_saveColumns()
{
- global $pref,$admin_log;
- $pref['admin_news_columns'] = $_POST['e-columns'];
- save_prefs();
+ global $user_pref,$admin_log;
+ $user_pref['admin_news_columns'] = $_POST['e-columns'];
+ save_prefs('user');
}
function show_existing_items()
{
- global $pref,$gen;
+ global $user_pref,$gen;
require_once(e_HANDLER."form_handler.php");
$frm = new e_form(true); //enable inner tabindex counter
@@ -597,6 +597,10 @@ class admin_newspost
$sort_link = $sort_order == 'asc' ? 'desc' : 'asc'; // Effectively toggle setting for headings
$amount = 10;//TODO - pref
+ if(!is_array($user_pref['admin_news_columns']))
+ {
+ $user_pref['admin_news_columns'] = array("news_id","news_title","news_author","news_render_type");
+ }
$field_columns = $this->_fields;
@@ -659,9 +663,9 @@ class admin_newspost