From a01fbc39e23887f13497428870b7f36f0bc75755 Mon Sep 17 00:00:00 2001 From: jengo Date: Wed, 22 Nov 2000 05:45:31 +0000 Subject: [PATCH] Cleaning up the templates --- admin/accesslog.php | 30 +++++++++++------------ admin/templates/default/accesslog.tpl | 18 +++----------- admin/templates/default/accesslog_row.tpl | 10 ++++++++ 3 files changed, 27 insertions(+), 31 deletions(-) create mode 100644 admin/templates/default/accesslog_row.tpl diff --git a/admin/accesslog.php b/admin/accesslog.php index bf4cb9608d..3993555b45 100755 --- a/admin/accesslog.php +++ b/admin/accesslog.php @@ -15,11 +15,8 @@ $phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True); include("../header.inc.php"); - $phpgw->template->set_file(array( "header" => "accesslog.tpl", - "row" => "accesslog.tpl", - "footer" => "accesslog.tpl" )); - - $phpgw->template->set_block("header","row","footer"); + $phpgw->template->set_file(array("list" => "accesslog.tpl", + "row" => "accesslog_row.tpl")); $show_maxlog = 30; @@ -32,10 +29,8 @@ $phpgw->template->set_var("lang_logout",lang("Logout")); $phpgw->template->set_var("lang_total",lang("Total")); - $phpgw->template->parse("out","header"); - $phpgw->db->query("select loginid,ip,li,lo from access_log order by li desc " - . "limit $show_maxlog"); + . "limit $show_maxlog"); while ($phpgw->db->next_record()) { $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); @@ -69,18 +64,20 @@ $lo = " "; } - $phpgw->template->set_var("row_loginid",$phpgw->db->f("loginid")); + if (ereg("@",$phpgw->db->f("loginid"))) { + $t = split("@",$phpgw->db->f("loginid")); + $loginid = $t[0]; + } else { + $loginid = $phpgw->db->f("loginid"); + } + + $phpgw->template->set_var("row_loginid",$loginid); $phpgw->template->set_var("row_ip",$phpgw->db->f("ip")); $phpgw->template->set_var("row_li",$li); $phpgw->template->set_var("row_lo",$lo); $phpgw->template->set_var("row_total",$total); - if ($phpgw->db->num_rows() == 1) { - $phpgw->template->set_var("output",""); - } - if ($phpgw->db->num_rows() != ++$i) { - $phpgw->template->parse("output","row",True); - } + $phpgw->template->parse("rows","row",True); } $phpgw->db->query("select count(*) from access_log"); @@ -97,6 +94,7 @@ $phpgw->template->set_var("footer_total",lang("Total records") . ": $total"); $phpgw->template->set_var("lang_percent",lang("Percent of users that logged out") . ": $percent%"); - $phpgw->template->pparse("out","footer"); + $phpgw->template->pparse("out","list"); $phpgw->common->phpgw_footer(); +?> \ No newline at end of file diff --git a/admin/templates/default/accesslog.tpl b/admin/templates/default/accesslog.tpl index ec6bf08723..59cf2acbc8 100644 --- a/admin/templates/default/accesslog.tpl +++ b/admin/templates/default/accesslog.tpl @@ -1,4 +1,4 @@ - +

@@ -13,21 +13,9 @@ - -{output} + {rows} - - - - - - - - - - - @@ -36,4 +24,4 @@
{lang_logout} {lang_total}
{row_loginid}{row_ip}{row_li}{row_lo}{row_total}
{footer_total}
{lang_percent}
- + diff --git a/admin/templates/default/accesslog_row.tpl b/admin/templates/default/accesslog_row.tpl new file mode 100644 index 0000000000..3983217ed0 --- /dev/null +++ b/admin/templates/default/accesslog_row.tpl @@ -0,0 +1,10 @@ + + + + {row_loginid} + {row_ip} + {row_li} + {row_lo} + {row_total} + +