update xslt

This commit is contained in:
ceb 2002-10-26 00:33:22 +00:00
parent f42db9d12d
commit b4e4be334b
12 changed files with 89 additions and 53 deletions

View File

@ -38,6 +38,6 @@
'about_app' => $app_data 'about_app' => $app_data
); );
$GLOBALS['phpgw']->xslttpl->set_var('about',$data); $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('about_data' => $data));
$GLOBALS['phpgw']->xslttpl->pparse(); //$GLOBALS['phpgw']->xslttpl->pparse();
?> ?>

View File

@ -211,5 +211,5 @@
$GLOBALS['phpgw']->preferences->save_repository(); $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);
?> ?>

View File

@ -8,7 +8,6 @@
* Free Software Foundation; either version 2 of the License, or (at your * * Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. * * option) any later version. *
\**************************************************************************/ \**************************************************************************/
/* $Id$ */ /* $Id$ */
if ($GLOBALS['phpgw_info']['user']['preferences']['infolog']['homeShowEvents']) if ($GLOBALS['phpgw_info']['user']['preferences']['infolog']['homeShowEvents'])
@ -18,42 +17,18 @@
$GLOBALS['phpgw']->translation->add_app('infolog'); $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'); $app_id = $GLOBALS['phpgw']->applications->name2id('infolog');
$GLOBALS['portal_order'][] = $app_id; $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)) $GLOBALS['phpgw']->portalbox->set_params(array('app_id' => $app_id,
{ 'title' => lang('infolog')));
$portalbox->set_controls($key,$value);
}
$portalbox->data = Array();
$GLOBALS['HTTP_POST_VARS']['filter'] = $GLOBALS['filter'] = 'own-open-today'; $GLOBALS['HTTP_POST_VARS']['filter'] = $GLOBALS['filter'] = 'own-open-today';
$infolog = CreateObject('infolog.uiinfolog'); $infolog = CreateObject('infolog.uiinfolog');
/*echo "\n".'<!-- BEGIN infolog info -->'."\n". $GLOBALS['phpgw']->portalbox->draw($infolog->get_list(2));
$portalbox->draw($infolog->get_list(2))."\n".
'<!-- END infolog info -->'."\n";
*/
$GLOBALS['phpgw']->template->set_var('phpgw_body',$portalbox->draw(),True);
unset($infolog); unset($infolog);
$GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app; $GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app;
} }
?>

View File

@ -276,5 +276,5 @@
//_debug_array($data); //_debug_array($data);
$GLOBALS['phpgw']->xslttpl->set_var('login',$data); $GLOBALS['phpgw']->xslttpl->set_var('login',$data,False);
?> ?>

View File

@ -154,6 +154,12 @@
*/ */
function set_var($varname, $value = '', $append=False) 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 (!is_array($varname))
{ {
if (!empty($varname)) if (!empty($varname))

View File

@ -1212,6 +1212,9 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
case 'home': case 'home':
$var['home'] = True; $var['home'] = True;
break; break;
case 'about':
$var['about'] = True;
break;
} }
$var['lang_powered_by'] = lang('powered by'); $var['lang_powered_by'] = lang('powered by');

View File

@ -27,8 +27,6 @@
class listbox extends portalbox class listbox extends portalbox
{ {
var $param;
/* /*
Set up the Object. You will notice, we have not reserved Set up the Object. You will notice, we have not reserved
memory space for variables. In this circumstance it is not necessary. memory space for variables. In this circumstance it is not necessary.

View File

@ -28,7 +28,6 @@
var $app_name; var $app_name;
var $app_id; var $app_id;
var $controls;
var $up; var $up;
var $down; var $down;
var $close; var $close;
@ -49,24 +48,24 @@
function portalbox($reset = False) function portalbox($reset = False)
{ {
$this->title = ''; $this->title = '';
$this->app_name = ''; $this->app_name = '';
$this->app_id = 0; $this->app_id = 0;
$this->up = ''; $this->up = '';
$this->down = ''; $this->down = '';
$this->close = ''; $this->close = '';
$this->question = ''; $this->question = '';
$this->edit = ''; $this->edit = '';
$this->extrabox = ''; $this->extrabox = '';
$this->xextrabox = ''; $this->xextrabox = '';
$this->listbox = ''; $this->listbox = '';
$this->data = array(); $this->data = array();
if (!$reset) if (!$reset)
{ {
$this->output; $this->output = array();
} }
} }
@ -139,7 +138,6 @@
function draw_box() function draw_box()
{ {
$control = '';
if($this->up || $this->down || $this->close || $this->question || $this->edit) if($this->up || $this->down || $this->close || $this->question || $this->edit)
{ {
$control_array = array $control_array = array

View File

@ -1,4 +1,29 @@
<?php <?php
/*******************************************************************\
* phpGroupWare API - XML tools *
* Written by Dan Kuykendall <seek3r@phpgroupware.org> *
* and Bettina Gille [ceb@phpgroupware.org] *
* and Ralf Becker <ralfbecker@outdoortraining.de> *
* 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) function var2xml($name, $data)
{ {
$doc = new xmltool('root','',''); $doc = new xmltool('root','','');

View File

@ -1,4 +1,28 @@
<?php <?php
/*******************************************************************\
* phpGroupWare API - XSLT Template class *
* Written by Dan Kuykendall <seek3r@phpgroupware.org> *
* and Bettina Gille [ceb@phpgroupware.org] *
* and Ralf Becker <ralfbecker@outdoortraining.de> *
* 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')) if (!extension_loaded('xslt'))
{ {
@ -131,7 +155,7 @@
} }
} }
function set_var($name, $value, $append = False) function set_var($name, $value, $append = True)
{ {
if($append) if($append)
{ {

View File

@ -1,6 +1,10 @@
<!-- $Id$ --> <!-- $Id$ -->
<xsl:template match="about"> <xsl:template name="about">
<xsl:apply-templates select="about_data"/>
</xsl:template>
<xsl:template match="about_data">
<table cellpadding="2" cellspacing="2" align="center" class="about"> <table cellpadding="2" cellspacing="2" align="center" class="about">
<xsl:variable name="phpgw_logo"><xsl:value-of select="phpgw_logo"/></xsl:variable> <xsl:variable name="phpgw_logo"><xsl:value-of select="phpgw_logo"/></xsl:variable>
<xsl:variable name="lang_url_statustext"><xsl:value-of select="lang_url_statustext"/></xsl:variable> <xsl:variable name="lang_url_statustext"><xsl:value-of select="lang_url_statustext"/></xsl:variable>

View File

@ -131,7 +131,7 @@
<!-- END top_part --> <!-- END top_part -->
</td> </td>
</tr> </tr>
<tr> <tr valign="top">
<td> <td>
<!-- BEGIN left_part --> <!-- BEGIN left_part -->
<table cellspacing="0" cellpadding="0" valign="top" class="left"> <table cellspacing="0" cellpadding="0" valign="top" class="left">
@ -152,6 +152,9 @@
<xsl:when test="home"> <xsl:when test="home">
<xsl:call-template name="portal"/> <xsl:call-template name="portal"/>
</xsl:when> </xsl:when>
<xsl:when test="about">
<xsl:call-template name="about"/>
</xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="body_data"/> <xsl:value-of disable-output-escaping="yes" select="body_data"/>
</xsl:otherwise> </xsl:otherwise>