aboutsummaryrefslogtreecommitdiff
path: root/views/default/event_calendar/calendar.php
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2011-06-28 23:13:49 -0700
committerKevin Jardine <kevinjardine@yahoo.com>2011-06-28 23:13:49 -0700
commit0a013cd9833a20d3b6334d80dba581bbbb2ce756 (patch)
treebad977e423a6d1193d362295611fe4472c2373af /views/default/event_calendar/calendar.php
parent1dd01c7ff9685995b4bc9de0ceeb7856086c3f40 (diff)
parent29792a9858484266952a53268e4fd0dd29b2f4a5 (diff)
downloadelgg-0a013cd9833a20d3b6334d80dba581bbbb2ce756.tar.gz
elgg-0a013cd9833a20d3b6334d80dba581bbbb2ce756.tar.bz2
Merge pull request #1 from cash/master
moved code into base directory
Diffstat (limited to 'views/default/event_calendar/calendar.php')
-rw-r--r--views/default/event_calendar/calendar.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/views/default/event_calendar/calendar.php b/views/default/event_calendar/calendar.php
new file mode 100644
index 000000000..ebf4aa589
--- /dev/null
+++ b/views/default/event_calendar/calendar.php
@@ -0,0 +1,61 @@
+<?php
+if ($vars['mode']) {
+ $mode = $vars['mode'];
+} else {
+ $mode = 'month';
+}
+$link_bit = $vars['url'].'mod/event_calendar/show_events.php?start_date='.$vars['original_start_date'].'&group_guid='.$vars['group_guid'].'&filter='.$vars['filter'].'&mode=';
+
+$range_bit = '';
+$first_date = $vars['first_date'];
+if ($first_date) {
+ $range_bit .= 'minDate: $.datepicker.parseDate("yy-mm-dd", "'.$first_date.'"),'."\n";
+}
+$last_date = $vars['last_date'];
+if ($last_date) {
+ $range_bit .= 'maxDate: $.datepicker.parseDate("yy-mm-dd", "'.$last_date.'"),'."\n";
+}
+if ($first_date || $last_date) {
+ if (substr($first_date,0,7) == substr($last_date,0,7)) {
+ $range_bit .= "changeMonth: false,\n";
+ }
+
+ if (substr($first_date,0,4) == substr($last_date,0,4)) {
+ $range_bit .= "changeYear: false,\n";
+ }
+}
+
+$body .= elgg_view("input/datepicker_inline",
+ array(
+ 'internalname' => 'my_datepicker',
+ 'mode' => $vars['mode']?$vars['mode']:'month',
+ 'start_date' => $vars['start_date'],
+ 'end_date' => $vars['end_date'],
+ 'group_guid' => $vars['group_guid'],
+ 'range_bit' => $range_bit,
+ )
+);
+$body .= '<div id="calendarmenucontainer">';
+$body .= '<ul id="calendarmenu">';
+if ($mode == 'day') {
+ $link_class = ' class="sys_selected"';
+} else {
+ $link_class = '';
+}
+$body .= '<li'.$link_class.'><a href="'.$link_bit.'day">'.elgg_echo('event_calendar:day_label').'</a></li>';
+if ($mode == 'week') {
+ $link_class = ' class="sys_selected"';
+} else {
+ $link_class = '';
+}
+$body .= '<li'.$link_class.'><a href="'.$link_bit.'week">'.elgg_echo('event_calendar:week_label').'</a></li>';
+if ($mode == 'month') {
+ $link_class = ' class="sys_selected sys_calmenu_last"';
+} else {
+ $link_class = ' class="sys_calmenu_last"';
+}
+$body .= '<li'.$link_class.'><a href="'.$link_bit.'month">'.elgg_echo('event_calendar:month_label').'</a></li>';
+$body .= '</ul>';
+$body .= '</div>';
+echo $body;
+?> \ No newline at end of file