protected function __construct()
 {
     $this->stringfilternames = filter_get_string_filters();
 }
Exemple #2
0
    redirect($returnurl);
}
/// End of process actions =====================================================
/// Print the page heading.
admin_externalpage_print_header();
echo $OUTPUT->heading(get_string('filtersettings', 'admin'));
$activechoices = array(TEXTFILTER_DISABLED => get_string('disabled', 'filters'), TEXTFILTER_OFF => get_string('offbutavailable', 'filters'), TEXTFILTER_ON => get_string('on', 'filters'));
$applytochoices = array(0 => get_string('content', 'filters'), 1 => get_string('contentandheadings', 'filters'));
$filters = filter_get_global_states();
// In case any new filters have been installed, but not put in the table yet.
$filternames = filter_get_all_installed();
$newfilters = $filternames;
foreach ($filters as $filter => $notused) {
    unset($newfilters[$filter]);
}
$stringfilters = filter_get_string_filters();
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'), get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('delete'));
$table->align = array('left', 'left', 'center', 'left', 'left');
$table->width = '100%';
$table->data = array();
$lastactive = null;
foreach ($filters as $filter => $filterinfo) {
    if ($filterinfo->active != TEXTFILTER_DISABLED) {
        $lastactive = $filter;
    }
}
// iterate through filters adding to display table
$firstrow = true;
foreach ($filters as $filter => $filterinfo) {
    $applytostrings = isset($stringfilters[$filter]) && $filterinfo->active != TEXTFILTER_DISABLED;