From c4fe1069d51a7bfa17b14430efb13c4e936e694f Mon Sep 17 00:00:00 2001 From: jengo Date: Wed, 22 Nov 2000 06:22:00 +0000 Subject: [PATCH] Converted groups list to templates --- admin/groups.php | 59 +++++++++++++------------- admin/templates/default/groups.tpl | 36 ++++++++++++++++ admin/templates/default/groups_row.tpl | 8 ++++ 3 files changed, 74 insertions(+), 29 deletions(-) create mode 100644 admin/templates/default/groups.tpl create mode 100644 admin/templates/default/groups_row.tpl diff --git a/admin/groups.php b/admin/groups.php index b60a4bb0d2..a2b6cb3259 100755 --- a/admin/groups.php +++ b/admin/groups.php @@ -15,6 +15,9 @@ $phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True); include("../header.inc.php"); + $phpgw->template->set_file(array("list" => "groups.tpl", + "row" => "groups_row.tpl")); + if (! $start) $start = 0; @@ -35,42 +38,40 @@ $total = $phpgw->db->f(0); $limit = $phpgw->nextmatchs->sql_limit($start); + + $phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); + $phpgw->template->set_var("left_nextmatchs",$phpgw->nextmatchs->left("groups.php",$start,$total)); + $phpgw->template->set_var("right_nextmatchs",$phpgw->nextmatchs->right("groups.php",$start,$total)); + $phpgw->template->set_var("lang_groups",lang("user groups")); - echo '

' - . '' - . '' - . '' - . '
' . $phpgw->nextmatchs->left("groups.php",$start,$total) . '' . lang("user groups") . '' . $phpgw->nextmatchs->right("groups.php",$start,$total) . '
'; - - echo "" - . "" - . ""; + $phpgw->template->set_var("sort_name",$phpgw->nextmatchs->show_sort_order($sort,"group_name",$order,"groups.php",lang("name"))); + $phpgw->template->set_var("header_edit",lang("Edit")); + $phpgw->template->set_var("header_delete",lang("Delete")); $phpgw->db->query("select * from groups $querymethod $ordermethod limit $limit"); while ($phpgw->db->next_record()) { - $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + + $phpgw->template->set_var("tr_color",$tr_color); + + $group_name = $phpgw->db->f("group_name"); + + if (! $group_name) $group_name = ' '; - $group_name = $phpgw->db->f("group_name"); - - if (! $group_name) $group_name = ' '; - - echo "" - . "" . ""; + $phpgw->template->set_var("group_name",$group_name); + $phpgw->template->set_var("edit_link",' ' . lang("Edit") . ' '); + $phpgw->template->set_var("delete_link",' ' . lang("Delete") . ' '); + + $phpgw->template->parse("rows","row",True); } - echo "\nlink("newgroup.php")."\">" - . "
" - . $phpgw->nextmatchs->show_sort_order($sort,"group_name",$order,"groups.php", - lang("name")) . " " . lang("Edit") . " " . lang("Delete") - . "
$group_namelink("editgroup.php","group_id=" . $phpgw->db->f("group_id")) - . "\"> " . lang("Edit") . " link("deletegroup.php","group_id=" . $phpgw->db->f("group_id")) - . "\"> " . lang("Delete") . "
" - . "" - . "
link("groups.php")."\">
" . lang("search") . " " - . "
"; + $phpgw->template->set_var("new_action",$phpgw->link("newgroup.php")); + $phpgw->template->set_var("lang_add",lang("add")); + + $phpgw->template->set_var("search_action",$phpgw->link("groups.php")); + $phpgw->template->set_var("lang_search",lang("search")); + + $phpgw->template->pparse("out","list"); $phpgw->common->phpgw_footer(); ?> diff --git a/admin/templates/default/groups.tpl b/admin/templates/default/groups.tpl new file mode 100644 index 0000000000..5a249731c4 --- /dev/null +++ b/admin/templates/default/groups.tpl @@ -0,0 +1,36 @@ + +

+ + + + + + +
{left_nextmatchs}{lang_groups}{right_nextmatchs}
+ + + + + + + + + {rows} + +
{sort_name}{header_edit}{header_delete}
+ + + + + + +
+
+ +
+
{lang_search}  +
+ +
+
+ diff --git a/admin/templates/default/groups_row.tpl b/admin/templates/default/groups_row.tpl new file mode 100644 index 0000000000..7d42fa1f67 --- /dev/null +++ b/admin/templates/default/groups_row.tpl @@ -0,0 +1,8 @@ + + + + {group_name} + {edit_link} + {delete_link} + +