use ['phpgw']->template

This commit is contained in:
ceb 2002-11-15 00:18:55 +00:00
parent 73581badc5
commit 6326e50944
2 changed files with 42 additions and 55 deletions

View File

@ -2,14 +2,14 @@
/**************************************************************************\
* phpGroupWare - administration *
* http://www.phpgroupware.org *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* Modified by Stephen Brown <steve@dataclarity.net> *
* to distribute admin across the application directories *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
* Written by coreteam <phpgroupware-developers@gnu.org> *
* & Stephen Brown <steve@dataclarity.net> *
* to distribute admin across the application directories *
* ------------------------------------------------------ *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
@ -17,47 +17,42 @@
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'admin';
include('../header.inc.php');
$GLOBALS['admin_tpl'] = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$GLOBALS['admin_tpl']->set_file(
Array(
'admin' => 'index.tpl'
)
);
$GLOBALS['phpgw']->template->set_file(Array('admin' => 'index.tpl'));
$GLOBALS['admin_tpl']->set_block('admin','list');
$GLOBALS['admin_tpl']->set_block('admin','app_row');
$GLOBALS['admin_tpl']->set_block('admin','app_row_noicon');
$GLOBALS['admin_tpl']->set_block('admin','link_row');
$GLOBALS['admin_tpl']->set_block('admin','spacer_row');
$GLOBALS['phpgw']->template->set_block('admin','list');
$GLOBALS['phpgw']->template->set_block('admin','app_row');
$GLOBALS['phpgw']->template->set_block('admin','app_row_noicon');
$GLOBALS['phpgw']->template->set_block('admin','link_row');
$GLOBALS['phpgw']->template->set_block('admin','spacer_row');
$GLOBALS['admin_tpl']->set_var('title',lang('Administration'));
$GLOBALS['phpgw']->template->set_var('title',lang('Administration'));
// This func called by the includes to dump a row header
function section_start($appname='',$icon='')
{
$GLOBALS['admin_tpl']->set_var('app_title',lang($appname));
$GLOBALS['admin_tpl']->set_var('app_name',$appname);
$GLOBALS['admin_tpl']->set_var('app_icon',$icon);
$GLOBALS['phpgw']->template->set_var('app_title',lang($appname));
$GLOBALS['phpgw']->template->set_var('app_name',$appname);
$GLOBALS['phpgw']->template->set_var('app_icon',$icon);
if ($icon)
{
$GLOBALS['admin_tpl']->parse('rows','app_row',True);
$GLOBALS['phpgw']->template->parse('rows','app_row',True);
}
else
{
$GLOBALS['admin_tpl']->parse('rows','app_row_noicon',True);
$GLOBALS['phpgw']->template->parse('rows','app_row_noicon',True);
}
}
function section_item($pref_link='',$pref_text='')
{
$GLOBALS['admin_tpl']->set_var('pref_link',$pref_link);
$GLOBALS['admin_tpl']->set_var('pref_text',$pref_text);
$GLOBALS['admin_tpl']->parse('rows','link_row',True);
$GLOBALS['phpgw']->template->set_var('pref_link',$pref_link);
$GLOBALS['phpgw']->template->set_var('pref_text',$pref_text);
$GLOBALS['phpgw']->template->parse('rows','link_row',True);
}
function section_end()
{
$GLOBALS['admin_tpl']->parse('rows','spacer_row',True);
$GLOBALS['phpgw']->template->parse('rows','spacer_row',True);
}
function display_section($appname,$file)
@ -79,6 +74,6 @@
$GLOBALS['phpgw']->hooks->process('admin');
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array
(
'body_data' => $GLOBALS['admin_tpl']->parse('out','list')
'body_data' => $GLOBALS['phpgw']->template->parse('out','list')
));
?>

View File

@ -15,19 +15,13 @@
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'preferences';
include('../header.inc.php');
$GLOBALS['pref_tpl'] = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$templates = Array
(
'pref' => 'index.tpl'
);
$GLOBALS['phpgw']->template->set_file(Array('pref' => 'index.tpl'));
$GLOBALS['pref_tpl']->set_file($templates);
$GLOBALS['pref_tpl']->set_block('pref','list');
$GLOBALS['pref_tpl']->set_block('pref','app_row');
$GLOBALS['pref_tpl']->set_block('pref','app_row_noicon');
$GLOBALS['pref_tpl']->set_block('pref','link_row');
$GLOBALS['pref_tpl']->set_block('pref','spacer_row');
$GLOBALS['phpgw']->template->set_block('pref','list');
$GLOBALS['phpgw']->template->set_block('pref','app_row');
$GLOBALS['phpgw']->template->set_block('pref','app_row_noicon');
$GLOBALS['phpgw']->template->set_block('pref','link_row');
$GLOBALS['phpgw']->template->set_block('pref','spacer_row');
if ($GLOBALS['phpgw']->acl->check('run',1,'admin'))
{
@ -74,31 +68,29 @@
case 'default': $selected = 1; break;
case 'forced': $selected = 2; break;
}
$GLOBALS['pref_tpl']->set_var('tabs',$GLOBALS['phpgw']->common->create_tabs($tabs,$selected));
$GLOBALS['phpgw']->template->set_var('tabs',$GLOBALS['phpgw']->common->create_tabs($tabs,$selected));
}
// This func called by the includes to dump a row header
function section_start($appname='',$icon='')
{
$GLOBALS['pref_tpl']->set_var('icon_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
// $GLOBALS['pref_tpl']->set_var('link_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
$GLOBALS['pref_tpl']->set_var('app_name',$appname);
$GLOBALS['pref_tpl']->set_var('app_title',lang($appname));
$GLOBALS['pref_tpl']->set_var('app_icon',$icon);
$GLOBALS['phpgw']->template->set_var('app_name',$appname);
$GLOBALS['phpgw']->template->set_var('app_title',lang($appname));
$GLOBALS['phpgw']->template->set_var('app_icon',$icon);
if ($icon)
{
$GLOBALS['pref_tpl']->parse('rows','app_row',True);
$GLOBALS['phpgw']->template->parse('rows','app_row',True);
}
else
{
$GLOBALS['pref_tpl']->parse('rows','app_row_noicon',True);
$GLOBALS['phpgw']->template->parse('rows','app_row_noicon',True);
}
}
function section_item($pref_link='',$pref_text='')
{
$GLOBALS['pref_tpl']->set_var('pref_link',$pref_link);
$GLOBALS['phpgw']->template->set_var('pref_link',$pref_link);
if (strtolower($pref_text) == 'grant access' && $GLOBALS['phpgw_info']['server']['deny_user_grants_access'])
{
@ -106,15 +98,15 @@
}
else
{
$GLOBALS['pref_tpl']->set_var('pref_text',$pref_text);
$GLOBALS['phpgw']->template->set_var('pref_text',$pref_text);
}
$GLOBALS['pref_tpl']->parse('rows','link_row',True);
$GLOBALS['phpgw']->template->parse('rows','link_row',True);
}
function section_end()
{
$GLOBALS['pref_tpl']->parse('rows','spacer_row',True);
$GLOBALS['phpgw']->template->parse('rows','spacer_row',True);
}
function display_section($appname,$file)
@ -130,6 +122,6 @@
$GLOBALS['phpgw']->hooks->process('preferences',array('preferences'));
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array(
'body_data' => $GLOBALS['pref_tpl']->fp('out','list')
'body_data' => $GLOBALS['phpgw']->template->parse('out','list')
));
?>