diff --git a/admin/applications.php b/admin/applications.php index db8411fe62..229596fe25 100644 --- a/admin/applications.php +++ b/admin/applications.php @@ -15,7 +15,8 @@ $phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True); include("../header.inc.php"); - $phpgw->template->set_file(array("list" => "applications.tpl", + $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $p->set_file(array("list" => "applications.tpl", "row" => "applications_row.tpl")); if ($order) { @@ -28,14 +29,14 @@ $sort = "desc"; } - $phpgw->template->set_var("lang_installed",lang("Installed applications")); - $phpgw->template->set_var("bg_color",$phpgw_info["theme"]["bg_color"]); - $phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); + $p->set_var("lang_installed",lang("Installed applications")); + $p->set_var("bg_color",$phpgw_info["theme"]["bg_color"]); + $p->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); - $phpgw->template->set_var("sort_title",$phpgw->nextmatchs->show_sort_order($sort,"app_title",$order,"applications.php",lang("title"))); - $phpgw->template->set_var("lang_edit",lang("Edit")); - $phpgw->template->set_var("lang_delete",lang("Delete")); - $phpgw->template->set_var("lang_enabled",lang("Enabled")); + $p->set_var("sort_title",$phpgw->nextmatchs->show_sort_order($sort,"app_title",$order,"applications.php",lang("title"))); + $p->set_var("lang_edit",lang("Edit")); + $p->set_var("lang_delete",lang("Delete")); + $p->set_var("lang_enabled",lang("Enabled")); $phpgw->db->query("select * from phpgw_applications $ordermethod",__LINE__,__FILE__); while ($phpgw->db->next_record()) { @@ -45,24 +46,24 @@ if (! $phpgw->db->f("app_title")) $name = $phpgw->db->f("app_name"); if (! $name) $name = " "; - $phpgw->template->set_var("tr_color",$tr_color); - $phpgw->template->set_var("name",$name); - $phpgw->template->set_var("edit",'db->f("app_name"))) . '"> ' . lang("Edit") . ' '); - $phpgw->template->set_var("delete",'db->f("app_name"))) . '"> ' . lang("Delete") . ' '); + $p->set_var("tr_color",$tr_color); + $p->set_var("name",$name); + $p->set_var("edit",'db->f("app_name"))) . '"> ' . lang("Edit") . ' '); + $p->set_var("delete",'db->f("app_name"))) . '"> ' . lang("Delete") . ' '); if ($phpgw->db->f("app_enabled") != 0) { $status = lang("Yes"); } else { $status = "" . lang("No") . ""; } - $phpgw->template->set_var("status",$status); + $p->set_var("status",$status); - $phpgw->template->parse("rows","row",True); + $p->parse("rows","row",True); } - $phpgw->template->set_var("new_action",$phpgw->link("newapplication.php")); - $phpgw->template->set_var("lang_add",lang("add")); + $p->set_var("new_action",$phpgw->link("newapplication.php")); + $p->set_var("lang_add",lang("add")); - $phpgw->template->pparse("out","list"); - $phpgw->common->phpgw_footer(); -?> \ No newline at end of file + $p->pparse("out","list"); + $p->common->phpgw_footer(); +?> diff --git a/admin/editapplication.php b/admin/editapplication.php index 94ad4a025c..7128c1a889 100644 --- a/admin/editapplication.php +++ b/admin/editapplication.php @@ -18,21 +18,25 @@ $phpgw_info["flags"]["currentapp"] = "admin"; $phpgw_info["flags"]["enable_nextmatchs_class"] = True; + include("../header.inc.php"); + $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + function display_row($label, $value) { - global $phpgw; - $phpgw->template->set_var("tr_color",$phpgw->nextmatchs->alternate_row_color()); - $phpgw->template->set_var("label",$label); - $phpgw->template->set_var("value",$value); + global $phpgw,$p; + $p->set_var("tr_color",$phpgw->nextmatchs->alternate_row_color()); + $p->set_var("label",$label); + $p->set_var("value",$value); - $phpgw->template->parse("rows","row",True); + $p->parse("rows","row",True); } - $phpgw->template->set_file(array("form" => "application_form.tpl", - "row" => "application_form_row.tpl" - )); + $p->set_file(array( + "form" => "application_form.tpl", + "row" => "application_form_row.tpl" + )); if ($submit) { if (! $app_order) { @@ -53,10 +57,10 @@ $phpgw->db->next_record(); if ($phpgw->db->f(0) != 0) { - $error[$totalerrors++] = lang("That application name already exsists."); + $error[$totalerrors++] = lang("That application name already exists."); } } - + if (! $totalerrors) { $phpgw->db->query("update phpgw_applications set app_name='" . addslashes($n_app_name) . "'," . "app_title='" . addslashes($n_app_title) . "', app_enabled='" @@ -79,9 +83,9 @@ $phpgw->common->phpgw_header(); echo parse_navbar(); - $phpgw->template->set_var("error","