@@ -2,10 +2,10 @@ |
||
| 2 | 2 | /** |
| 3 | 3 | * Description: simple example on i18N. |
| 4 | 4 | */ |
| 5 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 5 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 6 | 6 | define('CALENDAR_ROOT', '../../'); |
| 7 | 7 | } |
| 8 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 8 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 9 | 9 | |
| 10 | 10 | $Day = new Calendar_Day(2003, 10, 23); |
| 11 | 11 | |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | list($usec, $sec) = explode(' ', microtime()); |
| 8 | 8 | |
| 9 | - return (float)$usec + (float)$sec; |
|
| 9 | + return (float) $usec + (float) $sec; |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | $start = getmicrotime(); |
| 13 | 13 | |
| 14 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 14 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 15 | 15 | define('CALENDAR_ROOT', '../../'); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -require_once CALENDAR_ROOT . 'Year.php'; |
|
| 19 | -require_once CALENDAR_ROOT . 'Month/Weeks.php'; |
|
| 18 | +require_once CALENDAR_ROOT.'Year.php'; |
|
| 19 | +require_once CALENDAR_ROOT.'Month/Weeks.php'; |
|
| 20 | 20 | |
| 21 | 21 | define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH_WEEKS); |
| 22 | 22 | |
@@ -124,20 +124,20 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | echo "<td>\n<table class=\"month\">\n"; |
| 127 | - echo '<caption class="month">' . date('F', $Month->thisMonth(true)) . '</caption>'; |
|
| 128 | - echo '<colgroup><col class="weekNumbers"><col span="7"></colgroup>' . "\n"; |
|
| 127 | + echo '<caption class="month">'.date('F', $Month->thisMonth(true)).'</caption>'; |
|
| 128 | + echo '<colgroup><col class="weekNumbers"><col span="7"></colgroup>'."\n"; |
|
| 129 | 129 | echo "<tr>\n<th>Week</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>"; |
| 130 | 130 | $Month->build(); |
| 131 | 131 | while ($Week = $Month->fetch()) { |
| 132 | 132 | echo "<tr>\n"; |
| 133 | - echo '<td>' . $Week->thisWeek($_GET['week_type']) . "</td>\n"; |
|
| 133 | + echo '<td>'.$Week->thisWeek($_GET['week_type'])."</td>\n"; |
|
| 134 | 134 | $Week->build(); |
| 135 | 135 | |
| 136 | 136 | while ($Day = $Week->fetch()) { |
| 137 | 137 | if ($Day->isEmpty()) { |
| 138 | 138 | echo "<td> </td>\n"; |
| 139 | 139 | } else { |
| 140 | - echo '<td>' . $Day->thisDay() . "</td>\n"; |
|
| 140 | + echo '<td>'.$Day->thisDay()."</td>\n"; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -7,20 +7,20 @@ discard block |
||
| 7 | 7 | { |
| 8 | 8 | list($usec, $sec) = explode(' ', microtime()); |
| 9 | 9 | |
| 10 | - return (float)$usec + (float)$sec; |
|
| 10 | + return (float) $usec + (float) $sec; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | $start = getmicrotime(); |
| 14 | 14 | |
| 15 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 15 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 16 | 16 | define('CALENDAR_ROOT', '../../'); |
| 17 | 17 | } |
| 18 | -require_once CALENDAR_ROOT . 'Year.php'; |
|
| 19 | -require_once CALENDAR_ROOT . 'Month.php'; |
|
| 20 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 21 | -require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 22 | -require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 23 | -require_once CALENDAR_ROOT . 'Second.php'; |
|
| 18 | +require_once CALENDAR_ROOT.'Year.php'; |
|
| 19 | +require_once CALENDAR_ROOT.'Month.php'; |
|
| 20 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 21 | +require_once CALENDAR_ROOT.'Hour.php'; |
|
| 22 | +require_once CALENDAR_ROOT.'Minute.php'; |
|
| 23 | +require_once CALENDAR_ROOT.'Second.php'; |
|
| 24 | 24 | |
| 25 | 25 | // Initialize if not set |
| 26 | 26 | if (!isset($_POST['y'])) { |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | if (\Xmf\Request::hasVar('update', 'POST')) { |
| 54 | 54 | $Second = new Calendar_Second($_POST['y'], $_POST['m'], $_POST['d'], $_POST['h'], $_POST['i'], $_POST['s']); |
| 55 | 55 | if (!$Second->isValid()) { |
| 56 | - $V =& $Second->getValidator(); |
|
| 56 | + $V = & $Second->getValidator(); |
|
| 57 | 57 | echo '<p>Validation failed:</p>'; |
| 58 | 58 | while ($error = $V->fetch()) { |
| 59 | - echo $error->toString() . '<br>'; |
|
| 59 | + echo $error->toString().'<br>'; |
|
| 60 | 60 | } |
| 61 | 61 | } else { |
| 62 | 62 | echo '<p>Validation success.</p>'; |
| 63 | - echo '<p>New timestamp is: ' . $Second->getTimestamp() . ' which could be used to update a database, for example'; |
|
| 63 | + echo '<p>New timestamp is: '.$Second->getTimestamp().' which could be used to update a database, for example'; |
|
| 64 | 64 | } |
| 65 | 65 | } else { |
| 66 | 66 | $Year = new Calendar_Year($_POST['y']); |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | $Year->build($selection); |
| 79 | 79 | while ($Child = $Year->fetch()) { |
| 80 | 80 | if ($Child->isSelected()) { |
| 81 | - echo '<option value="' . $Child->thisMonth() . '" selected>' . $Child->thisMonth() . "\n"; |
|
| 81 | + echo '<option value="'.$Child->thisMonth().'" selected>'.$Child->thisMonth()."\n"; |
|
| 82 | 82 | } else { |
| 83 | - echo '<option value="' . $Child->thisMonth() . '">' . $Child->thisMonth() . "\n"; |
|
| 83 | + echo '<option value="'.$Child->thisMonth().'">'.$Child->thisMonth()."\n"; |
|
| 84 | 84 | } |
| 85 | 85 | } ?> |
| 86 | 86 | </select> |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | $Month->build($selection); |
| 91 | 91 | while ($Child = $Month->fetch()) { |
| 92 | 92 | if ($Child->isSelected()) { |
| 93 | - echo '<option value="' . $Child->thisDay() . '" selected>' . $Child->thisDay() . "\n"; |
|
| 93 | + echo '<option value="'.$Child->thisDay().'" selected>'.$Child->thisDay()."\n"; |
|
| 94 | 94 | } else { |
| 95 | - echo '<option value="' . $Child->thisDay() . '">' . $Child->thisDay() . "\n"; |
|
| 95 | + echo '<option value="'.$Child->thisDay().'">'.$Child->thisDay()."\n"; |
|
| 96 | 96 | } |
| 97 | 97 | } ?> |
| 98 | 98 | </select> |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | $Day->build($selection); |
| 103 | 103 | while ($Child = $Day->fetch()) { |
| 104 | 104 | if ($Child->isSelected()) { |
| 105 | - echo '<option value="' . $Child->thisHour() . '" selected>' . $Child->thisHour() . "\n"; |
|
| 105 | + echo '<option value="'.$Child->thisHour().'" selected>'.$Child->thisHour()."\n"; |
|
| 106 | 106 | } else { |
| 107 | - echo '<option value="' . $Child->thisHour() . '">' . $Child->thisHour() . "\n"; |
|
| 107 | + echo '<option value="'.$Child->thisHour().'">'.$Child->thisHour()."\n"; |
|
| 108 | 108 | } |
| 109 | 109 | } ?> |
| 110 | 110 | </select> |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | $Hour->build($selection); |
| 115 | 115 | while ($Child = $Hour->fetch()) { |
| 116 | 116 | if ($Child->isSelected()) { |
| 117 | - echo '<option value="' . $Child->thisMinute() . '" selected>' . $Child->thisMinute() . "\n"; |
|
| 117 | + echo '<option value="'.$Child->thisMinute().'" selected>'.$Child->thisMinute()."\n"; |
|
| 118 | 118 | } else { |
| 119 | - echo '<option value="' . $Child->thisMinute() . '">' . $Child->thisMinute() . "\n"; |
|
| 119 | + echo '<option value="'.$Child->thisMinute().'">'.$Child->thisMinute()."\n"; |
|
| 120 | 120 | } |
| 121 | 121 | } ?> |
| 122 | 122 | </select> |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | $Minute->build($selection); |
| 127 | 127 | while ($Child = $Minute->fetch()) { |
| 128 | 128 | if ($Child->isSelected()) { |
| 129 | - echo '<option value="' . $Child->thisSecond() . '" selected>' . $Child->thisSecond() . "\n"; |
|
| 129 | + echo '<option value="'.$Child->thisSecond().'" selected>'.$Child->thisSecond()."\n"; |
|
| 130 | 130 | } else { |
| 131 | - echo '<option value="' . $Child->thisSecond() . '">' . $Child->thisSecond() . "\n"; |
|
| 131 | + echo '<option value="'.$Child->thisSecond().'">'.$Child->thisSecond()."\n"; |
|
| 132 | 132 | } |
| 133 | 133 | } ?> |
| 134 | 134 | </select> |
@@ -136,6 +136,6 @@ discard block |
||
| 136 | 136 | <?php |
| 137 | 137 | } |
| 138 | 138 | ?> |
| 139 | - <?php echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; ?> |
|
| 139 | + <?php echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; ?> |
|
| 140 | 140 | </body> |
| 141 | 141 | </html> |
@@ -2,22 +2,22 @@ |
||
| 2 | 2 | /** |
| 3 | 3 | * Description: demonstrates using the Weekday decorator. |
| 4 | 4 | */ |
| 5 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 5 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 6 | 6 | define('CALENDAR_ROOT', '../../'); |
| 7 | 7 | } |
| 8 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 9 | -require_once CALENDAR_ROOT . 'Decorator/Weekday.php'; |
|
| 8 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 9 | +require_once CALENDAR_ROOT.'Decorator/Weekday.php'; |
|
| 10 | 10 | |
| 11 | 11 | $Day = new Calendar_Day(date('Y'), date('n'), date('d')); |
| 12 | 12 | $WeekDay = new Calendar_Decorator_Weekday($Day); |
| 13 | 13 | // $WeekDay->setFirstDay(0); // Make Sunday first Day |
| 14 | 14 | |
| 15 | -echo 'Yesterday: ' . $WeekDay->prevWeekDay() . '<br>'; |
|
| 16 | -echo 'Today: ' . $WeekDay->thisWeekDay() . '<br>'; |
|
| 17 | -echo 'Tomorrow: ' . $WeekDay->nextWeekDay() . '<br>'; |
|
| 15 | +echo 'Yesterday: '.$WeekDay->prevWeekDay().'<br>'; |
|
| 16 | +echo 'Today: '.$WeekDay->thisWeekDay().'<br>'; |
|
| 17 | +echo 'Tomorrow: '.$WeekDay->nextWeekDay().'<br>'; |
|
| 18 | 18 | |
| 19 | 19 | $WeekDay->build(); |
| 20 | 20 | echo 'Hours today:<br>'; |
| 21 | 21 | while ($Hour = $WeekDay->fetch()) { |
| 22 | - echo $Hour->thisHour() . '<br>'; |
|
| 22 | + echo $Hour->thisHour().'<br>'; |
|
| 23 | 23 | } |
@@ -3,12 +3,12 @@ discard block |
||
| 3 | 3 | * Description: demonstrates a decorator used to "attach a payload" to a selection |
| 4 | 4 | * to make it available when iterating over calendar children. |
| 5 | 5 | */ |
| 6 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 6 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 7 | 7 | define('CALENDAR_ROOT', '../../'); |
| 8 | 8 | } |
| 9 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 10 | -require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 11 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
| 9 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 10 | +require_once CALENDAR_ROOT.'Hour.php'; |
|
| 11 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
| 12 | 12 | |
| 13 | 13 | // Decorator to "attach" functionality to selected hours |
| 14 | 14 | |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | FROM |
| 55 | 55 | diary |
| 56 | 56 | WHERE |
| 57 | - eventtime >= '" . $Day->thisDay(true) . "' |
|
| 57 | + eventtime >= '" . $Day->thisDay(true)."' |
|
| 58 | 58 | AND |
| 59 | - eventtime < '" . $Day->nextDay(true) . "';"; |
|
| 59 | + eventtime < '" . $Day->nextDay(true)."';"; |
|
| 60 | 60 | |
| 61 | 61 | // An array simulating data from a database |
| 62 | 62 | $result = [ |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // If the hour is selected, call the decorator method... |
| 114 | 114 | if ($Hour->isSelected()) { |
| 115 | - echo '<td bgcolor="silver">' . $Hour->getEntry() . "</td>\n"; |
|
| 115 | + echo '<td bgcolor="silver">'.$Hour->getEntry()."</td>\n"; |
|
| 116 | 116 | } else { |
| 117 | 117 | echo "<td> </td>\n"; |
| 118 | 118 | } |
@@ -8,10 +8,10 @@ discard block |
||
| 8 | 8 | { |
| 9 | 9 | list($usec, $sec) = explode(' ', microtime()); |
| 10 | 10 | |
| 11 | - return (float)$usec + (float)$sec; |
|
| 11 | + return (float) $usec + (float) $sec; |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 14 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 15 | 15 | define('CALENDAR_ROOT', '../../'); |
| 16 | 16 | } |
| 17 | 17 | |
@@ -39,33 +39,33 @@ discard block |
||
| 39 | 39 | $_GET['view'] = 'calendar_year'; |
| 40 | 40 | // no break |
| 41 | 41 | case 'calendar_year': |
| 42 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
| 42 | + require_once CALENDAR_ROOT.'Year.php'; |
|
| 43 | 43 | $c = new Calendar_Year($_GET['y']); |
| 44 | 44 | break; |
| 45 | 45 | case 'calendar_month': |
| 46 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
| 46 | + require_once CALENDAR_ROOT.'Month.php'; |
|
| 47 | 47 | $c = new Calendar_Month($_GET['y'], $_GET['m']); |
| 48 | 48 | break; |
| 49 | 49 | case 'calendar_day': |
| 50 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 50 | + require_once CALENDAR_ROOT.'Day.php'; |
|
| 51 | 51 | $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
| 52 | 52 | break; |
| 53 | 53 | case 'calendar_hour': |
| 54 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 54 | + require_once CALENDAR_ROOT.'Hour.php'; |
|
| 55 | 55 | $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
| 56 | 56 | break; |
| 57 | 57 | case 'calendar_minute': |
| 58 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 58 | + require_once CALENDAR_ROOT.'Minute.php'; |
|
| 59 | 59 | $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
| 60 | 60 | break; |
| 61 | 61 | case 'calendar_second': |
| 62 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
| 62 | + require_once CALENDAR_ROOT.'Second.php'; |
|
| 63 | 63 | $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
| 64 | 64 | break; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | -echo 'Viewing: ' . @$_GET['view'] . '<br>'; |
|
| 68 | -echo 'The time is now: ' . date('Y M d H:i:s', $c->getTimestamp()) . '<br >'; |
|
| 67 | +echo 'Viewing: '.@$_GET['view'].'<br>'; |
|
| 68 | +echo 'The time is now: '.date('Y M d H:i:s', $c->getTimestamp()).'<br >'; |
|
| 69 | 69 | |
| 70 | 70 | $i = 1; |
| 71 | 71 | echo '<h1>First Iteration</h1>'; |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | $c->build(); |
| 76 | 76 | while ($e = $c->fetch()) { |
| 77 | 77 | $class = strtolower(get_class($e)); |
| 78 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 79 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 80 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 78 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 79 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 80 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 81 | 81 | if (0 == ($i % 10)) { |
| 82 | 82 | echo '<br>'; |
| 83 | 83 | } |
| 84 | 84 | ++$i; |
| 85 | 85 | } |
| 86 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 86 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
| 87 | 87 | |
| 88 | 88 | $i = 1; |
| 89 | 89 | echo '<h1>Second Iteration</h1>'; |
@@ -92,12 +92,12 @@ discard block |
||
| 92 | 92 | $start = getmicrotime(); |
| 93 | 93 | while ($e = $c->fetch()) { |
| 94 | 94 | $class = strtolower(get_class($e)); |
| 95 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 96 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 97 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 95 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 96 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 97 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 98 | 98 | if (0 == ($i % 10)) { |
| 99 | 99 | echo '<br>'; |
| 100 | 100 | } |
| 101 | 101 | ++$i; |
| 102 | 102 | } |
| 103 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 103 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | { |
| 8 | 8 | list($usec, $sec) = explode(' ', microtime()); |
| 9 | 9 | |
| 10 | - return (float)$usec + (float)$sec; |
|
| 10 | + return (float) $usec + (float) $sec; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | $start = getmicrotime(); |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | // Force UnixTs engine (default setting) |
| 16 | 16 | define('CALENDAR_ENGINE', 'UnixTS'); |
| 17 | 17 | |
| 18 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 18 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 19 | 19 | define('CALENDAR_ROOT', '../../'); |
| 20 | 20 | } |
| 21 | -require_once CALENDAR_ROOT . 'Month/Weeks.php'; |
|
| 22 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 21 | +require_once CALENDAR_ROOT.'Month/Weeks.php'; |
|
| 22 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 23 | 23 | |
| 24 | 24 | // Initialize GET variables if not set |
| 25 | 25 | if (!isset($_GET['y'])) { |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | // Construct strings for next/previous links |
| 50 | 50 | $PMonth = $Month->prevMonth('object'); // Get previous month as object |
| 51 | -$prev = $_SERVER['PHP_SELF'] . '?y=' . $PMonth->thisYear() . '&m=' . $PMonth->thisMonth() . '&d=' . $PMonth->thisDay(); |
|
| 51 | +$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); |
|
| 52 | 52 | $NMonth = $Month->nextMonth('object'); |
| 53 | -$next = $_SERVER['PHP_SELF'] . '?y=' . $NMonth->thisYear() . '&m=' . $NMonth->thisMonth() . '&d=' . $NMonth->thisDay(); |
|
| 53 | +$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); |
|
| 54 | 54 | ?> |
| 55 | 55 | <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 56 | 56 | <html> |
@@ -124,19 +124,19 @@ discard block |
||
| 124 | 124 | while ($Day = $Week->fetch()) { |
| 125 | 125 | |
| 126 | 126 | // Build a link string for each day |
| 127 | - $link = $_SERVER['PHP_SELF'] . '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay(); |
|
| 127 | + $link = $_SERVER['PHP_SELF'].'?y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay(); |
|
| 128 | 128 | |
| 129 | 129 | // Check to see if day is selected |
| 130 | 130 | if ($Day->isSelected()) { |
| 131 | - echo '<td class="selected">' . $Day->thisDay() . '</td>' . "\n"; |
|
| 131 | + echo '<td class="selected">'.$Day->thisDay().'</td>'."\n"; |
|
| 132 | 132 | // Check to see if day is empty |
| 133 | 133 | } elseif ($Day->isEmpty()) { |
| 134 | - echo '<td class="empty">' . $Day->thisDay() . '</td>' . "\n"; |
|
| 134 | + echo '<td class="empty">'.$Day->thisDay().'</td>'."\n"; |
|
| 135 | 135 | } else { |
| 136 | - echo '<td><a href="' . $link . '">' . $Day->thisDay() . '</a></td>' . "\n"; |
|
| 136 | + echo '<td><a href="'.$link.'">'.$Day->thisDay().'</a></td>'."\n"; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | - echo '</tr>' . "\n"; |
|
| 139 | + echo '</tr>'."\n"; |
|
| 140 | 140 | } |
| 141 | 141 | ?> |
| 142 | 142 | <tr> |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | </tr> |
| 151 | 151 | </table> |
| 152 | 152 | <?php |
| 153 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 153 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
| 154 | 154 | ?> |
| 155 | 155 | </body> |
| 156 | 156 | </html> |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | /** |
| 3 | 3 | * Description: demonstrates using the Uri decorator. |
| 4 | 4 | */ |
| 5 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 5 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 6 | 6 | define('CALENDAR_ROOT', '../../'); |
| 7 | 7 | } |
| 8 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 9 | -require_once CALENDAR_ROOT . 'Decorator/Uri.php'; |
|
| 8 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 9 | +require_once CALENDAR_ROOT.'Decorator/Uri.php'; |
|
| 10 | 10 | |
| 11 | 11 | if (!isset($_GET['jahr'])) { |
| 12 | 12 | $_GET['jahr'] = date('Y'); |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | // Build the month |
| 19 | 19 | $Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']); |
| 20 | 20 | |
| 21 | -echo '<p>The current month is ' . $Calendar->thisMonth() . ' of year ' . $Calendar->thisYear() . '</p>'; |
|
| 21 | +echo '<p>The current month is '.$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>'; |
|
| 22 | 22 | |
| 23 | 23 | $Uri = new Calendar_Decorator_Uri($Calendar); |
| 24 | 24 | $Uri->setFragments('jahr', 'monat'); |
| 25 | 25 | // $Uri->setSeperator('/'); // Default is & |
| 26 | 26 | // $Uri->setScalar(); // Omit variable names |
| 27 | -echo "<pre>Previous Uri:\t" . $Uri->prev('month') . "\n"; |
|
| 28 | -echo "This Uri:\t" . $Uri->this('month') . "\n"; |
|
| 29 | -echo "Next Uri:\t" . $Uri->next('month') . "\n</pre>"; |
|
| 27 | +echo "<pre>Previous Uri:\t".$Uri->prev('month')."\n"; |
|
| 28 | +echo "This Uri:\t".$Uri->this('month')."\n"; |
|
| 29 | +echo "Next Uri:\t".$Uri->next('month')."\n</pre>"; |
|
| 30 | 30 | ?> |
| 31 | 31 | <p> |
| 32 | - <a href="<?php echo $_SERVER['PHP_SELF'] . '?' . $Uri->prev('month'); ?>">Prev</a> : |
|
| 33 | - <a href="<?php echo $_SERVER['PHP_SELF'] . '?' . $Uri->next('month'); ?>">Next</a> |
|
| 32 | + <a href="<?php echo $_SERVER['PHP_SELF'].'?'.$Uri->prev('month'); ?>">Prev</a> : |
|
| 33 | + <a href="<?php echo $_SERVER['PHP_SELF'].'?'.$Uri->next('month'); ?>">Next</a> |
|
| 34 | 34 | </p> |
@@ -6,16 +6,16 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | list($usec, $sec) = explode(' ', microtime()); |
| 8 | 8 | |
| 9 | - return (float)$usec + (float)$sec; |
|
| 9 | + return (float) $usec + (float) $sec; |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | $start = getmicrotime(); |
| 13 | 13 | |
| 14 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 14 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 15 | 15 | define('CALENDAR_ROOT', '../../'); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -require_once CALENDAR_ROOT . 'Year.php'; |
|
| 18 | +require_once CALENDAR_ROOT.'Year.php'; |
|
| 19 | 19 | |
| 20 | 20 | define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH_WEEKDAYS); |
| 21 | 21 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | echo "<td>\n<table class=\"month\">\n"; |
| 103 | - echo '<caption class="month">' . date('F', $Month->thisMonth(true)) . '</caption>'; |
|
| 103 | + echo '<caption class="month">'.date('F', $Month->thisMonth(true)).'</caption>'; |
|
| 104 | 104 | echo "<tr>\n<th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>"; |
| 105 | 105 | $Month->build(); |
| 106 | 106 | while ($Day = $Month->fetch()) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($Day->isEmpty()) { |
| 111 | 111 | echo "<td> </td>\n"; |
| 112 | 112 | } else { |
| 113 | - echo '<td>' . $Day->thisDay() . "</td>\n"; |
|
| 113 | + echo '<td>'.$Day->thisDay()."</td>\n"; |
|
| 114 | 114 | } |
| 115 | 115 | if ($Day->isLast()) { |
| 116 | 116 | echo "</tr>\n"; |