diff --git a/class2.php b/class2.php
index 70db38e2f..be952626e 100644
--- a/class2.php
+++ b/class2.php
@@ -713,6 +713,11 @@ if (!function_exists('checkvalidtheme'))
if (ADMIN && strpos(e_SELF, $ADMIN_DIRECTORY) === false)
{
echo '';
+ $tm = e107::getSingleton('themeHandler');
+ $tm->setTheme($e107tmp_theme);
+ // $config = e107::getConfig();
+ // $config->set('sitetheme','core');
+
}
}
$themes_dir = $e107->getFolder('themes');
diff --git a/e107_admin/admin.php b/e107_admin/admin.php
index a56fbd67a..c03824e44 100644
--- a/e107_admin/admin.php
+++ b/e107_admin/admin.php
@@ -165,10 +165,7 @@ if (e_QUERY == 'purge' && getperms('0'))
*/
$td = 1;
-if(!defined("ADLINK_COLS"))
-{
- define("ADLINK_COLS",5);
-}
+
// DEPRECATED
function render_links($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE)
diff --git a/e107_admin/e107_update.php b/e107_admin/e107_update.php
index 9bc0dcb8d..f1d8af4ae 100644
--- a/e107_admin/e107_update.php
+++ b/e107_admin/e107_update.php
@@ -16,20 +16,19 @@
*/
require_once ("../class2.php");
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+// include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$e_sub_cat = 'database';
require_once ("auth.php");
require_once ("update_routines.php");
-$mes = e107::getMessage();
-$frm = e107::getForm();
-// FIX ME - Should be a class so it can be called any where.
+//
-// Carry out core updates
+// Carry out CORE updates
+/*
function run_updates($dbupdate)
{
global $mes;
@@ -77,6 +76,9 @@ function run_updates_plugin($func,$check=TRUE) // New for {plugin}_setup.php
}
}
+
+
+
function show_updates($dbupdate, $what)
{
global $frm;
@@ -122,7 +124,8 @@ function show_updates($dbupdate, $what)
}
$text .= "\n";
}
- elseif(class_exists($func.'_setup')) // plugin_setup.php
+
+ if(class_exists($func.'_setup')) // plugin_setup.php
{
$text .= "
{$rmks} | ";
@@ -151,6 +154,192 @@ function show_updates($dbupdate, $what)
echo $text;
return $updates; // Number of updates to do
}
+*/
+
+
+// New in v2.x ------------------------------------------------
+
+class e107Update
+{
+ var $core = array();
+ var $updates = 0;
+
+
+ function __construct($core=null)
+ {
+ $mes = e107::getMessage();
+
+ $this->core = $core;
+
+ if(varset($_POST['update_core']) && is_array($_POST['update_core']))
+ {
+ $message = $this->updateCore();
+ }
+
+ if(varset($_POST['update']) && is_array($_POST['update'])) // Do plugin updates
+ {
+ $func = key($_POST['update']);
+ $this->updatePlugin($func);
+ }
+
+ if(vartrue($message))
+ {
+ $mes->addSuccess($message);
+ }
+
+ $this->renderForm();
+ }
+
+
+
+
+ function updateCore()
+ {
+ $mes = e107::getMessage();
+
+ foreach($this->core as $func => $rmks)
+ {
+ if(function_exists('update_'.$func)) // Legacy Method.
+ {
+ $installed = call_user_func("update_".$func);
+ //?! (LAN_UPDATE == $_POST[$func])
+ if(varsettrue($_POST['update_core'][$func]) && !$installed)
+ {
+ if(function_exists("update_".$func))
+ {
+ $message = LAN_UPDATE_7." {$rmks}";
+ $error = call_user_func("update_".$func, "do");
+
+ if($error != '')
+ {
+ $mes->add($message, E_MESSAGE_ERROR);
+ $mes->add($error, E_MESSAGE_ERROR);
+ }
+ else
+ {
+ $mes->add($message, E_MESSAGE_SUCCESS);
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+
+
+
+ function updatePlugin($path)
+ {
+ e107::getPlugin()->install_plugin_xml($path, 'upgrade');
+ }
+
+
+
+ function plugins()
+ {
+ if(!$list = e107::getPlugin()->updateRequired())
+ {
+ return;
+ }
+
+ $frm = e107::getForm();
+
+ $text = "";
+ foreach($list as $path=>$val)
+ {
+ $text .= "
+ ".$val['@attributes']['name']." |
+ ".$frm->admin_button('update['.$path.']', LAN_UPDATE, 'warning')." |
+
";
+ }
+
+ return $text;
+ }
+
+
+
+
+ function core()
+ {
+ $frm = e107::getForm();
+
+ $text = "";
+
+ foreach($this->core as $func => $rmks)
+ {
+ if(function_exists("update_".$func))
+ {
+ $text .= "{$rmks} | ";
+
+ if(call_user_func("update_".$func))
+ {
+ $text .= "".LAN_UPDATE_3." | ";
+ }
+ else
+ {
+ $this->updates ++;
+ $text .= "".$frm->admin_button('update_core['.$func.']', LAN_UPDATE, 'warning', '', "id=e-{$func}")." | ";
+ }
+ $text .= "
\n";
+ }
+ }
+
+ return $text;
+ }
+
+
+
+ function renderForm()
+ {
+ $ns = e107::getRender();
+ $mes = e107::getMessage();
+
+ $caption = LAN_UPDATE;
+ $text = "
+
+ ";
+
+
+ $ns->tablerender("Updates",$mes->render() . $text);
+
+ }
+
+
+}
+
+new e107Update($dbupdate);
+
+
+require_once ("footer.php");
+
+
+
+/*
if(varset($_POST['update_core']) && is_array($_POST['update_core']))
{
@@ -181,6 +370,10 @@ if($total_updates == 0)
{ // No updates needed - clear the cache to be sure
$e107cache->set_sys("nq_admin_updatecheck", time().', 1, '.$e107info['e107_version'], TRUE);
}
+ *
+ *
+ */
+
+
-require_once ("footer.php");
?>
\ No newline at end of file
diff --git a/e107_admin/footer.php b/e107_admin/footer.php
index 74c26ced1..fc08bf8e8 100644
--- a/e107_admin/footer.php
+++ b/e107_admin/footer.php
@@ -172,7 +172,7 @@ if (varset($e107_popup) != 1)
}
else
{
- echo($rinfo ? "\n\n" : "");
+ echo($rinfo ? "\n\n" : "");
}
} // End of regular-page footer (the above NOT done for popups)
diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php
index 594f8361a..495f5dadb 100644
--- a/e107_admin/includes/infopanel.php
+++ b/e107_admin/includes/infopanel.php
@@ -21,6 +21,8 @@ if (!defined('e107_INIT'))
class adminstyle_infopanel
{
+ private $iconlist = array();
+
function __construct()
{
e107::js('core','tweet/jquery.tweet.js');
@@ -64,6 +66,13 @@ EOF;
save_prefs();
}
+
+
+ $array_functions_assoc = e107::getNav()->adminLinks('assoc');
+
+ $this->iconlist = array_merge($array_functions_assoc, e107::getNav()->pluginLinks(E_16_PLUGMANAGER, "array"));
+
+
}
@@ -145,9 +154,7 @@ EOF;
}
- $array_functions_assoc = e107::getNav()->adminLinks('assoc');
- $iconlist = array_merge($array_functions_assoc, e107::getNav()->pluginLinks(E_16_PLUGMANAGER, "array"));
// "