From b4e4be334bd59e84d19d6f4b538dced10d01fdca Mon Sep 17 00:00:00 2001 From: ceb Date: Sat, 26 Oct 2002 00:33:22 +0000 Subject: [PATCH] update xslt --- about.php | 4 +-- home.php | 2 +- infolog/inc/hook_home.inc.php | 33 +++--------------------- login.php | 2 +- phpgwapi/inc/class.Template.inc.php | 6 +++++ phpgwapi/inc/class.common.inc.php | 3 +++ phpgwapi/inc/class.listbox.inc.php | 2 -- phpgwapi/inc/class.portalbox.inc.php | 28 ++++++++++---------- phpgwapi/inc/class.xmltool.inc.php | 25 ++++++++++++++++++ phpgwapi/inc/class.xslttemplates.inc.php | 26 ++++++++++++++++++- phpgwapi/templates/default/about.xsl | 6 ++++- phpgwapi/templates/idsociety/phpgw.xsl | 5 +++- 12 files changed, 89 insertions(+), 53 deletions(-) diff --git a/about.php b/about.php index 8eba7fb432..89c9fa0a7b 100644 --- a/about.php +++ b/about.php @@ -38,6 +38,6 @@ 'about_app' => $app_data ); - $GLOBALS['phpgw']->xslttpl->set_var('about',$data); - $GLOBALS['phpgw']->xslttpl->pparse(); + $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('about_data' => $data)); + //$GLOBALS['phpgw']->xslttpl->pparse(); ?> diff --git a/home.php b/home.php index ea7bdc5f2c..7618c923f4 100755 --- a/home.php +++ b/home.php @@ -211,5 +211,5 @@ $GLOBALS['phpgw']->preferences->save_repository(); } - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->portalbox->output,True); + $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->portalbox->output); ?> diff --git a/infolog/inc/hook_home.inc.php b/infolog/inc/hook_home.inc.php index f43508340b..4c51a6460d 100644 --- a/infolog/inc/hook_home.inc.php +++ b/infolog/inc/hook_home.inc.php @@ -8,7 +8,6 @@ * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ - /* $Id$ */ if ($GLOBALS['phpgw_info']['user']['preferences']['infolog']['homeShowEvents']) @@ -18,42 +17,18 @@ $GLOBALS['phpgw']->translation->add_app('infolog'); - $portalbox = CreateObject('phpgwapi.listbox', - Array( - 'title' => lang('Infolog'), - 'width' => '100%', - 'outerborderwidth' => '0', - 'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler') - ) - ); - $app_id = $GLOBALS['phpgw']->applications->name2id('infolog'); $GLOBALS['portal_order'][] = $app_id; - $var = Array( - 'up' => Array('url' => '/set_box.php', 'app' => $app_id), - 'down' => Array('url' => '/set_box.php', 'app' => $app_id), - 'close' => Array('url' => '/set_box.php', 'app' => $app_id), - 'question' => Array('url' => '/set_box.php', 'app' => $app_id), - 'edit' => Array('url' => '/set_box.php', 'app' => $app_id) - ); - while(list($key,$value) = each($var)) - { - $portalbox->set_controls($key,$value); - } - - $portalbox->data = Array(); + $GLOBALS['phpgw']->portalbox->set_params(array('app_id' => $app_id, + 'title' => lang('infolog'))); $GLOBALS['HTTP_POST_VARS']['filter'] = $GLOBALS['filter'] = 'own-open-today'; $infolog = CreateObject('infolog.uiinfolog'); - /*echo "\n".''."\n". - $portalbox->draw($infolog->get_list(2))."\n". - ''."\n"; -*/ - - $GLOBALS['phpgw']->template->set_var('phpgw_body',$portalbox->draw(),True); + $GLOBALS['phpgw']->portalbox->draw($infolog->get_list(2)); unset($infolog); $GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app; } +?> diff --git a/login.php b/login.php index ce9d989201..550d38a1e4 100755 --- a/login.php +++ b/login.php @@ -276,5 +276,5 @@ //_debug_array($data); - $GLOBALS['phpgw']->xslttpl->set_var('login',$data); + $GLOBALS['phpgw']->xslttpl->set_var('login',$data,False); ?> diff --git a/phpgwapi/inc/class.Template.inc.php b/phpgwapi/inc/class.Template.inc.php index c73f656048..53fa40f7d3 100644 --- a/phpgwapi/inc/class.Template.inc.php +++ b/phpgwapi/inc/class.Template.inc.php @@ -154,6 +154,12 @@ */ function set_var($varname, $value = '', $append=False) { + if ($varname == 'phpgw_body' && is_object($GLOBALS['phpgw']->xslttpl)) + { + $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('body_data' => $value)); + return; + } + if (!is_array($varname)) { if (!empty($varname)) diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index dc1c0971d0..d3e313a558 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -1212,6 +1212,9 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info' case 'home': $var['home'] = True; break; + case 'about': + $var['about'] = True; + break; } $var['lang_powered_by'] = lang('powered by'); diff --git a/phpgwapi/inc/class.listbox.inc.php b/phpgwapi/inc/class.listbox.inc.php index d41d2e7ade..1a21d48d4a 100755 --- a/phpgwapi/inc/class.listbox.inc.php +++ b/phpgwapi/inc/class.listbox.inc.php @@ -27,8 +27,6 @@ class listbox extends portalbox { - var $param; - /* Set up the Object. You will notice, we have not reserved memory space for variables. In this circumstance it is not necessary. diff --git a/phpgwapi/inc/class.portalbox.inc.php b/phpgwapi/inc/class.portalbox.inc.php index 8dfff03452..76976236bb 100755 --- a/phpgwapi/inc/class.portalbox.inc.php +++ b/phpgwapi/inc/class.portalbox.inc.php @@ -28,7 +28,6 @@ var $app_name; var $app_id; - var $controls; var $up; var $down; var $close; @@ -49,24 +48,24 @@ function portalbox($reset = False) { - $this->title = ''; - $this->app_name = ''; - $this->app_id = 0; + $this->title = ''; + $this->app_name = ''; + $this->app_id = 0; - $this->up = ''; - $this->down = ''; - $this->close = ''; - $this->question = ''; - $this->edit = ''; + $this->up = ''; + $this->down = ''; + $this->close = ''; + $this->question = ''; + $this->edit = ''; - $this->extrabox = ''; - $this->xextrabox = ''; - $this->listbox = ''; - $this->data = array(); + $this->extrabox = ''; + $this->xextrabox = ''; + $this->listbox = ''; + $this->data = array(); if (!$reset) { - $this->output; + $this->output = array(); } } @@ -139,7 +138,6 @@ function draw_box() { - $control = ''; if($this->up || $this->down || $this->close || $this->question || $this->edit) { $control_array = array diff --git a/phpgwapi/inc/class.xmltool.inc.php b/phpgwapi/inc/class.xmltool.inc.php index 7e593f8dba..4096f7e25a 100644 --- a/phpgwapi/inc/class.xmltool.inc.php +++ b/phpgwapi/inc/class.xmltool.inc.php @@ -1,4 +1,29 @@ * + * and Bettina Gille [ceb@phpgroupware.org] * + * and Ralf Becker * + * Copyright (C) 2002 Dan Kuykendall, Bettina Gille, Ralf Becker * + * ----------------------------------------------------------------- * + * This library is part of the phpGroupWare API * + * ----------------------------------------------------------------- * + * This library 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * + \*******************************************************************/ + /* $Id$ */ + function var2xml($name, $data) { $doc = new xmltool('root','',''); diff --git a/phpgwapi/inc/class.xslttemplates.inc.php b/phpgwapi/inc/class.xslttemplates.inc.php index 65923b7988..7377af75b8 100644 --- a/phpgwapi/inc/class.xslttemplates.inc.php +++ b/phpgwapi/inc/class.xslttemplates.inc.php @@ -1,4 +1,28 @@ * + * and Bettina Gille [ceb@phpgroupware.org] * + * and Ralf Becker * + * Copyright (C) 2002 Dan Kuykendall, Bettina Gille, Ralf Becker * + * ----------------------------------------------------------------- * + * This library is part of the phpGroupWare API * + * ----------------------------------------------------------------- * + * This library 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * + \*******************************************************************/ + /* $Id$ */ if (!extension_loaded('xslt')) { @@ -131,7 +155,7 @@ } } - function set_var($name, $value, $append = False) + function set_var($name, $value, $append = True) { if($append) { diff --git a/phpgwapi/templates/default/about.xsl b/phpgwapi/templates/default/about.xsl index 80e0a78560..92df0bc5cb 100644 --- a/phpgwapi/templates/default/about.xsl +++ b/phpgwapi/templates/default/about.xsl @@ -1,6 +1,10 @@ - + + + + + diff --git a/phpgwapi/templates/idsociety/phpgw.xsl b/phpgwapi/templates/idsociety/phpgw.xsl index 8960348474..d3ef00a9a8 100644 --- a/phpgwapi/templates/idsociety/phpgw.xsl +++ b/phpgwapi/templates/idsociety/phpgw.xsl @@ -131,7 +131,7 @@ - +
@@ -152,6 +152,9 @@ + + +