From 64393ce7a29459f1761162af09c91284ba9db6c4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 4 Sep 2011 15:25:53 +0000 Subject: [PATCH] calling framework->render() after parsing the template, to allow callbacks to register javascript files --- admin/inc/class.uiconfig.inc.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index 423dd866e5..7a5e5449f2 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -1,6 +1,6 @@ @@ -62,14 +62,14 @@ class uiconfig $config_appname = $appname; break; } - $t =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir($appname)); + $t = new Template(common::get_tpl_dir($appname)); $t->set_unknowns('keep'); $t->set_file(array('config' => 'config.tpl')); $t->set_block('config','header','header'); $t->set_block('config','body','body'); $t->set_block('config','footer','footer'); - $c =& CreateObject('phpgwapi.config',$config_appname); + $c = new config($config_appname); $c->read_repository(); if ($_POST['cancel'] || $_POST['submit'] && $GLOBALS['egw']->acl->check('site_config_access',2,'admin')) @@ -134,11 +134,6 @@ class uiconfig $t->set_var('error',''); $t->set_var('th_err',$GLOBALS['egw_info']['theme']['th_bg']); } - // set currentapp to our calling app, to show the right sidebox-menu - $GLOBALS['egw_info']['flags']['currentapp'] = $show_app; - $GLOBALS['egw']->common->egw_header(); - echo parse_navbar(); - $t->set_var('title',lang('Site Configuration')); $t->set_var('action_url',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname)); $t->set_var('th_bg', $GLOBALS['egw_info']['theme']['th_bg']); @@ -146,7 +141,6 @@ class uiconfig $t->set_var('row_on', $GLOBALS['egw_info']['theme']['row_on']); $t->set_var('row_off', $GLOBALS['egw_info']['theme']['row_off']); $t->set_var('hidden_vars',''); - $t->pparse('out','header'); $vars = $t->get_undefined('body'); @@ -230,11 +224,17 @@ class uiconfig break; } } - - $t->pfp('out','body'); - $t->set_var('lang_submit', $GLOBALS['egw']->acl->check('site_config_access',2,'admin') ? lang('Cancel') : lang('Save')); $t->set_var('lang_cancel', lang('Cancel')); - $t->pfp('out','footer'); + + // set currentapp to our calling app, to show the right sidebox-menu + $GLOBALS['egw_info']['flags']['currentapp'] = $show_app; + + // render the page + $GLOBALS['egw']->framework->render( + $t->parse('out','header'). + $t->fp('out','body'). + $t->fp('out','footer') + ); } }