phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] etemplate/inc class.uietemplate.inc.php class.h...


From: Caeies
Subject: [Phpgroupware-cvs] etemplate/inc class.uietemplate.inc.php class.h...
Date: Wed, 06 Sep 2006 10:27:23 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    etemplate
Changes by:     Caeies <Caeies> 06/09/06 10:27:22

Modified files:
        inc            : class.uietemplate.inc.php class.html.inc.php 

Log message:
        E_ALL partial fix

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.uietemplate.inc.php?cvsroot=phpgroupware&r1=1.64&r2=1.65
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.html.inc.php?cvsroot=phpgroupware&r1=1.23&r2=1.24

Patches:
Index: class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- class.uietemplate.inc.php   26 Feb 2006 20:41:19 -0000      1.64
+++ class.uietemplate.inc.php   6 Sep 2006 10:27:22 -0000       1.65
@@ -10,7 +10,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id: class.uietemplate.inc.php,v 1.64 2006/02/26 20:41:19 Caeies Exp 
$ */
+       /* $Id: class.uietemplate.inc.php,v 1.65 2006/09/06 10:27:22 Caeies Exp 
$ */
 
        include_once(PHPGW_INCLUDE_ROOT . 
'/etemplate/inc/class.boetemplate.inc.php');
 
@@ -157,7 +157,7 @@
                                $hooked = 
$GLOBALS['phpgw']->template->get_var('phpgw_body');
                                if 
(address@hidden'phpgw_info']['etemplate']['hooked'] && !$return_html)
                                {
-                                       
$GLOBALS['phpgw_info']['flags']['java_script'] .= $this->include_java_script(2);
+                                       
$GLOBALS['phpgw_info']['flags']['java_script'] = 
isset($GLOBALS['phpgw_info']['flags']['java_script']) ? 
$GLOBALS['phpgw_info']['flags']['java_script'] : '' . 
$this->include_java_script(2);
                                        
$GLOBALS['phpgw']->common->phpgw_header();
                                }
                                else
@@ -171,7 +171,11 @@
                                $hooked = $hooked['body_data'];
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('java_script' => 
$GLOBALS['phpgw_info']['flags']['java_script'].$this->include_java_script(2)));
                        }
-                       list($width,$height,,,,,$overflow) = 
explode(',',$this->size);
+                       $tmpa = explode(',',$this->size);
+                       $width = isset($tmpa[0]) ? $tmpa[0] : '';
+                       $height = isset($tmpa[1]) ? $tmpa[1] : '';
+                       $overflow = isset($tmpa[6]) ? $tmpa[6] : '';
+                       unset($tmpa);
                        if ($overflow)
                        {
                                $html = 
$this->html->div($html,'STYLE="'.($width?"width: $width; 
":'').($height?"height: $height; ":'')."overflow: $overflow;\"");
@@ -182,10 +186,10 @@
                                'changes' => $changes,
                                'sel_options' => $sel_options,
                                'preserv' => $preserv,
-                               'extension_data' => 
$GLOBALS['phpgw_info']['etemplate']['extension_data'],
-                               'to_process' => 
$GLOBALS['phpgw_info']['etemplate']['to_process'],
-                               'java_script' => 
$GLOBALS['phpgw_info']['etemplate']['java_script'],
-                               'dom_enabled' => 
$GLOBALS['phpgw_info']['etemplate']['dom_enabled'],
+                               'extension_data' => 
isset($GLOBALS['phpgw_info']['etemplate']['extension_data']) ? 
$GLOBALS['phpgw_info']['etemplate']['extension_data'] : '',
+                               'to_process' => 
isset($GLOBALS['phpgw_info']['etemplate']['to_process']) ? 
$GLOBALS['phpgw_info']['etemplate']['to_process'] : '',
+                               'java_script' => 
isset($GLOBALS['phpgw_info']['etemplate']['java_script']) ? 
$GLOBALS['phpgw_info']['etemplate']['java_script'] : '',
+                               'dom_enabled' => 
isset($GLOBALS['phpgw_info']['etemplate']['dom_enabled']) ? 
$GLOBALS['phpgw_info']['etemplate']['dom_enabled'] : '',
                                'method' => $method,
                                'hooked' => $hooked
                        ),$id);
@@ -356,13 +360,32 @@
                                else
                                {
                                        $cols = &$this->data[$r_key];
+                                       if(isset($opts["h$row"]))
+                                       {
                                        list($height,$disabled) = 
explode(',',$opts["h$row"]);
+                                       }
+                                       else
+                                       {
+                                               $height ='';
+                                               $disabled= '';
+                                       }
+                                       if(isset($opts["c$row"]))
+                                       {
                                        $class = $no_table_tr ? $tr_class : 
$opts["c$row"];
                                }
+                                       else
+                                       {
+                                               $class = '';
+                                       }
+                               }
                                if ($disabled != '' && 
$this->check_disabled($disabled,$content))
                                {
                                        continue;       // row is disabled
                                }
+                               if(!isset($rows[".$row"]))
+                               {
+                                       $rows[".$row"] = '';
+                               }
                                $rows[".$row"] .= 
$this->html->formatOptions($height,'HEIGHT');
                                list($cl) = explode(',',$class);
                                if ($cl == 'nmr' || $cl == 'row')
@@ -386,18 +409,33 @@
                                                        break;  // no 
auto-col-repeat
                                                }
                                        }
-                                       else
+                                       else if(isset($c_key) && 
isset($cols[$c_key]))
                                        {
                                                $cell = &$cols[$c_key];
+                                               if(isset($opts[$col]))
+                                               {
                                                list($col_width,$col_disabled) 
= explode(',',$opts[$col]);
+                                               }
+                                               else
+                                               {
+                                                       $col_width=0;
+                                                       $col_disabled=false;
+                                               }
                                                
-                                               if (!$cell['height'])   // if 
not set, cell-height = height of row
+                                               if (!isset($cell['height']))    
// if not set, cell-height = height of row
                                                {
                                                        $cell['height'] = 
$height;
                                                }
-                                               if (!$cell['width'])    // if 
not set, cell-width = width of column or table
+                                               if (!isset($cell['width']))     
// if not set, cell-width = width of column or table
+                                               {
+                                                       if(isset($cell['span']))
                                                {
                                                        list($col_span) = 
explode(',',$cell['span']);
+                                                       }
+                                                       else
+                                                       {
+                                                               $col_span = '';
+                                                       }
                                                        if ($col_span == 'all' 
&& !$c)
                                                        {
                                                                
list($cell['width']) = explode(',',$this->size);
@@ -423,7 +461,11 @@
                                                unset($row_data[$col]); // omit 
empty/disabled cells if only one row
                                                continue;
                                        }
-                                       if ($cell['onclick'])   // can only be 
set via source at the moment
+                                       if(!isset($row_data[".$col"]))
+                                       {
+                                               $row_data[".$col"] = '';
+                                       }
+                                       if (isset($cell['onclick']) && 
$cell['onclick'])        // can only be set via source at the moment
                                        {
                                                $row_data[".$col"] .= ' 
onClick="'.$cell['onclick'].'"';
 
@@ -443,6 +485,8 @@
                                        }
                                        else
                                        {
+                                               if(isset($opts[$col]))
+                                               {
                                                list($width,$disable) = 
explode(',',$opts[$col]);
                                                if ($width)             // 
width only once for a non colspan cell
                                                {
@@ -450,12 +494,20 @@
                                                        $opts[$col] = 
"0,$disable";
                                                }
                                        }
+                                       }
+                                       if(isset($cell['align']))
+                                       {
                                        $row_data[".$col"] .= 
$this->html->formatOptions($cell['align'],'ALIGN');
-                                       list(,$cl) = explode(',',$cell['span']);
+                                       }
+                                       if(isset($cell['span']))
+                                       {
+                                               $cl = 
explode(',',$cell['span']);
+                                               $cl = isset($cl[1]) ? $cl[1] : 
'';
                                        $cl = 
$this->expand_name(isset($this->class_conf[$cl]) ? $this->class_conf[$cl] : $cl,
                                                
$c,$r,$show_c,$show_row,$content);
                                        $row_data[".$col"] .= 
$this->html->formatOptions($cl,'CLASS');
                                }
+                               }
                                $rows[$row] = $row_data;
                        }
                        if 
(!$GLOBALS['phpgw_info']['etemplate']['styles_included'][$this->name])
@@ -488,13 +540,24 @@
                        {
                                echo 
"<p>etemplate.show_cell($this->name,name='${cell['name']}',type='${cell['type']}',cname='$cname')</p>\n";
                        }
+                       if(isset($cell['span']))
+                       {
                        list($span) = explode(',',$cell['span']);       // 
evtl. overriten later for type template
+                       }
+                       else
+                       {
+                               $span = '';
+                       }
 
+                       $name = '';
+                       if(isset($cell['name']))
+                       {
                        if ($cell['name'][0] == '@' && $cell['type'] != 
'template')
                        {
                                $cell['name'] = 
$this->get_array($content,substr($cell['name'],1));
                        }
                        $name = 
$this->expand_name($cell['name'],$show_c,$show_row,$content['.c'],$content['.row'],$content);
+                       }
 
                        $name_parts = explode('[',str_replace(']','',$name));
                        if (!empty($cname))

Index: class.html.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.html.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- class.html.inc.php  26 Feb 2006 21:29:50 -0000      1.23
+++ class.html.inc.php  6 Sep 2006 10:27:22 -0000       1.24
@@ -10,7 +10,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id: class.html.inc.php,v 1.23 2006/02/26 21:29:50 Caeies Exp $ */
+       /* $Id: class.html.inc.php,v 1.24 2006/09/06 10:27:22 Caeies Exp $ */
 
 class html
 {
@@ -83,6 +83,7 @@
 
        function input_hidden($vars,$value='',$ignore_empty=True)
        {
+               $html = '';
                if (!is_array($vars))
                {
                        $vars = array( $vars => $value );
@@ -179,8 +180,11 @@
                                $vars = array();
                        }
                }
+               if(strpos('?',$url) > 0)
+               {
                list($url,$v) = explode('?',$url);      // url may contain 
additional vars
-               if ($v)
+               }
+               if (isset($v))
                {
                        $vars += explode('&',$v);
                        foreach($vars as $k => $vv)
@@ -242,7 +246,10 @@
                        {
                                continue;                                       
// parameter
                        }
+                       if(isset($rows['.'.$key]))
+                       {
                        $html .= $no_table_tr && $key == 1 ? '' : "\t<TR 
".$rows['.'.$key].">\n";
+                       }
 
                        foreach($row as $key => $cell)
                        {
@@ -347,7 +354,7 @@
        {
                if (!is_array($options)) $options = explode(',',$options);
                if (!is_array($names))   $names   = explode(',',$names);
-
+               $html = '';
                while (list($n,$val) = each($options))
                        if ($val != '' && $names[$n] != '')
                                $html .= ' '.$names[$n].'="'.$val.'"';
@@ -372,10 +379,18 @@
        */
        function theme2css()
        {
-               return 
-                       ".th { background: 
".$GLOBALS['phpgw_info']['theme']['th_bg']."; font-weight: bold; }\n".
-                       ".row_on,.th_bright { background: 
".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n".
-                       ".row_off { background: 
".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n";
+               //XXX Temporary fix, Caeies
+               //if(isset($GLOBALS['phpgw_info']['theme']))
+               //{
+               //      return 
+               //              ".th { background: 
".$GLOBALS['phpgw_info']['theme']['th_bg']."; font-weight: bold; }\n".
+               //              ".row_on,.th_bright { background: 
".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n".
+               //              ".row_off { background: 
".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n";
+               //}
+               //else
+               //{
+                       return '';
+               //}
        }
 
        function style($styles)




reply via email to

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