Ignore:
Timestamp:
2013/08/28 13:55:43 (7 years ago)
Author:
m_uehara
Message:

#2348 r23140 をマージ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13_0/data/module/Calendar/Table/Helper.php

    r23126 r23143  
    11<?php 
    22/* 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// 
    422/** 
    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 $ 
    3725 */ 
    3826 
     
    4028 * Used by Calendar_Month_Weekdays, Calendar_Month_Weeks and Calendar_Week to 
    4129 * 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 
    5032 */ 
    5133class Calendar_Table_Helper 
     
    10991    /** 
    11092     * 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 
    11595     * @access protected 
    11696     */ 
     
    133113    /** 
    134114     * Constructs $this->daysOfWeek based on $this->firstDay 
    135      * 
    136115     * @return void 
    137116     * @access private 
     
    162141    /** 
    163142     * Constructs $this->daysOfMonth 
    164      * 
    165143     * @return void 
    166144     * @access private 
     
    197175    /** 
    198176     * Returns the first day of the month 
    199      * 
    200      * @return int 
    201      * @access protected 
    202177     * @see Calendar_Engine_Interface::getFirstDayOfWeek() 
     178     * @return int 
     179     * @access protected 
    203180     */ 
    204181    function getFirstDay() 
     
    209186    /** 
    210187     * Returns the order array of days in a week 
    211      * 
    212188     * @return int 
    213189     * @access protected 
     
    220196    /** 
    221197     * Returns the number of tabular weeks in a month 
    222      * 
    223198     * @return int 
    224199     * @access protected 
     
    231206    /** 
    232207     * Returns the number of real days + empty days 
    233      * 
    234208     * @return int 
    235209     * @access protected 
     
    242216    /** 
    243217     * Returns the number of empty days before the real days begin 
    244      * 
    245218     * @return int 
    246219     * @access protected 
     
    253226    /** 
    254227     * Returns the index of the last real day in the month 
    255      * 
    256228     * @todo Potential performance optimization with static 
    257229     * @return int 
     
    261233    { 
    262234        // Causes bug when displaying more than one month 
    263         //static $index; 
    264         //if (!isset($index)) { 
     235//        static $index; 
     236//        if (!isset($index)) { 
    265237            $index = $this->getEmptyDaysBefore() + $this->cE->getDaysInMonth( 
    266238                $this->calendar->thisYear(), $this->calendar->thisMonth()); 
    267         //} 
     239//        } 
    268240        return $index; 
    269241    } 
     
    272244     * Returns the index of the last real day in the month, relative to the 
    273245     * beginning of the tabular week it is part of 
    274      * 
    275246     * @return int 
    276247     * @access protected 
     
    284255                $this->calendar->thisMonth(), 
    285256                $this->calendar->thisDay() 
    286             ) * ($this->numWeeks-1)); 
     257            ) * ($this->numWeeks-1) ); 
    287258    } 
    288259 
    289260    /** 
    290261     * 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 
    298262     */ 
    299263    function getWeekStart($y, $m, $d, $firstDay=1) 
Note: See TracChangeset for help on using the changeset viewer.