right align for DNs

This commit is contained in:
Roland Gruber 2010-08-23 19:21:50 +00:00
parent 75a4d7eb9d
commit 12adfa992f
7 changed files with 28 additions and 5 deletions

View File

@ -578,6 +578,8 @@ class htmlSelect extends htmlElement {
private $hasDescriptiveElements = false; private $hasDescriptiveElements = false;
/** sorting enabled */ /** sorting enabled */
private $sortElements = true; private $sortElements = true;
/** right to left text direction */
private $rightToLeftTextDirection = false;
/** /**
* Constructor. * Constructor.
@ -616,7 +618,11 @@ class htmlSelect extends htmlElement {
} }
$name = ' name="' . $this->name . '"'; $name = ' name="' . $this->name . '"';
$size = ' size="' . $this->size . '"'; $size = ' size="' . $this->size . '"';
echo '<select' . $name . $size . $multi . ' tabindex="' . $tabindex . "\">\n"; $class = '';
if ($this->rightToLeftTextDirection) {
$class = ' class="rightToLeftText"';
}
echo '<select' . $class . $name . $size . $multi . ' tabindex="' . $tabindex . "\">\n";
$tabindex++; $tabindex++;
// sorting // sorting
if ($this->sortElements) { if ($this->sortElements) {
@ -684,6 +690,15 @@ class htmlSelect extends htmlElement {
$this->sortElements = $sortElements; $this->sortElements = $sortElements;
} }
/**
* Specifies if the text direction should be set to right to left.
*
* @param boolean $rightToLeftTextDirection if true use right to left direction
*/
public function setRightToLeftTextDirection($rightToLeftTextDirection) {
$this->rightToLeftTextDirection = $rightToLeftTextDirection;
}
} }
/** /**

View File

@ -652,7 +652,7 @@ class lamList {
protected function listShowOUSelection() { protected function listShowOUSelection() {
if (sizeof($this->possibleSuffixes) > 1) { if (sizeof($this->possibleSuffixes) > 1) {
echo ("<b>" . _("Suffix") . ": </b>"); echo ("<b>" . _("Suffix") . ": </b>");
echo ("<select class=\"" . $this->type . "\" size=1 name=\"suffix\" onchange=\"listOUchanged('" . $this->type . "', this)\">\n"); echo ("<select class=\"" . $this->type . " rightToLeftText\" size=1 name=\"suffix\" onchange=\"listOUchanged('" . $this->type . "', this)\">\n");
for ($i = 0; $i < sizeof($this->possibleSuffixes); $i++) { for ($i = 0; $i < sizeof($this->possibleSuffixes); $i++) {
if ($this->suffix == $this->possibleSuffixes[$i]) { if ($this->suffix == $this->possibleSuffixes[$i]) {
echo ("<option value=\"" . $this->possibleSuffixes[$i] . "\" selected>" . getAbstractDN($this->possibleSuffixes[$i]) . "</option>\n"); echo ("<option value=\"" . $this->possibleSuffixes[$i] . "\" selected>" . getAbstractDN($this->possibleSuffixes[$i]) . "</option>\n");

View File

@ -303,6 +303,9 @@ class asteriskExtension extends baseModule {
array('kind' => 'input', 'name' => 'form_subpage_' . get_class($this) . '_user_changeFilter' ,'type' => 'submit', 'value' => _('Refresh') ), array('kind' => 'input', 'name' => 'form_subpage_' . get_class($this) . '_user_changeFilter' ,'type' => 'submit', 'value' => _('Refresh') ),
) )
))); )));
// !!! setRightToLeftText -> true for select
$return[] = array( $return[] = array(
array('kind' => 'fieldset', 'legend' => _("Extension owners"), 'value' => array( array('kind' => 'fieldset', 'legend' => _("Extension owners"), 'value' => array(
array( array(

View File

@ -959,6 +959,7 @@ class inetOrgPerson extends baseModule implements passwordService {
} }
$managerElement = new htmlTableExtendedSelect('manager', $options, $optionsSelected, _('Manager'), 'manager'); $managerElement = new htmlTableExtendedSelect('manager', $options, $optionsSelected, _('Manager'), 'manager');
$managerElement->setHasDescriptiveElements(true); $managerElement->setHasDescriptiveElements(true);
$managerElement->setRightToLeftTextDirection(true);
$fieldContainer->addElement($managerElement, true); $fieldContainer->addElement($managerElement, true);
} }
// photo // photo

View File

@ -95,6 +95,10 @@ tr.highlight {
border-width: 1px 0px 1px 0px; border-width: 1px 0px 1px 0px;
} }
.rightToLeftText {
text-align: right;
}
table.settingsTab { table.settingsTab {
border-width:0px; border-width:0px;
border-style:solid; border-style:solid;

View File

@ -164,7 +164,7 @@ function display_main($message, $error) {
echo ("<tr>\n"); echo ("<tr>\n");
echo ("<td><b>" . _("New organizational unit") . "</b></td>\n"); echo ("<td><b>" . _("New organizational unit") . "</b></td>\n");
echo ("<td>&nbsp;</td>\n"); echo ("<td>&nbsp;</td>\n");
echo ("<td><select size=1 name=\"parentOU\">"); echo ("<td><select class=\"rightToLeftText\" size=1 name=\"parentOU\">");
echo $options; echo $options;
echo ("</select><td>\n"); echo ("</select><td>\n");
echo ("<td><input type=text name=\"newOU\"></td>\n"); echo ("<td><input type=text name=\"newOU\"></td>\n");
@ -180,7 +180,7 @@ function display_main($message, $error) {
echo ("<tr>\n"); echo ("<tr>\n");
echo ("<td><b>" . _("Delete organizational unit") . "</b></td>\n"); echo ("<td><b>" . _("Delete organizational unit") . "</b></td>\n");
echo ("<td>&nbsp;</td>\n"); echo ("<td>&nbsp;</td>\n");
echo ("<td><select size=1 name=\"deleteableOU\">"); echo ("<td><select class=\"rightToLeftText\" size=1 name=\"deleteableOU\">");
echo $options; echo $options;
echo ("</select><td>\n"); echo ("</select><td>\n");
echo ("<td>&nbsp;</td>\n"); echo ("<td>&nbsp;</td>\n");

View File

@ -179,7 +179,7 @@ echo "<legend><img align=\"middle\" src=\"../../graphics/logo32.png\" alt=\"logo
// LDAP suffix // LDAP suffix
echo _("LDAP suffix") . ":"; echo _("LDAP suffix") . ":";
echo "</td><td>"; echo "</td><td>";
echo "<select name=\"ldap_suffix\" tabindex=\"1\">"; echo "<select class=\"rightToLeftText\" name=\"ldap_suffix\" tabindex=\"1\">";
for ($i = 0; $i < sizeof($suffixes); $i++) { for ($i = 0; $i < sizeof($suffixes); $i++) {
if (isset($old_options['ldap_suffix']) && ($old_options['ldap_suffix'][0] == $suffixes[$i])) { if (isset($old_options['ldap_suffix']) && ($old_options['ldap_suffix'][0] == $suffixes[$i])) {
echo "<option selected value=\"" .$suffixes[$i] . "\">" . getAbstractDN($suffixes[$i]) . "</option>\n"; echo "<option selected value=\"" .$suffixes[$i] . "\">" . getAbstractDN($suffixes[$i]) . "</option>\n";