phpgroupware-cvs
[Top][All Lists]
Advanced

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

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


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.boetemplate.inc.php,1.9,1.10
Date: Sat, 15 Jun 2002 08:52:35 -0400

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

Modified Files:
        class.boetemplate.inc.php 
Log Message:
added functions get_cell_attribute and set_cell_attribute to get and set an 
attribute in a named cell.
changed disable_cell to use set_cell_attribute

Index: class.boetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.boetemplate.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.boetemplate.inc.php   15 Jun 2002 09:21:55 -0000      1.9
--- class.boetemplate.inc.php   15 Jun 2002 12:52:33 -0000      1.10
***************
*** 60,64 ****
  
                        $this->public_functions += array(
!                               'disable_cells' => True
                        );
                }
--- 60,65 ----
  
                        $this->public_functions += array(
!                               'disable_cells' => True,
!                               'set_cell_attribute' => True
                        );
                }
***************
*** 208,215 ****
  
                /*!
!               @function disable_cells($name)
!               @abstract disables all cells with name == $name
                */
!               function disable_cells($name)
                {
                        reset($this->data);
--- 209,266 ----
  
                /*!
!               @function get_cell_attribute($name,$attr)
!               @abstract gets an attribute in a named cell
!               @returns the attribute or False if named cell not found
                */
!               function get_cell_attribute($name,$attr)
!               {
!                       reset($this->data);
!          while(list($row,$cols) = each($this->data))
!                       {
!                               while(list($col,$cell) = each($cols))
!                               {
!                                       if ($cell['name'] == $name)
!                                       {
!                                               reset($this->data);
!                                               return 
$this->data[$row][$col][$attr];
!                                       }
!                               }
!                       }
!                       reset($this->data);
! 
!                       return False;
!               }
! 
!               /*!
!               @function set_cell_attribute($name,$attr,$val)
!               @abstract set an attribute in a named cell
!               @returns the number of changed cells
!               */
!               function set_cell_attribute($name,$attr,$val)
!               {
!                       reset($this->data);
!                       $n = 0;
!          while(list($row,$cols) = each($this->data))
!                       {
!                               while(list($col,$cell) = each($cols))
!                               {
!                                       if ($cell['name'] == $name)
!                                       {
!                                               $this->data[$row][$col][$attr] 
= $val;
!                                               ++$n;
!                                       }
!                               }
!                       }
!                       reset($this->data);
! 
!                       return $n;
!               }
! 
!               /*!
!               @function set_cell_attribute($name,$attr,$val)
!               @abstract set an attribute in a named cell
!               @returns the number of changed cells
!               */
!               function set_cell_attribute($name,$attr,$val)
                {
                        reset($this->data);
***************
*** 221,225 ****
                                        if ($cell['name'] == $name)
                                        {
!                                               
$this->data[$row][$col]['disabled'] = True;
                                                ++$n;
                                        }
--- 272,276 ----
                                        if ($cell['name'] == $name)
                                        {
!                                               $this->data[$row][$col][$attr] 
= $val;
                                                ++$n;
                                        }
***************
*** 229,232 ****
--- 280,292 ----
  
                        return $n;
+               }
+ 
+               /*!
+               @function disable_cells($name)
+               @abstract disables all cells with name == $name
+               */
+               function disable_cells($name)
+               {
+                       return $this->set_cell_attribute($name,'disabled',True);
                }
  




reply via email to

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