Index: branches/version-2_13_0/data/module/Calendar/Decorator.php
===================================================================
--- branches/version-2_13_0/data/module/Calendar/Decorator.php	(revision 23126)
+++ branches/version-2_13_0/data/module/Calendar/Decorator.php	(revision 23143)
@@ -1,40 +1,27 @@
 <?php
 /* vim: set expandtab tabstop=4 shiftwidth=4: */
-
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Harry Fuecks <hfuecks@phppatterns.com>                      |
+// +----------------------------------------------------------------------+
+//
+// $Id: Decorator.php,v 1.3 2005/10/22 10:29:46 quipo Exp $
+//
 /**
- * Contains the Calendar_Decorator class
- *
- * PHP versions 4 and 5
- *
- * LICENSE: Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * @category  Date and Time
- * @package   Calendar
- * @author    Harry Fuecks <hfuecks@phppatterns.com>
- * @copyright 2003-2007 Harry Fuecks
- * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
- * @version   CVS: $Id: Decorator.php 300729 2010-06-24 12:05:53Z quipo $
- * @link      http://pear.php.net/package/Calendar
+ * @package Calendar
+ * @version $Id: Decorator.php,v 1.3 2005/10/22 10:29:46 quipo Exp $
  */
-
 /**
  * Decorates any calendar class.
@@ -50,16 +37,10 @@
  *     }
  * }
- * $Day = new Calendar_Day(2003, 10, 25);
- * $DayDecorator = new DayDecorator($Day);
+ * $Day = & new Calendar_Day(2003, 10, 25);
+ * $DayDecorator = & new DayDecorator($Day);
  * echo $DayDecorator->thisDay(); // Outputs "Sat"
  * </code>
- *
- * @category  Date and Time
- * @package   Calendar
- * @author    Harry Fuecks <hfuecks@phppatterns.com>
- * @copyright 2003-2007 Harry Fuecks
- * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
- * @link      http://pear.php.net/package/Calendar
  * @abstract
+ * @package Calendar
  */
 class Calendar_Decorator
@@ -74,8 +55,7 @@
     /**
      * Constructs the Calendar_Decorator
-     *
-     * @param object &$calendar subclass to Calendar to decorate
-     */
-    function Calendar_Decorator(&$calendar)
+     * @param object subclass to Calendar to decorate
+     */
+    function Calendar_Decorator(& $calendar)
     {
         $this->calendar = & $calendar;
@@ -85,7 +65,5 @@
      * Defines the calendar by a Unix timestamp, replacing values
      * passed to the constructor
-     *
-     * @param int $ts Unix timestamp
-     *
+     * @param int Unix timestamp
      * @return void
      * @access public
@@ -99,6 +77,5 @@
      * Returns a timestamp from the current date / time values. Format of
      * timestamp depends on Calendar_Engine implementation being used
-     *
-     * @return int $ts timestamp
+     * @return int timestamp
      * @access public
      */
@@ -110,7 +87,5 @@
     /**
      * Defines calendar object as selected (e.g. for today)
-     *
-     * @param boolean $state whether Calendar subclass must be selected
-     *
+     * @param boolean state whether Calendar subclass
      * @return void
      * @access public
@@ -123,5 +98,4 @@
     /**
      * True if the calendar subclass object is selected (e.g. today)
-     *
      * @return boolean
      * @access public
@@ -134,5 +108,4 @@
     /**
      * Adjusts the date (helper method)
-     *
      * @return void
      * @access public
@@ -145,11 +118,9 @@
     /**
      * Returns the date as an associative array (helper method)
-     *
-     * @param mixed $stamp timestamp (leave empty for current timestamp)
-     *
+     * @param mixed timestamp (leave empty for current timestamp)
      * @return array
      * @access public
      */
-    function toArray($stamp = null)
+    function toArray($stamp=null)
     {
         return $this->calendar->toArray($stamp);
@@ -158,10 +129,8 @@
     /**
      * Returns the value as an associative array (helper method)
-     *
-     * @param string  $returnType type of date object that return value represents
-     * @param string  $format     ['int'|'timestamp'|'object'|'array']
-     * @param mixed   $stamp      timestamp (depending on Calendar engine being used)
-     * @param integer $default    default value (i.e. give me the answer quick)
-     *
+     * @param string type of date object that return value represents
+     * @param string $format ['int' | 'array' | 'timestamp' | 'object']
+     * @param mixed timestamp (depending on Calendar engine being used)
+     * @param int integer default value (i.e. give me the answer quick)
      * @return mixed
      * @access private
@@ -175,13 +144,11 @@
      * Defines Day object as first in a week
      * Only used by Calendar_Month_Weekdays::build()
-     *
-     * @param boolean $state whether it's first or not
-     *
+     * @param boolean state
      * @return void
      * @access private
      */
-    function setFirst($state = true)
-    {
-        if (method_exists($this->calendar, 'setFirst')) {
+    function setFirst ($state = true)
+    {
+        if ( method_exists($this->calendar,'setFirst') ) {
             $this->calendar->setFirst($state);
         }
@@ -191,7 +158,5 @@
      * Defines Day object as last in a week
      * Used only following Calendar_Month_Weekdays::build()
-     *
-     * @param boolean $state whether it's last or not
-     *
+     * @param boolean state
      * @return void
      * @access private
@@ -199,5 +164,5 @@
     function setLast($state = true)
     {
-        if (method_exists($this->calendar, 'setLast')) {
+        if ( method_exists($this->calendar,'setLast') ) {
             $this->calendar->setLast($state);
         }
@@ -207,11 +172,9 @@
      * Returns true if Day object is first in a Week
      * Only relevant when Day is created by Calendar_Month_Weekdays::build()
-     *
      * @return boolean
      * @access public
      */
-    function isFirst()
-    {
-        if (method_exists($this->calendar, 'isFirst')) {
+    function isFirst() {
+        if ( method_exists($this->calendar,'isFirst') ) {
             return $this->calendar->isFirst();
         }
@@ -221,5 +184,4 @@
      * Returns true if Day object is last in a Week
      * Only relevant when Day is created by Calendar_Month_Weekdays::build()
-     *
      * @return boolean
      * @access public
@@ -227,5 +189,5 @@
     function isLast()
     {
-        if (method_exists($this->calendar, 'isLast')) {
+        if ( method_exists($this->calendar,'isLast') ) {
             return $this->calendar->isLast();
         }
@@ -235,7 +197,5 @@
      * Defines Day object as empty
      * Only used by Calendar_Month_Weekdays::build()
-     *
-     * @param boolean $state whether it's empty or not
-     *
+     * @param boolean state
      * @return void
      * @access private
@@ -243,5 +203,5 @@
     function setEmpty ($state = true)
     {
-        if (method_exists($this->calendar, 'setEmpty')) {
+        if ( method_exists($this->calendar,'setEmpty') ) {
             $this->calendar->setEmpty($state);
         }
@@ -249,6 +209,4 @@
 
     /**
-     * Check if the current object is empty
-     *
      * @return boolean
      * @access public
@@ -256,5 +214,5 @@
     function isEmpty()
     {
-        if (method_exists($this->calendar, 'isEmpty')) {
+        if ( method_exists($this->calendar,'isEmpty') ) {
             return $this->calendar->isEmpty();
         }
@@ -263,7 +221,5 @@
     /**
      * Build the children
-     *
-     * @param array $sDates array containing Calendar objects to select (optional)
-     *
+     * @param array containing Calendar objects to select (optional)
      * @return boolean
      * @access public
@@ -280,5 +236,4 @@
      * the collection, returns false and resets the collection for
      * further iteratations.
-     *
      * @return mixed either an object subclass of Calendar or false
      * @access public
@@ -291,5 +246,4 @@
     /**
      * Fetches all child from the current collection of children
-     *
      * @return array
      * @access public
@@ -301,6 +255,6 @@
 
     /**
-     * Get the number Calendar subclass objects stored in the internal collection
-     *
+     * Get the number Calendar subclass objects stored in the internal
+     * collection.
      * @return int
      * @access public
@@ -313,6 +267,6 @@
     /**
      * Determine whether this date is valid, with the bounds determined by
-     * the Calendar_Engine. The call is passed on to Calendar_Validator::isValid
-     *
+     * the Calendar_Engine. The call is passed on to
+     * Calendar_Validator::isValid
      * @return boolean
      * @access public
@@ -325,5 +279,4 @@
     /**
      * Returns an instance of Calendar_Validator
-     *
      * @return Calendar_Validator
      * @access public
@@ -338,5 +291,4 @@
      * Returns a reference to the current Calendar_Engine being used. Useful
      * for Calendar_Table_Helper and Calendar_Validator
-     *
      * @return object implementing Calendar_Engine_Inteface
      * @access private
@@ -344,13 +296,10 @@
     function & getEngine()
     {
-        $engine = $this->calendar->getEngine();
-        return $engine;
+        return $this->calendar->getEngine();
     }
 
     /**
      * Returns the value for the previous year
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 2002 or timestamp
      * @access public
@@ -363,7 +312,5 @@
     /**
      * Returns the value for this year
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 2003 or timestamp
      * @access public
@@ -376,7 +323,5 @@
     /**
      * Returns the value for next year
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 2004 or timestamp
      * @access public
@@ -389,7 +334,5 @@
     /**
      * Returns the value for the previous month
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 4 or Unix timestamp
      * @access public
@@ -402,7 +345,5 @@
     /**
      * Returns the value for this month
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 5 or timestamp
      * @access public
@@ -415,7 +356,5 @@
     /**
      * Returns the value for next month
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 6 or timestamp
      * @access public
@@ -428,7 +367,5 @@
     /**
      * Returns the value for the previous week
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 4 or Unix timestamp
      * @access public
@@ -436,8 +373,8 @@
     function prevWeek($format = 'n_in_month')
     {
-        if ( method_exists($this->calendar, 'prevWeek')) {
+        if ( method_exists($this->calendar,'prevWeek') ) {
             return $this->calendar->prevWeek($format);
         } else {
-            include_once 'PEAR.php';
+            require_once 'PEAR.php';
             PEAR::raiseError(
                 'Cannot call prevWeek on Calendar object of type: '.
@@ -450,7 +387,5 @@
     /**
      * Returns the value for this week
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 5 or timestamp
      * @access public
@@ -458,8 +393,8 @@
     function thisWeek($format = 'n_in_month')
     {
-        if ( method_exists($this->calendar, 'thisWeek')) {
+        if ( method_exists($this->calendar,'thisWeek') ) {
             return $this->calendar->thisWeek($format);
         } else {
-            include_once 'PEAR.php';
+            require_once 'PEAR.php';
             PEAR::raiseError(
                 'Cannot call thisWeek on Calendar object of type: '.
@@ -472,7 +407,5 @@
     /**
      * Returns the value for next week
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 6 or timestamp
      * @access public
@@ -480,8 +413,8 @@
     function nextWeek($format = 'n_in_month')
     {
-        if ( method_exists($this->calendar, 'nextWeek')) {
+        if ( method_exists($this->calendar,'nextWeek') ) {
             return $this->calendar->nextWeek($format);
         } else {
-            include_once 'PEAR.php';
+            require_once 'PEAR.php';
             PEAR::raiseError(
                 'Cannot call thisWeek on Calendar object of type: '.
@@ -494,12 +427,9 @@
     /**
      * Returns the value for the previous day
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 10 or timestamp
      * @access public
      */
-    function prevDay($format = 'int')
-    {
+    function prevDay($format = 'int') {
         return $this->calendar->prevDay($format);
     }
@@ -507,7 +437,5 @@
     /**
      * Returns the value for this day
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 11 or timestamp
      * @access public
@@ -520,7 +448,5 @@
     /**
      * Returns the value for the next day
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 12 or timestamp
      * @access public
@@ -533,7 +459,5 @@
     /**
      * Returns the value for the previous hour
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 13 or timestamp
      * @access public
@@ -546,7 +470,5 @@
     /**
      * Returns the value for this hour
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 14 or timestamp
      * @access public
@@ -559,7 +481,5 @@
     /**
      * Returns the value for the next hour
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 14 or timestamp
      * @access public
@@ -572,7 +492,5 @@
     /**
      * Returns the value for the previous minute
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 23 or timestamp
      * @access public
@@ -585,7 +503,5 @@
     /**
      * Returns the value for this minute
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 24 or timestamp
      * @access public
@@ -598,11 +514,9 @@
     /**
      * Returns the value for the next minute
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 25 or timestamp
      * @access public
      */
-    function nextMinute($format = 'int')
+   function nextMinute($format = 'int')
     {
         return $this->calendar->nextMinute($format);
@@ -611,7 +525,5 @@
     /**
      * Returns the value for the previous second
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 43 or timestamp
      * @access public
@@ -624,7 +536,5 @@
     /**
      * Returns the value for this second
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 44 or timestamp
      * @access public
@@ -637,7 +547,5 @@
     /**
      * Returns the value for the next second
-     *
-     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
-     *
+     * @param string return value format ['int' | 'timestamp' | 'object' | 'array']
      * @return int e.g. 45 or timestamp
      * @access public
