calling framework->render() after parsing the template, to allow callbacks to register javascript files

This commit is contained in:
Ralf Becker 2011-09-04 15:26:26 +00:00
parent a3b17caa5f
commit 41f17bc745

View File

@ -1,6 +1,6 @@
<?php <?php
/** /**
* eGgroupWare admin - site configuration * EGgroupware admin - site configuration
* *
* @link http://www.egroupware.org * @link http://www.egroupware.org
* @author Miles Lott <milos@groupwhere.org> * @author Miles Lott <milos@groupwhere.org>
@ -62,14 +62,14 @@ class uiconfig
$config_appname = $appname; $config_appname = $appname;
break; 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_unknowns('keep');
$t->set_file(array('config' => 'config.tpl')); $t->set_file(array('config' => 'config.tpl'));
$t->set_block('config','header','header'); $t->set_block('config','header','header');
$t->set_block('config','body','body'); $t->set_block('config','body','body');
$t->set_block('config','footer','footer'); $t->set_block('config','footer','footer');
$c =& CreateObject('phpgwapi.config',$config_appname); $c = new config($config_appname);
$c->read_repository(); $c->read_repository();
if ($_POST['cancel'] || $_POST['submit'] && $GLOBALS['egw']->acl->check('site_config_access',2,'admin')) 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('error','');
$t->set_var('th_err',$GLOBALS['egw_info']['theme']['th_bg']); $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('title',lang('Site Configuration'));
$t->set_var('action_url',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname)); $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']); $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_on', $GLOBALS['egw_info']['theme']['row_on']);
$t->set_var('row_off', $GLOBALS['egw_info']['theme']['row_off']); $t->set_var('row_off', $GLOBALS['egw_info']['theme']['row_off']);
$t->set_var('hidden_vars','<input type="hidden" name="referer" value="'.$referer.'">'); $t->set_var('hidden_vars','<input type="hidden" name="referer" value="'.$referer.'">');
$t->pparse('out','header');
$vars = $t->get_undefined('body'); $vars = $t->get_undefined('body');
@ -230,11 +224,17 @@ class uiconfig
break; 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_submit', $GLOBALS['egw']->acl->check('site_config_access',2,'admin') ? lang('Cancel') : lang('Save'));
$t->set_var('lang_cancel', lang('Cancel')); $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')
);
} }
} }