diff --git a/home.php b/home.php
index 96fba07f50..a8884384ba 100755
--- a/home.php
+++ b/home.php
@@ -205,4 +205,6 @@
}
$GLOBALS['phpgw']->preferences->save_repository();
}
+
+ $GLOBALS['phpgw']->xslttpl->pp();
?>
diff --git a/login.php b/login.php
index c2f47f4e97..06ae0077bc 100755
--- a/login.php
+++ b/login.php
@@ -262,7 +262,7 @@
if($GLOBALS['phpgw_info']['flags']['msgbox_data'])
{
- $data['login_standard']['msgbox_data'] = $GLOBALS['phpgw']->common->msgbox('',False,True);
+ $data['login_standard']['msgbox_data'] = $GLOBALS['phpgw']->common->msgbox('',False);
}
$data['login_standard']['website_title'] = $GLOBALS['phpgw_info']['server']['site_title'];
diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php
index a5ad517fba..b686712ce1 100644
--- a/phpgwapi/inc/class.common.inc.php
+++ b/phpgwapi/inc/class.common.inc.php
@@ -422,10 +422,10 @@
return $lid;
break;
case 1:
- return '<' . $lid . '> ' . $a[0];
+ return '<' . $lid . '> ' . $a[0];
break;
case 2:
- return '<' . $lid . '> ' . implode(', ',$a);
+ return '<' . $lid . '> ' . implode(', ',$a);
break;
}
}
@@ -697,9 +697,9 @@
/******** start temporarily code **************************************/
/* this just makes sure the template set is updated to the new format */
-if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'].'/parts.inc.php'))
+if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'].'/phpgw.xsl'))
{
- $GLOBALS['phpgw_info']['server']['template_set'] = 'default';
+ $GLOBALS['phpgw_info']['server']['template_set'] = 'idsociety';
}
/******** end temporarily code **************************************/
@@ -993,7 +993,7 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
@discussion makes it easier and more consistant to generate message boxes
*/
- function msgbox($text='',$type=True,$xslt=False)
+ function msgbox($text = '', $type = True, $base = '')
{
if ($text=='' && @isset($GLOBALS['phpgw_info']['flags']['msgbox_data']))
{
@@ -1005,7 +1005,7 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
return;
}
- $GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'msgbox');
+ $GLOBALS['phpgw']->xslttpl->add_file($this->get_tpl_dir('phpgwapi','default') . SEP . 'msgbox');
$prev_helper = $GLOBALS['phpgw']->translation->translator_helper;
$GLOBALS['phpgw']->translation->translator_helper = '';
@@ -1060,113 +1060,125 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
$GLOBALS['phpgw']->translation->translator_helper = $prev_helper;
- if ($xslt)
+ if ($base)
{
- return $data;
+ $GLOBALS['phpgw']->xslttpl->set_var($base,array('msgbox_data' => $data),True);
}
else
{
- $parse_data['msgbox_data'] = $data;
-
- $GLOBALS['phpgw']->xslttpl->set_var('msgbox',$parse_data);
- return $GLOBALS['phpgw']->xslttpl->parse();
+ return $data;
}
}
function framework()
{
- if (!$GLOBALS['phpgw_info']['flags']['nonavbar'])
- {
- $GLOBALS['phpgw']->xslttpl->add_file('phpgw');
- }
+ $this->navbar();
+ $css = $this->get_css_url();
$var = array
(
- 'img_root' => PHPGW_IMAGES_DIR
+ '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
);
- $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'].'/';
- }
+ $GLOBALS['phpgw']->xslttpl->add_file($this->get_tpl_dir('phpgwapi') . SEP . 'phpgw');
- $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'];
+ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'idsociety';
- if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home')
+ switch ($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
{
- $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');
+ 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'].'/';
+ }
- 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['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'];
- $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'] != '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'] != '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');
- }
+ 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['logo_img'] = $GLOBALS['phpgw']->common->image('phpgwapi','logo2');
+ $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']))
{
- $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');
+ $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'] = $GLOBALS['phpgw']->common->display_fullname();
+ $var['user_info_name'] = $this->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_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'];
while ($app = each($GLOBALS['phpgw_info']['navbar']))
@@ -1189,7 +1201,19 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
}
}
- $var['nav_bar_left_top_bg_img'] = $GLOBALS['phpgw']->common->image('phpgwapi','nav_bar_left_top_bg');
+ $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');
$var['lang_version'] = lang('version');
@@ -1197,7 +1221,7 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
$var['lang_phpgw_statustext'] = lang('phpGroupWare --> homepage');
$var['top_spacer_middle_img'] = $GLOBALS['phpgw']->common->image('phpgwapi','top_spacer_middle');
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$var);
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$var,True);
}
/*!
@@ -1258,6 +1282,7 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
}
}
+ $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'));
$GLOBALS['phpgw_info']['navbar']['preferences']['icon_hover'] = $this->image_on('preferences',Array('navbar','nonav'),'-over');
@@ -1278,12 +1303,8 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
$GLOBALS['phpgw_info']['navbar']['about']['icon'] = $this->image('phpgwapi',Array('about','nonav'));
$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']['title'] = lang('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');
}
@@ -1340,15 +1361,11 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
}
$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','' . "\n"
- . '');
+ return array($phpgw_css_file,$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']))
{
$preload_image_string = '';
diff --git a/phpgwapi/inc/class.listbox.inc.php b/phpgwapi/inc/class.listbox.inc.php
index 731199dacf..73191cc4f4 100755
--- a/phpgwapi/inc/class.listbox.inc.php
+++ b/phpgwapi/inc/class.listbox.inc.php
@@ -93,10 +93,10 @@
'lang_link_statustext' => $this->data[$x]['lang_link_statustext']
);
}
- $this->output['listbox'] = $var;
+ $this->output[]['listbox'] = $var;
}
$this->set_internal($extra_data);
- return $this->draw_box();
+ $this->draw_box();
}
function xdraw($extra_data='')
@@ -121,10 +121,10 @@
'lang_link_statustext' => $this->data[$x]['lang_link_statustext']
);
}
- $this->output['listbox'] = $var;
+ $this->output[]['listbox'] = $var;
}
$this->set_xinternal($extra_data);
- return $this->draw_box();
+ $this->draw_box();
}
}
?>
diff --git a/phpgwapi/inc/class.portalbox.inc.php b/phpgwapi/inc/class.portalbox.inc.php
index f10ee88b0b..35890c8da4 100755
--- a/phpgwapi/inc/class.portalbox.inc.php
+++ b/phpgwapi/inc/class.portalbox.inc.php
@@ -41,6 +41,14 @@
// Textual variables
var $title;
+ /* This is the constructor for the object. */
+
+ function portalbox($title = '')
+ {
+ $this->setvar('title',$title);
+ // echo 'After SetVar Title = '.$this->getvar('title')." \n";
+ }
+
/*
Use these functions to get and set the values of this
object's variables. This is good OO practice, as it means
@@ -70,16 +78,6 @@
return $this->$var;
}
- /*
- This is the constructor for the object.
- */
- function portalbox($title = '')
- {
- $this->setvar('title',$title);
-
- // echo 'After SetVar Title = '.$this->getvar('title')." \n";
- }
-
function start_template($extra = '')
{
if ($extra && $this->getvar('app_name'))
@@ -88,14 +86,11 @@
}
else
{
- $GLOBALS['phpgw']->xslttpl->add_file(array('portal'));
+ $GLOBALS['phpgw']->xslttpl->add_file('portal');
}
- $this->output = array
- (
- 'title' => $this->getvar('title'),
- 'space' => ' '
- );
+ $this->output[]['title'] = $this->getvar('title');
+ $this->output[]['space'] = ' ';
}
function set_controls($control='',$control_param='')
@@ -112,7 +107,7 @@
{
if($extra_data !='')
{
- $this->output['extrabox'] = $extra_data;
+ $this->output[]['extrabox'] = $extra_data;
}
}
@@ -120,7 +115,7 @@
{
if($extra_data !='')
{
- $this->output['xextrabox'] = $extra_data;
+ $this->output[]['xextrabox'] = $extra_data;
}
}
@@ -158,9 +153,9 @@
}
}
- $this->output['control_link'] = $control_link;
+ $this->output[]['control_link'] = $control_link;
}
- $GLOBALS['phpgw']->xslttpl->set_var('portal',$this->output);
- return $GLOBALS['phpgw']->xslttpl->parse();
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('portal_data' => $this->output),True);
+ //return $GLOBALS['phpgw']->xslttpl->parse();
}
}
diff --git a/phpgwapi/inc/class.xslttemplates.inc.php b/phpgwapi/inc/class.xslttemplates.inc.php
index 0c2690b18f..22252815a9 100644
--- a/phpgwapi/inc/class.xslttemplates.inc.php
+++ b/phpgwapi/inc/class.xslttemplates.inc.php
@@ -133,9 +133,16 @@
function set_var($name, $value, $append = False)
{
- if(!is_array($value) && $append)
+ if($append)
{
- $this->vars[$name] .= $value;
+ //_debug_array($value);
+ if (is_array($value))
+ {
+ while(list($key,$val) = each($value))
+ {
+ $this->vars[$name][$key] = $val;
+ }
+ }
}
else
{
@@ -221,7 +228,7 @@
$this->xmldata = var2xml('PHPGW',$xmldata);
return $this->xmldata;
}
-
+
function list_lineno($xml)
{
$xml = explode("\n",$xml);
diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php
index dac020a09e..c812b9ab33 100644
--- a/phpgwapi/inc/functions.inc.php
+++ b/phpgwapi/inc/functions.inc.php
@@ -4,8 +4,8 @@
* This file written by Dan Kuykendall *
* and Joseph Engo *
* Has a few functions, but primary role is to load the phpgwapi *
- * Copyright (C) 2000, 2001, 2002 Dan Kuykendall *
- * -------------------------------------------------------------------------*
+ * Copyright (C) 2000 - 2002 Dan Kuykendall *
+ * ------------------------------------------------------------------------ *
* This library is part of the phpGroupWare API *
* http://www.phpgroupware.org/api *
* ------------------------------------------------------------------------ *
@@ -21,13 +21,12 @@
* along with this library; if not, write to the Free Software Foundation, *
* 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 running in PHP3, then load up the support functions file for *
+ * transparent support. *
+ \***************************************************************************/
if (floor(phpversion()) == 3)
{
@@ -35,7 +34,7 @@
}
include(PHPGW_API_INC.'/common_functions.inc.php');
-
+
/*!
@function lang
@abstract function to handle multilanguage support
@@ -271,8 +270,8 @@
/****************************************************************************\
* 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'));
+ //$footer_common = &$GLOBALS['phpgw']->common;
+ //register_shutdown_function(array(&$footer_common, 'phpgw_footer'));
/****************************************************************************\
* Stuff to use if logging in or logging out *
@@ -334,12 +333,101 @@
$GLOBALS['phpgw']->xslttpl = CreateObject('phpgwapi.xslttemplates',PHPGW_TEMPLATE_DIR);
- /* load required tpl files */
+ /******* 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!!! \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')
+ . ' Click this image on the 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 (!@$GLOBALS['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');
+ $GLOBALS['phpgw']->template->set_file('msgbox', 'msgbox.tpl');
- /* These default values will be overridden and appended to as needed by template sets */
+ 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');
$GLOBALS['phpgw']->template->set_var('phpgw_top_scrolling','AUTO');
@@ -369,17 +457,17 @@
$GLOBALS['phpgw']->template->set_var('phpgw_head_browser_ico','favicon.ico');
$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 */
+ 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'))
{
include(PHPGW_TEMPLATE_DIR . '/parts.inc.php');
}
- /*************************************************************************\
+
* 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' ||
$GLOBALS['HTTP_GET_VARS']['framepart'] == 'top' ||
@@ -406,7 +494,7 @@
define('PHPGW_NAVBAR_TARGET','body');
if (PHPGW_FRAME_PART == 'start')
{
- /* if just starting up, then we intialize the frameset with the appropriate block */
+ 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'));
$GLOBALS['phpgw']->template->set_var('phpgw_body_link',$GLOBALS['phpgw']->session->link('home.php','framepart=body'));
@@ -418,14 +506,14 @@
}
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 */
+ 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');
}
}
else
{
- /* Not using frames, so we default to tables */
+ Not using frames, so we default to tables
define('PHPGW_USE_FRAMES',False);
define('PHPGW_NAVBAR_TARGET','_self');
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_tables_start','phpgw_main_start');
@@ -433,17 +521,17 @@
}
$GLOBALS['phpgw']->template->set_var('phpgw_head_target',PHPGW_NAVBAR_TARGET);
- /******* Define the GLOBALS['MENUACTION'] *******/
+ Define the GLOBALS['MENUACTION']
define('MENUACTION',get_var('menuaction',Array('GET')));
- /********* This sets the user variables (this should be moved to somewhere else [Seek3r])*********/
+ 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 */
+ 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 *********/
+ 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]))
@@ -456,9 +544,8 @@
unset($enable_class);
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();
if(!PHPGW_USE_FRAMES || (PHPGW_USE_FRAMES && PHPGW_FRAME_PART != 'body'))
@@ -466,9 +553,9 @@
$GLOBALS['phpgw']->common->navbar();
}
- /*************************************************************************\
+
* load up top part if appropriate *
- \*************************************************************************/
+
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'top')
{
if(!PHPGW_USE_FRAMES)
@@ -488,9 +575,9 @@
exit;
}
}
- /*************************************************************************\
+
* load up left part if appropriate *
- \*************************************************************************/
+
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'left')
{
if(!PHPGW_USE_FRAMES)
@@ -510,9 +597,9 @@
exit;
}
}
- /*************************************************************************\
+
* load up right part if appropriate *
- \*************************************************************************/
+
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'right')
{
if(!PHPGW_USE_FRAMES)
@@ -532,9 +619,9 @@
exit;
}
}
- /*************************************************************************\
+
* load up bottom part if appropriate *
- \*************************************************************************/
+
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'bottom')
{
if(!PHPGW_USE_FRAMES)
@@ -555,74 +642,16 @@
}
}
- /*************************************************************************\
+
* 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 */
+ // 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!!! \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 (!@$GLOBALS['phpgw_info']['flags']['noheader'])
- {
- $GLOBALS['phpgw']->common->phpgw_header();
- }
-
- if(!PHPGW_USE_FRAMES)
- {
-// echo '
';
- }
+*/
- /* 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')
- . ' Click this image on the 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);
+?>
diff --git a/phpgwapi/templates/default/portal.xsl b/phpgwapi/templates/default/portal.xsl
index 5cb35c6421..37d9e67087 100644
--- a/phpgwapi/templates/default/portal.xsl
+++ b/phpgwapi/templates/default/portal.xsl
@@ -1,50 +1,54 @@
-
-