From 34ffbb4f36dd42c9cb9a1bb01a5d9904671f1923 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 23 Feb 2019 18:42:21 +0100 Subject: [PATCH] responsive account edit page --- lam/lib/modules.inc | 95 ++++++------- lam/lib/types/user.inc | 16 +-- lam/style/500_layout.css | 7 +- lam/style/responsive/120_lam.css | 6 +- lam/templates/lib/500_lam.js | 4 +- lam/templates/main_footer.php | 34 ----- lam/templates/main_header.php | 224 ------------------------------- 7 files changed, 69 insertions(+), 317 deletions(-) delete mode 100644 lam/templates/main_footer.php delete mode 100644 lam/templates/main_header.php diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 2e910537..d0e8729a 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -1055,44 +1055,47 @@ class accountContainer { } echo "type->getScope() . "-bright\" valign=\"top\">"; // print title bar - echo '
'; - echo ''; - echo ''; - echo ''; - echo '
'; - echo $this->titleBarTitle; - echo '
'; - $group = new htmlGroup(); - // suffix - $group->addElement(new htmlOutputText(_('Suffix'))); - $group->addElement(new htmlSpacer('2px', null)); - $suffixList = array(); - foreach ($this->getOUs() as $suffix) { - $suffixList[getAbstractDN($suffix)] = $suffix; - } - if (!($this->dnSuffix == '') && !in_array($this->dnSuffix, $this->getOUs())) { - $suffixList[getAbstractDN($this->dnSuffix)] = $this->dnSuffix; - } - $selectedSuffix = array($this->dnSuffix); - $suffixSelect = new htmlSelect('accountContainerSuffix', $suffixList, $selectedSuffix); - $suffixSelect->setHasDescriptiveElements(true); - $suffixSelect->setRightToLeftTextDirection(true); - $group->addElement($suffixSelect); - $group->addElement(new htmlSpacer('10px', null)); - // RDN selection - $group->addElement(new htmlOutputText(_('RDN identifier'))); - $group->addElement(new htmlSpacer('2px', null)); - $rdnlist = getRDNAttributes($this->type->getId()); - $group->addElement(new htmlSelect('accountContainerRDN', $rdnlist, array($this->rdn))); - $group->addElement(new htmlHelpLink('301')); - parseHtml(null, $group, array(), true, $tabindex, $this->type->getScope()); - echo '
'; - if ($this->titleBarSubtitle != null) { - echo '
'; - echo $this->titleBarSubtitle; - echo '
'; + $titleBarContainer = new htmlResponsiveRow(); + $titleBarContainer->setCSSClasses(array('maxrow')); + $titleBarTitleText = new htmlOutputText($this->titleBarTitle, false); + $titleBarContainer->add(new htmlDiv(null, $titleBarTitleText, array('titleBarTitle', 'text-left')), 12); + $titleBarContainer->addVerticalSpacer('0.5rem'); + $titleBarSubtitleText = new htmlOutputText($this->titleBarSubtitle, false); + $titleBarContainer->add(new htmlDiv(null, $titleBarSubtitleText, array('titleBarSubtitle', 'text-left')), 12); + $titleBarContainer->addVerticalSpacer('1rem'); + $titleBarSuffixRdn = new htmlResponsiveRow(); + // suffix + $suffixList = array(); + foreach ($this->getOUs() as $suffix) { + $suffixList[getAbstractDN($suffix)] = $suffix; } - echo '
'; + if (!($this->dnSuffix == '') && !in_array($this->dnSuffix, $this->getOUs())) { + $suffixList[getAbstractDN($this->dnSuffix)] = $this->dnSuffix; + } + $selectedSuffix = array($this->dnSuffix); + $suffixGroup = new htmlGroup(); + $suffixGroup->addElement(new htmlOutputText(_('Suffix'))); + $suffixSelect = new htmlSelect('accountContainerSuffix', $suffixList, $selectedSuffix); + $suffixSelect->setHasDescriptiveElements(true); + $suffixSelect->setRightToLeftTextDirection(true); + $suffixSelect->setCSSClasses(array('auto-width')); + $suffixGroup->addElement($suffixSelect); + $suffixGroup->addElement(new htmlHelpLink('361')); + $titleBarSuffixRdn->add($suffixGroup, 12, 6, 6, 'nowrap maxrow'); + // RDN selection + $rdnGroup = new htmlGroup(); + $rdnGroup->addElement(new htmlOutputText(_('RDN identifier'))); + $rdnlist = getRDNAttributes($this->type->getId()); + $rdnSelect = new htmlSelect('accountContainerRDN', $rdnlist, array($this->rdn)); + $rdnSelect->setCSSClasses(array('auto-width')); + $rdnGroup->addElement($rdnSelect); + $rdnGroup->addElement(new htmlHelpLink('301'), 1); + $titleBarSuffixRdn->add($rdnGroup, 12, 6, 6, 'nowrap maxrow'); + $titleBarContainer->add($titleBarSuffixRdn, 12); + + $titleBarDiv = new htmlDiv(null, $titleBarContainer, array('titleBar', 'ui-corner-top')); + parseHtml(null, $titleBarDiv, array(), false, $tabindex, $this->type->getScope()); + echo '
'; echo ''; echo '
'; @@ -1298,7 +1301,8 @@ class accountContainer { * @param int $tabindex tabindex for GUI elements */ private function printCommonControls(&$tabindex) { - $table = new htmlTable('100%'); + $row = new htmlResponsiveRow(); + $row->setCSSClasses(array('maxrow')); $leftButtonGroup = new htmlGroup(); $leftButtonGroup->alignment = htmlElement::ALIGN_LEFT; // save button @@ -1322,14 +1326,15 @@ class accountContainer { . getSecurityTokenName() . '\',\'' . getSecurityTokenValue() . '\');'); $leftButtonGroup->addElement($passwordButton); } - $table->addElement($leftButtonGroup); + $row->add($leftButtonGroup, 12, 7); $rightGroup = new htmlGroup(); - $rightGroup->alignment = htmlElement::ALIGN_RIGHT; // profile selection $profilelist = \LAM\PROFILES\getAccountProfiles($this->type->getId()); if (sizeof($profilelist) > 0) { - $rightGroup->addElement(new htmlSelect('accountContainerSelectLoadProfile', $profilelist, array($this->lastLoadedProfile))); + $profilesSelect = new htmlSelect('accountContainerSelectLoadProfile', $profilelist, array($this->lastLoadedProfile)); + $profilesSelect->setCSSClasses(array('auto-width')); + $rightGroup->addElement($profilesSelect); $profileButton = new htmlButton('accountContainerLoadProfile', _('Load profile')); $profileButton->setIconClass('loadProfileButton'); if (!$this->isNewAccount) { @@ -1340,9 +1345,9 @@ class accountContainer { $rightGroup->addElement(new htmlSpacer('1px', null)); $rightGroup->addElement(new htmlHelpLink('401')); } - $table->addElement($rightGroup); + $row->add($rightGroup, 12, 5, 5, 'text-right'); - parseHtml(null, $table, array(), false, $tabindex, $this->type->getScope()); + parseHtml(null, $row, array(), false, $tabindex, $this->type->getScope()); } /** @@ -1366,7 +1371,7 @@ class accountContainer { if (!empty($_POST)) { validateSecurityToken(); } - include '../main_header.php'; + include '../../lib/adminHeader.inc'; echo '\n"; -} - -// get tool list -$availableTools = getTools(); -$toolSettings = $_SESSION['config']->getToolSettings(); -// sort tools -$toSort = array(); -foreach ($availableTools as $toolClass) { - $myTool = new $toolClass(); - if ($myTool->getRequiresWriteAccess() && !checkIfWriteAccessIsAllowed()) { - continue; - } - if ($myTool->getRequiresPasswordChangeRights() && !checkIfPasswordChangeIsAllowed()) { - continue; - } - // check visibility - if (!$myTool->isVisible()) { - continue; - } - // check if hidden by config - $toolName = substr($toolClass, strrpos($toolClass, '\\') + 1); - if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] == 'true')) { - continue; - } - $toSort[$toolClass] = $myTool->getPosition(); -} -asort($toSort); -$tools = array(); -foreach ($toSort as $key => $value) { - $tools[] = new $key(); -} -?> - - - - - - - -
- - - decrypt_login(); - echo '  '; - printf('(' . _('Logged in as: %s') . ')', extractRDNValue($userData[0])); - $userData = null; - echo ''; - ?> - - -
- - - -
-
-
    - -
- -getConfiguredTypes(); - foreach ($types as $type) { - if ($type->isHidden()) { - continue; - } - $link = '' . - '' . $type->getId() . ' ' . - $type->getAlias() . ''; - echo '
  • '; - echo $link; - echo "
  • \n"; - } -} -