@@ -104,7 +104,7 @@ |
||
| 104 | 104 | case 6: |
| 105 | 105 | case 9: |
| 106 | 106 | echo "</tr>\n<tr>\n"; |
| 107 | - break; |
|
| 107 | + break; |
|
| 108 | 108 | case 12: |
| 109 | 109 | echo "</tr>\n"; |
| 110 | 110 | break; |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | echo ( "<tr>\n" ); |
| 106 | 106 | |
| 107 | 107 | if ( $Day->isSelected() ) { |
| 108 | - echo ( "<td class=\"selected\">".$Day->thisDay()."</td>\n" ); |
|
| 108 | + echo ( "<td class=\"selected\">".$Day->thisDay()."</td>\n" ); |
|
| 109 | 109 | } else if ( $Day->isEmpty() ) { |
| 110 | 110 | echo ( "<td> </td>\n" ); |
| 111 | 111 | } else { |
@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | // Decorate a Month with methods to improve formatting |
| 16 | 16 | class MonthDecorator extends Calendar_Decorator { |
| 17 | 17 | /** |
| 18 | - * @param Calendar_Month |
|
| 19 | - */ |
|
| 18 | + * @param Calendar_Month |
|
| 19 | + */ |
|
| 20 | 20 | function MonthDecorator(& $Month) { |
| 21 | 21 | parent::Calendar_Decorator($Month); |
| 22 | 22 | } |
| 23 | 23 | /** |
| 24 | - * Override the prevMonth method to format the output |
|
| 25 | - */ |
|
| 24 | + * Override the prevMonth method to format the output |
|
| 25 | + */ |
|
| 26 | 26 | function prevMonth() { |
| 27 | 27 | $prevStamp = parent::prevMonth(TRUE); |
| 28 | 28 | // Build the URL for the previous month |
@@ -30,16 +30,16 @@ discard block |
||
| 30 | 30 | '&m='.date('n',$prevStamp).'&d='.date('j',$prevStamp); |
| 31 | 31 | } |
| 32 | 32 | /** |
| 33 | - * Override the thisMonth method to format the output |
|
| 34 | - */ |
|
| 33 | + * Override the thisMonth method to format the output |
|
| 34 | + */ |
|
| 35 | 35 | function thisMonth() { |
| 36 | 36 | $thisStamp = parent::thisMonth(TRUE); |
| 37 | 37 | // A human readable string from this month |
| 38 | 38 | return date('F Y',$thisStamp); |
| 39 | 39 | } |
| 40 | 40 | /** |
| 41 | - * Override the nextMonth method to format the output |
|
| 42 | - */ |
|
| 41 | + * Override the nextMonth method to format the output |
|
| 42 | + */ |
|
| 43 | 43 | function nextMonth() { |
| 44 | 44 | $nextStamp = parent::nextMonth(TRUE); |
| 45 | 45 | // Build the URL for next month |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | echo "<tr>\n"; |
| 112 | 112 | |
| 113 | 113 | if ($day->isSelected()) { |
| 114 | - echo '<td class="selected">'.$day->thisDay().'</td>'."\n"; |
|
| 114 | + echo '<td class="selected">'.$day->thisDay().'</td>'."\n"; |
|
| 115 | 115 | } else if ($day->isEmpty()) { |
| 116 | 116 | echo '<td> </td>'."\n"; |
| 117 | 117 | } else { |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | { |
| 20 | 20 | $this->__dispatch_map['getMonth'] = |
| 21 | 21 | array('in' => array('year' => 'int', 'month'=>'int'), |
| 22 | - 'out' => array('month' => '{urn:PEAR_SOAP_Calendar}Month'), |
|
| 23 | - ); |
|
| 22 | + 'out' => array('month' => '{urn:PEAR_SOAP_Calendar}Month'), |
|
| 23 | + ); |
|
| 24 | 24 | $this->__typedef['Month'] = array ( |
| 25 | 25 | 'monthname' => 'string', |
| 26 | 26 | 'days' => '{urn:PEAR_SOAP_Calendar}MonthDays' |
@@ -346,22 +346,22 @@ discard block |
||
| 346 | 346 | function prevWeek($format = 'n_in_month') |
| 347 | 347 | { |
| 348 | 348 | switch (strtolower($format)) { |
| 349 | - case 'int': |
|
| 350 | - case 'n_in_month': |
|
| 351 | - return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') -1; |
|
| 352 | - case 'n_in_year': |
|
| 353 | - return $this->cE->getWeekNInYear( |
|
| 354 | - $this->cE->stampToYear($this->prevWeek), |
|
| 355 | - $this->cE->stampToMonth($this->prevWeek), |
|
| 356 | - $this->cE->stampToDay($this->prevWeek)); |
|
| 357 | - case 'array': |
|
| 358 | - return $this->toArray($this->prevWeek); |
|
| 359 | - case 'object': |
|
| 360 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
| 361 | - return Factory::createByTimestamp('Week', $this->prevWeek); |
|
| 362 | - case 'timestamp': |
|
| 363 | - default: |
|
| 364 | - return $this->prevWeek; |
|
| 349 | + case 'int': |
|
| 350 | + case 'n_in_month': |
|
| 351 | + return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') -1; |
|
| 352 | + case 'n_in_year': |
|
| 353 | + return $this->cE->getWeekNInYear( |
|
| 354 | + $this->cE->stampToYear($this->prevWeek), |
|
| 355 | + $this->cE->stampToMonth($this->prevWeek), |
|
| 356 | + $this->cE->stampToDay($this->prevWeek)); |
|
| 357 | + case 'array': |
|
| 358 | + return $this->toArray($this->prevWeek); |
|
| 359 | + case 'object': |
|
| 360 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
| 361 | + return Factory::createByTimestamp('Week', $this->prevWeek); |
|
| 362 | + case 'timestamp': |
|
| 363 | + default: |
|
| 364 | + return $this->prevWeek; |
|
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
@@ -376,35 +376,35 @@ discard block |
||
| 376 | 376 | function thisWeek($format = 'n_in_month') |
| 377 | 377 | { |
| 378 | 378 | switch (strtolower($format)) { |
| 379 | - case 'int': |
|
| 380 | - case 'n_in_month': |
|
| 381 | - if ($this->firstWeek) { |
|
| 382 | - return 1; |
|
| 383 | - } |
|
| 384 | - if ($this->lastWeek) { |
|
| 385 | - return $this->cE->getWeeksInMonth( |
|
| 379 | + case 'int': |
|
| 380 | + case 'n_in_month': |
|
| 381 | + if ($this->firstWeek) { |
|
| 382 | + return 1; |
|
| 383 | + } |
|
| 384 | + if ($this->lastWeek) { |
|
| 385 | + return $this->cE->getWeeksInMonth( |
|
| 386 | + $this->thisYear(), |
|
| 387 | + $this->thisMonth(), |
|
| 388 | + $this->firstDay); |
|
| 389 | + } |
|
| 390 | + return $this->cE->getWeekNInMonth( |
|
| 386 | 391 | $this->thisYear(), |
| 387 | 392 | $this->thisMonth(), |
| 393 | + $this->thisDay(), |
|
| 388 | 394 | $this->firstDay); |
| 389 | - } |
|
| 390 | - return $this->cE->getWeekNInMonth( |
|
| 391 | - $this->thisYear(), |
|
| 392 | - $this->thisMonth(), |
|
| 393 | - $this->thisDay(), |
|
| 394 | - $this->firstDay); |
|
| 395 | - case 'n_in_year': |
|
| 396 | - return $this->cE->getWeekNInYear( |
|
| 397 | - $this->cE->stampToYear($this->thisWeek), |
|
| 398 | - $this->cE->stampToMonth($this->thisWeek), |
|
| 399 | - $this->cE->stampToDay($this->thisWeek)); |
|
| 400 | - case 'array': |
|
| 401 | - return $this->toArray($this->thisWeek); |
|
| 402 | - case 'object': |
|
| 403 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
| 404 | - return Factory::createByTimestamp('Week', $this->thisWeek); |
|
| 405 | - case 'timestamp': |
|
| 406 | - default: |
|
| 407 | - return $this->thisWeek; |
|
| 395 | + case 'n_in_year': |
|
| 396 | + return $this->cE->getWeekNInYear( |
|
| 397 | + $this->cE->stampToYear($this->thisWeek), |
|
| 398 | + $this->cE->stampToMonth($this->thisWeek), |
|
| 399 | + $this->cE->stampToDay($this->thisWeek)); |
|
| 400 | + case 'array': |
|
| 401 | + return $this->toArray($this->thisWeek); |
|
| 402 | + case 'object': |
|
| 403 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
| 404 | + return Factory::createByTimestamp('Week', $this->thisWeek); |
|
| 405 | + case 'timestamp': |
|
| 406 | + default: |
|
| 407 | + return $this->thisWeek; |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | |
@@ -419,22 +419,22 @@ discard block |
||
| 419 | 419 | function nextWeek($format = 'n_in_month') |
| 420 | 420 | { |
| 421 | 421 | switch (strtolower($format)) { |
| 422 | - case 'int': |
|
| 423 | - case 'n_in_month': |
|
| 424 | - return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') +1; |
|
| 425 | - case 'n_in_year': |
|
| 426 | - return $this->cE->getWeekNInYear( |
|
| 427 | - $this->cE->stampToYear($this->nextWeek), |
|
| 428 | - $this->cE->stampToMonth($this->nextWeek), |
|
| 429 | - $this->cE->stampToDay($this->nextWeek)); |
|
| 430 | - case 'array': |
|
| 431 | - return $this->toArray($this->nextWeek); |
|
| 432 | - case 'object': |
|
| 433 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
| 434 | - return Factory::createByTimestamp('Week', $this->nextWeek); |
|
| 435 | - case 'timestamp': |
|
| 436 | - default: |
|
| 437 | - return $this->nextWeek; |
|
| 422 | + case 'int': |
|
| 423 | + case 'n_in_month': |
|
| 424 | + return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') +1; |
|
| 425 | + case 'n_in_year': |
|
| 426 | + return $this->cE->getWeekNInYear( |
|
| 427 | + $this->cE->stampToYear($this->nextWeek), |
|
| 428 | + $this->cE->stampToMonth($this->nextWeek), |
|
| 429 | + $this->cE->stampToDay($this->nextWeek)); |
|
| 430 | + case 'array': |
|
| 431 | + return $this->toArray($this->nextWeek); |
|
| 432 | + case 'object': |
|
| 433 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
| 434 | + return Factory::createByTimestamp('Week', $this->nextWeek); |
|
| 435 | + case 'timestamp': |
|
| 436 | + default: |
|
| 437 | + return $this->nextWeek; |
|
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
@@ -96,41 +96,41 @@ |
||
| 96 | 96 | { |
| 97 | 97 | $firstDay = defined('CALENDAR_FIRST_DAY_OF_WEEK') ? CALENDAR_FIRST_DAY_OF_WEEK : 1; |
| 98 | 98 | switch ($type) { |
| 99 | - case 'Day': |
|
| 100 | - return new Day($y, $m, $d); |
|
| 101 | - case 'Month': |
|
| 102 | - // Set default state for which month type to build |
|
| 103 | - if (!defined('CALENDAR_MONTH_STATE')) { |
|
| 104 | - define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH); |
|
| 105 | - } |
|
| 106 | - switch (CALENDAR_MONTH_STATE) { |
|
| 107 | - case CALENDAR_USE_MONTH_WEEKDAYS: |
|
| 108 | - $class = 'Calendar_Month_Weekdays'; |
|
| 109 | - break; |
|
| 110 | - case CALENDAR_USE_MONTH_WEEKS: |
|
| 111 | - $class = 'Calendar_Month_Weeks'; |
|
| 112 | - break; |
|
| 113 | - case CALENDAR_USE_MONTH: |
|
| 114 | - default: |
|
| 115 | - $class = 'Pear\Calendar\Month'; |
|
| 116 | - break; |
|
| 117 | - } |
|
| 99 | + case 'Day': |
|
| 100 | + return new Day($y, $m, $d); |
|
| 101 | + case 'Month': |
|
| 102 | + // Set default state for which month type to build |
|
| 103 | + if (!defined('CALENDAR_MONTH_STATE')) { |
|
| 104 | + define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH); |
|
| 105 | + } |
|
| 106 | + switch (CALENDAR_MONTH_STATE) { |
|
| 107 | + case CALENDAR_USE_MONTH_WEEKDAYS: |
|
| 108 | + $class = 'Calendar_Month_Weekdays'; |
|
| 109 | + break; |
|
| 110 | + case CALENDAR_USE_MONTH_WEEKS: |
|
| 111 | + $class = 'Calendar_Month_Weeks'; |
|
| 112 | + break; |
|
| 113 | + case CALENDAR_USE_MONTH: |
|
| 114 | + default: |
|
| 115 | + $class = 'Pear\Calendar\Month'; |
|
| 116 | + break; |
|
| 117 | + } |
|
| 118 | 118 | return new $class($y, $m, $firstDay); |
| 119 | - case 'Week': |
|
| 120 | - return new Week($y, $m, $d, $firstDay); |
|
| 121 | - case 'Hour': |
|
| 122 | - return new Hour($y, $m, $d, $h); |
|
| 123 | - case 'Minute': |
|
| 124 | - return new Minute($y, $m, $d, $h, $i); |
|
| 125 | - case 'Second': |
|
| 126 | - return new Second($y, $m, $d, $h, $i, $s); |
|
| 127 | - case 'Year': |
|
| 128 | - return new Year($y); |
|
| 129 | - default: |
|
| 130 | - include_once 'PEAR.php'; |
|
| 131 | - PEAR::raiseError('Calendar_Factory::create() unrecognised type: '.$type, |
|
| 132 | - null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Factory::create()'); |
|
| 133 | - return false; |
|
| 119 | + case 'Week': |
|
| 120 | + return new Week($y, $m, $d, $firstDay); |
|
| 121 | + case 'Hour': |
|
| 122 | + return new Hour($y, $m, $d, $h); |
|
| 123 | + case 'Minute': |
|
| 124 | + return new Minute($y, $m, $d, $h, $i); |
|
| 125 | + case 'Second': |
|
| 126 | + return new Second($y, $m, $d, $h, $i, $s); |
|
| 127 | + case 'Year': |
|
| 128 | + return new Year($y); |
|
| 129 | + default: |
|
| 130 | + include_once 'PEAR.php'; |
|
| 131 | + PEAR::raiseError('Calendar_Factory::create() unrecognised type: '.$type, |
|
| 132 | + null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Factory::create()'); |
|
| 133 | + return false; |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | $stamp = mktime(0, 0, 0, $i, 1, 2003); |
| 97 | 97 | $month = strftime($formats[$format], $stamp); |
| 98 | 98 | switch($format) { |
| 99 | - case 'one': |
|
| 100 | - $month = substr($month, 0, 1); |
|
| 101 | - break; |
|
| 102 | - case 'two': |
|
| 103 | - $month = substr($month, 0, 2); |
|
| 104 | - break; |
|
| 99 | + case 'one': |
|
| 100 | + $month = substr($month, 0, 1); |
|
| 101 | + break; |
|
| 102 | + case 'two': |
|
| 103 | + $month = substr($month, 0, 2); |
|
| 104 | + break; |
|
| 105 | 105 | } |
| 106 | 106 | $months[$i] = $month; |
| 107 | 107 | } |
@@ -133,12 +133,12 @@ discard block |
||
| 133 | 133 | $stamp = mktime(0, 0, 0, 11, $i+2, 2003); |
| 134 | 134 | $day = strftime($formats[$format], $stamp); |
| 135 | 135 | switch($format) { |
| 136 | - case 'one': |
|
| 137 | - $day = substr($day, 0, 1); |
|
| 138 | - break; |
|
| 139 | - case 'two': |
|
| 140 | - $day = substr($day, 0, 2); |
|
| 141 | - break; |
|
| 136 | + case 'one': |
|
| 137 | + $day = substr($day, 0, 1); |
|
| 138 | + break; |
|
| 139 | + case 'two': |
|
| 140 | + $day = substr($day, 0, 2); |
|
| 141 | + break; |
|
| 142 | 142 | } |
| 143 | 143 | $days[$i] = $day; |
| 144 | 144 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | * |
| 394 | 394 | * @return int e.g. 4 or Unix timestamp |
| 395 | 395 | * @access public |
| 396 | - */ |
|
| 396 | + */ |
|
| 397 | 397 | function prevMonth($format = 'int') |
| 398 | 398 | { |
| 399 | 399 | return $this->calendar->prevMonth($format); |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | * |
| 433 | 433 | * @return int e.g. 4 or Unix timestamp |
| 434 | 434 | * @access public |
| 435 | - */ |
|
| 435 | + */ |
|
| 436 | 436 | function prevWeek($format = 'n_in_month') |
| 437 | 437 | { |
| 438 | 438 | if ( method_exists($this->calendar, 'prevWeek')) { |