aboutsummaryrefslogtreecommitdiff
path: root/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'start.php')
-rw-r--r--start.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/start.php b/start.php
index ed0ba41db..03f1a183a 100644
--- a/start.php
+++ b/start.php
@@ -337,11 +337,13 @@ function event_calendar_entity_menu_setup($hook, $type, $return, $params) {
function event_calendar_entity_menu_prepare($hook, $type, $return, $params) {
// remove access level from listings
- if (!elgg_in_context('event_calendar:view')) {
+ if (elgg_in_context('event_calendar') && !elgg_in_context('event_calendar:view')) {
$new_return = array();
- foreach($return['default'] AS $item) {
- if ($item->getName() != 'access') {
- $new_return[] = $item;
+ if ($return['default']) {
+ foreach($return['default'] AS $item) {
+ if ($item->getName() != 'access') {
+ $new_return[] = $item;
+ }
}
}
$return['default'] = $new_return;