From 29792a9858484266952a53268e4fd0dd29b2f4a5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 28 Jun 2011 18:12:41 -0400 Subject: moved the code into the base directory so that it is easier to work with --- views/default/widgets/event_calendar/edit.php | 35 ++++++++++++++++++++++++ views/default/widgets/event_calendar/view.php | 39 +++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 views/default/widgets/event_calendar/edit.php create mode 100644 views/default/widgets/event_calendar/view.php (limited to 'views/default/widgets') diff --git a/views/default/widgets/event_calendar/edit.php b/views/default/widgets/event_calendar/edit.php new file mode 100644 index 000000000..716920c8a --- /dev/null +++ b/views/default/widgets/event_calendar/edit.php @@ -0,0 +1,35 @@ + + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ + +if (!$vars['entity']->num_display) { + $num_display = 5; +} else { + $num_display = $vars['entity']->num_display; +} +?> + +

+ : + +

diff --git a/views/default/widgets/event_calendar/view.php b/views/default/widgets/event_calendar/view.php new file mode 100644 index 000000000..12fff6d60 --- /dev/null +++ b/views/default/widgets/event_calendar/view.php @@ -0,0 +1,39 @@ + + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ + + // Load event calendar model + require_once(dirname(dirname(dirname(dirname(dirname(__FILE__)))))."/models/model.php"); + + //the number of events to display + $num = (int) $vars['entity']->num_display; + if (!$num) + $num = 5; + + // Get the events + + $events = event_calendar_get_personal_events_for_user(page_owner(),$num); + + // If there are any events to view, view them + if (is_array($events) && sizeof($events) > 0) { + + echo "
"; + + foreach($events as $event) { + echo elgg_view("object/event_calendar",array('entity' => $event)); + } + + echo "
"; + + } + +?> \ No newline at end of file -- cgit v1.2.3