示例#1
0
$Tool->addOut(_g('welcome'), 'h2');
// Messages ?
if (isset($_GET['msg'])) {
    switch ($_GET['msg']) {
        case 2:
            $Tool->addOut($I18N->msg('clearcookies-success'), 'div', array('class' => 'msg ns'));
            break;
        case 3:
            $Tool->addOut($I18N->msg('renewcookies-success', array('variables' => array('30 ' . _g('days', array('parsemag' => true, 'variables' => array(30)))))), 'div', array('class' => 'msg ns success'));
            break;
    }
}
$Tool->addOut('<div id="tsint-dashboard">');
// Cookie has already been set, show "current-settings" box
if ($I18N->hasCookies()) {
    $lifetime = $I18N->getCookieLifetime();
    $after = '';
    $renew = ' (' . kfTag($I18N->msg('renew-cookies'), 'a', array('href' => $Tool->generatePermalink(array('action' => 'renewcookies')))) . ')';
    // 29+ days
    if ($lifetime > 29 * 24 * 3600) {
        $class = 'perfect';
        $number = floor($lifetime / 3600 / 24 / 7);
        $time = $number . '+ ' . _g('weeks', array('parsemag' => true, 'variables' => array($number)));
        // 10+ days
    } elseif ($lifetime > 10 * 24 * 3600) {
        $class = 'good';
        $number = floor($lifetime / 3600 / 24);
        $time = $number . '+ ' . _g('days', array('parsemag' => true, 'variables' => array($number)));
        $after = $renew;
        // 1+ day
    } elseif ($lifetime > 24 * 3600) {