phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.Template.inc.php,1.25,1.26 cl


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.Template.inc.php,1.25,1.26 class.common.inc.php,1.142,1.143 class.phpgw.inc.php,1.44,1.45 functions.inc.php,1.139,1.140
Date: Thu, 30 May 2002 17:13:11 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv9844/phpgwapi/inc

Modified Files:
        class.Template.inc.php class.common.inc.php 
        class.phpgw.inc.php functions.inc.php 
Log Message:
updated phpgwapi/inc/functions.inc.php to follow a nice and orderly loadup 
process. Added back in the support for CSS, added support for preloading 
images, fixed javascript problems, updated themes to use , overall just got 
this api nice and tight in the loadup and template areas. Now we need to update 
all the template sets and apps to follow suit

Index: class.Template.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.Template.inc.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** class.Template.inc.php      30 May 2002 09:44:38 -0000      1.25
--- class.Template.inc.php      30 May 2002 21:13:07 -0000      1.26
***************
*** 61,98 ****
                }
  
-               function update_css()
-               {
-                       if(@is_array($GLOBALS['phpgw_info']['theme']['css']))
-                       {
-                               $css_string = '';
-                               reset($GLOBALS['phpgw_info']['theme']['css']);
-                               //$css_string = '<STYLE type="text/css">'."\n";
-                               while(list($key,$value) = 
each($GLOBALS['phpgw_info']['theme']['css']))
-                               {
-                                       $css_string .= "\n\t$key { $value } ";
-                               }
-                               $css_string .= "\n";
-                               //$css_string .= '</STYLE>'."\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 = '<STYLE type="text/css">'."\n";
-                               while(list($key,$value) = 
each($GLOBALS['phpgw_info']['flags']['preload_images']))
-                               {
-                                       $css_string .= "\n\t$key { $value } ";
-                               }
-                               $css_string .= "\n";
-                               //$css_string .= '</STYLE>'."\n";
-                               $this->set_var('phpgw_css',$css_string);
-                       }
-               }
- 
                /* public: setroot(pathname $root)
                 * root:   new template directory.
--- 61,64 ----

Index: class.common.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.common.inc.php,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -r1.142 -r1.143
*** class.common.inc.php        30 May 2002 09:44:38 -0000      1.142
--- class.common.inc.php        30 May 2002 21:13:07 -0000      1.143
***************
*** 317,321 ****
                                $this->phpgw_footer();
                        }
!                       $GLOBALS['phpgw']->db->disconnect();
                        exit;
                }
--- 317,324 ----
                                $this->phpgw_footer();
                        }
!                       else
!                       {
!                               $GLOBALS['phpgw']->db->disconnect();
!                       }
                        exit;
                }
***************
*** 1146,1149 ****
--- 1149,1156 ----
                        $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');
***************
*** 1151,1197 ****
  
                /*!
!               @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 (address@hidden'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 (address@hidden'phpgw_info']['flags']['nonavbar'] && 
address@hidden'phpgw_info']['flags']['navbar_target'])
                        {
!                               
$GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
!                               parse_navbar();
!                               $GLOBALS['phpgw']->template->reset_root();
                        }
!                       //elseif 
(address@hidden'phpgw_info']['flags']['noheader'] && 
function_exists('parse_nonavbar'))
!                       //{
!                       //      parse_nonavbar();
!                       //}
!                       if (address@hidden'phpgw_info']['flags']['noheader'] && 
address@hidden'phpgw_info']['flags']['nonavbar'])
                        {
!                               
$GLOBALS['phpgw']->hooks->process('after_navbar');
                        }
! */                    
                }
  
--- 1158,1303 ----
  
                /*!
!               @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 = "<STYLE type=\"text/css\">";
!                               while(list($key,$value) = 
each($GLOBALS['phpgw_info']['theme']['css']))
!                               {
!                                       $css_string .= "\n\t\t$key { $value } ";
!                               }
!                               $css_string .= "\n";
!                               $css_string .= "\t</STYLE>\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)
!               {
!                       /* This is no longer used */
                }
  
***************
*** 1241,1245 ****
                        {
                                define('PHPGW_FOOTER_RAN',True);
!                               if 
(!isset($GLOBALS['phpgw_info']['flags']['nofooter']) || 
!$GLOBALS['phpgw_info']['flags']['nofooter'])
                                {
                                        
if($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
--- 1347,1351 ----
                        {
                                define('PHPGW_FOOTER_RAN',True);
!                               if 
(!isset($GLOBALS['phpgw_info']['flags']['nodisplay']) || 
!$GLOBALS['phpgw_info']['flags']['nodisplay'])
                                {
                                        
if($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
***************
*** 1252,1255 ****
--- 1358,1363 ----
                                        $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');
  /*

Index: class.phpgw.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.phpgw.inc.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** class.phpgw.inc.php 30 May 2002 09:44:38 -0000      1.44
--- class.phpgw.inc.php 30 May 2002 21:13:07 -0000      1.45
***************
*** 133,136 ****
--- 133,141 ----
                                }
                        }
+ 
+ //                    if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']))
+ //                    {
+ //                            $url .= '" target="_parent"';
+ //                    }
                        if ($iis)
                        {

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/functions.inc.php,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -r1.139 -r1.140
*** functions.inc.php   30 May 2002 09:44:38 -0000      1.139
--- functions.inc.php   30 May 2002 21:13:07 -0000      1.140
***************
*** 61,69 ****
        }
  
-       /*!
-        @collection_end direct functions
-       */
- 
-       //      print_debug('core functions are done');
        
/****************************************************************************\
        * Quick verification of sane environment                                
     *
--- 61,64 ----
***************
*** 158,169 ****
        @print_debug('domain',$GLOBALS['phpgw_info']['user']['domain'],'api');
  
!        
/****************************************************************************\
!        * These lines load up the API, fill up the $phpgw_info array, etc      
      *
!        
\****************************************************************************/
         /* Load main class */
        $GLOBALS['phpgw'] = CreateObject('phpgwapi.phpgw');
!        
/************************************************************************\
!        * 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'];
--- 153,164 ----
        @print_debug('domain',$GLOBALS['phpgw_info']['user']['domain'],'api');
  
!       
/****************************************************************************\
!       * 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.                            
 *
!       
\************************************************************************/
        $GLOBALS['phpgw']->db           = CreateObject('phpgwapi.db');
        $GLOBALS['phpgw']->db->Host     = 
$GLOBALS['phpgw_info']['server']['db_host'];
***************
*** 188,193 ****
        $GLOBALS['phpgw']->db->Halt_On_Error = 'yes';
  
!        /* Fill 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())
--- 183,190 ----
        $GLOBALS['phpgw']->db->Halt_On_Error = 'yes';
  
!       
/****************************************************************************\
!       * 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())
***************
*** 277,281 ****
                        
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']);
                                exit;
                        }
--- 274,278 ----
                        
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && 
$GLOBALS['phpgw_info']['server']['enforce_ssl'] && 
!$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
                        {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->redirect($GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']));
                                exit;
                        }
***************
*** 297,300 ****
--- 294,300 ----
        else
        {
+               
/**************************************************************************\
+               * If users session is not valid, send them to login page        
           *
+               
\**************************************************************************/
                if (! $GLOBALS['phpgw']->session->verify())
                {
***************
*** 303,311 ****
                }
  
                $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.datetime');
  
!               /* A few hacker resistant constants that will be used throught 
the program */
  
! $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 
'default';
                define('PHPGW_TEMPLATE_DIR', 
ExecMethod('phpgwapi.phpgw.common.get_tpl_dir', 'phpgwapi'));
                define('PHPGW_IMAGES_DIR', 
ExecMethod('phpgwapi.phpgw.common.get_image_path', 'phpgwapi'));
--- 303,333 ----
                }
  
+               
/***************************************************************************\
+               * Now that we know we have a good session we can load up the 
datatime class *
+               
\***************************************************************************/
                $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.datetime');
  
!               /* 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')
!                               . '<br> Click this image on the navbar: <img 
src="'
!                               . 
$GLOBALS['phpgw']->common->image('preferences','navbar.gif').'">';
!                       
$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;
!               }
! 
!               
! /*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'));
***************
*** 321,371 ****
                
\*************************************************************************/
                $GLOBALS['phpgw']->template = 
CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
                $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');
!               }
  
                
$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_browser_ico','favicon.ico');
-               
$GLOBALS['phpgw']->template->set_var('phpgw_head_website_title', 
$GLOBALS['phpgw_info']['server']['site_title']);
  
                
/*************************************************************************\
!               * If they are using frames, we need to set some variables       
          *
                
\*************************************************************************/
                if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']) && 
--- 343,382 ----
                
\*************************************************************************/
                $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');
                
!               /* 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');
+               
$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 the PHPGW_FRAME_PART 
safely    *
                
\*************************************************************************/
                if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']) && 
***************
*** 384,389 ****
                        define('PHPGW_FRAME_PART','start');
                }
! 
! //$GLOBALS['phpgw_info']['server']['useframes'] = 'always';           
                
if(((isset($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'])
 &&     
                        
$GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] && 
--- 395,399 ----
                        define('PHPGW_FRAME_PART','start');
                }
! $GLOBALS['phpgw_info']['server']['useframes'] = 'always';
                
if(((isset($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'])
 &&     
                        
$GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] && 
***************
*** 396,399 ****
--- 406,410 ----
                        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'));
***************
*** 401,408 ****
--- 412,421 ----
                                
$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');
                        }
***************
*** 410,413 ****
--- 423,427 ----
                else
                {
+                       /* Not using frames, so we default to tables */
                        define('PHPGW_USE_FRAMES',False);
                        define('PHPGW_NAVBAR_TARGET','_self');
***************
*** 416,433 ****
                
$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 *********/
                $GLOBALS['phpgw_info']['user']['private_dir'] = 
$GLOBALS['phpgw_info']['server']['files_dir']
                        . '/users/'.$GLOBALS['phpgw_info']['user']['userid'];
--- 430,437 ----
                
$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'];
***************
*** 450,529 ****
  
  
!               
/*************************************************************************\
!               * These lines load up the themes and CSS 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     
           */
!                       echo '<body bgcolor="FFFFFF">';
!                       $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();
! //            }
  
                
/*************************************************************************\
--- 454,466 ----
  
  
!               
/***************************************************************************\
!               * 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'))
                {
                        $GLOBALS['phpgw']->common->navbar();
!               }
  
                
/*************************************************************************\
***************
*** 612,616 ****
                        if(PHPGW_USE_FRAMES)
                        {
! //                            $GLOBALS['phpgw']->common->phpgw_footer();
                        }
                }
--- 549,553 ----
                        if(PHPGW_USE_FRAMES)
                        {
!                               $GLOBALS['phpgw']->common->phpgw_footer();
                        }
                }
***************
*** 636,641 ****
                                        $continue_app_data = False;
                                        
$GLOBALS['phpgw']->template->set_var('phpgw_body',"user has no rights to this 
app!!!<br>\n");
!                                       
//$GLOBALS['phpgw']->common->phpgw_display();
!                                       
//$GLOBALS['phpgw']->common->phpgw_exit(True);
                                }
                        }
--- 573,578 ----
                                        $continue_app_data = False;
                                        
$GLOBALS['phpgw']->template->set_var('phpgw_body',"user has no rights to this 
app!!!<br>\n");
!                                       
//$GLOBALS['phpgw']->common->phpgw_footer();
!                                       
$GLOBALS['phpgw']->common->phpgw_exit(True);
                                }
                        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]