From 63c72daa6349f2253d6f15c58440e3eba13fe991 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 2 Jan 2018 21:42:02 +0100 Subject: [PATCH] responsive --- lam/lib/adminFooter.php | 35 +++++++ lam/lib/adminHeader.inc | 206 +++++++++++++++++++++++++++++++++++++++ lam/style/500_layout.css | 4 + lam/templates/tools.php | 17 ++-- 4 files changed, 253 insertions(+), 9 deletions(-) create mode 100644 lam/lib/adminFooter.php create mode 100644 lam/lib/adminHeader.inc diff --git a/lam/lib/adminFooter.php b/lam/lib/adminFooter.php new file mode 100644 index 00000000..bd147649 --- /dev/null +++ b/lam/lib/adminFooter.php @@ -0,0 +1,35 @@ + + + +
+ + diff --git a/lam/lib/adminHeader.inc b/lam/lib/adminHeader.inc new file mode 100644 index 00000000..cef9b397 --- /dev/null +++ b/lam/lib/adminHeader.inc @@ -0,0 +1,206 @@ +get_ServerURL()) . ")"; +printHeaderContents($title, $headerPrefix); +echo "\n"; + +// include all JavaScript files +printJsIncludes($headerPrefix); + +// 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"; + } +} + diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index b4bc5758..90e223ce 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -154,6 +154,10 @@ textarea { margin-top: 0px; } +.padding0 { + padding: 0em !important; +} + .padding05 { padding: 0.5em; } diff --git a/lam/templates/tools.php b/lam/templates/tools.php index 9a81e7bb..98247652 100644 --- a/lam/templates/tools.php +++ b/lam/templates/tools.php @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2003 - 2017 Roland Gruber + Copyright (C) 2003 - 2018 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ enforceUserIsLoggedIn(); setlanguage(); -include 'main_header.php'; +include '../lib/adminHeader.inc'; // get tool list $availableTools = getTools(); @@ -60,8 +60,8 @@ foreach ($toSort as $key => $value) { echo "
    \n"; // print tools table -$container = new htmlTable(); -$container->addElement(new htmlTitle(_('Tools')), true); +$container = new htmlResponsiveRow(); +$container->add(new htmlTitle(_('Tools')), 12); $toolSettings = $_SESSION['config']->getToolSettings(); for ($i = 0; $i < sizeof($tools); $i++) { @@ -83,10 +83,9 @@ for ($i = 0; $i < sizeof($tools); $i++) { continue; } // add tool - $container->addElement(new htmlLink($tools[$i]->getName(), $tools[$i]->getLink(), '../graphics/' . $tools[$i]->getImageLink())); - $container->addElement(new htmlSpacer('10px', null)); - $container->addElement(new htmlOutputText($tools[$i]->getDescription()), true); - $container->addElement(new htmlSpacer(null, '20px'), true); + $container->add(new htmlLink($tools[$i]->getName(), $tools[$i]->getLink(), '../graphics/' . $tools[$i]->getImageLink()), 12, 4); + $container->add(new htmlOutputText($tools[$i]->getDescription()), 12, 8); + $container->addVerticalSpacer('2rem'); } $tabindex = 1; @@ -94,6 +93,6 @@ parseHtml(null, $container, array(), true, $tabindex, 'user'); echo "
    "; -include 'main_footer.php'; +include '../lib/adminFooter.php'; ?>