mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-11 16:38:52 +01:00
update to use xslt
This commit is contained in:
parent
b5abff2679
commit
f684ccd732
@ -20,13 +20,10 @@
|
|||||||
|
|
||||||
$portalbox = CreateObject('phpgwapi.listbox',
|
$portalbox = CreateObject('phpgwapi.listbox',
|
||||||
Array(
|
Array(
|
||||||
'title' => '<font color="#FFFFFF">'.lang('Infolog').'</font>',
|
'title' => lang('Infolog'),
|
||||||
'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
|
|
||||||
'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
|
|
||||||
'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
|
|
||||||
'width' => '100%',
|
'width' => '100%',
|
||||||
'outerborderwidth' => '0',
|
'outerborderwidth' => '0',
|
||||||
'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/phpgw_website','bg_filler')
|
'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -50,9 +47,12 @@
|
|||||||
$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".
|
/*echo "\n".'<!-- BEGIN infolog info -->'."\n".
|
||||||
$portalbox->draw($infolog->get_list(2))."\n".
|
$portalbox->draw($infolog->get_list(2))."\n".
|
||||||
'<!-- END infolog info -->'."\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;
|
||||||
|
@ -1,28 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
/**************************************************************************\
|
/**************************************************************************\
|
||||||
* phpGroupWare API - Link box generator *
|
* phpGroupWare API - Link box generator *
|
||||||
* http://www.phpgroupware.org/api *
|
* http://www.phpgroupware.org/api *
|
||||||
* This file written by Mark Peters <skeeter@phpgroupware.org> *
|
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
||||||
* Creates listboxes using templates *
|
* Creates listboxes using templates *
|
||||||
* Copyright (C) 2000, 2001 Mark Peters *
|
* Copyright (C) 2000 - 2002 Mark Peters *
|
||||||
* -------------------------------------------------------------------------*
|
* ------------------------------------------------------------------------ *
|
||||||
* This library is part of the phpGroupWare API *
|
* This library is part of the phpGroupWare API *
|
||||||
* http://www.phpgroupware.org/api *
|
* http://www.phpgroupware.org/api *
|
||||||
* ------------------------------------------------------------------------ *
|
* ------------------------------------------------------------------------ *
|
||||||
* This library is free software; you can redistribute it and/or modify it *
|
* This library is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms of the GNU Lesser General Public License as published by *
|
* under the terms of the GNU Lesser General Public License as published by *
|
||||||
* the Free Software Foundation; either version 2.1 of the License, *
|
* the Free Software Foundation; either version 2.1 of the License, *
|
||||||
* or any later version. *
|
* or any later version. *
|
||||||
* This library is distributed in the hope that it will be useful, but *
|
* This library is distributed in the hope that it will be useful, but *
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
* See the GNU Lesser General Public License for more details. *
|
* See the GNU Lesser General Public License for more details. *
|
||||||
* You should have received a copy of the GNU Lesser General Public License *
|
* You should have received a copy of the GNU Lesser General Public License *
|
||||||
* along with this library; if not, write to the Free Software Foundation, *
|
* along with this library; if not, write to the Free Software Foundation, *
|
||||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
||||||
\**************************************************************************/
|
\**************************************************************************/
|
||||||
|
/* $Id$ */
|
||||||
/* $Id$ */
|
|
||||||
|
|
||||||
CreateObject('phpgwapi.portalbox');
|
CreateObject('phpgwapi.portalbox');
|
||||||
|
|
||||||
@ -70,20 +69,22 @@
|
|||||||
{
|
{
|
||||||
if(count($this->data))
|
if(count($this->data))
|
||||||
{
|
{
|
||||||
$this->p->parse('row','portal_listbox_header',True);
|
|
||||||
|
|
||||||
for ($x = 0; $x < count($this->data); $x++)
|
for ($x = 0; $x < count($this->data); $x++)
|
||||||
{
|
{
|
||||||
$var = Array(
|
$var = array
|
||||||
'text' => $this->data[$x]['text'],
|
(
|
||||||
'link' => $this->data[$x]['link']
|
'text' => $this->data[$x]['text'],
|
||||||
|
'link' => $this->data[$x]['link'],
|
||||||
|
'lang_link_statustext' => $this->data[$x]['lang_link_statustext']
|
||||||
|
);
|
||||||
|
$this->output['portal_row'] = array
|
||||||
|
(
|
||||||
|
'listbox' => $var
|
||||||
);
|
);
|
||||||
$this->p->set_var($var);
|
|
||||||
$this->p->parse('row','portal_listbox_link',True);
|
|
||||||
}
|
}
|
||||||
$this->p->parse('row','portal_listbox_footer',True);
|
|
||||||
}
|
}
|
||||||
$this->set_internal($extra_data);
|
$this->set_internal($extra_data);
|
||||||
return $this->draw_box();
|
return $this->draw_box();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
@ -1,27 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
/**************************************************************************\
|
/**************************************************************************\
|
||||||
* phpGroupWare API - Portal Box manager *
|
* phpGroupWare API - Portal Box manager *
|
||||||
* This file written by Joseph Engo <jengo@phpgroupware.org> *
|
* Written by Joseph Engo <jengo@phpgroupware.org> *
|
||||||
* Helps manage the portal boxes for phpGroupWares main page *
|
* Helps manage the portal boxes for phpGroupWares main page *
|
||||||
* Copyright (C) 2000, 2001 Joseph Engo *
|
* Copyright (C) 2000 - 2002 Joseph Engo *
|
||||||
* -------------------------------------------------------------------------*
|
* ------------------------------------------------------------------------ *
|
||||||
* This library is part of the phpGroupWare API *
|
* This library is part of the phpGroupWare API *
|
||||||
* http://www.phpgroupware.org/api *
|
* http://www.phpgroupware.org/api *
|
||||||
* ------------------------------------------------------------------------ *
|
* ------------------------------------------------------------------------ *
|
||||||
* This library is free software; you can redistribute it and/or modify it *
|
* This library is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms of the GNU Lesser General Public License as published by *
|
* under the terms of the GNU Lesser General Public License as published by *
|
||||||
* the Free Software Foundation; either version 2.1 of the License, *
|
* the Free Software Foundation; either version 2.1 of the License, *
|
||||||
* or any later version. *
|
* or any later version. *
|
||||||
* This library is distributed in the hope that it will be useful, but *
|
* This library is distributed in the hope that it will be useful, but *
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
* See the GNU Lesser General Public License for more details. *
|
* See the GNU Lesser General Public License for more details. *
|
||||||
* You should have received a copy of the GNU Lesser General Public License *
|
* You should have received a copy of the GNU Lesser General Public License *
|
||||||
* along with this library; if not, write to the Free Software Foundation, *
|
* along with this library; if not, write to the Free Software Foundation, *
|
||||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
||||||
\**************************************************************************/
|
\**************************************************************************/
|
||||||
|
/* $Id$ */
|
||||||
/* $Id$ */
|
|
||||||
|
|
||||||
class portalbox
|
class portalbox
|
||||||
{
|
{
|
||||||
@ -39,7 +38,8 @@
|
|||||||
var $close;
|
var $close;
|
||||||
var $question;
|
var $question;
|
||||||
var $edit;
|
var $edit;
|
||||||
|
|
||||||
|
var $output;
|
||||||
var $data = Array();
|
var $data = Array();
|
||||||
|
|
||||||
// Textual variables
|
// Textual variables
|
||||||
@ -88,37 +88,22 @@
|
|||||||
|
|
||||||
function start_template()
|
function start_template()
|
||||||
{
|
{
|
||||||
$this->p = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('home'));
|
$GLOBALS['phpgw']->xslttpl->add_file(array('portal'));
|
||||||
$this->p->set_file(
|
|
||||||
array(
|
|
||||||
'PORTAL' => 'portal.tpl'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->p->set_block('PORTAL','portal_box','portal_box');
|
$this->output = array
|
||||||
$this->p->set_block('PORTAL','portal_row','portal_row');
|
(
|
||||||
$this->p->set_block('PORTAL','portal_listbox_header','portal_listbox_header');
|
|
||||||
$this->p->set_block('PORTAL','portal_listbox_link','portal_listbox_link');
|
|
||||||
$this->p->set_block('PORTAL','portal_listbox_footer','portal_listbox_footer');
|
|
||||||
$this->p->set_block('PORTAL','portal_control','portal_control');
|
|
||||||
$this->p->set_block('PORTAL','link_field','link_field');
|
|
||||||
|
|
||||||
$var = Array(
|
|
||||||
'outer_border' => $this->getvar('outerborderwidth'),
|
'outer_border' => $this->getvar('outerborderwidth'),
|
||||||
'outer_width' => $this->getvar('width'),
|
'outer_width' => $this->getvar('width'),
|
||||||
'title' => $this->getvar('title'),
|
'title' => $this->getvar('title'),
|
||||||
'inner_width' => $this->getvar('width'),
|
'inner_width' => $this->getvar('width'),
|
||||||
'header_background_image' => $this->getvar('header_background_image'),
|
'header_background_image' => $this->getvar('header_background_image')
|
||||||
'control_link' => ''
|
|
||||||
);
|
);
|
||||||
$this->p->set_var($var);
|
|
||||||
$this->p->set_var('row','',False);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_controls($control='',$control_param='')
|
function set_controls($control='',$control_param='')
|
||||||
{
|
{
|
||||||
// echo '<br>Control: ' . $control . ', control_param="' . $control_param . '"';
|
//echo '<br>Control: ' . $control . ', control_param="' . $control_param . '"';
|
||||||
// if($control != '' && $control_param != '')
|
|
||||||
if($control != '' && is_array($control_param))
|
if($control != '' && is_array($control_param))
|
||||||
{
|
{
|
||||||
$this->setvar($control,$GLOBALS['phpgw']->link($control_param['url'],'app='.$control_param['app'].'&control='.$control));
|
$this->setvar($control,$GLOBALS['phpgw']->link($control_param['url'],'app='.$control_param['app'].'&control='.$control));
|
||||||
@ -129,10 +114,13 @@
|
|||||||
{
|
{
|
||||||
if($data=='' && !count($this->data))
|
if($data=='' && !count($this->data))
|
||||||
{
|
{
|
||||||
$data = '<td> </td>';
|
$data = ' ';
|
||||||
}
|
}
|
||||||
$this->p->set_var('output',$data);
|
|
||||||
$this->p->parse('row','portal_row',true);
|
$this->output['portal_row']['extrabox'] = array
|
||||||
|
(
|
||||||
|
'data' => $data
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function draw_box()
|
function draw_box()
|
||||||
@ -140,7 +128,8 @@
|
|||||||
$control = '';
|
$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
|
||||||
|
(
|
||||||
'up',
|
'up',
|
||||||
'down',
|
'down',
|
||||||
'question',
|
'question',
|
||||||
@ -157,12 +146,20 @@
|
|||||||
{
|
{
|
||||||
$image_width = 30;
|
$image_width = 30;
|
||||||
}
|
}
|
||||||
$this->p->set_var('link_field_data','<a href="'.$this->$param.'"><img src="'.$GLOBALS['phpgw']->common->image('phpgwapi',$param.'.button.gif').'" border="0" width="'.$image_width.'" height="15" alt="'.lang($param).'"></a>');
|
|
||||||
$this->p->parse('control_link','link_field',True);
|
$control_link[] = array
|
||||||
|
(
|
||||||
|
'param_url' => $this->$param,
|
||||||
|
'link_img' => $GLOBALS['phpgw']->common->image('phpgwapi',$param.'.button'),
|
||||||
|
'img_width' => $image_width,
|
||||||
|
'lang_param_statustext' => lang($param)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->p->parse('portal_controls','portal_control',True);
|
|
||||||
|
$this->output['control_link'] = $control_link;
|
||||||
}
|
}
|
||||||
return $this->p->fp('out','portal_box');
|
$GLOBALS['phpgw']->xslttpl->set_var('portal',$this->output);
|
||||||
|
return $GLOBALS['phpgw']->xslttpl->parse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,6 +331,9 @@
|
|||||||
* These lines load up the templates class and set some default values *
|
* These lines load up the templates class and set some default values *
|
||||||
\*************************************************************************/
|
\*************************************************************************/
|
||||||
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
|
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
|
||||||
|
|
||||||
|
$GLOBALS['phpgw']->xslttpl = CreateObject('phpgwapi.xslttemplates',PHPGW_TEMPLATE_DIR);
|
||||||
|
|
||||||
/* load required tpl files */
|
/* load required tpl files */
|
||||||
$GLOBALS['phpgw']->template->set_file('common', 'common.tpl');
|
$GLOBALS['phpgw']->template->set_file('common', 'common.tpl');
|
||||||
$GLOBALS['phpgw']->template->set_file('phpgw', 'phpgw.tpl');
|
$GLOBALS['phpgw']->template->set_file('phpgw', 'phpgw.tpl');
|
||||||
@ -610,6 +613,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
|
$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
|
||||||
|
|
||||||
|
$GLOBALS['phpgw']->xslttpl->set_root(PHPGW_APP_TPL);
|
||||||
|
|
||||||
$GLOBALS['phpgw']->template->halt_on_error = 'report';
|
$GLOBALS['phpgw']->template->halt_on_error = 'report';
|
||||||
if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION)
|
if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user