aboutsummaryrefslogtreecommitdiff
path: root/views/default/event_calendar/container.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-20 05:45:54 +0200
committerSem <sembrestels@riseup.net>2012-07-20 05:45:54 +0200
commit3ac2c8fd0cacc57b8080be5f7d381b8cf5524f2f (patch)
tree46475df7579e0bf12c7bff62c3e125b16c641247 /views/default/event_calendar/container.php
parent6e3d519f4ff1e163fe698607adba1568386d8c55 (diff)
parent86d154541f9cf1de74f79cae6c1b05b3214bdca8 (diff)
downloadelgg-3ac2c8fd0cacc57b8080be5f7d381b8cf5524f2f.tar.gz
elgg-3ac2c8fd0cacc57b8080be5f7d381b8cf5524f2f.tar.bz2
Merge branch 'full' of https://github.com/kevinjardine/Elgg-Event-Calendar
Diffstat (limited to 'views/default/event_calendar/container.php')
-rw-r--r--views/default/event_calendar/container.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/views/default/event_calendar/container.php b/views/default/event_calendar/container.php
new file mode 100644
index 000000000..cb5c8620c
--- /dev/null
+++ b/views/default/event_calendar/container.php
@@ -0,0 +1,28 @@
+<?php
+elgg_load_library('elgg:event_calendar');
+$site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar');
+$group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar');
+$admin = elgg_is_admin_logged_in();
+$containers = array();
+if (($site_calendar != 'no') && ($admin || !$site_calendar || ($site_calendar == 'loggedin'))) {
+ $containers[0] = elgg_echo('event_calendar:site_calendar');
+}
+$user = elgg_get_logged_in_user_entity();
+$groups = $user->getGroups('',0,0);
+foreach ($groups as $group) {
+ if (event_calendar_activated_for_group($group)) {
+ if ($admin || !$group_calendar || $group_calendar == 'members') {
+ if ($group->canWriteToContainer($user->guid)) {
+ $containers[$group->guid] = $group->name;
+ }
+ } else if ($group->canEdit()) {
+ $containers[$group->guid] = $group->name;
+ }
+ }
+}
+if ($vars['container_guid']) {
+ $value = $vars['container_guid'];
+} else {
+ $value = 0;
+}
+echo elgg_view('input/dropdown',array('name'=>'group_guid', 'value'=>$vars['container_guid'],'options_values'=>$containers));