Cleaning up templates

This commit is contained in:
jengo 2000-11-22 05:50:42 +00:00
parent a01fbc39e2
commit a7eb74b77d
3 changed files with 22 additions and 35 deletions

View File

@ -15,11 +15,8 @@
$phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True);
include("../header.inc.php");
$phpgw->template->set_file(array("header" => "currentusers.tpl",
"row" => "currentusers.tpl",
"footer" => "currentusers.tpl"));
$phpgw->template->set_block("header","row","footer","output");
$phpgw->template->set_file(array("list" => "currentusers.tpl",
"row" => "currentusers_row.tpl"));
if (! $start) {
$start = 0;
@ -29,13 +26,13 @@
$phpgw->db->query("select count(*) from sessions",__LINE__,__FILE__);
$phpgw->db->next_record();
$phpgw->templateotal = $phpgw->db->f(0);
$total = $phpgw->db->f(0);
$limit = $phpgw->nextmatchs->sql_limit($start);
$phpgw->template->set_var("lang_current_users",lang("List of current users"));
$phpgw->template->set_var("bg_color",$phpgw_info["theme"][bg_color]);
$phpgw->template->set_var("left_next_matchs",$phpgw->nextmatchs->left("currentusers.php",$start,$phpgw->templateotal));
$phpgw->template->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$phpgw->templateotal));
$phpgw->template->set_var("left_next_matchs",$phpgw->nextmatchs->left("currentusers.php",$start,$total));
$phpgw->template->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$total));
$phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
$phpgw->template->set_var("sort_loginid",$phpgw->nextmatchs->show_sort_order($sort,"session_lid",$order,
@ -48,9 +45,6 @@
"currentusers.php",lang("idle")));
$phpgw->template->set_var("lang_kill",lang("Kill"));
$phpgw->template->parse("out","header");
if ($order) {
$ordermethod = "order by $order $sort";
} else {
@ -61,8 +55,8 @@
$i = 0;
while ($phpgw->db->next_record()) {
$phpgw->templater_color = $phpgw->nextmatchs->alternate_row_color($phpgw->templater_color);
$phpgw->template->set_var("tr_color",$phpgw->templater_color);
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$phpgw->template->set_var("tr_color",$tr_color);
if (ereg("@",$phpgw->db->f("session_lid"))) {
$t = split("@",$phpgw->db->f("session_lid"));
@ -83,14 +77,9 @@
$phpgw->template->set_var("row_kill"," ");
}
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->template->pparse("out","footer");
$phpgw->template->pparse("out","list");
$phpgw->common->phpgw_footer();
?>

View File

@ -1,4 +1,4 @@
<!-- BEGIN header -->
<!-- BEGIN list -->
<center>
{lang_current_users}:
<table border="0" width="50%">
@ -15,21 +15,9 @@
<td>{sort_idle}</td>
<td>{lang_kill}</td>
</tr>
<!-- END header -->
{output}
{rows}
<!-- BEGIN row -->
<tr bgcolor="{tr_color}">
<td>{row_loginid}</td>
<td>{row_ip}</td>
<td>{row_logintime}</td>
<td>{row_idle}</td>
<td>{row_kill}</td>
</tr>
<!-- END row -->
<!-- BEGIN footer -->
</center>
</table>
<!-- END footer -->
<!-- END list -->

View File

@ -0,0 +1,10 @@
<!-- BEGIN row -->
<tr bgcolor="{tr_color}">
<td>{row_loginid}</td>
<td>{row_ip}</td>
<td>{row_logintime}</td>
<td>{row_idle}</td>
<td>{row_kill}</td>
</tr>
<!-- END row -->