switch ($action) {
case 'delete':
if ($eid) {
+ if ($element['type'] == 'item' and $object->is_external_item() and !$object->is_outcome_item()) {
+ // no deleting of external activities!
+ break;
+ }
$confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($confirm and confirm_sesskey()) {
$actions .= $gtree->get_calculation_icon($element, $gpr);
if ($element['type'] == 'item' or ($element['type'] == 'category' and $element['depth'] > 1)) {
- $actions .= '<a href="index.php?id='.$COURSE->id.'&action=delete&eid='
- . $eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'
- . $strdelete.'" title="'.$strdelete.'"/></a>';
+ if (!($element['type'] == 'item' and $object->is_external_item() and !$object->is_outcome_item())) {
+ $actions .= '<a href="index.php?id='.$COURSE->id.'&action=delete&eid='
+ . $eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'
+ . $strdelete.'" title="'.$strdelete.'"/></a>';
+ }
$actions .= '<a href="index.php?id='.$COURSE->id.'&action=moveselect&eid='
. $eid.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/move.gif" class="iconsmall" alt="'
. $strmove.'" title="'.$strmove.'"/></a>';