Пример #1
0
/**
 * @param EasySCP_TemplateEngine $tpl
 * @return void
 */
function get_update_infos($tpl)
{
    $cfg = EasySCP_Registry::get('Config');
    if (EasySCP_Update_Database::getInstance()->checkUpdateExists()) {
        $tpl->assign(array('DATABASE_UPDATE' => '<a href="easyscp_updates.php" class="link">' . tr('A database update is available') . '</a>', 'DATABASE_MSG_TYPE' => 'info'));
    }
    if (!$cfg->CHECK_FOR_UPDATES) {
        $tpl->assign(array('UPDATE' => tr('Update checking is disabled!'), 'UPDATE_TYPE' => 'info'));
        return false;
    }
    if (EasyUpdate::checkUpdate()) {
        $tpl->assign(array('UPDATE' => '<a href="easyscp_updates.php" class="link">' . tr('New EasySCP update is now available') . '</a>', 'UPDATE_TYPE' => 'info'));
    } else {
        if (EasySCP_Update_Version::getInstance()->getErrorMessage() != "") {
            $tpl->assign(array('UPDATE' => EasySCP_Update_Version::getInstance()->getErrorMessage(), 'UPDATE_TYPE' => 'error'));
        }
    }
}
Пример #2
0
/**
 * @param EasySCP_TemplateEngine $tpl
 * @return void
 */
function get_update_infos($tpl)
{
    $cfg = EasySCP_Registry::get('Config');
    if (!$cfg->CHECK_FOR_UPDATES) {
        $tpl->assign(array('UPDATE_MESSAGE' => tr('Update checking is disabled!') . '<br />' . tr('Enable update at') . ' <a href="settings.php">' . tr('Settings') . '</a>.', 'UPDATE_MSG_TYPE' => 'info'));
    } else {
        if (EasyUpdate::checkUpdate()) {
            $tpl->assign(array('UPDATE' => tr('New EasySCP update is now available'), 'INFOS' => tr('Get it at') . ' <a href="http://www.easyscp.net" class="link">http://www.easyscp.net</a>'));
        } else {
            $tpl->assign(array('UPDATE_MESSAGE' => tr('No new EasySCP updates available'), 'UPDATE_MSG_TYPE' => 'info'));
        }
        if (EasySCP_Update_Version::getInstance()->getErrorMessage() != "") {
            $tpl->assign(array('UPDATE_MESSAGE' => EasySCP_Update_Version::getInstance()->getErrorMessage(), 'UPDATE_MSG_TYPE' => 'error'));
        }
    }
}