responsive self service

This commit is contained in:
Roland Gruber 2015-08-09 07:22:01 +00:00
parent a74e645ea3
commit d5ea258c10
2 changed files with 90 additions and 87 deletions

View File

@ -2650,28 +2650,25 @@ class posixAccount extends baseModule implements passwordService {
* @param array $attributes attributes of LDAP account
* @param boolean $passwordChangeOnly indicates that the user is only allowed to change his password and no LDAP content is readable
* @param array $readOnlyFields list of read-only fields
* @return array list of meta HTML elements (field name => htmlTableRow)
* @return array list of meta HTML elements (field name => htmlResponsiveRow)
*/
function getSelfServiceOptions($fields, $attributes, $passwordChangeOnly, $readOnlyFields) {
$return = array();
if (in_array('password', $fields)) {
$pwdTable = new htmlTable();
$pwdTable->colspan = 3;
$row = new htmlResponsiveRow();
if (!empty($this->selfServiceSettings->moduleSettings['posixAccount_useOldPwd']) && ($this->selfServiceSettings->moduleSettings['posixAccount_useOldPwd'][0] == 'true')) {
$pwd0 = new htmlTableExtendedInputField(_('Old password'), 'posixAccount_passwordOld');
$pwd0 = new htmlResponsiveInputField(_('Old password'), 'posixAccount_passwordOld');
$pwd0->setIsPassword(true, true);
$pwdTable->addElement($pwd0, true);
$row->add($pwd0, 12);
}
$pwd1 = new htmlTableExtendedInputField($this->getSelfServiceLabel('password', _('New password')), 'posixAccount_password');
$pwd1 = new htmlResponsiveInputField($this->getSelfServiceLabel('password', _('New password')), 'posixAccount_password');
$pwd1->setIsPassword(true, true);
$pwdTable->addElement($pwd1, true);
$pwd2 = new htmlTableExtendedInputField(_('Reenter password'), 'posixAccount_password2');
$row->add($pwd1, 12);
$pwd2 = new htmlResponsiveInputField(_('Reenter password'), 'posixAccount_password2');
$pwd2->setIsPassword(true);
$pwd2->setSameValueFieldID('posixAccount_password');
$pwdTable->addElement($pwd2);
$return['password'] = new htmlTableRow(array(
$pwdTable
));
$row->add($pwd2, 12);
$return['password'] = $row;
}
if ($passwordChangeOnly) {
return $return; // only password fields as long no LDAP content can be read
@ -2683,9 +2680,10 @@ class posixAccount extends baseModule implements passwordService {
if (in_array('cn', $readOnlyFields)) {
$cnField = new htmlOutputText($cn);
}
$return['cn'] = new htmlTableRow(array(
new htmlOutputText($this->getSelfServiceLabel('cn', _('Common name'))), $cnField
));
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('cn', _('Common name'))), 12, 6, 6, 'responsiveLabel');
$row->add($cnField, 12, 6, 6, 'responsiveField');
$return['cn'] = $row;
}
if (in_array('loginShell', $fields)) {
$shelllist = $this->getShells(); // list of all valid shells
@ -2695,9 +2693,10 @@ class posixAccount extends baseModule implements passwordService {
if (in_array('loginShell', $readOnlyFields)) {
$loginShellField = new htmlOutputText($loginShell);
}
$return['loginShell'] = new htmlTableRow(array(
new htmlOutputText($this->getSelfServiceLabel('loginShell', _('Login shell'))), $loginShellField
));
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('loginShell', _('Login shell'))), 12, 6, 6, 'responsiveLabel');
$row->add($loginShellField, 12, 6, 6, 'responsiveField');
$return['loginShell'] = $row;
}
return $return;
}

View File

@ -672,6 +672,10 @@ h4.schema_oclass_sub {
/** responsive styles */
.row input {
width: 100%;
}
div.dialog-page {
float: left;
}