@@ -6,84 +6,84 @@ discard block |
||
6 | 6 | */ |
7 | 7 | function getmicrotime() |
8 | 8 | { |
9 | - list($usec, $sec) = explode(" ",microtime()); |
|
9 | + list($usec, $sec) = explode(" ", microtime()); |
|
10 | 10 | |
11 | 11 | return ((float) $usec + (float) $sec); |
12 | 12 | } |
13 | 13 | $start = getmicrotime(); |
14 | 14 | |
15 | 15 | if (!@include 'Calendar/Calendar.php') { |
16 | - define('CALENDAR_ROOT','../../'); |
|
16 | + define('CALENDAR_ROOT', '../../'); |
|
17 | 17 | } |
18 | -require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
19 | -require_once CALENDAR_ROOT.'Day.php'; |
|
18 | +require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
19 | +require_once CALENDAR_ROOT . 'Day.php'; |
|
20 | 20 | |
21 | 21 | if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
22 | 22 | if (!isset($_GET['m'])) $_GET['m'] = date('n'); |
23 | 23 | if (!isset($_GET['d'])) $_GET['d'] = date('j'); |
24 | 24 | |
25 | -$Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']); |
|
26 | -$Day = new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']); |
|
25 | +$Month = new Calendar_Month_Weekdays($_GET['y'], $_GET['m']); |
|
26 | +$Day = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
27 | 27 | $selection = array($Day); |
28 | 28 | |
29 | 29 | #-----------------------------------------------------------------------------# |
30 | -if ( isset($_GET['mime']) && $_GET['mime']=='wml' ) { |
|
31 | - header ('Content-Type: text/vnd.wap.wml'); |
|
32 | - echo ( '<?xml version="1.0"?>' ); |
|
30 | +if (isset($_GET['mime']) && $_GET['mime'] == 'wml') { |
|
31 | + header('Content-Type: text/vnd.wap.wml'); |
|
32 | + echo ('<?xml version="1.0"?>'); |
|
33 | 33 | ?> |
34 | 34 | <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> |
35 | 35 | <wml> |
36 | 36 | <big><strong>Personal Planner Rendered with WML</strong></big> |
37 | 37 | <?php |
38 | -if ( isset($_GET['viewday']) ) { |
|
38 | +if (isset($_GET['viewday'])) { |
|
39 | 39 | ?> |
40 | -<p><strong>Viewing <?php echo ( date('l, jS of F, Y',$Day->getTimeStamp()) ); ?></strong></p> |
|
40 | +<p><strong>Viewing <?php echo (date('l, jS of F, Y', $Day->getTimeStamp())); ?></strong></p> |
|
41 | 41 | <p> |
42 | 42 | <anchor> |
43 | 43 | Back to Month View |
44 | 44 | <go href="<?php |
45 | -echo ( "?y=".$Day->thisYear()."&m=". |
|
46 | - $Day->thisMonth()."&d=".$Day->thisDay()."&mime=wml" ); |
|
45 | +echo ("?y=" . $Day->thisYear() . "&m=" . |
|
46 | + $Day->thisMonth() . "&d=" . $Day->thisDay() . "&mime=wml"); |
|
47 | 47 | ?>"/> |
48 | 48 | </anchor> |
49 | 49 | </p> |
50 | 50 | <table> |
51 | 51 | <?php |
52 | 52 | $Day->build(); |
53 | - while ( $Hour = & $Day->fetch() ) { |
|
54 | - echo ( "<tr>\n" ); |
|
55 | - echo ( "<td>".date('g a',$Hour->getTimeStamp())."</td><td>Free time!</td>\n" ); |
|
56 | - echo ( "</tr>\n" ); |
|
53 | + while ($Hour = & $Day->fetch()) { |
|
54 | + echo ("<tr>\n"); |
|
55 | + echo ("<td>" . date('g a', $Hour->getTimeStamp()) . "</td><td>Free time!</td>\n"); |
|
56 | + echo ("</tr>\n"); |
|
57 | 57 | } |
58 | 58 | ?> |
59 | 59 | </table> |
60 | 60 | <?php |
61 | 61 | } else { |
62 | 62 | ?> |
63 | -<p><strong><?php echo ( date('F Y',$Month->getTimeStamp()) ); ?></strong></p> |
|
63 | +<p><strong><?php echo (date('F Y', $Month->getTimeStamp())); ?></strong></p> |
|
64 | 64 | <table> |
65 | 65 | <tr> |
66 | 66 | <td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td><td>S</td> |
67 | 67 | </tr> |
68 | 68 | <?php |
69 | 69 | $Month->build($selection); |
70 | -while ( $Day = $Month->fetch() ) { |
|
71 | - if ( $Day->isFirst() ) { |
|
72 | - echo ( "<tr>\n" ); |
|
70 | +while ($Day = $Month->fetch()) { |
|
71 | + if ($Day->isFirst()) { |
|
72 | + echo ("<tr>\n"); |
|
73 | 73 | } |
74 | - if ( $Day->isEmpty() ) { |
|
75 | - echo ( "<td></td>\n" ); |
|
76 | - } elseif ( $Day->isSelected() ) { |
|
77 | - echo ( "<td><anchor><strong><u>".$Day->thisDay()."</u></strong>\n<go href=\"".$_SERVER['PHP_SELF']."?viewday=true&y=". |
|
78 | - $Day->thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). |
|
79 | - "&mime=wml\" />\n</anchor></td>\n" ); |
|
74 | + if ($Day->isEmpty()) { |
|
75 | + echo ("<td></td>\n"); |
|
76 | + } elseif ($Day->isSelected()) { |
|
77 | + echo ("<td><anchor><strong><u>" . $Day->thisDay() . "</u></strong>\n<go href=\"" . $_SERVER['PHP_SELF'] . "?viewday=true&y=" . |
|
78 | + $Day->thisYear() . "&m=" . $Day->thisMonth() . "&d=" . $Day->thisDay() . |
|
79 | + "&mime=wml\" />\n</anchor></td>\n"); |
|
80 | 80 | } else { |
81 | - echo ( "<td><anchor>".$Day->thisDay()."\n<go href=\"?viewday=true&y=". |
|
82 | - $Day->thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). |
|
83 | - "&mime=wml\" /></anchor></td>\n" ); |
|
81 | + echo ("<td><anchor>" . $Day->thisDay() . "\n<go href=\"?viewday=true&y=" . |
|
82 | + $Day->thisYear() . "&m=" . $Day->thisMonth() . "&d=" . $Day->thisDay() . |
|
83 | + "&mime=wml\" /></anchor></td>\n"); |
|
84 | 84 | } |
85 | - if ( $Day->isLast() ) { |
|
86 | - echo ( "</tr>\n" ); |
|
85 | + if ($Day->isLast()) { |
|
86 | + echo ("</tr>\n"); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | ?> |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | <anchor> |
93 | 93 | << |
94 | 94 | <go href="<?php |
95 | -echo ( "?y=".$Month->thisYear()."&m=". |
|
96 | - $Month->prevMonth()."&d=".$Month->thisDay()."&mime=wml" ); |
|
95 | +echo ("?y=" . $Month->thisYear() . "&m=" . |
|
96 | + $Month->prevMonth() . "&d=" . $Month->thisDay() . "&mime=wml"); |
|
97 | 97 | ?>"/> |
98 | 98 | </anchor> |
99 | 99 | </td> |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | <anchor> |
103 | 103 | >> |
104 | 104 | <go href="<?php |
105 | -echo ( "?y=".$Month->thisYear()."&m=". |
|
106 | - $Month->nextMonth()."&d=".$Month->thisDay()."&mime=wml" ); |
|
105 | +echo ("?y=" . $Month->thisYear() . "&m=" . |
|
106 | + $Month->nextMonth() . "&d=" . $Month->thisDay() . "&mime=wml"); |
|
107 | 107 | ?>"/> |
108 | 108 | </anchor> |
109 | 109 | </td> |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | <?php |
114 | 114 | } |
115 | 115 | ?> |
116 | -<p><a href="<?php echo ( $_SERVER['PHP_SELF'] ); ?>">Back to HTML</a></p> |
|
117 | -<?php echo ( '<p>Took: '.(getmicrotime()-$start).' seconds</p>' ); ?> |
|
116 | +<p><a href="<?php echo ($_SERVER['PHP_SELF']); ?>">Back to HTML</a></p> |
|
117 | +<?php echo ('<p>Took: ' . (getmicrotime() - $start) . ' seconds</p>'); ?> |
|
118 | 118 | </wml> |
119 | 119 | <?php |
120 | 120 | #-----------------------------------------------------------------------------# |
@@ -127,73 +127,73 @@ discard block |
||
127 | 127 | </head> |
128 | 128 | <body> |
129 | 129 | <h1>Personal Planner Rendered with HTML</h1> |
130 | -<p>To view in WML, click <a href="<?php echo ( $_SERVER['PHP_SELF'] ); ?>?mime=wml">here</a> or place a ?mime=wml at the end of any URL. |
|
130 | +<p>To view in WML, click <a href="<?php echo ($_SERVER['PHP_SELF']); ?>?mime=wml">here</a> or place a ?mime=wml at the end of any URL. |
|
131 | 131 | Note that <a href="http://www.opera.com/download">Opera</a> supports WML natively and Mozilla / Firefox has the WMLBrowser |
132 | 132 | plugin: <a href="http://wmlbrowser.mozdev.org">wmlbrowser.mozdev.org</a></p> |
133 | 133 | <?php |
134 | -if ( isset($_GET['viewday']) ) { |
|
134 | +if (isset($_GET['viewday'])) { |
|
135 | 135 | ?> |
136 | -<p><strong>Viewing <?php echo ( date('l, jS of F, Y',$Day->getTimeStamp()) ); ?></strong></p> |
|
136 | +<p><strong>Viewing <?php echo (date('l, jS of F, Y', $Day->getTimeStamp())); ?></strong></p> |
|
137 | 137 | <p> |
138 | 138 | <anchor> |
139 | 139 | <a href="<?php |
140 | -echo ( "?y=".$Day->thisYear()."&m=". |
|
141 | - $Day->thisMonth()."&d=".$Day->thisDay()); |
|
140 | +echo ("?y=" . $Day->thisYear() . "&m=" . |
|
141 | + $Day->thisMonth() . "&d=" . $Day->thisDay()); |
|
142 | 142 | ?>">Back to Month View</a> |
143 | 143 | </p> |
144 | 144 | <table> |
145 | 145 | <?php |
146 | 146 | $Day->build(); |
147 | - while ( $Hour = & $Day->fetch() ) { |
|
148 | - echo ( "<tr>\n" ); |
|
149 | - echo ( "<td>".date('g a',$Hour->getTimeStamp())."</td><td>Free time!</td>\n" ); |
|
150 | - echo ( "</tr>\n" ); |
|
147 | + while ($Hour = & $Day->fetch()) { |
|
148 | + echo ("<tr>\n"); |
|
149 | + echo ("<td>" . date('g a', $Hour->getTimeStamp()) . "</td><td>Free time!</td>\n"); |
|
150 | + echo ("</tr>\n"); |
|
151 | 151 | } |
152 | 152 | ?> |
153 | 153 | </table> |
154 | 154 | <?php |
155 | 155 | } else { |
156 | 156 | ?> |
157 | -<p><strong><?php echo ( date('F Y',$Month->getTimeStamp()) ); ?></strong></p> |
|
157 | +<p><strong><?php echo (date('F Y', $Month->getTimeStamp())); ?></strong></p> |
|
158 | 158 | <table> |
159 | 159 | <tr> |
160 | 160 | <td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td><td>S</td> |
161 | 161 | </tr> |
162 | 162 | <?php |
163 | 163 | $Month->build($selection); |
164 | -while ( $Day = $Month->fetch() ) { |
|
165 | - if ( $Day->isFirst() ) { |
|
166 | - echo ( "<tr>\n" ); |
|
164 | +while ($Day = $Month->fetch()) { |
|
165 | + if ($Day->isFirst()) { |
|
166 | + echo ("<tr>\n"); |
|
167 | 167 | } |
168 | - if ( $Day->isEmpty() ) { |
|
169 | - echo ( "<td></td>\n" ); |
|
170 | - } elseif ( $Day->isSelected() ) { |
|
171 | - echo ( "<td><a href=\"".$_SERVER['PHP_SELF']."?viewday=true&y=". |
|
172 | - $Day->thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). |
|
173 | - "&wml\"><strong><u>".$Day->thisDay()."</u></strong></a></td>\n" ); |
|
168 | + if ($Day->isEmpty()) { |
|
169 | + echo ("<td></td>\n"); |
|
170 | + } elseif ($Day->isSelected()) { |
|
171 | + echo ("<td><a href=\"" . $_SERVER['PHP_SELF'] . "?viewday=true&y=" . |
|
172 | + $Day->thisYear() . "&m=" . $Day->thisMonth() . "&d=" . $Day->thisDay() . |
|
173 | + "&wml\"><strong><u>" . $Day->thisDay() . "</u></strong></a></td>\n"); |
|
174 | 174 | } else { |
175 | - echo ( "<td><a href=\"".$_SERVER['PHP_SELF']."?viewday=true&y=". |
|
176 | - $Day->thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). |
|
177 | - "\">".$Day->thisDay()."</a></td>\n" ); |
|
175 | + echo ("<td><a href=\"" . $_SERVER['PHP_SELF'] . "?viewday=true&y=" . |
|
176 | + $Day->thisYear() . "&m=" . $Day->thisMonth() . "&d=" . $Day->thisDay() . |
|
177 | + "\">" . $Day->thisDay() . "</a></td>\n"); |
|
178 | 178 | } |
179 | - if ( $Day->isLast() ) { |
|
180 | - echo ( "</tr>\n" ); |
|
179 | + if ($Day->isLast()) { |
|
180 | + echo ("</tr>\n"); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | ?> |
184 | 184 | <tr> |
185 | 185 | <td> |
186 | 186 | <a href="<?php |
187 | -echo ( "?y=".$Month->thisYear()."&m=". |
|
188 | - $Month->prevMonth()."&d=".$Month->thisDay() ); |
|
187 | +echo ("?y=" . $Month->thisYear() . "&m=" . |
|
188 | + $Month->prevMonth() . "&d=" . $Month->thisDay()); |
|
189 | 189 | ?>"> |
190 | 190 | <<</a> |
191 | 191 | </td> |
192 | 192 | <td></td><td></td><td></td><td></td><td></td> |
193 | 193 | <td> |
194 | 194 | <a href="<?php |
195 | -echo ( "?y=".$Month->thisYear()."&m=". |
|
196 | - $Month->nextMonth()."&d=".$Month->thisDay() ); |
|
195 | +echo ("?y=" . $Month->thisYear() . "&m=" . |
|
196 | + $Month->nextMonth() . "&d=" . $Month->thisDay()); |
|
197 | 197 | ?>">>></a> |
198 | 198 | </td> |
199 | 199 | </tr> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | ?> |
205 | 205 | |
206 | -<?php echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' ); ?> |
|
206 | +<?php echo ('<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'); ?> |
|
207 | 207 | </body> |
208 | 208 | </html> |
209 | 209 | <?php |
@@ -18,9 +18,15 @@ |
||
18 | 18 | require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
19 | 19 | require_once CALENDAR_ROOT.'Day.php'; |
20 | 20 | |
21 | -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
|
22 | -if (!isset($_GET['m'])) $_GET['m'] = date('n'); |
|
23 | -if (!isset($_GET['d'])) $_GET['d'] = date('j'); |
|
21 | +if (!isset($_GET['y'])) { |
|
22 | + $_GET['y'] = date('Y'); |
|
23 | +} |
|
24 | +if (!isset($_GET['m'])) { |
|
25 | + $_GET['m'] = date('n'); |
|
26 | +} |
|
27 | +if (!isset($_GET['d'])) { |
|
28 | + $_GET['d'] = date('j'); |
|
29 | +} |
|
24 | 30 | |
25 | 31 | $Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']); |
26 | 32 | $Day = new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | if (!@include 'Calendar/Calendar.php') { |
14 | 14 | define('CALENDAR_ROOT', '../../'); |
15 | 15 | } |
16 | -require_once CALENDAR_ROOT.'Week.php'; |
|
16 | +require_once CALENDAR_ROOT . 'Week.php'; |
|
17 | 17 | |
18 | 18 | if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
19 | 19 | if (!isset($_GET['m'])) $_GET['m'] = date('m'); |
@@ -35,25 +35,25 @@ discard block |
||
35 | 35 | </head> |
36 | 36 | <body> |
37 | 37 | <h1>Paging Weeks</h1> |
38 | -<h2>Week: <?php echo $Week->thisWeek().' '.date('F Y',$Week->thisMonth(true)); ?></h2> |
|
38 | +<h2>Week: <?php echo $Week->thisWeek() . ' ' . date('F Y', $Week->thisMonth(true)); ?></h2> |
|
39 | 39 | <?php |
40 | 40 | $Week->build(); |
41 | 41 | while ($Day = $Week->fetch()) { |
42 | - echo '<p>'.date('jS F',$Day->thisDay(true))."</p>\n"; |
|
42 | + echo '<p>' . date('jS F', $Day->thisDay(true)) . "</p>\n"; |
|
43 | 43 | } |
44 | 44 | $days = $Week->fetchAll(); |
45 | 45 | |
46 | 46 | $prevWeek = $Week->prevWeek('array'); |
47 | -$prevWeekLink = $_SERVER['PHP_SELF']. |
|
48 | - '?y='.$prevWeek['year']. |
|
49 | - '&m='.$prevWeek['month']. |
|
50 | - '&d='.$prevWeek['day']; |
|
47 | +$prevWeekLink = $_SERVER['PHP_SELF'] . |
|
48 | + '?y=' . $prevWeek['year'] . |
|
49 | + '&m=' . $prevWeek['month'] . |
|
50 | + '&d=' . $prevWeek['day']; |
|
51 | 51 | |
52 | 52 | $nextWeek = $Week->nextWeek('array'); |
53 | -$nextWeekLink = $_SERVER['PHP_SELF']. |
|
54 | - '?y='.$nextWeek['year']. |
|
55 | - '&m='.$nextWeek['month']. |
|
56 | - '&d='.$nextWeek['day']; |
|
53 | +$nextWeekLink = $_SERVER['PHP_SELF'] . |
|
54 | + '?y=' . $nextWeek['year'] . |
|
55 | + '&m=' . $nextWeek['month'] . |
|
56 | + '&d=' . $nextWeek['day']; |
|
57 | 57 | ?> |
58 | 58 | <p><a href="<?php echo $prevWeekLink; ?>"><<</a> | <a href="<?php echo $nextWeekLink; ?>">>></a></p> |
59 | 59 | </body> |
@@ -15,9 +15,15 @@ |
||
15 | 15 | } |
16 | 16 | require_once CALENDAR_ROOT.'Week.php'; |
17 | 17 | |
18 | -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
|
19 | -if (!isset($_GET['m'])) $_GET['m'] = date('m'); |
|
20 | -if (!isset($_GET['d'])) $_GET['d'] = 1; |
|
18 | +if (!isset($_GET['y'])) { |
|
19 | + $_GET['y'] = date('Y'); |
|
20 | +} |
|
21 | +if (!isset($_GET['m'])) { |
|
22 | + $_GET['m'] = date('m'); |
|
23 | +} |
|
24 | +if (!isset($_GET['d'])) { |
|
25 | + $_GET['d'] = 1; |
|
26 | +} |
|
21 | 27 | |
22 | 28 | // Build the month |
23 | 29 | $Week = new Calendar_Week($_GET['y'], $_GET['m'], $_GET['d']); |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Load Calendar base class |
50 | 50 | */ |
51 | -require_once CALENDAR_ROOT.'Calendar.php'; |
|
51 | +require_once CALENDAR_ROOT . 'Calendar.php'; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Load base month |
55 | 55 | */ |
56 | -require_once CALENDAR_ROOT.'Month.php'; |
|
56 | +require_once CALENDAR_ROOT . 'Month.php'; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Represents a Month and builds Weeks |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @access public |
102 | 102 | */ |
103 | - function Calendar_Month_Weeks($y, $m, $firstDay=null) |
|
103 | + function Calendar_Month_Weeks($y, $m, $firstDay = null) |
|
104 | 104 | { |
105 | 105 | parent::Calendar_Month($y, $m, $firstDay); |
106 | 106 | } |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | */ |
117 | 117 | function build($sDates = array()) |
118 | 118 | { |
119 | - include_once CALENDAR_ROOT.'Table/Helper.php'; |
|
119 | + include_once CALENDAR_ROOT . 'Table/Helper.php'; |
|
120 | 120 | $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); |
121 | - include_once CALENDAR_ROOT.'Week.php'; |
|
121 | + include_once CALENDAR_ROOT . 'Week.php'; |
|
122 | 122 | $numWeeks = $this->tableHelper->getNumWeeks(); |
123 | - for ($i=1, $d=1; $i<=$numWeeks; ++$i, |
|
124 | - $d+=$this->cE->getDaysInWeek( |
|
123 | + for ($i = 1, $d = 1; $i <= $numWeeks; ++$i, |
|
124 | + $d += $this->cE->getDaysInWeek( |
|
125 | 125 | $this->thisYear(), |
126 | 126 | $this->thisMonth(), |
127 | 127 | $this->thisDay() |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT.'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT . 'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Load base month |
54 | 54 | */ |
55 | -require_once CALENDAR_ROOT.'Month.php'; |
|
55 | +require_once CALENDAR_ROOT . 'Month.php'; |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Represents a Month and builds Days in tabular form<br> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @access public |
110 | 110 | */ |
111 | - function Calendar_Month_Weekdays($y, $m, $firstDay=null) |
|
111 | + function Calendar_Month_Weekdays($y, $m, $firstDay = null) |
|
112 | 112 | { |
113 | 113 | parent::Calendar_Month($y, $m, $firstDay); |
114 | 114 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | function build($sDates = array()) |
130 | 130 | { |
131 | - include_once CALENDAR_ROOT.'Table/Helper.php'; |
|
131 | + include_once CALENDAR_ROOT . 'Table/Helper.php'; |
|
132 | 132 | $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); |
133 | 133 | Calendar_Month::build($sDates); |
134 | 134 | $this->buildEmptyDaysBefore(); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | static function buildEmptyDaysBefore() |
149 | 149 | { |
150 | 150 | $eBefore = $this->tableHelper->getEmptyDaysBefore(); |
151 | - for ($i=0; $i < $eBefore; ++$i) { |
|
151 | + for ($i = 0; $i < $eBefore; ++$i) { |
|
152 | 152 | $stamp = $this->cE->dateToStamp($this->year, $this->month, -$i); |
153 | 153 | $Day = new Calendar_Day( |
154 | 154 | $this->cE->stampToYear($stamp), |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | { |
185 | 185 | $eAfter = $this->tableHelper->getEmptyDaysAfter(); |
186 | 186 | $sDOM = $this->tableHelper->getNumTableDaysInMonth(); |
187 | - for ($i=1; $i <= $sDOM-$eAfter; ++$i) { |
|
188 | - $Day = new Calendar_Day($this->year, $this->month+1, $i); |
|
187 | + for ($i = 1; $i <= $sDOM - $eAfter; ++$i) { |
|
188 | + $Day = new Calendar_Day($this->year, $this->month + 1, $i); |
|
189 | 189 | $Day->setEmpty(); |
190 | 190 | $Day->adjust(); |
191 | 191 | array_push($this->children, $Day); |
@@ -207,9 +207,9 @@ discard block |
||
207 | 207 | $this->thisDay() |
208 | 208 | ); |
209 | 209 | $sDOM = $this->tableHelper->getNumTableDaysInMonth(); |
210 | - for ($i=1; $i <= $sDOM; $i+= $dIW) { |
|
210 | + for ($i = 1; $i <= $sDOM; $i += $dIW) { |
|
211 | 211 | $this->children[$i]->setFirst(); |
212 | - $this->children[$i+($dIW-1)]->setLast(); |
|
212 | + $this->children[$i + ($dIW - 1)]->setLast(); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 | } |
@@ -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 | } |
@@ -134,12 +134,12 @@ discard block |
||
134 | 134 | $stamp = mktime(0, 0, 0, 11, $i+2, 2003); |
135 | 135 | $day = strftime($formats[$format], $stamp); |
136 | 136 | switch ($format) { |
137 | - case 'one': |
|
138 | - $day = substr($day, 0, 1); |
|
139 | - break; |
|
140 | - case 'two': |
|
141 | - $day = substr($day, 0, 2); |
|
142 | - break; |
|
137 | + case 'one': |
|
138 | + $day = substr($day, 0, 1); |
|
139 | + break; |
|
140 | + case 'two': |
|
141 | + $day = substr($day, 0, 2); |
|
142 | + break; |
|
143 | 143 | } |
144 | 144 | $days[$i] = $day; |
145 | 145 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * Load Calendar decorator base class |
55 | 55 | */ |
56 | -require_once CALENDAR_ROOT.'Decorator.php'; |
|
56 | +require_once CALENDAR_ROOT . 'Decorator.php'; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Static utlities to help with fetching textual representations of months and |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $format = 'long'; |
93 | 93 | } |
94 | 94 | $months = array(); |
95 | - for ($i=1; $i<=12; ++$i) { |
|
95 | + for ($i = 1; $i <= 12; ++$i) { |
|
96 | 96 | $stamp = mktime(0, 0, 0, $i, 1, 2003); |
97 | 97 | $month = strftime($formats[$format], $stamp); |
98 | 98 | switch ($format) { |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | $format = 'long'; |
131 | 131 | } |
132 | 132 | $days = array(); |
133 | - for ($i=0; $i<=6; ++$i) { |
|
134 | - $stamp = mktime(0, 0, 0, 11, $i+2, 2003); |
|
133 | + for ($i = 0; $i <= 6; ++$i) { |
|
134 | + $stamp = mktime(0, 0, 0, 11, $i + 2, 2003); |
|
135 | 135 | $day = strftime($formats[$format], $stamp); |
136 | 136 | switch ($format) { |
137 | 137 | case 'one': |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @access public |
233 | 233 | * @static |
234 | 234 | */ |
235 | - static function thisDayName($Calendar, $format='long') |
|
235 | + static function thisDayName($Calendar, $format = 'long') |
|
236 | 236 | { |
237 | 237 | $days = Calendar_Util_Textual::weekdayNames($format); |
238 | 238 | include_once 'Date/Calc.php'; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @access public |
252 | 252 | * @static |
253 | 253 | */ |
254 | - static function nextDayName($Calendar, $format='long') |
|
254 | + static function nextDayName($Calendar, $format = 'long') |
|
255 | 255 | { |
256 | 256 | $days = Calendar_Util_Textual::weekdayNames($format); |
257 | 257 | $stamp = $Calendar->nextDay('timestamp'); |
@@ -97,11 +97,11 @@ |
||
97 | 97 | { |
98 | 98 | include_once CALENDAR_ROOT.'Minute.php'; |
99 | 99 | $mIH = $this->cE->getMinutesInHour($this->year, $this->month, $this->day, |
100 | - $this->hour); |
|
100 | + $this->hour); |
|
101 | 101 | for ($i=0; $i < $mIH; ++$i) { |
102 | 102 | $this->children[$i] = |
103 | 103 | new Calendar_Minute($this->year, $this->month, $this->day, |
104 | - $this->hour, $i); |
|
104 | + $this->hour, $i); |
|
105 | 105 | } |
106 | 106 | if (count($sDates) > 0) { |
107 | 107 | $this->setSelection($sDates); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT.'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT . 'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents an Hour and builds Minutes |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function build($sDates = array()) |
97 | 97 | { |
98 | - include_once CALENDAR_ROOT.'Minute.php'; |
|
98 | + include_once CALENDAR_ROOT . 'Minute.php'; |
|
99 | 99 | $mIH = $this->cE->getMinutesInHour($this->year, $this->month, $this->day, |
100 | 100 | $this->hour); |
101 | - for ($i=0; $i < $mIH; ++$i) { |
|
101 | + for ($i = 0; $i < $mIH; ++$i) { |
|
102 | 102 | $this->children[$i] = |
103 | 103 | new Calendar_Minute($this->year, $this->month, $this->day, |
104 | 104 | $this->hour, $i); |
@@ -347,23 +347,23 @@ discard block |
||
347 | 347 | function prevWeek($format = 'n_in_month') |
348 | 348 | { |
349 | 349 | switch (strtolower($format)) { |
350 | - case 'int': |
|
351 | - case 'n_in_month': |
|
352 | - return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') -1; |
|
353 | - case 'n_in_year': |
|
354 | - return $this->cE->getWeekNInYear( |
|
355 | - $this->cE->stampToYear($this->prevWeek), |
|
356 | - $this->cE->stampToMonth($this->prevWeek), |
|
357 | - $this->cE->stampToDay($this->prevWeek)); |
|
358 | - case 'array': |
|
359 | - return $this->toArray($this->prevWeek); |
|
360 | - case 'object': |
|
361 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
362 | - |
|
363 | - return Calendar_Factory::createByTimestamp('Week', $this->prevWeek); |
|
364 | - case 'timestamp': |
|
365 | - default: |
|
366 | - return $this->prevWeek; |
|
350 | + case 'int': |
|
351 | + case 'n_in_month': |
|
352 | + return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') -1; |
|
353 | + case 'n_in_year': |
|
354 | + return $this->cE->getWeekNInYear( |
|
355 | + $this->cE->stampToYear($this->prevWeek), |
|
356 | + $this->cE->stampToMonth($this->prevWeek), |
|
357 | + $this->cE->stampToDay($this->prevWeek)); |
|
358 | + case 'array': |
|
359 | + return $this->toArray($this->prevWeek); |
|
360 | + case 'object': |
|
361 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
362 | + |
|
363 | + return Calendar_Factory::createByTimestamp('Week', $this->prevWeek); |
|
364 | + case 'timestamp': |
|
365 | + default: |
|
366 | + return $this->prevWeek; |
|
367 | 367 | } |
368 | 368 | } |
369 | 369 | |
@@ -378,37 +378,37 @@ discard block |
||
378 | 378 | function thisWeek($format = 'n_in_month') |
379 | 379 | { |
380 | 380 | switch (strtolower($format)) { |
381 | - case 'int': |
|
382 | - case 'n_in_month': |
|
383 | - if ($this->firstWeek) { |
|
384 | - return 1; |
|
385 | - } |
|
386 | - if ($this->lastWeek) { |
|
387 | - return $this->cE->getWeeksInMonth( |
|
381 | + case 'int': |
|
382 | + case 'n_in_month': |
|
383 | + if ($this->firstWeek) { |
|
384 | + return 1; |
|
385 | + } |
|
386 | + if ($this->lastWeek) { |
|
387 | + return $this->cE->getWeeksInMonth( |
|
388 | + $this->thisYear(), |
|
389 | + $this->thisMonth(), |
|
390 | + $this->firstDay); |
|
391 | + } |
|
392 | + |
|
393 | + return $this->cE->getWeekNInMonth( |
|
388 | 394 | $this->thisYear(), |
389 | 395 | $this->thisMonth(), |
396 | + $this->thisDay(), |
|
390 | 397 | $this->firstDay); |
391 | - } |
|
392 | - |
|
393 | - return $this->cE->getWeekNInMonth( |
|
394 | - $this->thisYear(), |
|
395 | - $this->thisMonth(), |
|
396 | - $this->thisDay(), |
|
397 | - $this->firstDay); |
|
398 | - case 'n_in_year': |
|
399 | - return $this->cE->getWeekNInYear( |
|
400 | - $this->cE->stampToYear($this->thisWeek), |
|
401 | - $this->cE->stampToMonth($this->thisWeek), |
|
402 | - $this->cE->stampToDay($this->thisWeek)); |
|
403 | - case 'array': |
|
404 | - return $this->toArray($this->thisWeek); |
|
405 | - case 'object': |
|
406 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
407 | - |
|
408 | - return Calendar_Factory::createByTimestamp('Week', $this->thisWeek); |
|
409 | - case 'timestamp': |
|
410 | - default: |
|
411 | - return $this->thisWeek; |
|
398 | + case 'n_in_year': |
|
399 | + return $this->cE->getWeekNInYear( |
|
400 | + $this->cE->stampToYear($this->thisWeek), |
|
401 | + $this->cE->stampToMonth($this->thisWeek), |
|
402 | + $this->cE->stampToDay($this->thisWeek)); |
|
403 | + case 'array': |
|
404 | + return $this->toArray($this->thisWeek); |
|
405 | + case 'object': |
|
406 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
407 | + |
|
408 | + return Calendar_Factory::createByTimestamp('Week', $this->thisWeek); |
|
409 | + case 'timestamp': |
|
410 | + default: |
|
411 | + return $this->thisWeek; |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
@@ -423,23 +423,23 @@ discard block |
||
423 | 423 | function nextWeek($format = 'n_in_month') |
424 | 424 | { |
425 | 425 | switch (strtolower($format)) { |
426 | - case 'int': |
|
427 | - case 'n_in_month': |
|
428 | - return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') +1; |
|
429 | - case 'n_in_year': |
|
430 | - return $this->cE->getWeekNInYear( |
|
431 | - $this->cE->stampToYear($this->nextWeek), |
|
432 | - $this->cE->stampToMonth($this->nextWeek), |
|
433 | - $this->cE->stampToDay($this->nextWeek)); |
|
434 | - case 'array': |
|
435 | - return $this->toArray($this->nextWeek); |
|
436 | - case 'object': |
|
437 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
438 | - |
|
439 | - return Calendar_Factory::createByTimestamp('Week', $this->nextWeek); |
|
440 | - case 'timestamp': |
|
441 | - default: |
|
442 | - return $this->nextWeek; |
|
426 | + case 'int': |
|
427 | + case 'n_in_month': |
|
428 | + return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') +1; |
|
429 | + case 'n_in_year': |
|
430 | + return $this->cE->getWeekNInYear( |
|
431 | + $this->cE->stampToYear($this->nextWeek), |
|
432 | + $this->cE->stampToMonth($this->nextWeek), |
|
433 | + $this->cE->stampToDay($this->nextWeek)); |
|
434 | + case 'array': |
|
435 | + return $this->toArray($this->nextWeek); |
|
436 | + case 'object': |
|
437 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
438 | + |
|
439 | + return Calendar_Factory::createByTimestamp('Week', $this->nextWeek); |
|
440 | + case 'timestamp': |
|
441 | + default: |
|
442 | + return $this->nextWeek; |
|
443 | 443 | } |
444 | 444 | } |
445 | 445 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Load Calendar base class |
50 | 50 | */ |
51 | -require_once CALENDAR_ROOT.'Calendar.php'; |
|
51 | +require_once CALENDAR_ROOT . 'Calendar.php'; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Represents a Week and builds Days in tabular format<br> |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | function Calendar_Week($y, $m, $d, $firstDay = null) |
139 | 139 | { |
140 | - include_once CALENDAR_ROOT.'Table/Helper.php'; |
|
140 | + include_once CALENDAR_ROOT . 'Table/Helper.php'; |
|
141 | 141 | parent::Calendar($y, $m, $d); |
142 | 142 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
143 | 143 | $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | function build($sDates = array()) |
213 | 213 | { |
214 | - include_once CALENDAR_ROOT.'Day.php'; |
|
214 | + include_once CALENDAR_ROOT . 'Day.php'; |
|
215 | 215 | $year = $this->cE->stampToYear($this->thisWeek); |
216 | 216 | $month = $this->cE->stampToMonth($this->thisWeek); |
217 | 217 | $day = $this->cE->stampToDay($this->thisWeek); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $this->thisDay() |
222 | 222 | ); |
223 | 223 | |
224 | - for ($i=1; $i <= $end; ++$i) { |
|
224 | + for ($i = 1; $i <= $end; ++$i) { |
|
225 | 225 | $stamp = $this->cE->dateToStamp($year, $month, $day++); |
226 | 226 | $this->children[$i] = new Calendar_Day( |
227 | 227 | $this->cE->stampToYear($stamp), |
@@ -233,13 +233,13 @@ discard block |
||
233 | 233 | //set empty days (@see Calendar_Month_Weeks::build()) |
234 | 234 | if ($this->firstWeek) { |
235 | 235 | $eBefore = $this->tableHelper->getEmptyDaysBefore(); |
236 | - for ($i=1; $i <= $eBefore; ++$i) { |
|
236 | + for ($i = 1; $i <= $eBefore; ++$i) { |
|
237 | 237 | $this->children[$i]->setEmpty(); |
238 | 238 | } |
239 | 239 | } |
240 | 240 | if ($this->lastWeek) { |
241 | 241 | $eAfter = $this->tableHelper->getEmptyDaysAfterOffset(); |
242 | - for ($i = $eAfter+1; $i <= $end; ++$i) { |
|
242 | + for ($i = $eAfter + 1; $i <= $end; ++$i) { |
|
243 | 243 | $this->children[$i]->setEmpty(); |
244 | 244 | } |
245 | 245 | } |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | switch (strtolower($format)) { |
350 | 350 | case 'int': |
351 | 351 | case 'n_in_month': |
352 | - return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') -1; |
|
352 | + return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') - 1; |
|
353 | 353 | case 'n_in_year': |
354 | 354 | return $this->cE->getWeekNInYear( |
355 | 355 | $this->cE->stampToYear($this->prevWeek), |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | case 'array': |
359 | 359 | return $this->toArray($this->prevWeek); |
360 | 360 | case 'object': |
361 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
361 | + include_once CALENDAR_ROOT . 'Factory.php'; |
|
362 | 362 | |
363 | 363 | return Calendar_Factory::createByTimestamp('Week', $this->prevWeek); |
364 | 364 | case 'timestamp': |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | case 'array': |
404 | 404 | return $this->toArray($this->thisWeek); |
405 | 405 | case 'object': |
406 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
406 | + include_once CALENDAR_ROOT . 'Factory.php'; |
|
407 | 407 | |
408 | 408 | return Calendar_Factory::createByTimestamp('Week', $this->thisWeek); |
409 | 409 | case 'timestamp': |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | switch (strtolower($format)) { |
426 | 426 | case 'int': |
427 | 427 | case 'n_in_month': |
428 | - return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') +1; |
|
428 | + return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') + 1; |
|
429 | 429 | case 'n_in_year': |
430 | 430 | return $this->cE->getWeekNInYear( |
431 | 431 | $this->cE->stampToYear($this->nextWeek), |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | case 'array': |
435 | 435 | return $this->toArray($this->nextWeek); |
436 | 436 | case 'object': |
437 | - include_once CALENDAR_ROOT.'Factory.php'; |
|
437 | + include_once CALENDAR_ROOT . 'Factory.php'; |
|
438 | 438 | |
439 | 439 | return Calendar_Factory::createByTimestamp('Week', $this->nextWeek); |
440 | 440 | case 'timestamp': |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT.'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT . 'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents a Month and builds Days |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @access public |
81 | 81 | */ |
82 | - function Calendar_Month($y, $m, $firstDay=null) |
|
82 | + function Calendar_Month($y, $m, $firstDay = null) |
|
83 | 83 | { |
84 | 84 | parent::Calendar($y, $m); |
85 | 85 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | */ |
97 | 97 | function build($sDates = array()) |
98 | 98 | { |
99 | - include_once CALENDAR_ROOT.'Day.php'; |
|
99 | + include_once CALENDAR_ROOT . 'Day.php'; |
|
100 | 100 | $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); |
101 | - for ($i=1; $i<=$daysInMonth; ++$i) { |
|
101 | + for ($i = 1; $i <= $daysInMonth; ++$i) { |
|
102 | 102 | $this->children[$i] = new Calendar_Day($this->year, $this->month, $i); |
103 | 103 | } |
104 | 104 | if (count($sDates) > 0) { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT.'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT . 'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents a Day and builds Hours. |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | */ |
115 | 115 | function build($sDates = array()) |
116 | 116 | { |
117 | - include_once CALENDAR_ROOT.'Hour.php'; |
|
117 | + include_once CALENDAR_ROOT . 'Hour.php'; |
|
118 | 118 | |
119 | 119 | $hID = $this->cE->getHoursInDay($this->year, $this->month, $this->day); |
120 | - for ($i=0; $i < $hID; ++$i) { |
|
120 | + for ($i = 0; $i < $hID; ++$i) { |
|
121 | 121 | $this->children[$i] = |
122 | 122 | new Calendar_Hour($this->year, $this->month, $this->day, $i); |
123 | 123 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @return void |
214 | 214 | * @access private |
215 | 215 | */ |
216 | - function setEmpty ($state = true) |
|
216 | + function setEmpty($state = true) |
|
217 | 217 | { |
218 | 218 | $this->empty = $state; |
219 | 219 | } |