Guest User

Untitled

a guest
May 23rd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. /**
  2. * Creates a themed table of events.
  3. *
  4. * @ingroup event_view
  5. * @param $op
  6. * @param $stamp The timestamp
  7. * @param $endstamp end of the menu
  8. * @param $types limit to given event node types
  9. * @param $terms limit to nodes with these
  10. * @return A fully themed table.
  11. */
  12. function event_calendar_table($op, $stamp, $endstamp, $types = NULL, $terms = NULL) {
  13.  
  14. $today = _event_user_date();
  15. $thead[] = array('data' => ' ');
  16.  
  17. while ($stamp <= $endstamp) {
  18. $year = gmdate('Y', $stamp);
  19. $month = gmdate('m', $stamp);
  20. $cur_day = gmdate('j', $stamp);
  21. $month_name = gmdate('M', $stamp);
  22. $dow = _event_day_of_week($stamp);
  23. $weekdays = event_week_days();
  24.  
  25. $tbody[][] = array('colspan' => 3,
  26. 'class' => strtolower("$month_name ". $weekdays[$dow]['day'] . ($stamp == $today ? ' today' : '') . ($cur_day == $day ? ' selected' : '')),
  27. 'id' => strtolower($month_name . $cur_day),
  28. 'data' => event_render_day($year, $month, $cur_day, 'table', $types, $terms));
  29. $stamp += 86400;
  30. }
  31.  
  32. return array($thead, $tbody);
  33. }
Add Comment
Please, Sign In to add comment