responsive self service

This commit is contained in:
Roland Gruber 2015-08-09 07:57:56 +00:00
parent d5ea258c10
commit a53a432c2b
8 changed files with 46 additions and 28 deletions

View File

@ -1428,8 +1428,8 @@ abstract class baseModule {
}
}
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel($name, $label)), 12, 6, 6, 'responsiveLabel');
$row->add($field, 12, 6, 6, 'responsiveField');
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel($name, $label)));
$row->addField($field);
$container[$name] = $row;
}

View File

@ -3279,6 +3279,24 @@ class htmlResponsiveRow extends htmlElement {
$this->addCell(new htmlResponsiveCell($content, $numMobile, $tabletCols, $tabletCols, $classes));
}
/**
* Adds the content as a typical label with 12/6/6 columns and CSS class "responsiveLabel".
*
* @param htmlElement $content label
*/
public function addLabel($content) {
$this->add($content, 12, 6, 6, 'responsiveLabel');
}
/**
* Adds the content as a typical field with 12/6/6 columns and CSS class "responsiveField".
*
* @param htmlElement $content field
*/
public function addField($content) {
$this->add($content, 12, 6, 6, 'responsiveField');
}
/**
* Prints the HTML code for this element.
*

View File

@ -789,7 +789,7 @@ class kolabUser extends baseModule {
* @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) {
if ($passwordChangeOnly) {
@ -842,10 +842,10 @@ class kolabUser extends baseModule {
$delegateContainer->addElement(new htmlTableExtendedInputCheckbox('new_delegate', false, _("Add"), null, false), true);
}
$delegateLabel = new htmlOutputText($this->getSelfServiceLabel('kolabDelegate', _('Delegates')));
$delegateLabel->alignment = htmlElement::ALIGN_TOP;
$return['kolabDelegate'] = new htmlTableRow(array(
$delegateLabel, $delegateContainer
));
$row = new htmlResponsiveRow();
$row->addLabel($delegateLabel);
$row->addField($delegateContainer);
$return['kolabDelegate'] = $row;
}
// invitation policies
if (in_array('kolabInvitationPolicy', $fields)) {
@ -890,10 +890,10 @@ class kolabUser extends baseModule {
$invitationContainer->addElement(new htmlTableExtendedInputCheckbox('addInvPol', false, _("Add"), null, false), true);
}
$invitationLabel = new htmlOutputText($this->getSelfServiceLabel('kolabInvitationPolicy', _('Invitation policy')));
$invitationLabel->alignment = htmlElement::ALIGN_TOP;
$return['kolabInvitationPolicy'] = new htmlTableRow(array(
$invitationLabel, $invitationContainer
));
$row = new htmlResponsiveRow();
$row->addLabel($invitationLabel);
$row->addField($invitationContainer);
$return['kolabInvitationPolicy'] = $row;
}
return $return;
}

View File

@ -230,7 +230,7 @@ class ldapPublicKey extends baseModule {
* @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();
@ -254,10 +254,10 @@ class ldapPublicKey extends baseModule {
$uploadStatus->colspan = 7;
$keyTable->addElement($uploadStatus, true);
$keyLabel = new htmlOutputText($this->getSelfServiceLabel('sshPublicKey', _('SSH public keys')));
$keyLabel->alignment = htmlElement::ALIGN_TOP;
$keyCells = array($keyLabel, $keyTable);
$keyRow = new htmlTableRow($keyCells);
$return['sshPublicKey'] = $keyRow;
$row = new htmlResponsiveRow();
$row->addLabel($keyLabel);
$row->addField($keyTable);
$return['sshPublicKey'] = $row;
}
return $return;
}

View File

@ -2681,8 +2681,8 @@ class posixAccount extends baseModule implements passwordService {
$cnField = new htmlOutputText($cn);
}
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('cn', _('Common name'))), 12, 6, 6, 'responsiveLabel');
$row->add($cnField, 12, 6, 6, 'responsiveField');
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('cn', _('Common name'))));
$row->addField($cnField);
$return['cn'] = $row;
}
if (in_array('loginShell', $fields)) {
@ -2694,8 +2694,8 @@ class posixAccount extends baseModule implements passwordService {
$loginShellField = new htmlOutputText($loginShell);
}
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('loginShell', _('Login shell'))), 12, 6, 6, 'responsiveLabel');
$row->add($loginShellField, 12, 6, 6, 'responsiveField');
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('loginShell', _('Login shell'))));
$row->addField($loginShellField);
$return['loginShell'] = $row;
}
return $return;

View File

@ -950,16 +950,16 @@ class pykotaUser extends baseModule {
$pykotaBalance = '';
if (isset($attributes['pykotaBalance'][0])) $pykotaBalance = $attributes['pykotaBalance'][0];
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('pykotaBalance', _('Balance'))), 12, 6, 6, 'responsiveLabel');
$row->add(new htmlOutputText($pykotaBalance), 12, 6, 6, 'responsiveField');
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('pykotaBalance', _('Balance'))));
$row->addField(new htmlOutputText($pykotaBalance));
$return['pykotaBalance'] = $row;
}
if (in_array('pykotaLifeTimePaid', $fields)) {
$pykotaLifeTimePaid = '';
if (isset($attributes['pykotaLifeTimePaid'][0])) $pykotaLifeTimePaid = $attributes['pykotaLifeTimePaid'][0];
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('pykotaLifeTimePaid', _('Total paid'))), 12, 6, 6, 'responsiveLabel');
$row->add(new htmlOutputText($pykotaLifeTimePaid), 12, 6, 6, 'responsiveField');
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('pykotaLifeTimePaid', _('Total paid'))));
$row->addField(new htmlOutputText($pykotaLifeTimePaid));
$return['pykotaLifeTimePaid'] = $row;
}
// payment history

View File

@ -2254,8 +2254,8 @@ class sambaSamAccount extends baseModule implements passwordService {
$sambaPwdLastSet = date('d.m.Y H:i', $attributes['sambaPwdLastSet'][0]);
}
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('sambaPwdLastSet', _('Last password change'))), 12, 6, 6, 'responsiveLabel');
$row->add(new htmlOutputText($sambaPwdLastSet), 12, 6, 6, 'responsiveField');
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('sambaPwdLastSet', _('Last password change'))));
$row->addField(new htmlOutputText($sambaPwdLastSet));
$return['sambaPwdLastSet'] = $row;
}
return $return;

View File

@ -743,8 +743,8 @@ class shadowAccount extends baseModule implements passwordService {
$shadowLastChange = $date['mday'] . "." . $date['mon'] . "." . $date['year'];
}
$row = new htmlResponsiveRow();
$row->add(new htmlOutputText($this->getSelfServiceLabel('shadowLastChange', _('Last password change'))), 12, 6, 6, 'responsiveLabel');
$row->add(new htmlOutputText($shadowLastChange), 12, 6, 6, 'responsiveField');
$row->addLabel(new htmlOutputText($this->getSelfServiceLabel('shadowLastChange', _('Last password change'))));
$row->addField(new htmlOutputText($shadowLastChange));
$return['shadowLastChange'] = $row;
}
return $return;