diff --git a/phpgwapi/inc/class.Template.inc.php b/phpgwapi/inc/class.Template.inc.php
index 00e491bce7..6632270059 100644
--- a/phpgwapi/inc/class.Template.inc.php
+++ b/phpgwapi/inc/class.Template.inc.php
@@ -60,40 +60,6 @@
$this->set_unknowns($unknowns);
}
- function update_css()
- {
- if(@is_array($GLOBALS['phpgw_info']['theme']['css']))
- {
- $css_string = '';
- reset($GLOBALS['phpgw_info']['theme']['css']);
- //$css_string = ''."\n";
- $this->set_var('phpgw_css',$css_string);
- }
- }
-
- function update_preload_images()
- {
- if(@is_array($GLOBALS['phpgw_info']['flags']['preload_images']))
- {
- $preload_image_string = '';
- reset($GLOBALS['phpgw_info']['flags']['preload_images']);
- //$css_string = ''."\n";
- $this->set_var('phpgw_css',$css_string);
- }
- }
-
/* public: setroot(pathname $root)
* root: new template directory.
*/
diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php
index 4edff1ba83..d9328a6dd5 100644
--- a/phpgwapi/inc/class.common.inc.php
+++ b/phpgwapi/inc/class.common.inc.php
@@ -316,7 +316,10 @@
{
$this->phpgw_footer();
}
- $GLOBALS['phpgw']->db->disconnect();
+ else
+ {
+ $GLOBALS['phpgw']->db->disconnect();
+ }
exit;
}
@@ -1145,54 +1148,157 @@
$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');
}
+ /*!
+ @function load_theme
+ @abstract Discover the selected theme and include it into the template set
+ @discussion *someone wanna add some detail here*
+ */
+ function load_theme_data()
+ {
+ if (! $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'])
+ {
+ if ($GLOBALS['phpgw_info']['server']['template_set'] == 'user_choice')
+ {
+ $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 'default';
+ }
+ else
+ {
+ $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = $GLOBALS['phpgw_info']['server']['template_set'];
+ }
+ }
+ if ($GLOBALS['phpgw_info']['server']['force_theme'] == 'user_choice')
+ {
+ if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['theme']))
+ {
+ $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 'default';
+ }
+ }
+ else
+ {
+ if (isset($GLOBALS['phpgw_info']['server']['force_theme']))
+ {
+ $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = $GLOBALS['phpgw_info']['server']['force_theme'];
+ }
+ }
+
+ if(@file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.theme'))
+ {
+ include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.theme');
+ }
+ elseif(@file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/themes/default.theme'))
+ {
+ include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/default.theme');
+ }
+ else
+ {
+ /* Hope we don't get to this point. Better then the user seeing a */
+ /* complety back screen and not know whats going on */
+ $phpgw_info['theme']['bg_color'] = 'FFFFFF';
+ $GLOBALS['phpgw']->log->write(array('text'=>'F-Abort, No themes found'));
+ }
+
+ /* This covers putting the theme values into the template, excluding CSS stuff which will be done later */
+ if (is_array($GLOBALS['phpgw_info']['theme']))
+ {
+ $theme_data = $GLOBALS['phpgw_info']['theme'];
+ unset($theme_data['css']);
+ $GLOBALS['phpgw']->template->set_var($theme_data);
+ unset($theme_data);
+ }
+ else
+ {
+ $GLOBALS['phpgw']->template->set_var('bg_color','FFFFFF');
+ }
+ }
+
+ /*!
+ @function load_css
+ @abstract generate CSS format from $phpgw_info['theme']['css'] and set its value into the template
+ @discussion *someone wanna add some detail here*
+ */
+ function load_css_data()
+ {
+
+ /* Make sure some of the defaults are set */
+ if (!isset($phpgw_info['theme']['css']['A']))
+ {
+ $phpgw_info['theme']['css']['A'] = 'text-decoration:none;';
+ }
+ if (!isset($phpgw_info['theme']['css']['A:link']) && !empty($GLOBALS['phpgw_info']['theme']['link']))
+ {
+ $phpgw_info['theme']['css']['A:link'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['link'].';';
+ }
+
+ if (!isset($phpgw_info['theme']['css']['A:visited']) && !empty($GLOBALS['phpgw_info']['theme']['vlink']))
+ {
+ $phpgw_info['theme']['css']['A:visited'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['vlink'].';';
+ }
+
+ if (!isset($phpgw_info['theme']['css']['A:active']) && !empty($GLOBALS['phpgw_info']['theme']['alink']))
+ {
+ $phpgw_info['theme']['css']['A:active'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['alink'].';';
+ }
+
+ if (!isset($phpgw_info['theme']['css']['A:hover']) && !empty($GLOBALS['phpgw_info']['theme']['hovlink']))
+ {
+ $phpgw_info['theme']['css']['A:hover'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['hovlink'].';';
+ }
+
+ /* now put the css data into the template class */
+ if(@is_array($GLOBALS['phpgw_info']['theme']['css']))
+ {
+ $css_string = '';
+ reset($GLOBALS['phpgw_info']['theme']['css']);
+ $css_string = "\n";
+ $GLOBALS['phpgw']->template->set_var('phpgw_css',$css_string);
+ }
+ }
+
+ 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 = '';
+ reset($GLOBALS['phpgw_info']['flags']['preload_images']);
+ while(list($key,$value) = each($GLOBALS['phpgw_info']['flags']['preload_images']))
+ {
+ if($preload_image_string != '')
+ {
+ $preload_image_string .= ",'$value'";
+ }
+ else
+ {
+ $preload_image_string .= "'$value'";
+ }
+ }
+ $preload_image_string = "MM_preloadImages($preload_image_string); ";
+ $GLOBALS['phpgw']->template->set_var('phpgw_preload_images',$preload_image_string);
+ }
+ }
+
/*!
@function phpgw_header
@abstract load the phpgw header
*/
function phpgw_header($forceheader = True, $forcenavbar = True)
{
-/*
- if($forceheader)
- {
- $GLOBALS['phpgw_info']['flags']['noheader'] = False;
- }
- if($forcenavbar)
- {
- $GLOBALS['phpgw_info']['flags']['nonavbar'] = False;
- }
-
- if (!@$GLOBALS['phpgw_info']['flags']['noheader'])
- {
- $GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
- include(PHPGW_TEMPLATE_DIR.'/head.inc.php');
- $GLOBALS['phpgw']->template->reset_root();
- }
- if(!function_exists('parse_navbar'))
- {
- $GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
- $this->navbar(False);
- include(PHPGW_TEMPLATE_DIR.'/navbar.inc.php');
- $GLOBALS['phpgw']->template->reset_root();
- }
- if (!@$GLOBALS['phpgw_info']['flags']['nonavbar'] && !@$GLOBALS['phpgw_info']['flags']['navbar_target'])
- {
- $GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
- parse_navbar();
- $GLOBALS['phpgw']->template->reset_root();
- }
- //elseif (!@$GLOBALS['phpgw_info']['flags']['noheader'] && function_exists('parse_nonavbar'))
- //{
- // parse_nonavbar();
- //}
- if (!@$GLOBALS['phpgw_info']['flags']['noheader'] && !@$GLOBALS['phpgw_info']['flags']['nonavbar'])
- {
- $GLOBALS['phpgw']->hooks->process('after_navbar');
- }
-*/
+ /* This is no longer used */
}
/*!
@@ -1240,7 +1346,7 @@
if(!defined('PHPGW_FOOTER_RAN'))
{
define('PHPGW_FOOTER_RAN',True);
- if (!isset($GLOBALS['phpgw_info']['flags']['nofooter']) || !$GLOBALS['phpgw_info']['flags']['nofooter'])
+ if (!isset($GLOBALS['phpgw_info']['flags']['nodisplay']) || !$GLOBALS['phpgw_info']['flags']['nodisplay'])
{
if($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'login' &&
@@ -1251,6 +1357,8 @@
}
$GLOBALS['phpgw']->db->disconnect();
$this->msgbox('',False,'phpgw_msgbox');
+ $this->load_css_data();
+ $this->load_preload_images_data();
$GLOBALS['phpgw']->template->pfp('out','phpgw_main');
/*
diff --git a/phpgwapi/inc/class.phpgw.inc.php b/phpgwapi/inc/class.phpgw.inc.php
index 4a3061a667..bd0f22e437 100644
--- a/phpgwapi/inc/class.phpgw.inc.php
+++ b/phpgwapi/inc/class.phpgw.inc.php
@@ -132,6 +132,11 @@
$url = str_replace ( 'http:', 'https:', $url);
}
}
+
+// if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']))
+// {
+// $url .= '" target="_parent"';
+// }
if ($iis)
{
echo "\n\n
\nRedirecting to $url";
diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php
index 9fb700af5d..d0cb1da041 100644
--- a/phpgwapi/inc/functions.inc.php
+++ b/phpgwapi/inc/functions.inc.php
@@ -60,11 +60,6 @@
return $GLOBALS['phpgw']->common->check_code($code);
}
- /*!
- @collection_end direct functions
- */
-
- // print_debug('core functions are done');
/****************************************************************************\
* Quick verification of sane environment *
\****************************************************************************/
@@ -157,14 +152,14 @@
@print_debug('domain',$GLOBALS['phpgw_info']['user']['domain'],'api');
- /****************************************************************************\
- * These lines load up the API, fill up the $phpgw_info array, etc *
- \****************************************************************************/
+ /****************************************************************************\
+ * These lines load up the API, fill up the $GLOBALS["phpgw_info"] array, etc *
+ \****************************************************************************/
/* Load main class */
$GLOBALS['phpgw'] = CreateObject('phpgwapi.phpgw');
- /************************************************************************\
- * Load up the main instance of the db class. *
- \************************************************************************/
+ /************************************************************************\
+ * Load up the main instance of the db class. *
+ \************************************************************************/
$GLOBALS['phpgw']->db = CreateObject('phpgwapi.db');
$GLOBALS['phpgw']->db->Host = $GLOBALS['phpgw_info']['server']['db_host'];
$GLOBALS['phpgw']->db->Type = $GLOBALS['phpgw_info']['server']['db_type'];
@@ -187,8 +182,10 @@
}
$GLOBALS['phpgw']->db->Halt_On_Error = 'yes';
- /* Fill phpgw_info["server"] array */
- // An Attempt to speed things up using cache premise
+ /****************************************************************************\
+ * These lines fill up the $GLOBALS["phpgw_info"]["server"] array *
+ \****************************************************************************/
+ // An Attempt to speed things up using cache premise
$GLOBALS['phpgw']->db->query("select config_value from phpgw_config WHERE config_app='phpgwapi' and config_name='cache_phpgw_info'",__LINE__,__FILE__);
if ($GLOBALS['phpgw']->db->num_rows())
{
@@ -276,7 +273,7 @@
{
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
{
- Header('Location: https://'.$GLOBALS['phpgw_info']['server']['hostname'].$GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']);
+ Header('Location: ' . $GLOBALS['phpgw']->redirect($GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']));
exit;
}
if (@$login != '')
@@ -296,17 +293,42 @@
}
else
{
+ /**************************************************************************\
+ * If users session is not valid, send them to login page *
+ \**************************************************************************/
if (! $GLOBALS['phpgw']->session->verify())
{
Header('Location: ' . $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->session->link('/login.php','code=10')));
exit;
}
+ /***************************************************************************\
+ * Now that we know we have a good session we can load up the datatime class *
+ \***************************************************************************/
$GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.datetime');
- /* A few hacker resistant constants that will be used throught the program */
+ /* 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 ($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 ($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_info']['user']['preferences']['common']['template_set'] = 'default';
+
+/*DELETE ME SOON!!!!*/ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'default';
+
+ /*************************************************************************\
+ * A few hacker resistant constants that will be used throught the program *
+ \*************************************************************************/
define('PHPGW_TEMPLATE_DIR', ExecMethod('phpgwapi.phpgw.common.get_tpl_dir', 'phpgwapi'));
define('PHPGW_IMAGES_DIR', ExecMethod('phpgwapi.phpgw.common.get_image_path', 'phpgwapi'));
define('PHPGW_IMAGES_FILEDIR', ExecMethod('phpgwapi.phpgw.common.get_image_dir', 'phpgwapi'));
@@ -320,53 +342,42 @@ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'defau
* These lines load up the templates class and set some default values *
\*************************************************************************/
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',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');
- /* This will bring in the template sets parts definitions */
- if (file_exists(PHPGW_TEMPLATE_DIR . '/parts.inc.php'))
- {
- include(PHPGW_TEMPLATE_DIR . '/parts.inc.php');
- }
- $val = $GLOBALS['phpgw']->template->get_var('phpgw_top_height');
- if (empty($val))
- {
- $GLOBALS['phpgw']->template->set_var('phpgw_top_height','10');
- }
- $val = $GLOBALS['phpgw']->template->get_var('phpgw_left_width');
- if (empty($val))
- {
- $GLOBALS['phpgw']->template->set_var('phpgw_left_width','10');
- }
- $val = $GLOBALS['phpgw']->template->get_var('phpgw_right_width');
- if (empty($val))
- {
- $GLOBALS['phpgw']->template->set_var('phpgw_right_width','10');
- }
- $val = $GLOBALS['phpgw']->template->get_var('phpgw_bottom_height');
- if (empty($val))
- {
- $GLOBALS['phpgw']->template->set_var('phpgw_bottom_height','10');
- }
+ /* 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','NO');
+ $GLOBALS['phpgw']->template->set_var('phpgw_left_table_width','0');
+ $GLOBALS['phpgw']->template->set_var('phpgw_left_frame_width','0');
+ $GLOBALS['phpgw']->template->set_var('phpgw_left_scrolling','NO');
+ $GLOBALS['phpgw']->template->set_var('phpgw_right_table_width','0');
+ $GLOBALS['phpgw']->template->set_var('phpgw_right_frame_width','0');
+ $GLOBALS['phpgw']->template->set_var('phpgw_right_scrolling','NO');
+ $GLOBALS['phpgw']->template->set_var('phpgw_bottom_table_height','0');
+ $GLOBALS['phpgw']->template->set_var('phpgw_bottom_frame_height','0');
+ $GLOBALS['phpgw']->template->set_var('phpgw_bottom_scrolling','NO');
$GLOBALS['phpgw']->template->set_var('phpgw_head_charset',lang('charset'));
$GLOBALS['phpgw']->template->set_var('phpgw_head_description','phpGroupWare');
$GLOBALS['phpgw']->template->set_var('phpgw_head_keywords','phpGroupWare');
-
- if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
- {
- $GLOBALS['phpgw']->template->set_var('phpgw_head_base','https://'.$GLOBALS['phpgw_info']['server']['hostname'].$GLOBALS['phpgw_info']['server']['webserver_url'].'/');
- }
- else
- {
- $GLOBALS['phpgw']->template->set_var('phpgw_head_base',$GLOBALS['phpgw_info']['server']['webserver_url'].'/');
- }
+ $GLOBALS['phpgw']->template->set_var('phpgw_head_base',$GLOBALS['phpgw']->session->link('/'));
$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 */
+ 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 some variables *
+ * 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' ||
@@ -383,8 +394,7 @@ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'defau
{
define('PHPGW_FRAME_PART','start');
}
-
-//$GLOBALS['phpgw_info']['server']['useframes'] = 'always';
+$GLOBALS['phpgw_info']['server']['useframes'] = 'always';
if(((isset($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] &&
$GLOBALS['phpgw_info']['server']['useframes'] == 'allowed') ||
@@ -395,40 +405,34 @@ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'defau
define('PHPGW_NAVBAR_TARGET','body');
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'));
$GLOBALS['phpgw']->template->set_var('phpgw_body_link',$GLOBALS['phpgw']->session->link('home.php','framepart=body'));
$GLOBALS['phpgw']->template->set_var('phpgw_left_link',$GLOBALS['phpgw']->session->link('home.php','framepart=left'));
$GLOBALS['phpgw']->template->set_var('phpgw_bottom_link',$GLOBALS['phpgw']->session->link('home.php','framepart=bottom'));
+ $GLOBALS['phpgw']->template->set_var('phpgw_unupported_link',$GLOBALS['phpgw']->session->link($GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME'],'framepart=unsupported'));
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_frames','phpgw_main');
}
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','phpgw_main');
}
}
else
{
+ /* 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','phpgw_main');
}
$GLOBALS['phpgw']->template->set_var('phpgw_head_target',PHPGW_NAVBAR_TARGET);
- /* define('PHPGW_APP_IMAGES_DIR', $GLOBALS['phpgw']->common->get_image_dir()); */
-
- /* Moved outside of this logic
- define('PHPGW_ACL_READ',1);
- define('PHPGW_ACL_ADD',2);
- define('PHPGW_ACL_EDIT',4);
- define('PHPGW_ACL_DELETE',8);
- define('PHPGW_ACL_PRIVATE',16);
- */
-
/******* Define the GLOBALS['MENUACTION'] *******/
define('MENUACTION',get_var('menuaction',Array('GET')));
- /********* This sets the user variables *********/
+ /********* 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'];
@@ -449,82 +453,15 @@ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'defau
reset($GLOBALS['phpgw_info']['flags']);
- /*************************************************************************\
- * These lines load up the themes and CSS data *
- \*************************************************************************/
- if (! $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'])
+ /***************************************************************************\
+ * 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'))
{
- if ($GLOBALS['phpgw_info']['server']['template_set'] == 'user_choice')
- {
- $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 'default';
- }
- else
- {
- $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = $GLOBALS['phpgw_info']['server']['template_set'];
- }
- }
- if ($GLOBALS['phpgw_info']['server']['force_theme'] == 'user_choice')
- {
- if (!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['theme']))
- {
- $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 'default';
- }
- }
- else
- {
- if (isset($GLOBALS['phpgw_info']['server']['force_theme']))
- {
- $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = $GLOBALS['phpgw_info']['server']['force_theme'];
- }
- }
-
- if(@file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.theme'))
- {
- include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.theme');
- }
- elseif(@file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/themes/default.theme'))
- {
- include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/default.theme');
- }
- else
- {
- /* Hope we don't get to this point. Better then the user seeing a */
- /* complety back screen and not know whats going on */
- echo '';
- $GLOBALS['phpgw']->log->write(array('text'=>'F-Abort, No themes found'));
- }
-
- if (isset($GLOBALS['phpgw_info']['theme']['hovlink'])
- && ($GLOBALS['phpgw_info']['theme']['hovlink'] != ''))
- {
- $phpgw_info['theme']['css']['A:hover'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['hovlink'].';';
- }
-
- $phpgw_info['theme']['css']['A'] = 'text-decoration:none;';
- $phpgw_info['theme']['css']['A:link'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['link'].';';
- $phpgw_info['theme']['css']['A:visited'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['vlink'].';';
- $phpgw_info['theme']['css']['A:active'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['alink'].';';
-
- if(@file_exists(PHPGW_TEMPLATE_DIR . '/css.inc.php'))
- {
- include(PHPGW_TEMPLATE_DIR . '/css.inc.php');
- }
- if(@file_exists(PHPGW_APP_TPL . '/css.inc.php'))
- {
- include(PHPGW_APP_TPL . '/css.inc.php');
- }
-
- /* This covers setting the theme values so that each app doesnt have to */
- $theme_data = $GLOBALS['phpgw_info']['theme'];
- unset($theme_data['css']);
- $GLOBALS['phpgw']->template->set_var($theme_data);
- unset($theme_data);
- $GLOBALS['phpgw']->template->update_css();
-
-// if(!PHPGW_USE_FRAMES || (PHPGW_USE_FRAMES && PHPGW_NAVBAR_TARGET != 'body'))
-// {
$GLOBALS['phpgw']->common->navbar();
-// }
+ }
/*************************************************************************\
* load up top part if appropriate *
@@ -611,7 +548,7 @@ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'defau
}
if(PHPGW_USE_FRAMES)
{
-// $GLOBALS['phpgw']->common->phpgw_footer();
+ $GLOBALS['phpgw']->common->phpgw_footer();
}
}
@@ -635,8 +572,8 @@ $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'defau
$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");
- //$GLOBALS['phpgw']->common->phpgw_display();
- //$GLOBALS['phpgw']->common->phpgw_exit(True);
+ //$GLOBALS['phpgw']->common->phpgw_footer();
+ $GLOBALS['phpgw']->common->phpgw_exit(True);
}
}
if($continue_app_data)
diff --git a/phpgwapi/templates/default/parts.inc.php b/phpgwapi/templates/default/parts.inc.php
index e5f57d3e0b..319ecba7d9 100644
--- a/phpgwapi/templates/default/parts.inc.php
+++ b/phpgwapi/templates/default/parts.inc.php
@@ -11,10 +11,10 @@
/* $Id$ */
- $GLOBALS['phpgw']->template->set_var('phpgw_top_height','10%');
- $GLOBALS['phpgw']->template->set_var('phpgw_left_width','0');
- $GLOBALS['phpgw']->template->set_var('phpgw_right_width','0');
- $GLOBALS['phpgw']->template->set_var('phpgw_bottom_height','5%');
+ $GLOBALS['phpgw']->template->set_var('phpgw_top_table_height','10%');
+ $GLOBALS['phpgw']->template->set_var('phpgw_top_frame_height','45');
+ $GLOBALS['phpgw']->template->set_var('phpgw_bottom_table_height','5%');
+ $GLOBALS['phpgw']->template->set_var('phpgw_bottom_frame_height','40');
function parse_toppart($output)
{
@@ -64,7 +64,6 @@
}
if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'text')
{
- $var['navbar_color'] = $GLOBALS['phpgw_info']['theme']['bg_color'];
$var['align'] = 'right';
$var['value'] = $GLOBALS['phpgw']->common->create_tabs($tabs,$selected,-1);
$GLOBALS['phpgw']->template->set_var($var);
@@ -90,23 +89,10 @@
// . lang($GLOBALS['phpgw']->common->show_date($now,'F')) . ' '
// . $GLOBALS['phpgw']->common->show_date($now,'d, Y');
- // Maybe we should create a common function in the phpgw_accounts_shared.inc.php file
- // to get rid of duplicate code.
- if ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0)
- {
- $api_messages = lang('You are required to change your password during your first login')
- . ' Click this image on the navbar: ';
- }
- elseif ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - (86400*30))
- {
- $api_messages = lang('it has been more then x days since you changed your password',30);
- }
-
// This is gonna change
if (isset($cd))
{
- $var['messages'] = $api_messages . ' ' . checkcode($cd);
+ $var['messages'] = checkcode($cd);
}
$GLOBALS['phpgw']->template->set_var($var);
$GLOBALS['phpgw']->template->fp($output,'top_part');
@@ -119,7 +105,6 @@
$GLOBALS['phpgw']->template->set_file('parts','parts.tpl');
$GLOBALS['phpgw']->template->set_block('parts','bottom_part');
$var = Array(
- 'bg_color' => $GLOBALS['phpgw_info']['theme']['bg_color'],
'msg' => "
\n".lang('Powered by phpGroupWare version x',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']),
'version' => $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']
);
diff --git a/phpgwapi/templates/default/parts.tpl b/phpgwapi/templates/default/parts.tpl
index 9489c40efd..24507e1b57 100644
--- a/phpgwapi/templates/default/parts.tpl
+++ b/phpgwapi/templates/default/parts.tpl
@@ -1,6 +1,6 @@