Exemplo n.º 1
0
$Tool->addOut('<div class="well">');
$tabContent = '<div class="tab-content">';
// 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;
    }
}
// Cookie has already been set, show "current-settings" box
if ($I18N->hasCookies()) {
    $lifetime = $I18N->getCookieLifetime();
    $after = '';
    $cookieHealthClass = false;
    $cookieHealthIcon = false;
    $renew = '<p class="help-block">' . Html::element('a', array('href' => $Tool->generatePermalink(array('action' => 'renewcookies'))), $I18N->msg('renew-cookies')) . '</p>';
    // 29+ days
    if ($lifetime > 29 * 24 * 3600) {
        $cookieHealthClass = 'success';
        $cookieHealthIcon = 'ok';
        $number = floor($lifetime / 3600 / 24 / 29);
        $time = $number . '+ ' . _g('months', array('parsemag' => true, 'variables' => array($number)));
        // 10+ days
    } elseif ($lifetime > 10 * 24 * 3600) {
        $cookieHealthClass = 'warning';
        $cookieHealthIcon = 'warning-sign';
        $number = floor($lifetime / 3600 / 24);