From 122bddb15f0c56673284a11faf8cb146dbaa3183 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 26 Oct 2002 15:22:06 +0000 Subject: [PATCH] get preferences to send its output through the xslt-framework --- preferences/changepassword.php | 4 ++- preferences/index.php | 54 ++++++++++++++++------------------ preferences/preferences.php | 1 + 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/preferences/changepassword.php b/preferences/changepassword.php index daaced2710..839a556428 100755 --- a/preferences/changepassword.php +++ b/preferences/changepassword.php @@ -87,6 +87,8 @@ else { $GLOBALS['phpgw']->common->phpgw_header(); - $GLOBALS['phpgw']->template->pfp('out','form'); + $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array( + 'body_data' => $GLOBALS['phpgw']->template->fp('out','form') + )); } ?> diff --git a/preferences/index.php b/preferences/index.php index 97cde94460..037e5dcff7 100755 --- a/preferences/index.php +++ b/preferences/index.php @@ -15,19 +15,19 @@ $GLOBALS['phpgw_info']['flags']['currentapp'] = 'preferences'; include('../header.inc.php'); - $pref_tpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $GLOBALS['pref_tpl'] = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); $templates = Array ( 'pref' => 'index.tpl' ); - $pref_tpl->set_file($templates); + $GLOBALS['pref_tpl']->set_file($templates); - $pref_tpl->set_block('pref','list'); - $pref_tpl->set_block('pref','app_row'); - $pref_tpl->set_block('pref','app_row_noicon'); - $pref_tpl->set_block('pref','link_row'); - $pref_tpl->set_block('pref','spacer_row'); + $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'); if ($GLOBALS['phpgw']->acl->check('run',1,'admin')) { @@ -74,34 +74,30 @@ case 'default': $selected = 1; break; case 'forced': $selected = 2; break; } - $pref_tpl->set_var('tabs',$GLOBALS['phpgw']->common->create_tabs($tabs,$selected)); + $GLOBALS['pref_tpl']->set_var('tabs',$GLOBALS['phpgw']->common->create_tabs($tabs,$selected)); } // This func called by the includes to dump a row header function section_start($name='',$icon='',$appname='') { - global $pref_tpl; - - $pref_tpl->set_var('icon_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']); -// $pref_tpl->set_var('link_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']); - $pref_tpl->set_var('a_name',$appname); - $pref_tpl->set_var('app_name',lang($name)); - $pref_tpl->set_var('app_icon',$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('a_name',$appname); + $GLOBALS['pref_tpl']->set_var('app_name',lang($name)); + $GLOBALS['pref_tpl']->set_var('app_icon',$icon); if ($icon) { - $pref_tpl->parse('rows','app_row',True); + $GLOBALS['pref_tpl']->parse('rows','app_row',True); } else { - $pref_tpl->parse('rows','app_row_noicon',True); - } + $GLOBALS['pref_tpl']->parse('rows','app_row_noicon',True); + } } function section_item($pref_link='',$pref_text='') { - global $pref_tpl; - - $pref_tpl->set_var('pref_link',$pref_link); + $GLOBALS['pref_tpl']->set_var('pref_link',$pref_link); if (strtolower($pref_text) == 'grant access' && $GLOBALS['phpgw_info']['server']['deny_user_grants_access']) { @@ -109,17 +105,15 @@ } else { - $pref_tpl->set_var('pref_text',$pref_text); + $GLOBALS['pref_tpl']->set_var('pref_text',$pref_text); } - $pref_tpl->parse('rows','link_row',True); - } + $GLOBALS['pref_tpl']->parse('rows','link_row',True); + } function section_end() { - global $pref_tpl; - - $pref_tpl->parse('rows','spacer_row',True); + $GLOBALS['pref_tpl']->parse('rows','spacer_row',True); } function display_section($appname,$title,$file) @@ -130,9 +124,11 @@ { section_item($url,lang($text)); } - section_end(); + section_end(); } $GLOBALS['phpgw']->hooks->process('preferences',array('preferences')); - $pref_tpl->pfp('out','list'); + $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array( + 'body_data' => $GLOBALS['pref_tpl']->fp('out','list') + )); ?> diff --git a/preferences/preferences.php b/preferences/preferences.php index 4421966414..14d1fb21ba 100755 --- a/preferences/preferences.php +++ b/preferences/preferences.php @@ -327,4 +327,5 @@ $t->pfp('out','list'); $t->pfp('out','footer'); } + $GLOBALS['phpgw']->common->phpgw_footer(); ?>