- Timestamp:
- 2013/08/28 13:26:44 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/module/Calendar/Table/Helper.php
r23125 r23141 1 1 <?php 2 2 /* vim: set expandtab tabstop=4 shiftwidth=4: */ 3 3 // 4 // +----------------------------------------------------------------------+ 5 // | PHP Version 4 | 6 // +----------------------------------------------------------------------+ 7 // | Copyright (c) 1997-2002 The PHP Group | 8 // +----------------------------------------------------------------------+ 9 // | This source file is subject to version 2.02 of the PHP license, | 10 // | that is bundled with this package in the file LICENSE, and is | 11 // | available at through the world-wide-web at | 12 // | http://www.php.net/license/3_0.txt. | 13 // | If you did not receive a copy of the PHP license and are unable to | 14 // | obtain it through the world-wide-web, please send a note to | 15 // | license@php.net so we can mail you a copy immediately. | 16 // +----------------------------------------------------------------------+ 17 // | Authors: Harry Fuecks <hfuecks@phppatterns.com> | 18 // +----------------------------------------------------------------------+ 19 // 20 // $Id: Helper.php,v 1.5 2005/10/22 09:51:53 quipo Exp $ 21 // 4 22 /** 5 * Contains the Calendar_Decorator_Wrapper class 6 * 7 * PHP versions 4 and 5 8 * 9 * LICENSE: Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. The name of the author may not be used to endorse or promote products 17 * derived from this software without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED 20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 * IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * 30 * @category Date and Time 31 * @package Calendar 32 * @author Harry Fuecks <hfuecks@phppatterns.com> 33 * @copyright 2003-2007 Harry Fuecks 34 * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) 35 * @version CVS: $Id: Helper.php 246317 2007-11-16 20:05:32Z quipo $ 36 * @link http://pear.php.net/package/Calendar 23 * @package Calendar 24 * @version $Id: Helper.php,v 1.5 2005/10/22 09:51:53 quipo Exp $ 37 25 */ 38 26 … … 40 28 * Used by Calendar_Month_Weekdays, Calendar_Month_Weeks and Calendar_Week to 41 29 * help with building the calendar in tabular form 42 * 43 * @category Date and Time 44 * @package Calendar 45 * @author Harry Fuecks <hfuecks@phppatterns.com> 46 * @copyright 2003-2007 Harry Fuecks 47 * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) 48 * @link http://pear.php.net/package/Calendar 49 * @access public 30 * @package Calendar 31 * @access protected 50 32 */ 51 33 class Calendar_Table_Helper … … 109 91 /** 110 92 * Constructs Calendar_Table_Helper 111 * 112 * @param object &$calendar Calendar_Month_Weekdays, Calendar_Month_Weeks, Calendar_Week 113 * @param int $firstDay (optional) first day of the week e.g. 1 for Monday 114 * 93 * @param object Calendar_Month_Weekdays, Calendar_Month_Weeks, Calendar_Week 94 * @param int (optional) first day of the week e.g. 1 for Monday 115 95 * @access protected 116 96 */ … … 133 113 /** 134 114 * Constructs $this->daysOfWeek based on $this->firstDay 135 *136 115 * @return void 137 116 * @access private … … 162 141 /** 163 142 * Constructs $this->daysOfMonth 164 *165 143 * @return void 166 144 * @access private … … 197 175 /** 198 176 * Returns the first day of the month 199 *200 * @return int201 * @access protected202 177 * @see Calendar_Engine_Interface::getFirstDayOfWeek() 178 * @return int 179 * @access protected 203 180 */ 204 181 function getFirstDay() … … 209 186 /** 210 187 * Returns the order array of days in a week 211 *212 188 * @return int 213 189 * @access protected … … 220 196 /** 221 197 * Returns the number of tabular weeks in a month 222 *223 198 * @return int 224 199 * @access protected … … 231 206 /** 232 207 * Returns the number of real days + empty days 233 *234 208 * @return int 235 209 * @access protected … … 242 216 /** 243 217 * Returns the number of empty days before the real days begin 244 *245 218 * @return int 246 219 * @access protected … … 253 226 /** 254 227 * Returns the index of the last real day in the month 255 *256 228 * @todo Potential performance optimization with static 257 229 * @return int … … 261 233 { 262 234 // Causes bug when displaying more than one month 263 //static $index;264 //if (!isset($index)) {235 // static $index; 236 // if (!isset($index)) { 265 237 $index = $this->getEmptyDaysBefore() + $this->cE->getDaysInMonth( 266 238 $this->calendar->thisYear(), $this->calendar->thisMonth()); 267 //}239 // } 268 240 return $index; 269 241 } … … 272 244 * Returns the index of the last real day in the month, relative to the 273 245 * beginning of the tabular week it is part of 274 *275 246 * @return int 276 247 * @access protected … … 284 255 $this->calendar->thisMonth(), 285 256 $this->calendar->thisDay() 286 ) * ($this->numWeeks-1) );257 ) * ($this->numWeeks-1) ); 287 258 } 288 259 289 260 /** 290 261 * Returns the timestamp of the first day of the current week 291 *292 * @param int $y year293 * @param int $m month294 * @param int $d day295 * @param int $firstDay first day of the week (default 1 = Monday)296 *297 * @return int timestamp298 262 */ 299 263 function getWeekStart($y, $m, $d, $firstDay=1)
Note: See TracChangeset
for help on using the changeset viewer.