示例#1
0
        $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>
	<legend>' . $I18N->msg('settings-legend') . '</legend>
	<div class="form-group">
	<label class="col-sm-4 control-label">' . _html('choose-language') . _g('colon-separator') . '</label>
	<div class="col-sm-8">
	' . $dropdown . '
	</div>
	</div>