[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc class.common.inc.php,1.168,1.169 cl
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc class.common.inc.php,1.168,1.169 class.listbox.inc.php,1.10,1.11 class.portalbox.inc.php,1.18,1.19 class.xslttemplates.inc.php,1.6,1.7 functions.inc.php,1.157,1.158 |
Date: |
Thu, 24 Oct 2002 23:04:30 -0400 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv4957/phpgwapi/inc
Modified Files:
class.common.inc.php class.listbox.inc.php
class.portalbox.inc.php class.xslttemplates.inc.php
functions.inc.php
Log Message:
update to use xslt *** HEAD IS CURRENTLY BROKEN ***
Index: class.common.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.common.inc.php,v
retrieving revision 1.168
retrieving revision 1.169
diff -C2 -r1.168 -r1.169
*** class.common.inc.php 23 Oct 2002 20:47:31 -0000 1.168
--- class.common.inc.php 25 Oct 2002 03:04:28 -0000 1.169
***************
*** 423,430 ****
break;
case 1:
! return '<' . $lid . '> '
. $a[0];
break;
case 2:
! return '<' . $lid . '> '
. implode(', ',$a);
break;
}
--- 423,430 ----
break;
case 1:
! return '<' . $lid . '> ' .
$a[0];
break;
case 2:
! return '<' . $lid . '> ' .
implode(', ',$a);
break;
}
***************
*** 698,704 ****
/******** start temporarily code **************************************/
/* this just makes sure the template set is updated to the new format */
! if (address@hidden(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' .
$GLOBALS['phpgw_info']['server']['template_set'].'/parts.inc.php'))
{
! $GLOBALS['phpgw_info']['server']['template_set'] = 'default';
}
/******** end temporarily code **************************************/
--- 698,704 ----
/******** start temporarily code **************************************/
/* this just makes sure the template set is updated to the new format */
! if (address@hidden(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' .
$GLOBALS['phpgw_info']['server']['template_set'].'/phpgw.xsl'))
{
! $GLOBALS['phpgw_info']['server']['template_set'] = 'idsociety';
}
/******** end temporarily code **************************************/
***************
*** 994,998 ****
*/
! function msgbox($text='',$type=True,$xslt=False)
{
if ($text=='' &&
@isset($GLOBALS['phpgw_info']['flags']['msgbox_data']))
--- 994,998 ----
*/
! function msgbox($text = '', $type = True, $base = '')
{
if ($text=='' &&
@isset($GLOBALS['phpgw_info']['flags']['msgbox_data']))
***************
*** 1006,1010 ****
}
!
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
. SEP . 'msgbox');
$prev_helper =
$GLOBALS['phpgw']->translation->translator_helper;
--- 1006,1010 ----
}
!
$GLOBALS['phpgw']->xslttpl->add_file($this->get_tpl_dir('phpgwapi','default') .
SEP . 'msgbox');
$prev_helper =
$GLOBALS['phpgw']->translation->translator_helper;
***************
*** 1061,1074 ****
$GLOBALS['phpgw']->translation->translator_helper =
$prev_helper;
! if ($xslt)
{
! return $data;
}
else
{
! $parse_data['msgbox_data'] = $data;
!
!
$GLOBALS['phpgw']->xslttpl->set_var('msgbox',$parse_data);
! return $GLOBALS['phpgw']->xslttpl->parse();
}
}
--- 1061,1071 ----
$GLOBALS['phpgw']->translation->translator_helper =
$prev_helper;
! if ($base)
{
!
$GLOBALS['phpgw']->xslttpl->set_var($base,array('msgbox_data' => $data),True);
}
else
{
! return $data;
}
}
***************
*** 1076,1171 ****
function framework()
{
! if (!$GLOBALS['phpgw_info']['flags']['nonavbar'])
! {
! $GLOBALS['phpgw']->xslttpl->add_file('phpgw');
! }
$var = array
(
! 'img_root' => PHPGW_IMAGES_DIR
);
! $find_single =
strrpos($GLOBALS['phpgw_info']['server']['webserver_url'],'/');
! $find_double =
strpos(strrev($GLOBALS['phpgw_info']['server']['webserver_url'].' '),'//');
! if($find_double)
! {
! $find_double =
strlen($GLOBALS['phpgw_info']['server']['webserver_url']) - $find_double - 1;
! }
! if($find_double)
! {
! if($find_single == $find_double + 1)
! {
! $GLOBALS['strip_portion'] =
$GLOBALS['phpgw_info']['server']['webserver_url'];
! }
! else
! {
! $GLOBALS['strip_portion'] =
substr($GLOBALS['phpgw_info']['server']['webserver_url'],0,$find_double + 1);
! }
! }
! else
! {
! $GLOBALS['strip_portion'] =
$GLOBALS['phpgw_info']['server']['webserver_url'].'/';
! }
! $var['home_link'] =
$GLOBALS['phpgw_info']['navbar']['home']['url'];
! $var['preferences_link'] =
$GLOBALS['phpgw_info']['navbar']['preferences']['url'];
! $var['logout_link'] =
$GLOBALS['phpgw_info']['navbar']['logout']['url'];
! $var['about_link'] =
$GLOBALS['phpgw_info']['navbar']['about']['url'];
! if ($GLOBALS['phpgw_info']['flags']['currentapp'] !=
'home')
! {
! $var['welcome_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','welcome2');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','welcome2','_over');
! }
! else
{
! $var['welcome_img'] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','welcome2','_over');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$GLOBALS['phpgw']->common->image('phpgwapi','welcome2');
! }
! $var['welcome_img_hover'] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','welcome2','_over');
! if ($GLOBALS['phpgw_info']['flags']['currentapp'] !=
'preferences')
! {
! $var['preferences_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','preferences2');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','preferences2','_over');
! }
! else
! {
! $var['preferences_img'] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','preferences2','_over');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$GLOBALS['phpgw']->common->image('phpgwapi','preferences2');
! }
! $var['preferences_img_hover'] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','preferences2','_over');
! $var['logout_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','log_out2');
! $GLOBALS['phpgw_info']['flags']['preload_images'][] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','log_out2','_over');
! $var['logout_img_hover'] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','log_out2','_over');
! if ($GLOBALS['phpgw_info']['flags']['currentapp'] !=
'about')
! {
! $var['about_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','question_mark2');
! $var['about_img_hover'] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','question_mark2','_over');
! }
! else
! {
! $var['about_img'] =
$GLOBALS['phpgw']->common->image_on('phpgwapi','question_mark2','_over');
! $var['about_img_hover'] =
$GLOBALS['phpgw']->common->image('phpgwapi','question_mark2');
! }
! $var['logo_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','logo2');
if (isset($GLOBALS['phpgw_info']['navbar']['admin']) &&
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers']))
{
! $db = $GLOBALS['phpgw']->db;
! $db->query('select count(session_id) from
phpgw_sessions');
! $db->next_record();
! $var['current_users'] = lang('Current users') .
': ' . $db->f(0);
! $var['url_current_users'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions');
}
! $var['user_info_name'] =
$GLOBALS['phpgw']->common->display_fullname();
$now = time();
! $var['user_info_date'] =
!
lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
! .
$GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
$var['user_info'] = $var['user_info_name'] .' - '
.$var['user_info_date'];
--- 1073,1183 ----
function framework()
{
! $this->navbar();
+ $css = $this->get_css_url();
$var = array
(
! 'charset' =>
lang('charset'),
! 'website_title' =>
$GLOBALS['phpgw_info']['server']['site_title'],
! 'phpgw_css_file' => $css[0],
! 'theme_css_file' => $css[1],
! 'phpgw_body' => $phpgw_body
);
!
$GLOBALS['phpgw']->xslttpl->add_file($this->get_tpl_dir('phpgwapi') . SEP .
'phpgw');
!
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] =
'idsociety';
! switch
($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
{
! case 'idsociety':
! $find_single =
strrpos($GLOBALS['phpgw_info']['server']['webserver_url'],'/');
! $find_double =
strpos(strrev($GLOBALS['phpgw_info']['server']['webserver_url'].' '),'//');
! if($find_double)
! {
! $find_double =
strlen($GLOBALS['phpgw_info']['server']['webserver_url']) - $find_double - 1;
! }
! if($find_double)
! {
! if($find_single == $find_double
+ 1)
! {
!
$GLOBALS['strip_portion'] = $GLOBALS['phpgw_info']['server']['webserver_url'];
! }
! else
! {
!
$GLOBALS['strip_portion'] =
substr($GLOBALS['phpgw_info']['server']['webserver_url'],0,$find_double + 1);
! }
! }
! else
! {
! $GLOBALS['strip_portion'] =
$GLOBALS['phpgw_info']['server']['webserver_url'].'/';
! }
! $var['home_link'] =
$GLOBALS['phpgw_info']['navbar']['home']['url'];
! $var['prefs_link'] =
$GLOBALS['phpgw_info']['navbar']['preferences']['url'];
! $var['logout_link'] =
$GLOBALS['phpgw_info']['navbar']['logout']['url'];
! $var['about_link'] =
$GLOBALS['phpgw_info']['navbar']['about']['url'];
!
! $var['home_title'] =
$GLOBALS['phpgw_info']['navbar']['home']['title'];
! $var['prefs_title'] =
$GLOBALS['phpgw_info']['navbar']['preferences']['title'];
! $var['logout_title'] =
$GLOBALS['phpgw_info']['navbar']['logout']['title'];
! $var['about_title'] =
$GLOBALS['phpgw_info']['navbar']['about']['title'];
! if
($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home')
! {
! $var['home_img'] =
$this->image('phpgwapi','welcome2');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$this->image_on('phpgwapi','welcome2','_over');
! }
! else
! {
! $var['home_img'] =
$this->image_on('phpgwapi','welcome2','_over');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$this->image('phpgwapi','welcome2');
! }
! $var['home_img_hover'] =
$this->image_on('phpgwapi','welcome2','_over');
! if
($GLOBALS['phpgw_info']['flags']['currentapp'] != 'preferences')
! {
! $var['prefs_img'] =
$this->image('phpgwapi','preferences2');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$this->image_on('phpgwapi','preferences2','_over');
! }
! else
! {
! $var['prefs_img'] =
$this->image_on('phpgwapi','preferences2','_over');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$this->image('phpgwapi','preferences2');
! }
! $var['prefs_img_hover'] =
$this->image_on('phpgwapi','preferences2','_over');
! $var['logout_img'] =
$this->image('phpgwapi','log_out2');
!
$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$this->image_on('phpgwapi','log_out2','_over');
! $var['logout_img_hover'] =
$this->image_on('phpgwapi','log_out2','_over');
!
! if
($GLOBALS['phpgw_info']['flags']['currentapp'] != 'about')
! {
! $var['about_img']
= $this->image('phpgwapi','question_mark2');
! $var['about_img_hover'] =
$this->image_on('phpgwapi','question_mark2','_over');
! }
! else
! {
! $var['about_img'] =
$this->image_on('phpgwapi','question_mark2','_over');
! $var['about_img_hover'] =
$this->image('phpgwapi','question_mark2');
! }
!
! $var['logo_img'] =
$this->image('phpgwapi','logo2');
! $var['nav_bar_left_top_bg_img'] =
$this->image('phpgwapi','nav_bar_left_top_bg');
! break;
! }
if (isset($GLOBALS['phpgw_info']['navbar']['admin']) &&
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers']))
{
! $GLOBALS['phpgw']->db->query('select
count(session_id) from phpgw_sessions');
! $GLOBALS['phpgw']->db->next_record();
! $var['current_users'] = lang('Current
users') . ': ' . $GLOBALS['phpgw']->db->f(0);
! $var['url_current_users'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions');
}
! $var['user_info_name'] = $this->display_fullname();
$now = time();
! $var['user_info_date'] =
lang($this->show_date($now,'l')) . ' '
! .
$this->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
$var['user_info'] = $var['user_info_name'] .' - '
.$var['user_info_date'];
***************
*** 1190,1194 ****
}
! $var['nav_bar_left_top_bg_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','nav_bar_left_top_bg');
$var['lang_powered_by'] = lang('powered
by');
--- 1202,1218 ----
}
! $var['onload'] = $this->load_preload_images_data();
!
! if($GLOBALS['phpgw_info']['flags']['msgbox_data'])
! {
! $this->msgbox('',False,'phpgw');
! }
!
! switch($GLOBALS['phpgw_info']['flags']['currentapp'])
! {
! case 'home':
! $var['home'] = True;
! break;
! }
$var['lang_powered_by'] = lang('powered
by');
***************
*** 1198,1202 ****
$var['top_spacer_middle_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','top_spacer_middle');
! $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$var);
}
--- 1222,1226 ----
$var['top_spacer_middle_img'] =
$GLOBALS['phpgw']->common->image('phpgwapi','top_spacer_middle');
! $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$var,True);
}
***************
*** 1259,1262 ****
--- 1283,1287 ----
}
+
$GLOBALS['phpgw_info']['navbar']['preferences']['title'] =
lang('preferences');
$GLOBALS['phpgw_info']['navbar']['preferences']['url']
= $GLOBALS['phpgw']->link('/preferences/index.php');
$GLOBALS['phpgw_info']['navbar']['preferences']['icon']
= $this->image('preferences',Array('navbar','nonav'));
***************
*** 1279,1288 ****
$GLOBALS['phpgw_info']['navbar']['about']['icon_hover']
= $this->image_on('phpgwapi',Array('about','nonav'),'-over');
! $GLOBALS['phpgw_info']['navbar']['logout']['title'] =
'Logout';
$GLOBALS['phpgw_info']['navbar']['logout']['url'] =
$GLOBALS['phpgw']->link('/logout.php');
- if(PHPGW_USE_FRAMES)
- {
-
$GLOBALS['phpgw_info']['navbar']['logout']['url'] .= '" target="_parent"';
- }
$GLOBALS['phpgw_info']['navbar']['logout']['icon'] =
$this->image('phpgwapi',Array('logout','nonav'));
$GLOBALS['phpgw_info']['navbar']['logout']['icon_hover'] =
$this->image_on('phpgwapi',Array('logout','nonav'),'-over');
--- 1304,1309 ----
$GLOBALS['phpgw_info']['navbar']['about']['icon_hover']
= $this->image_on('phpgwapi',Array('about','nonav'),'-over');
! $GLOBALS['phpgw_info']['navbar']['logout']['title'] =
lang('logout');
$GLOBALS['phpgw_info']['navbar']['logout']['url'] =
$GLOBALS['phpgw']->link('/logout.php');
$GLOBALS['phpgw_info']['navbar']['logout']['icon'] =
$this->image('phpgwapi',Array('logout','nonav'));
$GLOBALS['phpgw_info']['navbar']['logout']['icon_hover'] =
$this->image_on('phpgwapi',Array('logout','nonav'),'-over');
***************
*** 1341,1353 ****
$phpgw_css_file =
$GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP .
'templates' . SEP .
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']
. SEP . 'css' . SEP .
'phpgw.css';
!
! $GLOBALS['phpgw']->template->set_var('phpgw_css','<link
rel="stylesheet" type="text/css" href="' . $phpgw_css_file . '">' . "\n"
!
. '<link rel="stylesheet"
type="text/css" href="' . $css_file . '">');
}
function load_preload_images_data()
{
- //$GLOBALS['phpgw_info']['flags']['preload_images'][] =
$GLOBALS['phpgw_info']['navbar']['logout']['icon'];
-
if(@is_array($GLOBALS['phpgw_info']['flags']['preload_images']))
{
--- 1362,1370 ----
$phpgw_css_file =
$GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP .
'templates' . SEP .
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']
. SEP . 'css' . SEP .
'phpgw.css';
! return array($phpgw_css_file,$css_file);
}
function load_preload_images_data()
{
if(@is_array($GLOBALS['phpgw_info']['flags']['preload_images']))
{
Index: class.listbox.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.listbox.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.listbox.inc.php 6 Oct 2002 22:28:40 -0000 1.10
--- class.listbox.inc.php 25 Oct 2002 03:04:28 -0000 1.11
***************
*** 94,101 ****
);
}
! $this->output['listbox'] = $var;
}
$this->set_internal($extra_data);
! return $this->draw_box();
}
--- 94,101 ----
);
}
! $this->output[]['listbox'] = $var;
}
$this->set_internal($extra_data);
! $this->draw_box();
}
***************
*** 122,129 ****
);
}
! $this->output['listbox'] = $var;
}
$this->set_xinternal($extra_data);
! return $this->draw_box();
}
}
--- 122,129 ----
);
}
! $this->output[]['listbox'] = $var;
}
$this->set_xinternal($extra_data);
! $this->draw_box();
}
}
Index: class.portalbox.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.portalbox.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.portalbox.inc.php 6 Oct 2002 22:28:41 -0000 1.18
--- class.portalbox.inc.php 25 Oct 2002 03:04:28 -0000 1.19
***************
*** 42,45 ****
--- 42,53 ----
var $title;
+ /* This is the constructor for the object. */
+
+ function portalbox($title = '')
+ {
+ $this->setvar('title',$title);
+ // echo 'After SetVar Title = '.$this->getvar('title')."<br>\n";
+ }
+
/*
Use these functions to get and set the values of this
***************
*** 71,84 ****
}
- /*
- This is the constructor for the object.
- */
- function portalbox($title = '')
- {
- $this->setvar('title',$title);
-
- // echo 'After SetVar Title =
'.$this->getvar('title')."<br>\n";
- }
-
function start_template($extra = '')
{
--- 79,82 ----
***************
*** 89,100 ****
else
{
!
$GLOBALS['phpgw']->xslttpl->add_file(array('portal'));
}
! $this->output = array
! (
! 'title' => $this->getvar('title'),
! 'space' => ' '
! );
}
--- 87,95 ----
else
{
! $GLOBALS['phpgw']->xslttpl->add_file('portal');
}
! $this->output[]['title'] = $this->getvar('title');
! $this->output[]['space'] = ' ';
}
***************
*** 113,117 ****
if($extra_data !='')
{
! $this->output['extrabox'] = $extra_data;
}
}
--- 108,112 ----
if($extra_data !='')
{
! $this->output[]['extrabox'] = $extra_data;
}
}
***************
*** 121,125 ****
if($extra_data !='')
{
! $this->output['xextrabox'] = $extra_data;
}
}
--- 116,120 ----
if($extra_data !='')
{
! $this->output[]['xextrabox'] = $extra_data;
}
}
***************
*** 159,166 ****
}
! $this->output['control_link'] = $control_link;
}
!
$GLOBALS['phpgw']->xslttpl->set_var('portal',$this->output);
! return $GLOBALS['phpgw']->xslttpl->parse();
}
}
--- 154,161 ----
}
! $this->output[]['control_link'] = $control_link;
}
!
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('portal_data' =>
$this->output),True);
! //return $GLOBALS['phpgw']->xslttpl->parse();
}
}
Index: class.xslttemplates.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.xslttemplates.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.xslttemplates.inc.php 19 Oct 2002 00:17:02 -0000 1.6
--- class.xslttemplates.inc.php 25 Oct 2002 03:04:28 -0000 1.7
***************
*** 134,140 ****
function set_var($name, $value, $append = False)
{
! if(!is_array($value) && $append)
{
! $this->vars[$name] .= $value;
}
else
--- 134,147 ----
function set_var($name, $value, $append = False)
{
! if($append)
{
! //_debug_array($value);
! if (is_array($value))
! {
! while(list($key,$val) = each($value))
! {
! $this->vars[$name][$key] = $val;
! }
! }
}
else
***************
*** 222,226 ****
return $this->xmldata;
}
!
function list_lineno($xml)
{
--- 229,233 ----
return $this->xmldata;
}
!
function list_lineno($xml)
{
Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/functions.inc.php,v
retrieving revision 1.157
retrieving revision 1.158
diff -C2 -r1.157 -r1.158
*** functions.inc.php 18 Oct 2002 00:58:32 -0000 1.157
--- functions.inc.php 25 Oct 2002 03:04:28 -0000 1.158
***************
*** 5,10 ****
* and Joseph Engo <address@hidden> *
* Has a few functions, but primary role is to load the phpgwapi
*
! * Copyright (C) 2000, 2001, 2002 Dan Kuykendall
*
! *
-------------------------------------------------------------------------*
* This library is part of the phpGroupWare API
*
* http://www.phpgroupware.org/api
*
--- 5,10 ----
* and Joseph Engo <address@hidden> *
* Has a few functions, but primary role is to load the phpgwapi
*
! * Copyright (C) 2000 - 2002 Dan Kuykendall
*
! *
------------------------------------------------------------------------ *
* This library is part of the phpGroupWare API
*
* http://www.phpgroupware.org/api
*
***************
*** 22,32 ****
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\**************************************************************************/
-
/* $Id$ */
!
!
/****************************************************************************\
! * If running in PHP3, then load up the support functions file for
*
! * transparent support.
*
!
\****************************************************************************/
if (floor(phpversion()) == 3)
--- 22,31 ----
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\**************************************************************************/
/* $Id$ */
!
!
/***************************************************************************\
! * If running in PHP3, then load up the support functions file for
*
! * transparent support.
*
!
\***************************************************************************/
if (floor(phpversion()) == 3)
***************
*** 36,40 ****
include(PHPGW_API_INC.'/common_functions.inc.php');
!
/*!
@function lang
--- 35,39 ----
include(PHPGW_API_INC.'/common_functions.inc.php');
!
/*!
@function lang
***************
*** 272,277 ****
* Forcing the footer to run when the rest of the script is done.
*
\****************************************************************************/
! $footer_common = &$GLOBALS['phpgw']->common;
! register_shutdown_function(array(&$footer_common, 'phpgw_footer'));
/****************************************************************************\
--- 271,276 ----
* Forcing the footer to run when the rest of the script is done.
*
\****************************************************************************/
! //$footer_common = &$GLOBALS['phpgw']->common;
! //register_shutdown_function(array(&$footer_common, 'phpgw_footer'));
/****************************************************************************\
***************
*** 335,344 ****
$GLOBALS['phpgw']->xslttpl =
CreateObject('phpgwapi.xslttemplates',PHPGW_TEMPLATE_DIR);
! /* load required tpl files */
$GLOBALS['phpgw']->template->set_file('common', 'common.tpl');
$GLOBALS['phpgw']->template->set_file('phpgw', 'phpgw.tpl');
! //$GLOBALS['phpgw']->template->set_file('msgbox', 'msgbox.tpl');
! /* These default values will be overridden and appended to as
needed by template sets */
$GLOBALS['phpgw']->template->set_var('phpgw_top_table_height','0');
$GLOBALS['phpgw']->template->set_var('phpgw_top_frame_height','0');
--- 334,432 ----
$GLOBALS['phpgw']->xslttpl =
CreateObject('phpgwapi.xslttemplates',PHPGW_TEMPLATE_DIR);
! /******* Define the GLOBALS['MENUACTION'] *******/
! define('MENUACTION',get_var('menuaction',Array('GET')));
!
! /********* This sets the user variables (this should be moved
to somewhere else [Seek3r])*********/
! $GLOBALS['phpgw_info']['user']['private_dir'] =
$GLOBALS['phpgw_info']['server']['files_dir']
! . '/users/'.$GLOBALS['phpgw_info']['user']['userid'];
!
! /* This will make sure that a user has the basic default prefs.
If not it will add them */
! $GLOBALS['phpgw']->preferences->verify_basic_settings();
!
! /********* Optional classes, which can be disabled for
performance increases *********/
! while ($phpgw_class_name =
each($GLOBALS['phpgw_info']['flags']))
! {
! if (ereg('enable_',$phpgw_class_name[0]))
! {
! $enable_class =
str_replace('enable_','',$phpgw_class_name[0]);
! $enable_class =
str_replace('_class','',$enable_class);
! eval('$GLOBALS["phpgw"]->' . $enable_class . '
= createobject(\'phpgwapi.' . $enable_class . '\');');
! }
! }
! unset($enable_class);
! reset($GLOBALS['phpgw_info']['flags']);
!
! //$GLOBALS['phpgw']->common->navbar();
! $GLOBALS['phpgw']->common->framework();
! /* Verify that user has rights to the currentapp */
!
! $continue_app_data = True;
! if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
! $GLOBALS['phpgw_info']['flags']['currentapp'] !=
'preferences' &&
! $GLOBALS['phpgw_info']['flags']['currentapp'] !=
'about')
! {
! // This will need to use ACL in the future
! if (!
$GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]
||
! (@$GLOBALS['phpgw_info']['flags']['admin_only']
&&
! !
$GLOBALS['phpgw_info']['user']['apps']['admin']))
! {
!
$GLOBALS['phpgw']->log->write(array('text'=>'W-Permissions, Attempted to access
%1','p1'=>$GLOBALS['phpgw_info']['flags']['currentapp']));
!
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Access not permitted']=False;
! $continue_app_data = False;
!
//$GLOBALS['phpgw']->template->set_var('phpgw_body',"user has no rights to this
app!!!<br>\n");
! exit;
! }
! }
! if($continue_app_data)
! {
! /* Make sure user is keeping his password in order */
! /* Maybe we should create a common function in the
phpgw_accounts_shared.inc.php file */
! /* to get rid of duplicate code. */
! if
(isset($GLOBALS['phpgw_info']['user']['lastpasswd_change']) &&
$GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0)
! {
! $message = lang('You are required to change
your password during your first login')
! . '<br> Click this image on the
navbar: <img src="'
! .
$GLOBALS['phpgw']->common->image('preferences','navbar').'">';
!
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=False;
! }
! elseif
(isset($GLOBALS['phpgw_info']['user']['lastpasswd_change']) &&
$GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - (86400*30))
! {
! $message = lang('it has been more then x days
since you changed your password',30);
!
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=False;
! }
!
! /* I want to phase this out over time. App apps should
put their data into the templates phpgw_body var*/
! if (address@hidden'phpgw_info']['flags']['noheader'])
! {
! //$GLOBALS['phpgw']->common->framework();
! }
!
! $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
!
! $GLOBALS['phpgw']->xslttpl->set_root(PHPGW_APP_TPL);
!
! $GLOBALS['phpgw']->template->halt_on_error = 'report';
! if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) &&
file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION)
! {
! include(PHPGW_APP_INC . '/functions.inc.php');
! }
! }
! }
!
! error_reporting(E_ERROR | E_WARNING | E_PARSE);
!
! /*
! These lines load up the templates class and set some default
values
!
! $GLOBALS['phpgw']->template =
CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
!
! $GLOBALS['phpgw']->xslttpl =
CreateObject('phpgwapi.xslttemplates',PHPGW_TEMPLATE_DIR);
!
! load required tpl files
$GLOBALS['phpgw']->template->set_file('common', 'common.tpl');
$GLOBALS['phpgw']->template->set_file('phpgw', 'phpgw.tpl');
! $GLOBALS['phpgw']->template->set_file('msgbox', 'msgbox.tpl');
! These default values will be overridden and appended to as
needed by template sets
$GLOBALS['phpgw']->template->set_var('phpgw_top_table_height','0');
$GLOBALS['phpgw']->template->set_var('phpgw_top_frame_height','0');
***************
*** 370,376 ****
$GLOBALS['phpgw']->template->set_var('phpgw_head_website_title',
$GLOBALS['phpgw_info']['server']['site_title']);
! /* This will bring in the template sets parts definitions */
! /* We do this so early to allow the template to overwrite */
! /* and append to the previous defaults as needed for frames
support to work */
if (file_exists(PHPGW_TEMPLATE_DIR . '/parts.inc.php'))
{
--- 458,464 ----
$GLOBALS['phpgw']->template->set_var('phpgw_head_website_title',
$GLOBALS['phpgw_info']['server']['site_title']);
! This will bring in the template sets parts definitions
! We do this so early to allow the template to overwrite
! and append to the previous defaults as needed for frames
support to work
if (file_exists(PHPGW_TEMPLATE_DIR . '/parts.inc.php'))
{
***************
*** 378,384 ****
}
!
/*************************************************************************\
* If they are using frames, we need to set the PHPGW_FRAME_PART
safely *
!
\*************************************************************************/
if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']) &&
( $GLOBALS['HTTP_GET_VARS']['framepart'] ==
'unsupported' ||
--- 466,472 ----
}
!
* If they are using frames, we need to set the PHPGW_FRAME_PART
safely *
!
if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']) &&
( $GLOBALS['HTTP_GET_VARS']['framepart'] ==
'unsupported' ||
***************
*** 407,411 ****
if (PHPGW_FRAME_PART == 'start')
{
! /* if just starting up, then we intialize the
frameset with the appropriate block */
$GLOBALS['phpgw']->template->set_var('phpgw_top_link',$GLOBALS['phpgw']->session->link('home.php','framepart=top'));
$GLOBALS['phpgw']->template->set_var('phpgw_right_link',$GLOBALS['phpgw']->session->link('home.php','framepart=right'));
--- 495,499 ----
if (PHPGW_FRAME_PART == 'start')
{
! if just starting up, then we intialize the
frameset with the appropriate block
$GLOBALS['phpgw']->template->set_var('phpgw_top_link',$GLOBALS['phpgw']->session->link('home.php','framepart=top'));
$GLOBALS['phpgw']->template->set_var('phpgw_right_link',$GLOBALS['phpgw']->session->link('home.php','framepart=right'));
***************
*** 419,423 ****
else
{
! /* if we are using frames and not starting then
we use the basic block to keep each part in a nice clean html format */
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_start','phpgw_main_start');
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_end','phpgw_main_end');
--- 507,511 ----
else
{
! if we are using frames and not starting then we
use the basic block to keep each part in a nice clean html format
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_start','phpgw_main_start');
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_end','phpgw_main_end');
***************
*** 426,430 ****
else
{
! /* Not using frames, so we default to tables */
define('PHPGW_USE_FRAMES',False);
define('PHPGW_NAVBAR_TARGET','_self');
--- 514,518 ----
else
{
! Not using frames, so we default to tables
define('PHPGW_USE_FRAMES',False);
define('PHPGW_NAVBAR_TARGET','_self');
***************
*** 434,448 ****
$GLOBALS['phpgw']->template->set_var('phpgw_head_target',PHPGW_NAVBAR_TARGET);
! /******* Define the GLOBALS['MENUACTION'] *******/
define('MENUACTION',get_var('menuaction',Array('GET')));
! /********* This sets the user variables (this should be moved
to somewhere else [Seek3r])*********/
$GLOBALS['phpgw_info']['user']['private_dir'] =
$GLOBALS['phpgw_info']['server']['files_dir']
. '/users/'.$GLOBALS['phpgw_info']['user']['userid'];
! /* This will make sure that a user has the basic default prefs.
If not it will add them */
$GLOBALS['phpgw']->preferences->verify_basic_settings();
! /********* Optional classes, which can be disabled for
performance increases *********/
while ($phpgw_class_name =
each($GLOBALS['phpgw_info']['flags']))
{
--- 522,536 ----
$GLOBALS['phpgw']->template->set_var('phpgw_head_target',PHPGW_NAVBAR_TARGET);
! Define the GLOBALS['MENUACTION']
define('MENUACTION',get_var('menuaction',Array('GET')));
! This sets the user variables (this should be moved to somewhere
else [Seek3r])
$GLOBALS['phpgw_info']['user']['private_dir'] =
$GLOBALS['phpgw_info']['server']['files_dir']
. '/users/'.$GLOBALS['phpgw_info']['user']['userid'];
! This will make sure that a user has the basic default prefs. If
not it will add them
$GLOBALS['phpgw']->preferences->verify_basic_settings();
! Optional classes, which can be disabled for performance
increases
while ($phpgw_class_name =
each($GLOBALS['phpgw_info']['flags']))
{
***************
*** 457,463 ****
reset($GLOBALS['phpgw_info']['flags']);
-
/***************************************************************************\
* These lines load up the themes data and put them into the
templates class *
!
\***************************************************************************/
//$GLOBALS['phpgw']->common->load_theme_data();
--- 545,550 ----
reset($GLOBALS['phpgw_info']['flags']);
* These lines load up the themes data and put them into the
templates class *
!
//$GLOBALS['phpgw']->common->load_theme_data();
***************
*** 467,473 ****
}
!
/*************************************************************************\
* load up top part if appropriate
*
!
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'top')
{
--- 554,560 ----
}
!
* load up top part if appropriate
*
!
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'top')
{
***************
*** 489,495 ****
}
}
!
/*************************************************************************\
* load up left part if appropriate
*
!
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'left')
{
--- 576,582 ----
}
}
!
* load up left part if appropriate
*
!
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'left')
{
***************
*** 511,517 ****
}
}
!
/*************************************************************************\
* load up right part if appropriate
*
!
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'right')
{
--- 598,604 ----
}
}
!
* load up right part if appropriate
*
!
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'right')
{
***************
*** 533,539 ****
}
}
!
/*************************************************************************\
* load up bottom part if appropriate
*
!
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'bottom')
{
--- 620,626 ----
}
}
!
* load up bottom part if appropriate
*
!
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'bottom')
{
***************
*** 556,628 ****
}
!
/*************************************************************************\
* load up body/appspace if appropriate
*
!
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'body')
{
! /* parse_bodypart() should not output anything. This is
here for them to set body tags and such */
if(function_exists('parse_bodypart'))
{
parse_bodypart();
}
! /* Verify that user has rights to the currentapp */
! $continue_app_data = True;
! if ($GLOBALS['phpgw_info']['flags']['currentapp'] !=
'home' &&
! $GLOBALS['phpgw_info']['flags']['currentapp']
!= 'preferences' &&
! $GLOBALS['phpgw_info']['flags']['currentapp']
!= 'about')
! {
! // This will need to use ACL in the future
! if (!
$GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]
||
!
(@$GLOBALS['phpgw_info']['flags']['admin_only'] &&
! !
$GLOBALS['phpgw_info']['user']['apps']['admin']))
! {
!
$GLOBALS['phpgw']->log->write(array('text'=>'W-Permissions, Attempted to access
%1','p1'=>$GLOBALS['phpgw_info']['flags']['currentapp']));
!
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Access not permitted']=False;
! $continue_app_data = False;
!
$GLOBALS['phpgw']->template->set_var('phpgw_body',"user has no rights to this
app!!!<br>\n");
! exit;
! }
! }
! if($continue_app_data)
! {
! /* I want to phase this out over time. App apps
should put their data into the templates phpgw_body var*/
! if
(address@hidden'phpgw_info']['flags']['noheader'])
! {
!
$GLOBALS['phpgw']->common->phpgw_header();
! }
!
! if(!PHPGW_USE_FRAMES)
! {
! // echo '<div style="width: 100%; height:
100%; overflow: auto;">';
! }
!
! /* Make sure user is keeping his password in
order */
! /* Maybe we should create a common function in
the phpgw_accounts_shared.inc.php file */
! /* to get rid of duplicate code. */
! if
(isset($GLOBALS['phpgw_info']['user']['lastpasswd_change']) &&
$GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0)
! {
! $message = lang('You are required to
change your password during your first login')
! . '<br> Click this image on the
navbar: <img src="'
! .
$GLOBALS['phpgw']->common->image('preferences','navbar').'">';
!
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=False;
! }
! elseif
(isset($GLOBALS['phpgw_info']['user']['lastpasswd_change']) &&
$GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - (86400*30))
! {
! $message = lang('it has been more then
x days since you changed your password',30);
!
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=False;
! }
!
!
$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
!
!
$GLOBALS['phpgw']->xslttpl->set_root(PHPGW_APP_TPL);
!
! $GLOBALS['phpgw']->template->halt_on_error =
'report';
! if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC)
&& file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION)
! {
! include(PHPGW_APP_INC .
'/functions.inc.php');
! }
! }
! }
! }
! error_reporting(E_ERROR | E_WARNING | E_PARSE);
--- 643,657 ----
}
!
* load up body/appspace if appropriate
*
!
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'body')
{
! // parse_bodypart() should not output anything. This is
here for them to set body tags and such
if(function_exists('parse_bodypart'))
{
parse_bodypart();
}
! */
! ?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc class.common.inc.php,1.168,1.169 class.listbox.inc.php,1.10,1.11 class.portalbox.inc.php,1.18,1.19 class.xslttemplates.inc.php,1.6,1.7 functions.inc.php,1.157,1.158,
Bettina Gille <address@hidden> <=