}
    $filter_type_options .= ">" . opf_quotes($text) . "</option>";
}
// fill target checkbox-trees
$mlist = $plist1 = '';
$mlist = opf_make_modules_checktree($modules, $type = 'tree', TRUE);
$plist1 = opf_make_pages_parent_checktree($pages_parent, $pages, $type = 'tree');
// do we have to display additional_fields? - No
$list_growfield = "";
$list_editarea = "";
$extra_fields = "";
// init template
$tpl = new Template(WB_PATH . '/modules/outputfilter_dashboard');
$tpl->set_file('page', 'templates/add_edit.htt');
// fill template vars
$tpl->set_var(array_merge($LANG['MOD_OPF'], array('tpl_filter_readonly' => $userfunc || $allowedit ? '' : 'readonly="readonly"', 'tpl_filter_disabled' => $userfunc || $allowedit ? '' : 'disabled="disabled"', 'tpl_filter_active' => $active ? 'checked="checked"' : '', 'tpl_filter_type' => $type, 'tpl_module_tree' => $mlist, 'tpl_pages_list1' => $plist1, 'tpl_save_url' => opf_quotes(ADMIN_URL . "/admintools/tool.php?tool=" . basename(dirname(__FILE__))), 'FTAN' => $ftan, 'tpl_id' => opf_quotes($id), 'tpl_filter_name' => opf_quotes($name), 'tpl_filter_funcname' => opf_quotes($funcname), 'tpl_filter_file' => opf_quotes($file), 'tpl_filter_description' => opf_quotes($desc), 'tpl_filter_helppath_onclick' => '', 'TPL_HELP_BLOCK' => '', 'tpl_funcname' => $funcname, 'tpl_func' => $func, 'tpl_cancel_onclick' => opf_quotes('javascript: window.location = \'' . ADMIN_URL . '/admintools/tool.php?tool=' . basename(dirname(__FILE__)) . '\';'), 'tpl_allowedit' => $func != "" ? "var opf_editarea = " . ($allowedit ? '"editable"' : '""') . ";" : "", 'tpl_list_editarea' => "", 'tpl_list_growfield' => $list_growfield, 'tpl_filter_type_options' => $filter_type_options, 'WB_URL' => WB_URL, 'MOD_URL' => WB_URL . '/modules/' . $module_directory, 'IMAGE_URL' => WB_URL . '/modules/' . $module_directory . '/templates/images', 'TPL_EXTRA_FIELDS_BLOCK' => "")));
// if file is not empty parse the file_area_block and store the result in TPL_FILE_AREA_BLOCK
if (!empty($file)) {
    $tpl->set_block('page', 'file_area_block', 'file_area');
    $tpl->parse('TPL_FILE_AREA_BLOCK', 'file_area_block', false);
} else {
    $tpl->set_var('TPL_FILE_AREA_BLOCK', "");
}
// if func is not empty parse the func_area_block and store the result in TPL_FUNC_AREA_BLOCK
if (!empty($func)) {
    $tpl->set_block('page', 'func_area_block', 'func_area');
    $tpl->parse('TPL_FUNC_AREA_BLOCK', 'func_area_block', false);
} else {
    $tpl->set_var('TPL_FUNC_AREA_BLOCK', "");
}
// show page
    } else {
        $tpl->set_var('TPL_UPLOAD_BLOCK', "");
    }
    // if the patch is not applied parse the patch block
    if (!$patch_applied) {
        $tpl->set_block('page', 'patch_block', 'patch');
        $tpl->parse('TPL_PATCH_BLOCK', 'patch_block', false);
    } else {
        $tpl->set_var('TPL_PATCH_BLOCK', "");
    }
    // construct the table rows for displaying the filter list
    $TPL_FILTER_BLOCK = "";
    $tpl->set_block('page', 'filter_block', 'filter');
    $row = 'row_a';
    foreach ($filterlist as $filter) {
        $row = $row == 'row_b' ? 'row_a' : 'row_b';
        $tpl->set_var(array('tpl_filter_id' => $filter['filter_id'], 'tpl_filter_class' => $filter['last_touched'] ? "last-modified" : opf_quotes($row), 'tpl_filter_active' => $filter['active'] ? "active" : "inactive", 'tpl_filter_separator' => $filter['sep_line'] ? 'class="row-separator"' : '', 'tpl_filter_move' => $filter['sep_line'] ? 'class="row-separator move"' : 'class="move"', 'tpl_filter_activelink' => opf_quotes($filter['active_link']), 'tpl_filter_active_inactive' => $filter['active'] ? "active" : "inactive", 'tpl_filter_on_off' => $filter['active'] ? "on" : "off", 'tpl_filter_activelink_title' => $filter['active'] ? $LANG['MOD_OPF']['TXT_FILTER_ACTIVE'] : $LANG['MOD_OPF']['TXT_FILTER_INACTIVE'], 'tpl_filter_name' => opf_quotes($filter['name']), 'tpl_filter_editlink' => opf_quotes($filter['edit_link']), 'tpl_convert_link_start' => $filter['plugin'] == '' && $filter['userfunc'] == 0 ? "<!--/*" : "", 'tpl_filter_convert_link' => opf_quotes($filter['convert_link']), 'tpl_filter_convert_query' => opf_quotes("opf_message('" . ($filter['plugin'] == '' ? $LANG['MOD_OPF']["TXT_CONVERT_FILTER"] : $LANG['MOD_OPF']["TXT_CONVERT_PLUGIN"]) . "', '" . sprintf($filter['plugin'] == '' ? $LANG['MOD_OPF']['TXT_SURE_TO_CONVERT'] : $LANG['MOD_OPF']['TXT_SURE_TO_INLINE'], $filter['name_js_quoted']) . "', 'query', '" . $LANG['MOD_OPF']["TXT_CANCEL"] . "', '" . $LANG['MOD_OPF']["TXT_OK"] . "', '" . opf_quotes($filter['convert_link']) . "'); return false;"), 'tpl_convert_link_end' => $filter['plugin'] == '' && $filter['userfunc'] == 0 ? "*/-->" : "", 'tpl_filter_type' => $filter['plugin'] ? "plugin" : ($filter['userfunc'] ? "inline" : "extension"), 'tpl_filter_title' => $filter['plugin'] ? $LANG['MOD_OPF']["TXT_PLUGIN_FILTER"] : ($filter['userfunc'] ? $LANG['MOD_OPF']["TXT_INLINE_FILTER"] : $LANG['MOD_OPF']["TXT_MODULE_EXTENSION_FILTER"]), 'tpl_filter_type_txt' => opf_quotes($filter['type']), 'tpl_filter_desc' => opf_quotes($filter['desc']), 'tpl_filter_help_start' => $filter['helppath_onclick'] ? "" : "<!--/*", 'tpl_filter_help_end' => $filter['helppath_onclick'] ? "&nbsp;" : "*/-->", 'tpl_filter_helppath_onclick' => opf_quotes($filter['helppath_onclick']), 'tpl_filter_configurl_start' => $filter['configurl'] ? "" : "<!--/*", 'tpl_filter_configurl_end' => $filter['configurl'] ? "&nbsp;" : "*/-->", 'tpl_filter_configurl' => opf_quotes($filter['configurl']), 'tpl_filter_css_link_start' => $filter['css_link'] ? "" : "<!--/*", 'tpl_filter_css_link_end' => $filter['css_link'] ? "&nbsp;" : "*/-->", 'tpl_filter_css_link' => opf_quotes($filter['css_link']), 'tpl_filter_moveup_link_start' => $filter['moveup_link'] ? "" : "<!--/*", 'tpl_filter_moveup_link_end' => $filter['moveup_link'] ? "&nbsp;" : "*/-->", 'tpl_filter_moveup_link' => opf_quotes($filter['moveup_link']), 'tpl_filter_export_link_start' => $filter['plugin'] || $filter['userfunc'] ? "" : "<!--/*", 'tpl_filter_export_link_end' => $filter['plugin'] || $filter['userfunc'] ? "&nbsp;" : "*/-->", 'tpl_filter_export_link' => opf_quotes($filter['export_link']), 'tpl_filter_delete_link_start' => $filter['delete_link'] ? "" : "<!--/*", 'tpl_filter_delete_link_end' => $filter['delete_link'] ? "&nbsp;" : "*/-->", 'tpl_filter_delete_query' => opf_quotes("opf_message('" . $LANG['MOD_OPF']["TXT_DELETE_FILTER"] . "', '" . sprintf($LANG['MOD_OPF']['TXT_SURE_TO_DELETE'], $filter['name_js_quoted']) . "', 'query', '" . $LANG['MOD_OPF']["TXT_CANCEL"] . "', '" . $LANG['MOD_OPF']["TXT_OK"] . "', '" . opf_quotes($filter['delete_link']) . "'); return false;"), 'tpl_filter_delete_link' => opf_quotes($filter['delete_link']), 'tpl_filter_movedown_link_start' => $filter['movedown_link'] ? "" : "<!--/*", 'tpl_filter_movedown_link_end' => $filter['movedown_link'] ? "&nbsp;" : "*/-->", 'tpl_filter_movedown_link' => opf_quotes($filter['movedown_link'])));
        $tpl->parse('TPL_FILTER_BLOCK', 'filter_block', false);
        // obtain the current line and hide the disabled parts
        $TPL_FILTER_BLOCK .= opf_filter_Comments($tpl->get_var('TPL_FILTER_BLOCK'));
    }
    $tpl->set_var('TPL_FILTER_BLOCK', $TPL_FILTER_BLOCK);
    // output template
    $tpl->set_block('page', 'main_block', 'main');
    $tpl->parse('main', 'main_block', false);
    print opf_filter_Comments($tpl->parse('output', 'main', false));
}
if ($need_footer) {
    $admin->print_footer();
    exit(0);
}
$mod_dir = basename(dirname(__FILE__));
require WB_PATH . '/modules/' . $mod_dir . '/info.php';
// include module.functions.php
include_once WB_PATH . '/framework/module.functions.php';
// include the module language file depending on the backend language of the current user
if (!(include get_module_language_file($mod_dir))) {
    return;
}
// load outputfilter-functions
require_once dirname(__FILE__) . '/functions.php';
// This file will be included from tool.php
// check if user is allowed to use admin-tools (to prevent this file to be called by an unauthorized user e.g. from a code-section)
if (!$admin->get_permission('admintools')) {
    die(header('Location: ../../index.php'));
}
// get content of csspath
$css = '';
if (file_exists($csspath) && is_readable($csspath)) {
    // csspath has to be local, file_exists() and is_readable() can't handle remote files
    $css = file_get_contents($csspath);
}
// template
$tpl = new Template(WB_PATH . '/modules/outputfilter_dashboard');
$tpl->set_file('page', "templates/css.htt");
// fill template vars
$tpl->set_var(array_merge($LANG['MOD_OPF'], array('tpl_save_url' => opf_quotes("{$ToolUrl}&amp;id={$id}&amp;css_save=1"), 'FTAN' => $ftan, 'tpl_id' => opf_quotes($id), 'tpl_csspath' => opf_quotes($csspath), 'tpl_css' => opf_quotes($css), 'tpl_cancel_onclick' => opf_quotes("javascript: window.location = '{$ToolUrl}'"), 'WB_URL' => WB_URL, 'MOD_URL' => WB_URL . '/modules/' . $module_directory, 'IMAGE_URL' => WB_URL . '/modules/' . $module_directory . '/templates/images')));
// output template
$tpl->set_unknowns('keep');
$tpl->set_block('page', 'main_block', 'main');
$tpl->parse('main', 'main_block', false);
print opf_filter_Comments($tpl->parse('output', 'main', false));
 $TPL_EXTRA_FIELDS_BLOCK = "";
 foreach ($extra_fields as $field) {
     $template = $field['type'];
     if ($field['type'] == 'editarea') {
         $template = 'textarea';
     }
     $tpl_field_text = opf_quotes($field['text']);
     $tpl->set_var('tpl_field_text', $tpl_field_text);
     $tpl_field_name = opf_quotes($field['name']);
     $tpl->set_var('tpl_field_name', $tpl_field_name);
     $tpl_field_value = $field['value'];
     $tpl_field_id = '';
     if ($template == 'textarea') {
         $tpl_field_id = opf_quotes($field['id']);
     } else {
         $tpl_field_value = opf_quotes($tpl_field_value);
     }
     $tpl->set_var('tpl_field_value', $tpl_field_value);
     $tpl->set_var('tpl_field_id', $tpl_field_id);
     $tpl_field_style = $field['style'];
     $tpl->set_var('tpl_field_style', $tpl_field_style);
     if (isset($field['checked'])) {
         $tpl_field_checked = $field['checked'];
     } else {
         $tpl_field_checked = "";
     }
     $tpl->set_var('tpl_field_checked', $tpl_field_checked);
     if (isset($field['options'])) {
         $tpl_field_options = $field['options'];
     } else {
         $tpl_field_options = "";