diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-06-28 18:12:41 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-06-28 18:12:41 -0400 |
commit | 29792a9858484266952a53268e4fd0dd29b2f4a5 (patch) | |
tree | bad977e423a6d1193d362295611fe4472c2373af /views/default/widgets/event_calendar/view.php | |
parent | 1dd01c7ff9685995b4bc9de0ceeb7856086c3f40 (diff) | |
download | elgg-29792a9858484266952a53268e4fd0dd29b2f4a5.tar.gz elgg-29792a9858484266952a53268e4fd0dd29b2f4a5.tar.bz2 |
moved the code into the base directory so that it is easier to work with
Diffstat (limited to 'views/default/widgets/event_calendar/view.php')
-rw-r--r-- | views/default/widgets/event_calendar/view.php | 39 |
1 files changed, 39 insertions, 0 deletions
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 @@ +<?php + +/** + * Elgg event calendar widget + * + * @package event_calendar + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Kevin Jardine <kevin@radagast.biz> + * @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 "<div id=\"widget_calendar\">"; + + foreach($events as $event) { + echo elgg_view("object/event_calendar",array('entity' => $event)); + } + + echo "</div>"; + + } + +?>
\ No newline at end of file |