break;
case 'delete':
- $filtername = $fitlernames[$filterpath];
+ if (!empty($filternames[$filterpath])) {
+ $filtername = $filternames[$filterpath];
+ } else {
+ $filtername = $filterpath;
+ }
+
if (substr($filterpath, 0, 4) == 'mod/') {
$mod = basename($filterpath);
$a = new stdClass;
$title = get_string('deletefilterareyousure', 'admin', $filtername);
print_header($title, $title);
print_heading($title);
- notice_yesno(get_string('deletefilterareyousuremessage', 'admin', $filtername),
- admin_url('filters.php?action=delete&filterpath=' . $delete . '&confirm=1&sesskey=' . sesskey()),
- $returnurl, NULL, NULL, 'post', 'get');
+ notice_yesno(get_string('deletefilterareyousuremessage', 'admin', $filtername), $CFG->wwwroot . '/' . $CFG->admin .
+ '/filters.php?action=delete&filterpath=' . $filterpath . '&confirm=1&sesskey=' . sesskey(),
+ "$CFG->wwwroot/$CFG->admin/settings.php", NULL, array('section' => 'managefilters'), 'post', 'get');
print_footer('empty');
exit;
}
filter_delete_all_data($filterpath);
$a = new stdClass;
- $a->fitler = $filtername;
- $a->directory = $filterparth;
+ $a->filter = $filtername;
+ $a->directory = $filterpath;
print_box(get_string('deletefilterfiles', 'admin', $a), 'generalbox', 'notice');
print_continue($returnurl);
- admin_externalpage_print_footer();
+ print_footer('empty');
exit;
}
$filter = $filterinfo->filter;
// Filter name
- $row[] = $this->filternames[$filter];
+ if (!empty($this->filternames[$filter])) {
+ $row[] = $this->filternames[$filter];
+ } else {
+ $row[] = '<span class="error">' . get_string('filemissing', '', $filter) . '</span>';
+ }
// Disable/off/on
$row[] = popup_form($this->action_url($filter, 'setstate') . '&newstate=', $this->activechoices,
}
$row[] = $settings;
+ // Delete
+ $row[] = '<a href="' . $this->action_url($filter, 'delete') . '">' . $this->strdelete . '</a>';
+
return $row;
}
$this->strup = get_string('up');
$this->strdown = get_string('down');
$this->strsettings = get_string('settings');
+ $this->strdelete = get_string('delete');
$filters = filter_get_global_states();
$table = new object();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
- get_string('order'), get_string('applyto', 'filters'), $this->strsettings);
+ get_string('order'), get_string('applyto', 'filters'), $this->strsettings, $this->strdelete);
$table->align = array('left', 'left', 'center', 'left', 'left');
$table->width = '100%';
$table->data = array();