@@ -155,7 +155,7 @@ public function initialize($config = array())
155155 public function generate ($ year = '' , $ month = '' , $ data = array ())
156156 {
157157 // Set and validate the supplied month/year
158- if ($ year == '' )
158+ if ($ year === '' )
159159 {
160160 $ year = date ('Y ' , $ this ->local_time );
161161 }
@@ -168,7 +168,7 @@ public function generate($year = '', $month = '', $data = array())
168168 $ year = '20 ' .$ year ;
169169 }
170170
171- if ($ month == '' )
171+ if ($ month === '' )
172172 {
173173 $ month = date ('m ' , $ this ->local_time );
174174 }
@@ -205,7 +205,7 @@ public function generate($year = '', $month = '', $data = array())
205205 $ cur_month = date ('m ' , $ this ->local_time );
206206 $ cur_day = date ('j ' , $ this ->local_time );
207207
208- $ is_current_month = ($ cur_year == $ year && $ cur_month == $ month );
208+ $ is_current_month = ($ cur_year === $ year && $ cur_month = == $ month );
209209
210210 // Generate the template data array
211211 $ this ->parse_template ();
@@ -214,7 +214,7 @@ public function generate($year = '', $month = '', $data = array())
214214 $ out = $ this ->temp ['table_open ' ]."\n\n" .$ this ->temp ['heading_row_start ' ]."\n" ;
215215
216216 // "previous" month link
217- if ($ this ->show_next_prev == TRUE )
217+ if ($ this ->show_next_prev === TRUE )
218218 {
219219 // Add a trailing slash to the URL if needed
220220 $ this ->next_prev_url = preg_replace ('/(.+?)\/*$/ ' , '\\1/ ' , $ this ->next_prev_url );
@@ -224,15 +224,15 @@ public function generate($year = '', $month = '', $data = array())
224224 }
225225
226226 // Heading containing the month/year
227- $ colspan = ($ this ->show_next_prev == TRUE ) ? 5 : 7 ;
227+ $ colspan = ($ this ->show_next_prev === TRUE ) ? 5 : 7 ;
228228
229229 $ this ->temp ['heading_title_cell ' ] = str_replace ('{colspan} ' , $ colspan ,
230230 str_replace ('{heading} ' , $ this ->get_month_name ($ month ).' ' .$ year , $ this ->temp ['heading_title_cell ' ]));
231231
232232 $ out .= $ this ->temp ['heading_title_cell ' ]."\n" ;
233233
234234 // "next" month link
235- if ($ this ->show_next_prev == TRUE )
235+ if ($ this ->show_next_prev === TRUE )
236236 {
237237 $ adjusted_date = $ this ->adjust_date ($ month + 1 , $ year );
238238 $ out .= str_replace ('{next_url} ' , $ this ->next_prev_url .$ adjusted_date ['year ' ].'/ ' .$ adjusted_date ['month ' ], $ this ->temp ['heading_next_cell ' ]);
@@ -258,21 +258,21 @@ public function generate($year = '', $month = '', $data = array())
258258
259259 for ($ i = 0 ; $ i < 7 ; $ i ++)
260260 {
261- $ out .= ($ is_current_month === TRUE && $ day == $ cur_day ) ? $ this ->temp ['cal_cell_start_today ' ] : $ this ->temp ['cal_cell_start ' ];
261+ $ out .= ($ is_current_month === TRUE && $ day === $ cur_day ) ? $ this ->temp ['cal_cell_start_today ' ] : $ this ->temp ['cal_cell_start ' ];
262262
263263 if ($ day > 0 && $ day <= $ total_days )
264264 {
265265 if (isset ($ data [$ day ]))
266266 {
267267 // Cells with content
268- $ temp = ($ is_current_month === TRUE && $ day == $ cur_day ) ?
268+ $ temp = ($ is_current_month === TRUE && $ day === $ cur_day ) ?
269269 $ this ->temp ['cal_cell_content_today ' ] : $ this ->temp ['cal_cell_content ' ];
270270 $ out .= str_replace (array ('{content} ' , '{day} ' ), array ($ data [$ day ], $ day ), $ temp );
271271 }
272272 else
273273 {
274274 // Cells with no content
275- $ temp = ($ is_current_month === TRUE && $ day == $ cur_day ) ?
275+ $ temp = ($ is_current_month === TRUE && $ day === $ cur_day ) ?
276276 $ this ->temp ['cal_cell_no_content_today ' ] : $ this ->temp ['cal_cell_no_content ' ];
277277 $ out .= str_replace ('{day} ' , $ day , $ temp );
278278 }
@@ -283,7 +283,7 @@ public function generate($year = '', $month = '', $data = array())
283283 $ out .= $ this ->temp ['cal_cell_blank ' ];
284284 }
285285
286- $ out .= ($ is_current_month === TRUE && $ day == $ cur_day ) ? $ this ->temp ['cal_cell_end_today ' ] : $ this ->temp ['cal_cell_end ' ];
286+ $ out .= ($ is_current_month === TRUE && $ day === $ cur_day ) ? $ this ->temp ['cal_cell_end_today ' ] : $ this ->temp ['cal_cell_end ' ];
287287 $ day ++;
288288 }
289289
@@ -306,7 +306,7 @@ public function generate($year = '', $month = '', $data = array())
306306 */
307307 public function get_month_name ($ month )
308308 {
309- if ($ this ->month_type == 'short ' )
309+ if ($ this ->month_type === 'short ' )
310310 {
311311 $ month_names = array ('01 ' => 'cal_jan ' , '02 ' => 'cal_feb ' , '03 ' => 'cal_mar ' , '04 ' => 'cal_apr ' , '05 ' => 'cal_may ' , '06 ' => 'cal_jun ' , '07 ' => 'cal_jul ' , '08 ' => 'cal_aug ' , '09 ' => 'cal_sep ' , '10 ' => 'cal_oct ' , '11 ' => 'cal_nov ' , '12 ' => 'cal_dec ' );
312312 }
@@ -333,7 +333,7 @@ public function get_month_name($month)
333333 */
334334 public function get_day_names ($ day_type = '' )
335335 {
336- if ($ day_type != '' )
336+ if ($ day_type !== '' )
337337 {
338338 $ this ->day_type = $ day_type ;
339339 }
@@ -419,9 +419,9 @@ public function get_total_days($month, $year)
419419 }
420420
421421 // Is the year a leap year?
422- if ($ month == 2 )
422+ if ($ month === 2 )
423423 {
424- if ($ year % 400 == 0 OR ($ year % 4 == 0 && $ year % 100 != 0 ))
424+ if ($ year % 400 === 0 OR ($ year % 4 === 0 && $ year % 100 != = 0 ))
425425 {
426426 return 29 ;
427427 }
@@ -480,7 +480,7 @@ public function parse_template()
480480 {
481481 $ this ->temp = $ this ->default_template ();
482482
483- if ($ this ->template == '' )
483+ if ($ this ->template === '' )
484484 {
485485 return ;
486486 }
0 commit comments