|
|
@ -314,8 +314,12 @@ switch ($action) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'delete_all': |
|
|
|
case 'delete_all': |
|
|
|
if (api_is_allowed_to_edit()) { |
|
|
|
if (api_is_allowed_to_edit()) { |
|
|
|
|
|
|
|
$allow = api_get_configuration_value('disable_delete_all_announcements'); |
|
|
|
|
|
|
|
if ($allow === false) { |
|
|
|
AnnouncementManager::delete_all_announcements($_course); |
|
|
|
AnnouncementManager::delete_all_announcements($_course); |
|
|
|
Display::addFlash(Display::return_message(get_lang('AnnouncementDeletedAll'))); |
|
|
|
Display::addFlash(Display::return_message(get_lang('AnnouncementDeletedAll'))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
header('Location: ' . $homeUrl); |
|
|
|
header('Location: ' . $homeUrl); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
@ -668,9 +672,12 @@ if ($allowToEdit && (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($allowToEdit) { |
|
|
|
if ($allowToEdit && api_get_group_id() == 0) { |
|
|
|
if (api_get_group_id() == 0) { |
|
|
|
$allow = api_get_configuration_value('disable_delete_all_announcements'); |
|
|
|
if (!isset($_GET['action'])) { |
|
|
|
if ($allow === false) { |
|
|
|
|
|
|
|
if (!isset($_GET['action']) || |
|
|
|
|
|
|
|
isset($_GET['action']) && $_GET['action'] == 'list' |
|
|
|
|
|
|
|
) { |
|
|
|
$actionsLeft .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=delete_all\" onclick=\"javascript:if(!confirm('" . get_lang("ConfirmYourChoice") . "')) return false;\">" . |
|
|
|
$actionsLeft .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=delete_all\" onclick=\"javascript:if(!confirm('" . get_lang("ConfirmYourChoice") . "')) return false;\">" . |
|
|
|
Display::return_icon( |
|
|
|
Display::return_icon( |
|
|
|
'delete_announce.png', |
|
|
|
'delete_announce.png', |
|
|
|