Esempio n. 1
0
    } elseif ($lifetime > 24 * 3600) {
        $cookieHealthClass = 'warning';
        $cookieHealthIcon = 'warning-sign';
        $number = floor($lifetime / 3600 / 24);
        $time = $number . '+ ' . _g('days', array('parsemag' => true, 'variables' => array($number)));
        $after = $renew;
        // Less than a day
    } else {
        $cookieHealthClass = 'error';
        $cookieHealthIcon = 'remove';
        $number = ceil($lifetime / 3600);
        $time = '<' . $number . '+ ' . _g('hours', array('parsemag' => true, 'variables' => array($number)));
        $after = $renew;
    }
    $toolSettings['tabs']['#tab-currentsettings'] = $I18N->msg('tab-overview');
    $tabContent .= '<div class="tab-pane active" id="tab-currentsettings">' . '<form role="form" class="form-horizontal"><fieldset>' . Html::element('legend', array(), $I18N->msg('current-settings')) . '<div class="form-group">' . Html::element('label', array('class' => 'col-sm-4 control-label'), $I18N->msg('current-language') . _g('colon-separator') . ' ') . '<div class="col-sm-8">' . Html::element('input', array('value' => $I18N->getLangName(), 'readonly' => true, 'class' => 'form-control')) . '<p class="help-block">' . Html::element('a', array('href' => $Tool->generatePermalink(array('action' => 'clearcookies'))), $I18N->msg('clear-cookies')) . '</p>' . '</div>' . Html::element('label', array('class' => 'col-sm-4 control-label'), $I18N->msg('cookie-expiration') . _g('colon-separator')) . "<div class=\"col-sm-8 has-{$cookieHealthClass} has-feedback\">" . Html::element('input', array('value' => $time, 'class' => "form-control", 'readonly' => true)) . "<span class=\"glyphicon glyphicon-{$cookieHealthIcon} form-control-feedback\"></span>" . $after . '</div>' . '</fieldset></form>' . '</div>';
    $settingsIsFirst = false;
} else {
    $settingsIsFirst = true;
}
// Settings form
$dropdown = '<select name="fpLang" class="form-control">';
$selected = ' selected';
foreach ($I18N->getAvailableLangs('any') as $langCode => $langName) {
    $attr = $langCode == $I18N->getLang() ? $selected : '';
    $dropdown .= '<option value="' . $langCode . '"' . $attr . '>' . "{$langCode} - {$langName}" . '</option>';
}
$dropdown .= '</select>';
$toolSettings['tabs']['#tab-settingsform'] = $I18N->msg('tab-settings');
$tabContent .= Html::openElement('div', array('class' => array('tab-pane', 'active' => $settingsIsFirst), 'id' => 'tab-settingsform')) . '<form action="' . $Tool->remoteBasePath . '" method="post" role="form" class="form-horizontal">
	<fieldset>
Esempio n. 2
0
<?php

/* Config */
require_once 'demoBase.php';
/* Demonstration */
// 1) Init
$I18N = new Intuition('general');
// 2) Use language names
// - Current language name
echo $I18N->getLangName();
// - Specific language name
echo '<br/>' . $I18N->getLangName('fr');
/* View source */
closeDemo(__FILE__);