CI calendar class changes


/ Published in: PHP
Save to your folder(s)

At line 220 you should see the the start if an if block. This is the section that needs to be edited. I added the foreach block to itterate over the data array and create links in the table cells.


Copy this code and paste it in your HTML
  1. if (isset($data[$day]))
  2. {
  3. // Cells with content
  4. $temp = ($is_current_month === TRUE AND $day == $cur_day) ?
  5. $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
  6. foreach($data[$day] as $content) {
  7. $out .= str_replace(array('{link}','{link_text}', '{day}'),
  8. array($content['link'], $content['link_text'], $day), $temp);
  9. }
  10. }
  11. else
  12. {
  13. // Cells with no content
  14. $temp = ($is_current_month === TRUE AND $day == $cur_day) ?
  15. $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
  16. $out .= str_replace('{day}', $day, $temp);
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.