diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 38761a15..1150b7da 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -72,7 +72,58 @@ function listSort($sort, $attr_array, $info) { // sort and return account list usort($info, "cmp_array"); return $info; - } + +/** +* @brief draws a navigation bar to switch between pages +* +* @param integer $count number of account entries +* @param integer $max_page_entries maximum number of account per page +* @param integer $page current page number +* @param string $sort sort attribute +* @param string $searchFilter LDAP search filter +* @param string $scope account type (user/group/host/domain) +* @param string $text string including the number of accounts +*/ +function listDrawNavigationBar($count, $max_page_entries, $page, $sort, $searchFilter, $scope, $text) { + + echo("
"); + if ($page != 1) { + echo("<=\n"); + } + else { + echo("<="); + } + echo(" "); + + if ($page < ($count / $max_page_entries)) { + echo("=>\n"); + } + else { + echo("=> | "); + } + + echo(""); + //echo" " . $count . " " . _("Group(s) found"); + echo" "; + printf($text, $count); + echo(" | "); + + echo(""); + for ($i = 0; $i < ($count / $max_page_entries); $i++) { + if ($i == $page - 1) { + echo(" " . ($i + 1)); + } + else { + echo(" " . ($i + 1) . "\n"); + } + } + echo(" |