static public showGMT ( $name, $value = '' ) | ||
$name | select name | |
$value | default value (default '') |
static function showGMT($name, $value = '')
{
$elements = array(-12, -11, -10, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, '+1', '+2', '+3', '+3.5', '+4', '+4.5', '+5', '+5.5', '+6', '+6.5', '+7', '+8', '+9', '+9.5', '+10', '+11', '+12', '+13');
$values = array();
foreach ($elements as $element) {
if ($element != 0) {
$values[$element * HOUR_TIMESTAMP] = sprintf(__('%1$s %2$s'), __('GMT'), sprintf(_n('%s hour', '%s hours', $element), $element));
} else {
$display_value = __('GMT');
$values[$element * HOUR_TIMESTAMP] = __('GMT');
}
}
Dropdown::showFromArray($name, $values, array('value' => $value));
}
function showFormAdvancedConfig() { $ID = $this->getField('id'); $hidden = ''; echo "<div class='center'>"; echo "<form method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_2'><th colspan='4'>"; echo "<input type='hidden' name='id' value='{$ID}'>" . __('Advanced information') . "</th></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . __('Use TLS') . "</td><td>"; if (function_exists("ldap_start_tls")) { Dropdown::showYesNo('use_tls', $this->fields["use_tls"]); } else { echo "<input type='hidden' name='use_tls' value='0'>" . __('ldap_start_tls does not exist'); } echo "</td>"; echo "<td>" . __('LDAP directory time zone') . "</td><td>"; Dropdown::showGMT("time_offset", $this->fields["time_offset"]); echo "</td></tr>"; if (self::isLdapPageSizeAvailable(false, false)) { echo "<tr class='tab_bg_1'>"; echo "<td>" . __('Use paged results') . "</td><td>"; Dropdown::showYesNo('can_support_pagesize', $this->fields["can_support_pagesize"]); echo "</td>"; echo "<td>" . __('Page size') . "</td><td>"; Dropdown::showNumber("pagesize", array('value' => $this->fields['pagesize'], 'min' => 100, 'max' => 100000, 'step' => 100)); echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . __('Maximum number of results') . "</td><td>"; Dropdown::showNumber('ldap_maxlimit', array('value' => $this->fields['ldap_maxlimit'], 'min' => 100, 'max' => 999999, 'step' => 100, 'toadd' => array(0 => __('Unlimited')))); echo "</td><td colspan='2'></td></tr>"; } else { $hidden .= "<input type='hidden' name='can_support_pagesize' value='0'>"; $hidden .= "<input type='hidden' name='pagesize' value='0'>"; $hidden .= "<input type='hidden' name='ldap_maxlimit' value='0'>"; } echo "<tr class='tab_bg_1'>"; echo "<td>" . __('How LDAP aliases should be handled') . "</td><td colspan='4'>"; $alias_options[LDAP_DEREF_NEVER] = __('Never dereferenced (default)'); $alias_options[LDAP_DEREF_ALWAYS] = __('Always dereferenced'); $alias_options[LDAP_DEREF_SEARCHING] = __('Dereferenced during the search (but not when locating)'); $alias_options[LDAP_DEREF_FINDING] = __('Dereferenced when locating (not during the search)'); Dropdown::showFromArray("deref_option", $alias_options, array('value' => $this->fields["deref_option"])); echo "</td></tr>"; echo "<tr class='tab_bg_2'><td class='center' colspan='4'>"; echo "<input type='submit' name='update' class='submit' value=\"" . __s('Save') . "\">"; echo $hidden; echo "</td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }