From 43df50de769ce11dac12ebedef07c7c1a7e9b7ab Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Sun, 22 Jul 2012 13:08:19 +0200 Subject: add button always appears, even for event polls, fixes issue #37 --- models/model.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'models') diff --git a/models/model.php b/models/model.php index 2752626bc..8e82052ec 100644 --- a/models/model.php +++ b/models/model.php @@ -1483,27 +1483,23 @@ function event_calendar_get_page_content_list($page_type,$container_guid,$start_ $user_guid = elgg_get_logged_in_user_guid(); // TODO - ideally avoid the check on the event_poll plugin, perhaps by having event_poll remove the menu item if(event_calendar_can_add($container_guid)) { - if (!elgg_plugin_exists('event_poll')) { - elgg_register_menu_item('title', array( - 'name' => 'add', - 'href' => "event_calendar/add/".$container_guid, - 'text' => elgg_echo('event_calendar:add'), - 'class' => 'elgg-button elgg-button-action', - )); - } + elgg_register_menu_item('title', array( + 'name' => 'add', + 'href' => "event_calendar/add/".$container_guid, + 'text' => elgg_echo('event_calendar:add'), + 'class' => 'elgg-button elgg-button-action', + )); } } else { elgg_push_breadcrumb(elgg_echo('item:object:event_calendar')); $user_guid = elgg_get_logged_in_user_guid(); if(event_calendar_can_add($container_guid)) { - if (!elgg_plugin_exists('event_poll')) { - elgg_register_menu_item('title', array( - 'name' => 'add', - 'href' => "event_calendar/add", - 'text' => elgg_echo('event_calendar:add'), - 'class' => 'elgg-button elgg-button-action', - )); - } + elgg_register_menu_item('title', array( + 'name' => 'add', + 'href' => "event_calendar/add", + 'text' => elgg_echo('event_calendar:add'), + 'class' => 'elgg-button elgg-button-action', + )); } } -- cgit v1.2.3