diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:24:39 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:24:39 +0100 |
commit | a9ac4c861335e60373c1e99b61372e6e0d6ac9f4 (patch) | |
tree | 84e660ad22367aab1697a1f910125f520243b882 /mod/event_calendar/views/default/widgets | |
parent | 1f40407cb2d2f0edfc4cc5346f332f5c6adab022 (diff) | |
parent | b011a80767e1062a394b7bbbc3be3d2959a5f773 (diff) | |
download | elgg-a9ac4c861335e60373c1e99b61372e6e0d6ac9f4.tar.gz elgg-a9ac4c861335e60373c1e99b61372e6e0d6ac9f4.tar.bz2 |
Add 'mod/event_calendar/' from commit 'b011a80767e1062a394b7bbbc3be3d2959a5f773'
git-subtree-dir: mod/event_calendar
git-subtree-mainline: 1f40407cb2d2f0edfc4cc5346f332f5c6adab022
git-subtree-split: b011a80767e1062a394b7bbbc3be3d2959a5f773
Diffstat (limited to 'mod/event_calendar/views/default/widgets')
-rw-r--r-- | mod/event_calendar/views/default/widgets/event_calendar/content.php | 43 | ||||
-rw-r--r-- | mod/event_calendar/views/default/widgets/event_calendar/edit.php | 35 |
2 files changed, 78 insertions, 0 deletions
diff --git a/mod/event_calendar/views/default/widgets/event_calendar/content.php b/mod/event_calendar/views/default/widgets/event_calendar/content.php new file mode 100644 index 000000000..eaedb76bd --- /dev/null +++ b/mod/event_calendar/views/default/widgets/event_calendar/content.php @@ -0,0 +1,43 @@ +<?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 + elgg_load_library('elgg:event_calendar'); + + //the number of events to display + $num = (int) $vars['entity']->num_display; + if (!$num) + $num = 5; + + // Get the events + $owner = elgg_get_page_owner_entity(); + if(elgg_instanceof($owner, 'group')) { + $events = event_calendar_get_events_for_group(elgg_get_page_owner_guid(),$num); + } else { + $events = event_calendar_get_personal_events_for_user(elgg_get_page_owner_guid(),$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 diff --git a/mod/event_calendar/views/default/widgets/event_calendar/edit.php b/mod/event_calendar/views/default/widgets/event_calendar/edit.php new file mode 100644 index 000000000..716920c8a --- /dev/null +++ b/mod/event_calendar/views/default/widgets/event_calendar/edit.php @@ -0,0 +1,35 @@ +<?php + +/** + * Elgg event_calendar group 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/ + * + */ + +if (!$vars['entity']->num_display) { + $num_display = 5; +} else { + $num_display = $vars['entity']->num_display; +} +?> + +<p> + <?php echo elgg_echo("event_calendar:num_display"); ?>: + <select name="params[num_display]"> + <option value="1" <?php if($num_display == 1) echo "SELECTED"; ?>>1</option> + <option value="2" <?php if($num_display == 2) echo "SELECTED"; ?>>2</option> + <option value="3" <?php if($num_display == 3) echo "SELECTED"; ?>>3</option> + <option value="4" <?php if($num_display == 4) echo "SELECTED"; ?>>4</option> + <option value="5" <?php if($num_display == 5) echo "SELECTED"; ?>>5</option> + <option value="6" <?php if($num_display == 6) echo "SELECTED"; ?>>6</option> + <option value="7" <?php if($num_display == 7) echo "SELECTED"; ?>>7</option> + <option value="8" <?php if($num_display == 8) echo "SELECTED"; ?>>8</option> + <option value="9" <?php if($num_display == 9) echo "SELECTED"; ?>>9</option> + <option value="10" <?php if($num_display == 10) echo "SELECTED"; ?>>10</option> + </select> +</p> |