phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: etemplate/inc class.xul_io.inc.php,1.6,1.7


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.xul_io.inc.php,1.6,1.7
Date: Tue, 17 Sep 2002 05:12:47 -0400

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

Modified Files:
        class.xul_io.inc.php 
Log Message:
added <listbox> tag for multiline-selects,
moved attributs from <menupopup> to <menulist> (execpt options and id)
added several options for the predefined phpgw selects like cats or accounts
changed the referenz.html accourdingly

Index: class.xul_io.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.xul_io.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.xul_io.inc.php        16 Sep 2002 23:05:15 -0000      1.6
--- class.xul_io.inc.php        17 Sep 2002 09:12:45 -0000      1.7
***************
*** 30,34 ****
                                'type' => '',   // this is the widget-name => 
dont write as attr
                                'disabled' => 'disabled=true',
!                               'readonly' => 'readonly=true'
                        );
                        $this->widget2xul = array(      // how to translate 
widget-names and widget-spec. attr.
--- 30,35 ----
                                'type' => '',   // this is the widget-name => 
dont write as attr
                                'disabled' => 'disabled=true',
!                               'readonly' => 'readonly=true',
!                               'size' => 'options'
                        );
                        $this->widget2xul = array(      // how to translate 
widget-names and widget-spec. attr.
***************
*** 57,61 ****
                                ),
                                'select' => array(
!                                       '.name' => 'menulist,menupopup'
                                ),
                                'template' => array(
--- 58,66 ----
                                ),
                                'select' => array(
!                                       '.name' => 'menulist,menupopup',
!                               ),
!                               'select-multi' => array(        // 
multiselection, if size > 0
!                                       '.name' => 'listbox',
!                                       'size'  => 'rows'
                                ),
                                'template' => array(
***************
*** 73,76 ****
--- 78,82 ----
                        $this->xul2widget = array(
                                'menupopup' => 'select',
+                               'listbox' => 'select',
                                'description' => 'label'
                        );
***************
*** 150,162 ****
                                                list(,$type) = each($type);
                                        }
                                        $widgetattr2xul = 
isset($this->widget2xul[$type]) ? $this->widget2xul[$type] : array();
                                        $type = isset($widgetattr2xul['.name']) 
? $widgetattr2xul['.name'] : $type;
                                        list($parent,$child,$child2) = 
explode(',',$type);
!                                       $widget = new xmlnode($child ? $child : 
$parent);
                                        if ($child2)
                                        {
                                                $child2 = new xmlnode($child2);
-                                               $child  = $widget;
-                                               $widget = new xmlnode($parent);
                                        }
                                        if (isset($widgetattr2xul['.set']))     
// set default-attr for type
--- 156,174 ----
                                                list(,$type) = each($type);
                                        }
+                                       if (substr($type,0,6) == 'select')
+                                       {
+                                               $type = $cell['size'] > 1 ? 
'select-multi' : 'select';
+                                       }
                                        $widgetattr2xul = 
isset($this->widget2xul[$type]) ? $this->widget2xul[$type] : array();
                                        $type = isset($widgetattr2xul['.name']) 
? $widgetattr2xul['.name'] : $type;
                                        list($parent,$child,$child2) = 
explode(',',$type);
!                                       $widget = new xmlnode($parent);
!                                       if ($child)
!                                       {
!                                               $child = new xmlnode($child);
!                                       }
                                        if ($child2)
                                        {
                                                $child2 = new xmlnode($child2);
                                        }
                                        if (isset($widgetattr2xul['.set']))     
// set default-attr for type
***************
*** 169,174 ****
                                                }
                                        }
!                                       if ($parent == 'tabbox')
                                        {
                                                $labels = 
explode('|',$cell['label']);  unset($cell['label']);
                                                $helps  = 
explode('|',$cell['help']);   unset($cell['help']);
--- 181,187 ----
                                                }
                                        }
!                                       switch ($parent)
                                        {
+                                       case 'tabbox':
                                                $labels = 
explode('|',$cell['label']);  unset($cell['label']);
                                                $helps  = 
explode('|',$cell['help']);   unset($cell['help']);
***************
*** 185,188 ****
--- 198,219 ----
                                                        
$child2->add_node($grid);
                                                }
+                                               break;
+                                       case 'menulist':        // id,options 
belongs to the 'menupopup' child
+                                               
$child->set_attribute('id',$cell['name']); unset($cell['name']);
+                                               if (isset($cell['size']) && 
$cell['size'] != '')
+                                               {
+                                                       
$child->set_attribute('options',$cell['size']); unset($cell['size']);
+                                               }
+                                               if ($cell['type'] != 'select')  
// one of the sub-types
+                                               {
+                                                       
$child->set_attribute('type',$cell['type']);
+                                               }
+                                               break;
+                                       case 'menulist':
+                                               if ($cell['type'] != 'select')  
// one of the sub-types
+                                               {
+                                                       
$widget->set_attribute('type',$cell['type']);
+                                               }
+                                               break;
                                        }
                                        while (list($attr,$val) = each($cell))
***************
*** 202,220 ****
                                                
$this->set_attributes($widget,$attr,$val,&$spanned);
                                        }
!                                       if ($child && !$child2)
                                        {
!                                               $parent = new xmlnode($parent);
!                                               $parent->add_node($widget);
!                                               $xul_row->add_node($parent);
                                        }
!                                       else
                                        {
!                                               if ($child2)
!                                               {
!                                                       
$widget->add_node($child);
!                                                       
$widget->add_node($child2);
!                                               }
!                                               $xul_row->add_node($widget);
                                        }
                                }
                                $xul_rows->add_node($xul_row);
--- 233,245 ----
                                                
$this->set_attributes($widget,$attr,$val,&$spanned);
                                        }
!                                       if ($child)
                                        {
!                                               $widget->add_node($child);
                                        }
!                                       if ($child2)
                                        {
!                                               $widget->add_node($child2);
                                        }
+                                       $xul_row->add_node($widget);
                                }
                                $xul_rows->add_node($xul_row);
***************
*** 234,238 ****
                        $xml = $doc->dump_mem();
  
!                       if ($this->debug)
                        {
                                echo "<pre>\n" . htmlentities($xml) . 
"\n</pre>\n";
--- 259,263 ----
                        $xml = $doc->dump_mem();
  
!                       //if ($this->debug)
                        {
                                echo "<pre>\n" . htmlentities($xml) . 
"\n</pre>\n";
***************
*** 272,280 ****
                                        $attr['name'] = $attr['id']; 
unset($attr['id']);
                                }
                                if ($tag == 'grid' && $type == 'complete' && 
!is_array($tab_attr))
                                {
                                        $tag = 'template';
                                }
!                               if ($tag != 'textbox')
                                {
                                        $attr['type'] = $this->xul2widget[$tag] 
? $this->xul2widget[$tag] : $tag;
--- 297,309 ----
                                        $attr['name'] = $attr['id']; 
unset($attr['id']);
                                }
+                               if (isset($attr['options']) && $attr['options'] 
!= '')
+                               {
+                                       $attr['size'] = $attr['options']; 
unset($attr['options']);
+                               }
                                if ($tag == 'grid' && $type == 'complete' && 
!is_array($tab_attr))
                                {
                                        $tag = 'template';
                                }
!                               if ($tag != 'textbox' && !isset($attr['type']))
                                {
                                        $attr['type'] = $this->xul2widget[$tag] 
? $this->xul2widget[$tag] : $tag;
***************
*** 312,316 ****
                                        case 'columns':
                                        case 'rows':
-                                       case 'menulist':
                                                break;
                                        case 'column':
--- 341,344 ----
***************
*** 368,371 ****
--- 396,402 ----
                                                }
                                                break;
+                                       case 'menulist':
+                                               $menulist_attr = $attr; // save 
for following menupopup
+                                               break;
                                        case 'textbox':
                                                if ($attr['multiline'])
***************
*** 404,407 ****
--- 435,448 ----
                                                                $attr['label'] 
= $attr['src'];
                                                                
unset($attr['src']);
+                                                               break;
+                                                       case 'listbox':
+                                                               $attr['size'] = 
$attr['rows'];
+                                                               
unset($attr['rows']);
+                                                               break;
+                                                       case 'menupopup':
+                                                               if 
(is_array($menulist_attr))
+                                                               {
+                                                                       $attr 
+= $menulist_attr;
+                                                               }
                                                                break;
                                                }





reply via email to

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