diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 5f522dd60..4f349eef5 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -15,6 +15,81 @@ if (!defined('e107_INIT')) { exit; } class admin_shortcodes { + + function cronUpdateRender($parm,$cacheData) + { + $mes = e107::getMessage(); + + if($cacheData == 'up-to-date') + { + return ''; + } + + $installUrl = "#"; // TODO + + + if($parm=='alert') + { + $text = 'A new update is ready to install! Click to unzip and install v'.$cacheData.'. + Install'; + + $mes->addInfo($text); + return $mes->render(); + } + + if($parm=='icon') + { + + return ' + '; + + + } + + } + + // {ADMIN_COREUPDATE} + function sc_admin_coreupdate($parm='') + { + $che = e107::getCache(); + $mes = e107::getMessage(); + + $che->setMD5(e_LANGUAGE); + + $cacheData = $che->retrieve("releasecheck",3600, TRUE); // 2.0.1 | 'up-to-date' | false ; + + $cacheData = 2.1; // XXX Remove to test for real. + + if($cacheData) + { + return $this->cronUpdateRender($parm, $cacheData); + } + + + require_once(e_HANDLER."cron_class.php"); + $cron = new _system_cron(); + + if($result = $cron->checkCoreUpdate()) + { + return $this->cronUpdateRender($parm, $cacheData); + } + + + } + + + + function sc_admin_credits() { if (!ADMIN) { return ''; } diff --git a/e107_themes/bootstrap/admin_template.php b/e107_themes/bootstrap/admin_template.php index 2e30fbc0b..d0cc49acf 100644 --- a/e107_themes/bootstrap/admin_template.php +++ b/e107_themes/bootstrap/admin_template.php @@ -174,6 +174,7 @@ $ADMIN_HEADER = '