phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi inc/class.common.inc.php inc/class.db....


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi inc/class.common.inc.php inc/class.db....
Date: Tue, 14 Feb 2006 10:01:05 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Branch:         
Changes by:     Dave Hall <address@hidden>      06/02/14 10:01:05

Modified files:
        inc            : class.common.inc.php class.db.inc.php 
                         class.javascript.inc.php 
                         class.preferences.inc.php functions.inc.php 
        templates/desktop: head.inc.php navbar.inc.php 

Log message:
        E_NOTICE, templates, XHTML and HEAD fixes

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.common.inc.php.diff?tr1=1.229&tr2=1.230&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.db.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.javascript.inc.php.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.preferences.inc.php.diff?tr1=1.58&tr2=1.59&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/functions.inc.php.diff?tr1=1.181&tr2=1.182&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/templates/desktop/head.inc.php.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/templates/desktop/navbar.inc.php.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: phpgwapi/inc/class.common.inc.php
diff -u phpgwapi/inc/class.common.inc.php:1.229 
phpgwapi/inc/class.common.inc.php:1.230
--- phpgwapi/inc/class.common.inc.php:1.229     Tue Mar 15 01:12:31 2005
+++ phpgwapi/inc/class.common.inc.php   Tue Feb 14 10:01:05 2006
@@ -8,7 +8,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage utilities
-       * @version $Id: class.common.inc.php,v 1.229 2005/03/15 01:12:31 ceb 
Exp $
+       * @version $Id: class.common.inc.php,v 1.230 2006/02/14 10:01:05 
skwashd Exp $
        */
 
        $d1 = strtolower(@substr(PHPGW_API_INC,0,3));
@@ -394,7 +394,11 @@
                                $lastname  = 
$GLOBALS['phpgw_info']['user']['lastname'];
                        }
 
-                       $display = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['account_display'];
+                       $display = 'firstname';
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['account_display'])
 )
+                       {
+                               $display = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['account_display'];
+                       }
 
                        if (!$firstname && !$lastname || $display == 'username')
                        {
@@ -436,6 +440,53 @@
                }
 
                /**
+               * Shows the applications preferences and admin links
+               *
+               * @param string $appname the application name
+               * @param array menu data
+               * @returns array menu data
+               */
+               function display_mainscreen($appname, $file)
+               {
+                       if(is_array($file))
+                       {
+                               $icon = 
$this->image($appname,'navbar','',($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']=='funkwerk'?True:False));
+
+                               if ( is_array($file) && count($file) )
+                               {
+                                       foreach ( $file as $text => $url )
+                                       {
+                                               $link_data[] = array
+                                               (
+                                                       'pref_link'     => $url,
+                                                       'pref_text'     => 
lang($text)
+                                               );
+                                       }
+                               }
+
+                               if ($icon)
+                               {
+                                       $pref = 'app_row_icon';
+                               }
+                               else
+                               {
+                                       $pref = 'app_row_noicon';
+                               }
+
+                               $this->output[$pref][] = array
+                               (
+                                       'layout'        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'],
+                                       'app_title'     => lang($appname),
+                                       'app_name'      => $appname,
+                                       'app_icon'      => $icon,
+                                       'link_row'      => $link_data
+                               );
+                       }
+               }
+
+
+
+               /**
                * Grab the owner name
                *
                * @param integer $accountid Account id
@@ -924,6 +975,7 @@
                                }
                                $image = array($image);
                        }
+
                        if ($use_lang)
                        {
                                while (list(,$img) = each($image))
@@ -933,6 +985,8 @@
                                }
                                $image = $lang_images;
                        }
+                       
+                       $image_found = false;
                        while (!$image_found && (list(,$img) = each($image)))
                        {
                                
if(isset($this->found_files[$appname][$img.$ext]))
@@ -1075,7 +1129,7 @@
                        }
 
                        /* used for xslt apps without xslt framework */
-                       if($GLOBALS['phpgw_info']['flags']['xslt_app'])
+                       if ( isset($GLOBALS['phpgw_info']['flags']['xslt_app']) 
&& $GLOBALS['phpgw_info']['flags']['xslt_app'] )
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file('app_data');
                        }
Index: phpgwapi/inc/class.db.inc.php
diff -u phpgwapi/inc/class.db.inc.php:1.18 phpgwapi/inc/class.db.inc.php:1.19
--- phpgwapi/inc/class.db.inc.php:1.18  Thu May 19 10:04:51 2005
+++ phpgwapi/inc/class.db.inc.php       Tue Feb 14 10:01:05 2006
@@ -9,7 +9,7 @@
        * @link http://www.sanisoft.com/phplib/manual/DB_sql.php
        * @package phpgwapi
        * @subpackage database
-       * @version $Id: class.db.inc.php,v 1.18 2005/05/19 10:04:51 fipsfuchs 
Exp $
+       * @version $Id: class.db.inc.php,v 1.19 2006/02/14 10:01:05 skwashd Exp 
$
        */
 
        if (empty($GLOBALS['phpgw_info']['server']['db_type']))
@@ -270,12 +270,13 @@
                        if($this->debug)
                        {
                                //$GLOBALS['phpgw']->log
-                               echo 'depricated: limit_query';
+                               //echo 'depricated: limit_query';
                        }
                        if(!$this->adodb->isConnected())
                        {
                                $this->connect();
                        }
+                       
                        $this->resultSet = 
$this->adodb->SelectLimit($Query_String, $num_rows, $offset);
                        if(!$this->resultSet && $this->Halt_On_Error == 'yes')
                        {
Index: phpgwapi/inc/class.javascript.inc.php
diff -u phpgwapi/inc/class.javascript.inc.php:1.4 
phpgwapi/inc/class.javascript.inc.php:1.5
--- phpgwapi/inc/class.javascript.inc.php:1.4   Thu Dec 30 06:47:30 2004
+++ phpgwapi/inc/class.javascript.inc.php       Tue Feb 14 10:01:05 2006
@@ -6,7 +6,7 @@
        * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage gui
-       * @version $Id: class.javascript.inc.php,v 1.4 2004/12/30 06:47:30 
skwashd Exp $
+       * @version $Id: class.javascript.inc.php,v 1.5 2006/02/14 10:01:05 
skwashd Exp $
        * @link http://docs.phpgroupware.org/wiki/classJavaScript
        */
 
@@ -36,7 +36,11 @@
                /**
                * @var array elements to be used for the on(Un)Load attributes 
of the body tag
                */
-               var $body;
+               var $body = array
+                               (
+                                       'onload'        => '',
+                                       'onunload'      => ''
+                               );
 
                /**
                * @var array list of validated files to be included in the head 
section of a page
@@ -72,14 +76,15 @@
                }
 
                /**
-               * Adds on(Un)Load= attributes to the body tag of a page
+               * Adds on(un)load= attributes to the body tag of a page
                *
+               * FIXME stop using unline event registration! skwashd Feb-2006
                * @returns string the attributes to be used
                */
                function get_body_attribs()
                {
-                       $js  = ($this->body['onLoad'] ? ' onLoad="' . 
$this->body['onLoad'] . '"' : '');
-                       $js .= ($this->body['onUnload'] ? ' onUnLoad="' . 
$this->body['onUnload'] . '"': '');
+                       $js  = ($this->body['onload'] ? ' onload="' . 
$this->body['onload'] . '"' : '');
+                       $js .= ($this->body['onunload'] ? ' onunLoad="' . 
$this->body['onunload'] . '"': '');
                        return $js;
                }
 
@@ -138,7 +143,7 @@
                */
                function set_onload($code)
                {
-                       $this->body['onLoad'] = $code;
+                       $this->body['onload'] = $code;
                }
 
                /**
@@ -148,7 +153,7 @@
                */
                function set_onunload($code)
                {
-                       $this->body['onUnload'] = $code;
+                       $this->body['onunload'] = $code;
                }
 
                /**
Index: phpgwapi/inc/class.preferences.inc.php
diff -u phpgwapi/inc/class.preferences.inc.php:1.58 
phpgwapi/inc/class.preferences.inc.php:1.59
--- phpgwapi/inc/class.preferences.inc.php:1.58 Wed Jan 11 23:26:57 2006
+++ phpgwapi/inc/class.preferences.inc.php      Tue Feb 14 10:01:05 2006
@@ -7,7 +7,7 @@
        * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage application
-       * @version $Id: class.preferences.inc.php,v 1.58 2006/01/11 23:26:57 
ceb Exp $
+       * @version $Id: class.preferences.inc.php,v 1.59 2006/02/14 10:01:05 
skwashd Exp $
        */
 
        /**
@@ -117,6 +117,11 @@
                */
                function standard_substitutes()
                {
+                       if ( 
isset($GLOBALS['phpgw_info']['server']['mail_suffix']) )
+                       {
+                               $GLOBALS['phpgw_info']['server']['mail_suffix'] 
= $_SERVER['HTTP_HOST'];
+                       }
+                       
                        if 
(!is_array($GLOBALS['phpgw_info']['user']['preferences']))
                        {
                                $GLOBALS['phpgw_info']['user']['preferences'] = 
$this->data;    // else no lang()
Index: phpgwapi/inc/functions.inc.php
diff -u phpgwapi/inc/functions.inc.php:1.181 
phpgwapi/inc/functions.inc.php:1.182
--- phpgwapi/inc/functions.inc.php:1.181        Wed May  4 14:35:47 2005
+++ phpgwapi/inc/functions.inc.php      Tue Feb 14 10:01:05 2006
@@ -7,7 +7,7 @@
        * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage utilities
-       * @version $Id: functions.inc.php,v 1.181 2005/05/04 14:35:47 fipsfuchs 
Exp $
+       * @version $Id: functions.inc.php,v 1.182 2006/02/14 10:01:05 skwashd 
Exp $
        */
 
 
@@ -417,9 +417,11 @@
                
/*************************************************************************\
                * Load the header unless the developer turns it off             
          *
                
\*************************************************************************/
-               if (address@hidden'phpgw_info']['flags']['noheader'])
+               if ( !isset($GLOBALS['phpgw_info']['flags']['noheader']) || 
!$GLOBALS['phpgw_info']['flags']['noheader'] )
                {
-                       
$GLOBALS['phpgw']->common->phpgw_header($GLOBALS['phpgw_info']['flags']['nonavbar']?False:True);
+                       $inc_navbar = 
!isset($GLOBALS['phpgw_info']['flags']['nonavbar']) || 
!$GLOBALS['phpgw_info']['flags']['nonavbar'];
+                       $GLOBALS['phpgw']->common->phpgw_header($inc_navbar);
+                       unset($inc_navbar);
                }
 
                
/*************************************************************************\
Index: phpgwapi/templates/desktop/head.inc.php
diff -u phpgwapi/templates/desktop/head.inc.php:1.5 
phpgwapi/templates/desktop/head.inc.php:1.6
--- phpgwapi/templates/desktop/head.inc.php:1.5 Sun May 15 02:10:56 2005
+++ phpgwapi/templates/desktop/head.inc.php     Tue Feb 14 10:01:05 2006
@@ -9,7 +9,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-  /* $Id: head.inc.php,v 1.5 2005/05/15 02:10:56 skwashd Exp $ */
+  /* $Id: head.inc.php,v 1.6 2006/02/14 10:01:05 skwashd Exp $ */
 
        $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
        $tpl->set_unknowns('remove');
@@ -33,6 +33,11 @@
        }
        $GLOBALS['phpgw']->js->set_onload('initPage();');
 
+       if ( ! (isset($GLOBALS['phpgw_info']['theme']) && 
is_array($GLOBALS['phpgw_info']['theme']) && 
count($GLOBALS['phpgw_info']['theme']) ) )
+       {
+               $GLOBALS['phpgw_info']['theme'] = array('font'  => '');
+       }
+
        $var = Array (
                'img_icon'      => PHPGW_IMAGES_DIR . '/favicon.ico',
                'img_shortcut'  => PHPGW_IMAGES_DIR . '/favicon.ico',
Index: phpgwapi/templates/desktop/navbar.inc.php
diff -u phpgwapi/templates/desktop/navbar.inc.php:1.5 
phpgwapi/templates/desktop/navbar.inc.php:1.6
--- phpgwapi/templates/desktop/navbar.inc.php:1.5       Sun May 15 02:10:56 2005
+++ phpgwapi/templates/desktop/navbar.inc.php   Tue Feb 14 10:01:05 2006
@@ -9,7 +9,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-  /* $Id: navbar.inc.php,v 1.5 2005/05/15 02:10:56 skwashd Exp $ */
+  /* $Id: navbar.inc.php,v 1.6 2006/02/14 10:01:05 skwashd Exp $ */
 
   function parse_navbar($force = False)
   {
@@ -65,7 +65,8 @@
                                break;
                }
                
-               if ($GLOBALS['phpgw_info']['flags']['navbar_target'])
+               $target = '';
+               if ( isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && 
$GLOBALS['phpgw_info']['flags']['navbar_target'] )
                {
                        $target = ' target="' . 
$GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
                }
@@ -111,11 +112,13 @@
                $var['cur_app_title'] = 
$GLOBALS['phpgw_info']['navbar'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title'];
                $var['cur_app_icon'] = 
$GLOBALS['phpgw_info']['navbar'][$GLOBALS['phpgw_info']['flags']['currentapp']]['icon'];
 
-               if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 
'top')
+               if ( isset($GLOBALS['phpgw_info']['server']['showpoweredbyon']) 
&& $GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'top')
                {
                        $var['powered_by'] = lang('Powered by phpGroupWare 
version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
                }
-               if (isset($GLOBALS['phpgw_info']['navbar']['admin']) && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
+               if (isset($GLOBALS['phpgw_info']['navbar']['admin']) 
+                       && 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
 
+                       && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'] )
                {
                        $var['current_users'] = '<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions')
                                . '">&nbsp;' . lang('Current users') . ': ' . 
$GLOBALS['phpgw']->session->total() . '</a>';
@@ -158,10 +161,10 @@
                $tpl->set_var($var);
                $tpl->pfp('out','navbar');
                // If the application has a header include, we now include it
-               if( !$GLOBALS['phpgw_info']['flags']['noappheader'] && 
isset($_GET['menuaction']) )
+               if( (!(isset($GLOBALS['phpgw_info']['flags']['noappheader']) && 
$GLOBALS['phpgw_info']['flags']['noappheader']) ) && isset($_GET['menuaction']) 
)
                {
                        list($app,$class,$method) = 
explode('.',$_GET['menuaction']);
-                       if (is_array($GLOBALS[$class]->public_functions) && 
$GLOBALS[$class]->public_functions['header'])
+                       if (is_array($GLOBALS[$class]->public_functions) && 
isset($GLOBALS[$class]->public_functions['header']) && 
$GLOBALS[$class]->public_functions['header'] )
                        {
                                $GLOBALS[$class]->header();
                        }




reply via email to

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