diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index bb0d4291..07897adf 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -103,6 +103,14 @@ tr.userlist_checked { * */ +/* */ +table.groupnav { + background-color:#a8c3ff; + border-width:1px; + border-style:solid; + border-color:#7167bf;//#0050ff; +} + /* table preferences */ table.grouplist { border-width:1px; @@ -118,7 +126,11 @@ tr.grouplist { /* color of head row */ tr.grouplist_head { background-color:#a8c3ff; - font-weight:bold; +} + +/* color of sorted column in head row */ +th.grouplist_sort { + background-color:#d6e3ff; } /* color of rows on mouseOver */ @@ -136,6 +148,14 @@ tr.grouplist_checked { * */ +/* */ +table.hostnav { + background-color:#ffc4ba; + border-width:1px; + border-style:solid; + border-color:#911a1a; +} + /* table preferences */ table.hostlist { border-width:1px; @@ -151,7 +171,11 @@ tr.hostlist { /* color of head row */ tr.hostlist_head { background-color:#ffc4ba; - font-weight:bold; +} + +/* color of sorted column in head row */ +th.hostlist_sort { + background-color:#ffe2dd; } /* color of rows on mouseOver */ diff --git a/lam/templates/lists/listgroups.php b/lam/templates/lists/listgroups.php index 86b0fcaa..7ab96176 100644 --- a/lam/templates/lists/listgroups.php +++ b/lam/templates/lists/listgroups.php @@ -74,23 +74,22 @@ else $max_pageentrys = $_SESSION["config"]->get_MaxListEntries(); for ($i = 0; $i < sizeof($temp_array); $i++) { -// if value is predifined, look up description in hash_table -if (substr($temp_array[$i],0,1) == "#") { - $attr = substr($temp_array[$i],1); - $attr_array[$i] = $attr; - $desc_array[] = $hash_table[$attr]; -} -// if not predefined, the attribute is seperated by a ":" from description -else { - $attr = explode(":", $temp_array[$i]); - $attr_array[$i] = $attr[0]; - $desc_array[$i] = $attr[1]; -} + // if value is predifined, look up description in hash_table + if (substr($temp_array[$i],0,1) == "#") { + $attr = substr($temp_array[$i],1); + $attr_array[$i] = $attr; + $desc_array[] = $hash_table[$attr]; + } + // if not predefined, the attribute is seperated by a ":" from description + else { + $attr = explode(":", $temp_array[$i]); + $attr_array[$i] = $attr[0]; + $desc_array[$i] = $attr[1]; + } } // configure search filter // Groups have the attribute "posixGroup" -$filter = "(objectClass=posixGroup)"; $filter = "(&(objectClass=posixGroup)"; for ($k = 0; $k < sizeof($desc_array); $k++) { if ($_POST["filter" . strtolower($attr_array[$k])]) @@ -117,12 +116,18 @@ else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences echo ("
\n"); +draw_navigation_bar(sizeof($info)); +echo ("
"); + // print group table header echo "\n"; echo ""; // table header for ($k = 0; $k < sizeof($desc_array); $k++) { - echo ""; + if (strtolower($attr_array[$k]) == $list) { + echo ""; + } + else echo ""; } echo "\n"; @@ -139,8 +144,13 @@ for ($k = 0; $k < sizeof ($desc_array); $k++) { } echo "\n"; +// calculate which rows to show +$table_begin = ($page - 1) * $max_pageentrys; +if (($page * $max_pageentrys) > sizeof($info)) $table_end = sizeof($info); +else $table_end = ($page * $max_pageentrys); + // print group list -for ($i = 0; $i < sizeof($info); $i++) { // ignore last entry in array which is "count" +for ($i = $table_begin; $i < $table_end; $i++) { echo("\n"); } echo ("
" . $desc_array[$k] . "" . $desc_array[$k] . "" . $desc_array[$k] . "
"); -echo ("

 

\n"); -echo (""); -echo (""); -echo (""); +echo ("
"); + +draw_navigation_bar(sizeof($info)); + +echo ("
\n"); +echo ("
"); +echo ("\n"); +echo ("\n"); echo ("
\n"); echo ("
\n"); echo "\n"; +/** + * @brief draws a navigation bar to switch between pages + * + * + * @return void + */ +function draw_navigation_bar ($count) { + global $max_pageentrys; + global $page; + global $list; + + echo ("\n"); + echo ("\n"); + echo (""); + + echo ("
  "); + if ($page != 1) + echo ("<=\n"); + else + echo ("<="); + echo (" "); + + if ($page < ($count / $max_pageentrys)) + echo ("=>\n"); + else + echo ("=>"); + for ($i = 0; $i < ($count / $max_pageentrys); $i++) { + if ($i == $page - 1) + echo (" " . ($i + 1)); + else + echo (" " . ($i + 1) . "\n"); + } + echo ("
\n"); +} + // compare function used for usort-method // rows are sorted with the first attribute entry of the sort column // if objects have attributes with multiple values the others are ignored diff --git a/lam/templates/lists/listhosts.php b/lam/templates/lists/listhosts.php index 06a6bb8f..ff63efc7 100644 --- a/lam/templates/lists/listhosts.php +++ b/lam/templates/lists/listhosts.php @@ -116,12 +116,18 @@ else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences echo ("
\n"); +draw_navigation_bar(sizeof($info)); +echo ("
"); + // print host table header echo "\n"; echo ""; // table header for ($k = 0; $k < sizeof($desc_array); $k++) { - echo ""; + if (strtolower($attr_array[$k]) == $list) { + echo ""; + } + else echo ""; } echo "\n"; @@ -138,8 +144,13 @@ for ($k = 0; $k < sizeof ($desc_array); $k++) { } echo "\n"; +// calculate which rows to show +$table_begin = ($page - 1) * $max_pageentrys; +if (($page * $max_pageentrys) > sizeof($info)) $table_end = sizeof($info); +else $table_end = ($page * $max_pageentrys); + // print host list -for ($i = 0; $i < sizeof($info); $i++) { +for ($i = $table_begin; $i < $table_end; $i++) { echo("\n"); } echo ("
" . $desc_array[$k] . "" . $desc_array[$k] . "" . $desc_array[$k] . "
"); -echo ("

 

\n"); -echo (""); -echo (""); -echo (""); + +echo ("
"); + +draw_navigation_bar(sizeof($info)); + +echo ("
\n"); +echo ("
\n"); +echo ("\n"); +echo ("\n"); echo ("
\n"); echo ("
\n"); echo "\n"; +/** + * @brief draws a navigation bar to switch between pages + * + * + * @return void + */ +function draw_navigation_bar ($count) { + global $max_pageentrys; + global $page; + global $list; + + echo ("\n"); + echo ("\n"); + echo (""); + + echo ("
  "); + if ($page != 1) + echo ("<=\n"); + else + echo ("<="); + echo (" "); + + if ($page < ($count / $max_pageentrys)) + echo ("=>\n"); + else + echo ("=>"); + for ($i = 0; $i < ($count / $max_pageentrys); $i++) { + if ($i == $page - 1) + echo (" " . ($i + 1)); + else + echo (" " . ($i + 1) . "\n"); + } + echo ("
\n"); +} + // compare function used for usort-method // rows are sorted with the first attribute entry of the sort column // if objects have attributes with multiple values the others are ignored