- Timestamp:
- 2013/08/26 12:42:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/module/Calendar/Table/Helper.php
r20119 r23125 1 1 <?php 2 2 /* vim: set expandtab tabstop=4 shiftwidth=4: */ 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 // 3 22 4 /** 23 * @package Calendar 24 * @version $Id: Helper.php,v 1.5 2005/10/22 09:51:53 quipo Exp $ 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 25 37 */ 26 38 … … 28 40 * Used by Calendar_Month_Weekdays, Calendar_Month_Weeks and Calendar_Week to 29 41 * help with building the calendar in tabular form 30 * @package Calendar 31 * @access protected 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 32 50 */ 33 51 class Calendar_Table_Helper … … 91 109 /** 92 110 * Constructs Calendar_Table_Helper 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 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 * 95 115 * @access protected 96 116 */ … … 113 133 /** 114 134 * Constructs $this->daysOfWeek based on $this->firstDay 135 * 115 136 * @return void 116 137 * @access private … … 141 162 /** 142 163 * Constructs $this->daysOfMonth 164 * 143 165 * @return void 144 166 * @access private … … 175 197 /** 176 198 * Returns the first day of the month 199 * 200 * @return int 201 * @access protected 177 202 * @see Calendar_Engine_Interface::getFirstDayOfWeek() 178 * @return int179 * @access protected180 203 */ 181 204 function getFirstDay() … … 186 209 /** 187 210 * Returns the order array of days in a week 211 * 188 212 * @return int 189 213 * @access protected … … 196 220 /** 197 221 * Returns the number of tabular weeks in a month 222 * 198 223 * @return int 199 224 * @access protected … … 206 231 /** 207 232 * Returns the number of real days + empty days 233 * 208 234 * @return int 209 235 * @access protected … … 216 242 /** 217 243 * Returns the number of empty days before the real days begin 244 * 218 245 * @return int 219 246 * @access protected … … 226 253 /** 227 254 * Returns the index of the last real day in the month 255 * 228 256 * @todo Potential performance optimization with static 229 257 * @return int … … 233 261 { 234 262 // Causes bug when displaying more than one month 235 //static $index;236 //if (!isset($index)) {263 //static $index; 264 //if (!isset($index)) { 237 265 $index = $this->getEmptyDaysBefore() + $this->cE->getDaysInMonth( 238 266 $this->calendar->thisYear(), $this->calendar->thisMonth()); 239 //}267 //} 240 268 return $index; 241 269 } … … 244 272 * Returns the index of the last real day in the month, relative to the 245 273 * beginning of the tabular week it is part of 274 * 246 275 * @return int 247 276 * @access protected … … 255 284 $this->calendar->thisMonth(), 256 285 $this->calendar->thisDay() 257 ) * ($this->numWeeks-1) 286 ) * ($this->numWeeks-1)); 258 287 } 259 288 260 289 /** 261 290 * Returns the timestamp of the first day of the current week 291 * 292 * @param int $y year 293 * @param int $m month 294 * @param int $d day 295 * @param int $firstDay first day of the week (default 1 = Monday) 296 * 297 * @return int timestamp 262 298 */ 263 299 function getWeekStart($y, $m, $d, $firstDay=1)
Note: See TracChangeset
for help on using the changeset viewer.