Trying to GLOBAL'ize these.

This commit is contained in:
skeeter 2001-11-21 03:22:08 +00:00
parent 6c2789242b
commit 11563491f8
2 changed files with 29 additions and 34 deletions

View File

@ -17,59 +17,54 @@
$phpgw_info['flags']['currentapp'] = 'admin'; $phpgw_info['flags']['currentapp'] = 'admin';
include('../header.inc.php'); include('../header.inc.php');
$admin_tpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); $GLOBALS['admin_tpl'] = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$admin_tpl->set_file(array( $GLOBALS['admin_tpl']->set_file(
'admin' => 'index.tpl' Array(
)); 'admin' => 'index.tpl'
)
);
$admin_tpl->set_block('admin','list'); $GLOBALS['admin_tpl']->set_block('admin','list');
$admin_tpl->set_block('admin','app_row'); $GLOBALS['admin_tpl']->set_block('admin','app_row');
$admin_tpl->set_block('admin','app_row_noicon'); $GLOBALS['admin_tpl']->set_block('admin','app_row_noicon');
$admin_tpl->set_block('admin','link_row'); $GLOBALS['admin_tpl']->set_block('admin','link_row');
$admin_tpl->set_block('admin','spacer_row'); $GLOBALS['admin_tpl']->set_block('admin','spacer_row');
$admin_tpl->set_var('title',lang('Administration')); $GLOBALS['admin_tpl']->set_var('title',lang('Administration'));
// This func called by the includes to dump a row header // This func called by the includes to dump a row header
function section_start($name='',$icon='',$appname='') function section_start($name='',$icon='',$appname='')
{ {
global $phpgw, $phpgw_info, $admin_tpl; $GLOBALS['admin_tpl']->set_var('icon_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
$GLOBALS['admin_tpl']->set_var('link_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
$admin_tpl->set_var('icon_backcolor',$phpgw_info['theme']['row_off']); $GLOBALS['admin_tpl']->set_var('app_name',lang($name));
$admin_tpl->set_var('link_backcolor',$phpgw_info['theme']['row_off']); $GLOBALS['admin_tpl']->set_var('a_name',$appname);
$admin_tpl->set_var('app_name',lang($name)); $GLOBALS['admin_tpl']->set_var('app_icon',$icon);
$admin_tpl->set_var('a_name',$appname);
$admin_tpl->set_var('app_icon',$icon);
if ($icon) if ($icon)
{ {
$admin_tpl->parse('rows','app_row',True); $GLOBALS['admin_tpl']->parse('rows','app_row',True);
} }
else else
{ {
$admin_tpl->parse('rows','app_row_noicon',True); $GLOBALS['admin_tpl']->parse('rows','app_row_noicon',True);
} }
} }
function section_item($pref_link='',$pref_text='') function section_item($pref_link='',$pref_text='')
{ {
global $phpgw, $phpgw_info, $admin_tpl; $GLOBALS['admin_tpl']->set_var('pref_link',$pref_link);
$GLOBALS['admin_tpl']->set_var('pref_text',$pref_text);
$admin_tpl->set_var('pref_link',$pref_link); $GLOBALS['admin_tpl']->parse('rows','link_row',True);
$admin_tpl->set_var('pref_text',$pref_text);
$admin_tpl->parse('rows','link_row',True);
} }
function section_end() function section_end()
{ {
global $phpgw, $phpgw_info, $admin_tpl; $GLOBALS['admin_tpl']->parse('rows','spacer_row',True);
$admin_tpl->parse('rows','spacer_row',True);
} }
function display_section($appname,$title,$file) function display_section($appname,$title,$file)
{ {
global $phpgw; section_start($title,$GLOBALS['phpgw']->common->image($appname,Array('navbar.gif',$appname.'.gif')),$appname);
section_start($title,$phpgw->common->image($appname,Array('navbar.gif',$appname.'.gif')),$appname);
while(list($text,$url) = each($file)) while(list($text,$url) = each($file))
{ {
@ -78,8 +73,8 @@
section_end(); section_end();
} }
$phpgw->common->hook('admin'); $GLOBALS['phpgw']->common->hook('admin');
$admin_tpl->pparse('out','list'); $GLOBALS['admin_tpl']->pparse('out','list');
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
?> ?>

View File

@ -15,8 +15,8 @@
// Only Modify the $file and $title variables..... // Only Modify the $file and $title variables.....
$title = $appname; $title = $appname;
$file = Array( $file = Array(
'Site Configuration' => $phpgw->link('/admin/config.php','appname=' . $appname), 'Site Configuration' => $GLOBALS['phpgw']->link('/admin/config.php','appname=' . $appname),
'Calendar Holiday Management' => $phpgw->link('/index.php','menuaction=calendar.uiholiday.admin') 'Calendar Holiday Management' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiholiday.admin')
); );
//Do not modify below this line //Do not modify below this line
display_section($appname,$title,$file); display_section($appname,$title,$file);