$desc = $LANG['MOD_OPF']['TXT_INSERT_DESCRIPTION'];
$func = htmlspecialchars("<?php\nfunction {$function_name}(&\$content, \$page_id, \$section_id, \$module, \$wb) {\n  // add filter here\n  \n  \n  return(TRUE);\n}\n?>");
$funcname = $function_name;
$allowedit = 1;
$allowedittarget = 1;
$filter_type_options = '';
foreach ($types as $value => $text) {
    $filter_type_options .= "<option value=\"{$value}\" ";
    if ($type == $value) {
        $filter_type_options .= 'selected="selected"';
    }
    $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 {
if ($helppath) {
    $helppath_onclick = "javascript: return opf_popup('{$helppath}');";
} else {
    $helppath_onclick = '';
}
// fill target checkbox-trees.
$mlist = $plist1 = $plist2 = '';
opf_preload_filter_definitions();
if ($allowedit == 0 && $allowedittarget == 0) {
    // We can't use disabled or readonly with checkbox-tree, so just list the modules
    $mlist = opf_make_modules_checktree($modules, 'flat');
    // pages_parent
    $plist1 = opf_make_pages_parent_checktree($pages_parent, $pages, 'flat');
    // pages
} else {
    $mlist = opf_make_modules_checktree($modules, 'tree');
    $plist1 = opf_make_pages_parent_checktree($pages_parent, $pages, 'tree');
}
// do we have to display additional_fields?
$list_growfield = array();
$list_editarea = array();
$extra_fields = array();
if (!empty($additional_fields)) {
    if (empty($additional_fields_languages)) {
        $lang = array();
    } else {
        // get language-strings
        if (isset($additional_fields_languages[LANGUAGE])) {
            $lang = $additional_fields_languages[LANGUAGE];
        } elseif (isset($additional_fields_languages['EN'])) {
            $lang = $additional_fields_languages['EN'];