diff --git a/admin/addcategory.php b/admin/addcategory.php
index 6fcbb92d9f..20515423f2 100644
--- a/admin/addcategory.php
+++ b/admin/addcategory.php
@@ -14,7 +14,7 @@
$phpgw_info['flags']['currentapp'] = 'admin';
include('../header.inc.php');
- $t = new Template(PHPGW_APP_TPL);
+ $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$t->set_file(array('form' => 'category_form.tpl'));
$t->set_block('form','add','addhandle');
$t->set_block('form','edit','edithandle');
diff --git a/admin/deletecategory.php b/admin/deletecategory.php
index 0ada25da31..b929298489 100644
--- a/admin/deletecategory.php
+++ b/admin/deletecategory.php
@@ -11,95 +11,97 @@
\**************************************************************************/
/* $Id$ */
- if ($confirm)
- {
- $phpgw_info['flags'] = array('noheader' => True,
- 'nonavbar' => True);
- }
-
- $phpgw_info['flags']['currentapp'] = 'admin';
- include('../header.inc.php');
-
- $c = CreateObject('phpgwapi.categories');
- $c->categories($phpgw_info['user']['account_id'],'phpgw');
-
- if (! $cat_id)
- {
- Header('Location: ' . $phpgw->link('/admin/categories.php'));
- }
-
- if ($confirm)
- {
- if ($subs)
+ if ($confirm)
{
- $c->delete($cat_id,'True');
+ $phpgw_info['flags'] = array(
+ 'noheader' => True,
+ 'nonavbar' => True
+ );
+ }
+
+ $phpgw_info['flags']['currentapp'] = 'admin';
+ include('../header.inc.php');
+
+ $c = CreateObject('phpgwapi.categories');
+ $c->categories($phpgw_info['user']['account_id'],'phpgw');
+
+ if (! $cat_id)
+ {
+ Header('Location: ' . $phpgw->link('/admin/categories.php'));
+ }
+
+ if ($confirm)
+ {
+ if ($subs)
+ {
+ $c->delete($cat_id,'True');
+ }
+ else
+ {
+ $c->delete($cat_id);
+ }
+ Header('Location: ' . $phpgw->link('/admin/categories.php',"start=$start&query=$query&sort=$sort&order=$order&filter=$filter"));
}
else
{
- $c->delete($cat_id);
- }
- Header('Location: ' . $phpgw->link('/admin/categories.php',"start=$start&query=$query&sort=$sort&order=$order&filter=$filter"));
- }
- else
- {
- $hidden_vars = "\n"
+ $hidden_vars = "\n"
. "\n"
. "\n"
. "\n"
. "\n"
. "\n";
- $t = new Template(PHPGW_APP_TPL);
- $t->set_file(array('category_delete' => 'delete_cat.tpl'));
- $t->set_block('category_delete','delete','deletehandle');
- $t->set_block('category_delete','done','donehandle');
+ $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+ $t->set_file(array('category_delete' => 'delete_cat.tpl'));
+ $t->set_block('category_delete','delete','deletehandle');
+ $t->set_block('category_delete','done','donehandle');
- $nolink = $phpgw->link('/admin/categories.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter");
+ $nolink = $phpgw->link('/admin/categories.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter");
- $apps_cats = $c->exists('subs',$cat_name='',$cat_id);
+ $apps_cats = $c->exists('subs',$cat_name='',$cat_id);
- if ($apps_cats==True)
- {
- $t->set_var('messages',lang('This category is used from applications as parent category !'));
- $t->set_var('hidden_vars',$hidden_vars);
- $t->set_var('lang_subs','');
- $t->set_var('subs','');
- $t->set_var('nolink',$nolink);
- $t->set_var('lang_done',lang('Done'));
- $t->set_var('deletehandle','');
- $t->set_var('donehandle','');
- $t->pparse('out','category_delete');
- $t->pparse('donehandle','done');
- $phpgw->common->phpgw_footer();
+ if ($apps_cats==True)
+ {
+ $t->set_var('messages',lang('This category is used from applications as parent category !'));
+ $t->set_var('hidden_vars',$hidden_vars);
+ $t->set_var('lang_subs','');
+ $t->set_var('subs','');
+ $t->set_var('nolink',$nolink);
+ $t->set_var('lang_done',lang('Done'));
+ $t->set_var('deletehandle','');
+ $t->set_var('donehandle','');
+ $t->pparse('out','category_delete');
+ $t->pparse('donehandle','done');
+ $phpgw->common->phpgw_footer();
+ }
+ else
+ {
+ $t->set_var('messages',lang('Are you sure you want to delete this category ?'));
+ $t->set_var('hidden_vars',$hidden_vars);
+
+ $exists = $c->exists('subs',$cat_name='',$cat_id);
+
+ if ($exists==True)
+ {
+ $t->set_var('lang_subs',lang('Do you also want to delete all global subcategories ?'));
+ $t->set_var('subs','');
+ }
+ else
+ {
+ $t->set_var('lang_subs','');
+ $t->set_var('subs', '');
+ }
+
+ $t->set_var('nolink',$nolink);
+ $t->set_var('lang_no',lang('No'));
+
+ $t->set_var('action_url',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id"));
+ $t->set_var('lang_yes',lang('Yes'));
+ $t->set_var('deletehandle','');
+ $t->set_var('donehandle','');
+ $t->pparse('out','category_delete');
+ $t->pparse('deletehandle','delete');
+ $phpgw->common->phpgw_footer();
+ }
}
- else
- {
- $t->set_var('messages',lang('Are you sure you want to delete this category ?'));
- $t->set_var('hidden_vars',$hidden_vars);
-
- $exists = $c->exists('subs',$cat_name='',$cat_id);
-
- if ($exists==True)
- {
- $t->set_var('lang_subs',lang('Do you also want to delete all global subcategories ?'));
- $t->set_var('subs','');
- }
- else
- {
- $t->set_var('lang_subs','');
- $t->set_var('subs', '');
- }
-
- $t->set_var('nolink',$nolink);
- $t->set_var('lang_no',lang('No'));
-
- $t->set_var('action_url',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id"));
- $t->set_var('lang_yes',lang('Yes'));
- $t->set_var('deletehandle','');
- $t->set_var('donehandle','');
- $t->pparse('out','category_delete');
- $t->pparse('deletehandle','delete');
- $phpgw->common->phpgw_footer();
- }
- }
?>
diff --git a/admin/groups.php b/admin/groups.php
index 3e7875180d..b08c3ae04c 100755
--- a/admin/groups.php
+++ b/admin/groups.php
@@ -33,7 +33,7 @@
return $phpgw->db->f(0);
}
- $p = new Template(PHPGW_APP_TPL);
+ $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$p->set_file(array(
'groups' => 'groups.tpl',
));
diff --git a/admin/newgroup.php b/admin/newgroup.php
index c6bec53ddd..52afc54339 100755
--- a/admin/newgroup.php
+++ b/admin/newgroup.php
@@ -156,8 +156,8 @@
}
}
- $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin'));
- $p->set_file(array("form" => "groups_form.tpl"));
+ $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
+ $p->set_file(array("form" => "groups_form.tpl"));
if ($error)
{
diff --git a/admin/viewaccount.php b/admin/viewaccount.php
index 25988fd973..cab6ccbf91 100755
--- a/admin/viewaccount.php
+++ b/admin/viewaccount.php
@@ -31,7 +31,7 @@
Header('Location: ' . $phpgw->link('/admin/accounts.php'));
}
- $t = new Template(PHPGW_APP_TPL);
+ $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$t->set_unknowns('remove');
$t->set_file(array('account' => 'account_form.tpl'));
$t->set_block('account','form','form');