function opf_preload_filter_definitions() { global $database; global $opf_FILTERS; // global storage of all filter-definitions global $opf_HEADER; // global storage of all css- and js-files to put into <head> global $opf_BODY; // global storage of all javascript-calls to put into <body> global $opf_PAGECHILDS; // store all child--page-relations global $opf_PAGES; // global storage of page-data global $opf_MODULES; // global storage of modules if (isset($opf_FILTERS) && is_array($opf_FILTERS)) { return FALSE; } $opf_FILTERS = $opf_HEADER = $opf_BODY = $opf_PAGECHILDS = $opf_PAGES = $opf_MODULES = array(); // fetch page-data if (!($pages = opf_db_query("SELECT *" . " FROM `" . TABLE_PREFIX . "pages`" . " ORDER BY `level`,`position` ASC"))) { $pages = array(); } $pages_act = array(); foreach ($pages as $page) { $pages_act[(int) $page['page_id']] = $page; } unset($pages); $opf_PAGES = $pages_act; // fetch filter-data $filters = opf_select_filters(); if (is_array($filters)) { foreach ($filters as $filter) { $filter['helppath'] = unserialize($filter['helppath']); $filter['desc'] = unserialize($filter['desc']); $filter['modules'] = unserialize($filter['modules']); $filter['pages'] = unserialize($filter['pages']); $filter['pages_parent'] = unserialize($filter['pages_parent']); $filter['pages_parent'] = opf_update_pages_parent($filter['pages_parent']); $filter['current'] = FALSE; $filter['activated'] = FALSE; $filter['failed'] = FALSE; $filter['additional_values'] = unserialize($filter['additional_values']); unset($filter['additional_fields']); unset($filter['additional_fields_languages']); $opf_FILTERS[$filter['name']] = $filter; } } // fetch module-data $opf_MODULES = opf_list_target_modules(TRUE); // fetch child--page-relations foreach ($opf_PAGES as $page) { $page_id = (int) $page['page_id']; $opf_PAGECHILDS[$page_id] = array($page_id); } foreach ($opf_PAGES as $subpage) { if ($subpage['parent'] == 0) { continue; } $trail = explode(',', $subpage['page_trail']); while ($trail) { $pid = array_pop($trail); foreach ($trail as $p) { //if(!in_array($pid, $opf_PAGECHILDS[$p])) // much more expensive than the array_unique()-calls below! $opf_PAGECHILDS[$p][] = $pid; } } } // clean $opf_PAGECHILDS -- this is much cheaper than the in_array()-calls above! $opf_PAGECHILDS_unique = array(); foreach ($opf_PAGECHILDS as $p) { $opf_PAGECHILDS_unique[] = array_unique($p); } $opf_PAGECHILDS = $opf_PAGECHILDS_unique; }
$docu_patch_url = '/modules/outputfilter_dashboard/docs/files/' . $lang . '/install_opf-txt.html'; if (!file_exists(WB_PATH . $docu_patch_url)) { $docu_patch_url = '/modules/outputfilter_dashboard/docs/files/' . 'EN' . '/install_opf-txt.html'; } // set language for help-browser $help_lang = LANGUAGE; if ($help_lang == 'NO') { $help_lang = 'NB'; } if (!file_exists("{$ModPath}/docs/files/" . $help_lang . '/intro-txt.html')) { $help_lang = 'EN'; } // get list of filters for template $filterlist = array(); $types = opf_get_types(); $filters = opf_select_filters(); if (!is_array($filters)) { $filters = array(); } $old_type = ''; // remember last type in foreach below, to draw a separator if type changed foreach ($filters as $filter) { // we need the next str_replace to allow \ ' " in the name for use with javascript $filter['name_js_quoted'] = str_replace(array('\\', ''', '"'), array('\\\\', '\\'', '\\"'), $filter['name']); $filter['desc'] = opf_fetch_entry_language(unserialize($filter['desc'])); $filter['helppath'] = opf_fetch_entry_language(unserialize($filter['helppath'])); $filter['desc'] = '<small>' . opf_correct_umlauts(htmlspecialchars(substr($filter['desc'], 0, 40))) . '...</small>'; // mark last added filter if ($filter['id'] == $id) { $filter['last_touched'] = TRUE; } else {