phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: etemplate/inc class.date_widget.inc.php,1.3,1.4


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.date_widget.inc.php,1.3,1.4 class.datefield_widget.inc.php,1.4,1.5 class.nextmatch_widget.inc.php,1.6,1.7 class.tab_widget.inc.php,1.5,1.6 class.uietemplate.inc.php,1.20,1.21
Date: Tue, 24 Sep 2002 17:57:17 -0400

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

Modified Files:
        class.date_widget.inc.php class.datefield_widget.inc.php 
        class.nextmatch_widget.inc.php class.tab_widget.inc.php 
        class.uietemplate.inc.php 
Log Message:
changed interface for extensions to:
pre_process(&$cell,&$value,&$extension_data,&$readonlys)
post_process(&$cell,&$value,&$extension_data,&$loop)


Index: class.date_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.date_widget.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.date_widget.inc.php   2 Sep 2002 11:11:08 -0000       1.3
--- class.date_widget.inc.php   24 Sep 2002 21:57:15 -0000      1.4
***************
*** 45,49 ****
                }
  
!               function pre_process(&$cell,&$value,&$templ)
                {
                        if ($cell['size'] != '')
--- 45,49 ----
                }
  
!               function 
pre_process(&$cell,&$value,&$extension_data,&$readonlys)
                {
                        if ($cell['size'] != '')
***************
*** 75,79 ****
                }
  
!               function post_process(&$cell,&$value,&$templ)
                {
                        if (!isset($value))
--- 75,79 ----
                }
  
!               function post_process(&$cell,&$value,&$extension_data,&$loop)
                {
                        if (!isset($value))

Index: class.datefield_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.datefield_widget.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.datefield_widget.inc.php      2 Sep 2002 11:11:08 -0000       1.4
--- class.datefield_widget.inc.php      24 Sep 2002 21:57:15 -0000      1.5
***************
*** 31,35 ****
                }
  
!               function pre_process(&$cell,&$value,&$templ)
                {
                        if ($cell['size'] != '')
--- 31,35 ----
                }
  
!               function 
pre_process(&$cell,&$value,&$extension_data,&$readonlys)
                {
                        if ($cell['size'] != '')
***************
*** 70,74 ****
                }
  
!               function post_process(&$cell,&$value,&$templ)
                {
                        if (!isset($value))
--- 70,74 ----
                }
  
!               function post_process(&$cell,&$value,&$extension_data,&$loop)
                {
                        if (!isset($value))

Index: class.nextmatch_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.nextmatch_widget.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.nextmatch_widget.inc.php      24 Sep 2002 17:26:04 -0000      1.6
--- class.nextmatch_widget.inc.php      24 Sep 2002 21:57:15 -0000      1.7
***************
*** 32,40 ****
                }
  
!               function pre_process(&$cell,&$value,&$templ,&$readonlys)
                {
                        //echo "<p>nextmatch_widget.pre_process: value = "; 
_debug_array($value);
                        // save values in persistent extension_data to be able 
use it in post_process
!                       
$GLOBALS['phpgw_info']['etemplate']['extension_data']['nextmatch_widget'][$cell['name']]
 = $value;
  
                        list($app,$class,$method) = 
explode('.',$value['get_rows']);
--- 32,40 ----
                }
  
!               function 
pre_process(&$cell,&$value,&$extension_data,&$readonlys)
                {
                        //echo "<p>nextmatch_widget.pre_process: value = "; 
_debug_array($value);
                        // save values in persistent extension_data to be able 
use it in post_process
!                       $extension_data = $value;
  
                        list($app,$class,$method) = 
explode('.',$value['get_rows']);
***************
*** 46,50 ****
                                $total = 
$obj->$method($value,$value['rows'],$readonlys['rows']);
                        }
!                       
$GLOBALS['phpgw_info']['etemplate']['extension_data']['nextmatch_widget'][$cell['name']]['total']
 = $total;
  
                        if ($cell['size'])
--- 46,50 ----
                                $total = 
$obj->$method($value,$value['rows'],$readonlys['rows']);
                        }
!                       $extension_data['total'] = $total;
  
                        if ($cell['size'])
***************
*** 82,90 ****
                }
  
!               function post_process(&$cell,&$value,&$templ)
                {
                        //echo "<p>nextmatch_widget.post_process: value = "; 
_debug_array($value);
  
!                       $old_value = 
$GLOBALS['phpgw_info']['etemplate']['extension_data']['nextmatch_widget'][$cell['name']];
  
                        list($value['cat_id']) = $value['cat_id'];
--- 82,90 ----
                }
  
!               function post_process(&$cell,&$value,&$extension_data,&$loop)
                {
                        //echo "<p>nextmatch_widget.post_process: value = "; 
_debug_array($value);
  
!                       $old_value = $extension_data;
  
                        list($value['cat_id']) = $value['cat_id'];
***************
*** 94,98 ****
                        $max   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
  
!                       $templ->loop = False;
                        if ($value['start_search'] || $value['cat_id'] != 
$old_value['cat_id'] ||
                            $old_value['filter'] != '' && $value['filter'] != 
$old_value['filter'] ||
--- 94,98 ----
                        $max   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
  
!                       $loop = False;
                        if ($value['start_search'] || $value['cat_id'] != 
$old_value['cat_id'] ||
                            $old_value['filter'] != '' && $value['filter'] != 
$old_value['filter'] ||
***************
*** 102,126 ****
                                //echo "new filter --> loop</p>";
                                //_debug_array($old_value);
!                               $templ->loop = True;
                        }
                        elseif ($value['first'])
                        {
                                $value['start'] = 0;
!                               $templ->loop = True;
                        }
                        elseif ($value['left'])
                        {
                                $value['start'] = $old_value['start'] - $max;
!                               $templ->loop = True;
                        }
                        elseif ($value['right'])
                        {
                                $value['start'] = $old_value['start'] + $max;
!                               $templ->loop = True;
                        }
                        elseif ($value['last'])
                        {
                                $value['start'] = (int) 
(($old_value['total']-2) / $max) * $max;
!                               $templ->loop = True;
                        }
                        return True;
--- 102,126 ----
                                //echo "new filter --> loop</p>";
                                //_debug_array($old_value);
!                               $loop = True;
                        }
                        elseif ($value['first'])
                        {
                                $value['start'] = 0;
!                               $loop = True;
                        }
                        elseif ($value['left'])
                        {
                                $value['start'] = $old_value['start'] - $max;
!                               $loop = True;
                        }
                        elseif ($value['right'])
                        {
                                $value['start'] = $old_value['start'] + $max;
!                               $loop = True;
                        }
                        elseif ($value['last'])
                        {
                                $value['start'] = (int) 
(($old_value['total']-2) / $max) * $max;
!                               $loop = True;
                        }
                        return True;

Index: class.tab_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.tab_widget.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.tab_widget.inc.php    2 Sep 2002 11:11:09 -0000       1.5
--- class.tab_widget.inc.php    24 Sep 2002 21:57:15 -0000      1.6
***************
*** 32,36 ****
                }
  
!               function pre_process(&$cell,&$value,&$templ)
                {
                        $labels = explode('|',$cell['label']);
--- 32,36 ----
                }
  
!               function 
pre_process(&$cell,&$value,&$extension_data,&$readonlys)
                {
                        $labels = explode('|',$cell['label']);
***************
*** 51,55 ****
                                {
                                        // save selected tab in persistent 
extension_data to use it in post_process
!                                       
$GLOBALS['phpgw_info']['etemplate']['extension_data']['tab_widget'][$cell['name']]
 = $selected_tab = $name;
                                        $tcell['name'] = $tab_active;
                                }
--- 51,55 ----
                                {
                                        // save selected tab in persistent 
extension_data to use it in post_process
!                                       $extension_data = $selected_tab = $name;
                                        $tcell['name'] = $tab_active;
                                }
***************
*** 75,79 ****
                        {
                                $tab_row['A']['name'] = $tab_active;
!                               
$GLOBALS['phpgw_info']['etemplate']['extension_data']['tab_widget'][$cell['name']]
 = $selected_tab = $names[0];
                        }
                        $tabs->data[1] = $tab_row;
--- 75,79 ----
                        {
                                $tab_row['A']['name'] = $tab_active;
!                               $extension_data = $selected_tab = $names[0];
                        }
                        $tabs->data[1] = $tab_row;
***************
*** 93,103 ****
                }
  
!               function post_process(&$cell,&$value,&$templ)
                {
                        $old_value = array(
                                '_tab_widget' => array(
!                                       
$GLOBALS['phpgw_info']['etemplate']['extension_data']['tab_widget'][$cell['name']]
 => array(True)
                        ));
!                       $this->pre_process($cell,$old_value,$templ);
  
                        if (is_array($value['_tab_widget']))
--- 93,103 ----
                }
  
!               function post_process(&$cell,&$value,&$extension_data,&$loop)
                {
                        $old_value = array(
                                '_tab_widget' => array(
!                                       $extension_data => array(True)
                        ));
!                       
$this->pre_process($cell,$old_value,$extension_data,$dummy);
  
                        if (is_array($value['_tab_widget']))
***************
*** 107,116 ****
                                        if (is_array($val) && $val[0])
                                        {
!                                               $templ->loop = True;
                                        }
                                }
                        }
-                       //$templ->loop = is_array($value['_tab_widget']);
- 
                        return True;
                }
--- 107,114 ----
                                        if (is_array($val) && $val[0])
                                        {
!                                               $loop = True;
                                        }
                                }
                        }
                        return True;
                }

Index: class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** class.uietemplate.inc.php   24 Sep 2002 17:26:04 -0000      1.20
--- class.uietemplate.inc.php   24 Sep 2002 21:57:15 -0000      1.21
***************
*** 102,105 ****
--- 102,106 ----
                        $id = $this->appsession_id();
  
+                       $GLOBALS['phpgw_info']['etemplate']['loop'] = False;
                        $GLOBALS['phpgw_info']['etemplate']['form_options'] = 
'';       // might be set in show
                        $html .= 
$this->html->nextMatchStyles($this->style)."\n\n". // so they get included once
***************
*** 166,170 ****
                        //echo "process_exec($this->name) 
merge(changes,content) ="; _debug_array($content);
  
!                       if ($this->loop)
                        {
                                //echo "<p>process_exec($this->name): <font 
color=red>loop is set</font>, content=</p>\n"; _debug_array($content);
--- 167,171 ----
                        //echo "process_exec($this->name) 
merge(changes,content) ="; _debug_array($content);
  
!                       if ($GLOBALS['phpgw_info']['etemplate']['loop'])
                        {
                                //echo "<p>process_exec($this->name): <font 
color=red>loop is set</font>, content=</p>\n"; _debug_array($content);
***************
*** 365,369 ****
                            (isset($this->extension[$cell['type']]) || 
$this->loadExtension($cell['type'],$this)))
                        {
!                               $extra_label = 
$this->extension[$cell['type']]->pre_process($cell,$value,$this,$readonlys[$name]);
                                if (strstr($name,'|'))
                                {
--- 366,371 ----
                            (isset($this->extension[$cell['type']]) || 
$this->loadExtension($cell['type'],$this)))
                        {
!                               $extra_label = 
$this->extension[$cell['type']]->pre_process($cell,$value,
!                                       
$GLOBALS['phpgw_info']['etemplate']['extension_data'][$cell['type']][$cell['name']],$readonlys[$name]);
                                if (strstr($name,'|'))
                                {
***************
*** 458,462 ****
                                        {
                                                $html .= 
$this->html->input_hidden($form_name,'',False) . "\n";
!                                               $html .= '<a href="" 
onClick="set_element(document.eTemplate,\''.$form_name.'\',\'pressed\'); 
document.eTemplate.submit(); return false;">' .
                                                        (strlen($label) <= 1 || 
$cell['no_lang'] ? $label : lang($label)) . '</a>';
                                        }
--- 460,464 ----
                                        {
                                                $html .= 
$this->html->input_hidden($form_name,'',False) . "\n";
!                                               $html .= '<a href="" 
onClick="set_element(document.eTemplate,\''.$form_name.'\',\'pressed\'); 
document.eTemplate.submit(); return false;" '.$options.'>' .
                                                        (strlen($label) <= 1 || 
$cell['no_lang'] ? $label : lang($label)) . '</a>';
                                        }
***************
*** 755,759 ****
                                        echo "<p>value for 
$cell[type]::post_process: "; _debug_array($value);
                                }
!                               
$this->extension[$cell['type']]->post_process($cell,$value,$this);
  
                                if ($this->debug > 1 || $this->debug && 
$this->debug == $this->name)
--- 757,763 ----
                                        echo "<p>value for 
$cell[type]::post_process: "; _debug_array($value);
                                }
!                               
$this->extension[$cell['type']]->post_process($cell,$value,
!                                       
$GLOBALS['phpgw_info']['etemplate']['extension_data'][$cell['type']][$cell['name']],
!                                       
$GLOBALS['phpgw_info']['etemplate']['loop']);
  
                                if ($this->debug > 1 || $this->debug && 
$this->debug == $this->name)





reply via email to

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