phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] ged/inc class.ged_ui.inc.php


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] ged/inc class.ged_ui.inc.php
Date: Wed, 07 Mar 2007 18:01:07 +0000

CVSROOT:        /sources/phpgroupware
Module name:    ged
Changes by:     Pascal Vilarem <maat>   07/03/07 18:01:07

Modified files:
        inc            : class.ged_ui.inc.php 

Log message:
        Tiny corrections to avoid php low level notices
        + use off css class to avoid inline css

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_ui.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8

Patches:
Index: class.ged_ui.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_ui.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- class.ged_ui.inc.php        2 Mar 2007 14:20:27 -0000       1.7
+++ class.ged_ui.inc.php        7 Mar 2007 18:01:07 -0000       1.8
@@ -25,12 +25,11 @@
        var $icons;
 
        /* TODO document my code in English :P */
-       /* fonction du meme nom que la classe appellee�� l'initialisation */
-       /* a voir ce que je vais en faire */
+       /* Constructor method called when ged_ui object is created */
 
        function ged_ui()
        {
-               $this->theme = $GLOBALS['phpgw_info']['theme'];
+               //$this->theme = $GLOBALS['phpgw_info']['theme'];
                $this->t = $GLOBALS['phpgw']->template;
                $this->t->set_root(PHPGW_APP_TPL);
                
@@ -47,6 +46,13 @@
                $this->categories=CreateObject('phpgwapi.categories');
                $this->browser=CreateObject('phpgwapi.browser');
                
+               if(address@hidden($GLOBALS['phpgw']->css))
+               {
+                       $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
+               }
+               $GLOBALS['phpgw']->css->validate_file('default','ged');
+               
+               
                //TODO Move this to a function, maybe an api mime class ?
                $this->icons["txt"]="txt";
                $this->icons["doc"]="word";
@@ -84,6 +90,21 @@
 
        function debug ($thefunction)
        {
+               if ( ! isset($GLOBALS['debug']))
+                       $GLOBALS['debug']=Array();
+                       
+               if ( ! isset($GLOBALS['debug']['all']))
+                       $GLOBALS['debug']=false;
+               
+               if ( ! isset($GLOBALS['debug']['all']))
+                       $GLOBALS['debug']=false;
+               
+               if ( $GLOBALS['debug']["ged.".get_class($this)] )
+                       $GLOBALS['debug']["ged.".get_class($this)]=false;
+               
+               if ( 
$GLOBALS['debug']["ged.".get_class($this).".".$thefunction] )
+                       
$GLOBALS['debug']["ged.".get_class($this).".".$thefunction];
+                       
                if ( $GLOBALS['debug']['all'] || 
$GLOBALS['debug']["ged.".get_class($this)] || 
$GLOBALS['debug']["ged.".get_class($this).".".$thefunction])
                {
                        $GLOBALS['debug']['show']=true;
@@ -91,87 +112,9 @@
                }
        }
 
-       
        function css ()
        {
-               return "
-ul
-{
-list-style: none;
-margin: 0px;
-padding: 0px;  
-border: none;
-}
-
-li
-{
-list-style: none;
-margin: 0px;
-padding: 0px;  
-border: none;
-}
-
-#ged_top_menu {
-text-align: left;
-background-color: #849ac8;
-border-top: 1px solid #6A0233;
-border-bottom: 1px solid #6A0233;
-padding: 3px;/index.php?menuaction=admin.uiaccounts.edit_group&account_id=1&
-}
-
-#ged_top_menu a:link {
-color: white;
-padding: 3px;
-text-decoration: none;
-font-size: 11pt;
-}
-
-#ged_top_menu a:visited  {
-color: white;
-padding: 3px;
-text-decoration: none;
-font-size: 11pt;
-}
-
-#ged_top_menu a:hover {
-text-decoration: none;
-color: #849ac8;
-padding: 3px;
-background-color: white;
-font-size: 11pt;
-}
-
-#ged_tree {
-float: left;
-}
-
-#ged_info {
-float: right;
-width: 400px;
-text-align: left;
-}
-
-.ged_label {
-font-weight: bold;
-color: #849AC8;
-}
-
-.current
-{
-font-weight: bold;
-color: green;
-}
-               
-.working
-{
-font-style: italic;
-}              
-
-.obsolete
-{
-color: gray;
-background: lightgrey;
-}\n";
+               return "";
        }
        
        function truncate ( $label, $size=30 )
@@ -415,7 +358,13 @@
                                
$last_version=$this->ged_dm->get_last_version($element_info['element_id']);
 
                                $extension=$last_version['file_extension'];
-                               if ( $this->icons[$extension]=='')
+                               
+                               if ( isset ( $this->icons[$extension] ) )
+                               {
+                                if ($this->icons[$extension]=='')
+                                               $extension='default';
+                               }
+                               else
                                        $extension='default';
                                
                                $this->t->set_var('imgtype', 
$GLOBALS['phpgw']->common->image('ged', $this->icons[$extension]));
@@ -527,7 +476,12 @@
                                                
                        $extension=$version_info['file_extension'];
 
-                       if ( $this->icons[$extension]=='')
+                       if ( isset ( $this->icons[$extension] ) )
+                       {
+                        if ($this->icons[$extension]=='')
+                                       $extension='default';
+                       }
+                       else
                                        $extension='default';
 
                        $this->t->set_var('version_img_mimetype', 
$GLOBALS['phpgw']->common->image('ged', $this->icons[$extension]));
@@ -567,7 +521,13 @@
                        print ( "draw_file_panel: end of version list<br/>\n");
                
                $extension=$current_version['file_extension'];
-               if ( $this->icons[$extension]=='')
+
+               if ( isset ( $this->icons[$extension] ) )
+               {
+                if ($this->icons[$extension]=='')
+                               $extension='default';
+               }
+               else
                        $extension='default';
 
                if ( $element_info['validity_period'] > 0)
@@ -604,6 +564,8 @@
                        $element_info['reference']=lang('Root folder');
                        $element_info['name']=lang('Root folder');
                        $element_info['description']=lang('Root folder');
+                       $element_info['owner_id']=0;
+                       $element_info['creation_date']=0;
                }
                else
                        
$element_info=$this->ged_dm->get_element_info($element_id);
@@ -619,6 +581,7 @@
                if ($sub_folders)
                {
                        $this->t->set_block('folder_tpl', 'subfolders_list', 
'subfolders_list_handle');
+                       $tr_class='';
                        foreach ($sub_folders as $subfolder)
                        {
                                if ( $tr_class=='row_off' )
@@ -703,6 +666,7 @@
                // MEMO Link to go up
                $link_data=null;
                $link_data['menuaction']='ged.ged_ui.browse';
+               if ( $focused_id != 0)
                $link_data['focused_id']=$focused_element['parent_id'];
                
                $up_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
@@ -888,8 +852,11 @@
                $parent_element=$this->ged_dm->get_element_info($parent_id);
 
                // TODO precalcul de la reference
-               // TODO attention : forcer si r�pertoire chrono
-               // TODO reprendre ce qui a �t� fait pour le wizard
+               // TODO attention : forcer si repertoire chrono
+               // TODO reprendre ce qui a ete fait pour le wizard
+               if ( ! isset ($reference))
+                       $reference="";
+                       
                if ($reference !="")
                        $this->t->set_var('new_reference', $reference);
                else
@@ -899,7 +866,8 @@
                $this->t->set_var('name_value', $name);
                $this->t->set_var('description_value', $description);
 
-               $this->t->set_var('action_add', 
$GLOBALS['phpgw']->link('/index.php', 'menuaction=ged.ged_ui.add_file'));
+               $add_link_data['menuaction']='ged.ged_ui.add_file';
+               $this->t->set_var('action_add', 
$GLOBALS['phpgw']->link('/index.php', $add_link_data));
                
                $select_periods=$this->ged_dm->select_periods ();
 
@@ -1273,10 +1241,15 @@
 
                // TODO precalcul de la reference
                // TODO attention : forcer si r�pertoire chrono
+               if ( ! isset ($reference))
+                       $reference="";
+                       
                if ($reference !="")
                        $this->t->set_var('new_reference', $reference);
-               else
+               elseif ($parent_id != 0 )
                        $this->t->set_var('new_reference', 
$parent_element['reference']."/");
+               else
+                       $this->t->set_var('new_reference', '');
 
                $this->t->set_var('parent_id_value', $parent_id);
                $this->t->set_var('name_value', $name);




reply via email to

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