phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: etemplate/inc class.html.inc.php,1.9,1.10 class.


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.html.inc.php,1.9,1.10 class.uietemplate.inc.php,1.34,1.35
Date: Thu, 03 Oct 2002 12:52:45 -0400

Update of /cvsroot/phpgroupware/etemplate/inc
In directory subversions:/tmp/cvs-serv26698

Modified Files:
        class.html.inc.php class.uietemplate.inc.php 
Log Message:
added extra-row for single-line selectbox in options and ability to have 
select-options set by an extension and by $sel_options or 
$content["options-$name"
changed names of theme-css-styles to be compatible with ceb's changes, 
html::themeStyles is used for 0.9.14

Index: class.html.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.html.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.html.inc.php  2 Oct 2002 00:44:33 -0000       1.9
--- class.html.inc.php  3 Oct 2002 16:52:42 -0000       1.10
***************
*** 275,288 ****
  
        /*!
!       @function nextMatchStyles
        @abstract returns simple stylesheet for nextmatch row-colors
!       @result the classes 'nmh' = nextmatch header, 'nmr0'+'nmr1' = 
alternating rows
        */
!       function nextMatchStyles()
        {
                return $this->style(
!                       ".nmh { background: 
".$GLOBALS['phpgw_info']['theme']['th_bg']."; }\n".
!                       ".nmr1 { background: 
".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n".
!                       ".nmr0 { background: 
".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n"
                );
        }
--- 275,288 ----
  
        /*!
!       @function themeStyles
        @abstract returns simple stylesheet for nextmatch row-colors
!       @result the classes 'th' = nextmatch header, 'row_on'+'row_off' = 
alternating rows
        */
!       function themeStyles()
        {
                return $this->style(
!                       ".th { background: 
".$GLOBALS['phpgw_info']['theme']['th_bg']."; }\n".
!                       ".row_on { background: 
".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n".
!                       ".row_off { background: 
".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n"
                );
        }

Index: class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** class.uietemplate.inc.php   2 Oct 2002 00:44:33 -0000       1.34
--- class.uietemplate.inc.php   3 Oct 2002 16:52:42 -0000       1.35
***************
*** 56,61 ****
                        list($a,$b,$c,$d) = 
explode('.',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
                        //echo "Version: $a.$b.$c.$d\n";
!                       if ($this->stable = $a <= 0 && $b <= 9 && $c <= 14)
!                               $this->class_conf = array();
                }
  
--- 56,60 ----
                        list($a,$b,$c,$d) = 
explode('.',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
                        //echo "Version: $a.$b.$c.$d\n";
!                       $this->stable = $a <= 0 && $b <= 9 && $c <= 14;
                }
  
***************
*** 104,108 ****
                        $GLOBALS['phpgw_info']['etemplate']['form_options'] = 
'';       // might be set in show
                        $GLOBALS['phpgw_info']['etemplate']['to_process'] = 
array();
!                       $html .= ($this->stable ? 
$this->html->nextMatchStyles()."\n\n" : ''). // so they get included once
                                $this->html->form($this->include_java_script() .
                                        
$this->show($this->complete_array_merge($content,$changes),$sel_options,$readonlys,'exec'),array(
--- 103,107 ----
                        $GLOBALS['phpgw_info']['etemplate']['form_options'] = 
'';       // might be set in show
                        $GLOBALS['phpgw_info']['etemplate']['to_process'] = 
array();
!                       $html .= ($this->stable ? 
$this->html->themeStyles()."\n\n" : ''). // so they get included once
                                $this->html->form($this->include_java_script() .
                                        
$this->show($this->complete_array_merge($content,$changes),$sel_options,$readonlys,'exec'),array(
***************
*** 296,302 ****
                                $rows[".$row"] .= 
$this->html->formatOptions($height,'HEIGHT');
                                list($cl) = explode(',',$class);
!                               if ($cl == 'nmr')
                                {
!                                       $cl .= $nmr_alternate++ & 1; // 
alternate color
                                }
                                $cl = isset($this->class_conf[$cl]) ? 
$this->class_conf[$cl] : $cl;
--- 295,301 ----
                                $rows[".$row"] .= 
$this->html->formatOptions($height,'HEIGHT');
                                list($cl) = explode(',',$class);
!                               if ($cl == 'nmr' || $cl == 'row')
                                {
!                                       $cl = 'row_'.($nmr_alternate++ & 1 ? 
'off' : 'on'); // alternate color
                                }
                                $cl = isset($this->class_conf[$cl]) ? 
$this->class_conf[$cl] : $cl;
***************
*** 567,608 ****
                                        break;
                                case 'select':  // size:[linesOnMultiselect]
                                        if (!empty($cell['sel_options']))
                                        {
!                                               if (!is_array($cell))
                                                {
-                                                       $sel_options = array();
                                                        $opts = 
explode(',',$cell['sel_options']);
                                                        while (list(,$opt) = 
each($opts))
                                                        {
                                                                list($k,$v) = 
explode('=',$opt);
!                                                               
$sel_options[$k] = $v;
                                                        }
                                                }
                                                else
                                                {
!                                                       $sel_options = 
$cell['sel_options'];
                                                }
                                        }
!                                       elseif (isset($sel_options[$name]))
                                        {
!                                               $sel_options = 
$sel_options[$name];
                                        }
                                        elseif (isset($sel_options[$org_name]))
                                        {
!                                               $sel_options = 
$sel_options[$org_name];
                                        }
!                                       elseif 
(isset($content["options-$name"]))
                                        {
!                                               $sel_options = 
$content["options-$name"];
                                        }
-                                       list($multiple) = 
explode(',',$cell['size']);
- 
                                        if ($readonly)
                                        {
!                                               $html .= $cell['no_lang'] ? 
$sel_options[$value] : lang($sel_options[$value]);
                                        }
                                        else
                                        {
!                                               $html .= 
$this->html->select($form_name.($multiple > 1 ? '[]' : ''),$value,$sel_options,
                                                        
$cell['no_lang'],$options,$multiple);
                                                
$GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name] = $cell['type'];
--- 566,611 ----
                                        break;
                                case 'select':  // size:[linesOnMultiselect]
+                                       $sels = array();
+                                       list($multiple) = 
explode(',',$cell['size']);
+                                       if (!empty($multiple) && 0+$multiple <= 
0)
+                                       {
+                                               $sels[''] = $multiple < 0 ? 
lang('all') : lang($multiple);
+                                               $multiple = 0;
+                                       }
                                        if (!empty($cell['sel_options']))
                                        {
!                                               if 
(!is_array($cell['sel_options']))
                                                {
                                                        $opts = 
explode(',',$cell['sel_options']);
                                                        while (list(,$opt) = 
each($opts))
                                                        {
                                                                list($k,$v) = 
explode('=',$opt);
!                                                               $sels[$k] = $v;
                                                        }
                                                }
                                                else
                                                {
!                                                       $sels += 
$cell['sel_options'];
                                                }
                                        }
!                                       if (isset($sel_options[$name]))
                                        {
!                                               $sels += $sel_options[$name];
                                        }
                                        elseif (isset($sel_options[$org_name]))
                                        {
!                                               $sels += 
$sel_options[$org_name];
                                        }
!                                       if (isset($content["options-$name"]))
                                        {
!                                               $sels += 
$content["options-$name"];
                                        }
                                        if ($readonly)
                                        {
!                                               $html .= $cell['no_lang'] ? 
$sels[$value] : lang($sels[$value]);
                                        }
                                        else
                                        {
!                                               $html .= 
$this->html->select($form_name.($multiple > 1 ? '[]' : ''),$value,$sels,
                                                        
$cell['no_lang'],$options,$multiple);
                                                
$GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name] = $cell['type'];





reply via email to

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