'); chmod(PL_PAGE_DATA_FILE, 0666); fclose($fh); } else { e('cntwriteto', 'file', PL_PAGE_DATA_FILE); } } /** * Create an instance of PL_Page_Data_Router */ $pd_router = new PL_Page_Data_Router(PL_PAGE_DATA_FILE, $h); if ($adm) { /** * Check for any changes to handle * First: check for changes from texteditor */ if ($function == 'save') { /** * Collect the headings and pass them over to the router */ $text = preg_replace("/]*>( | |\xC2\xA0| )?<\/h[1-" . $cf['menu']['levels'] . "]>/isu", "", stsl($text)); preg_match_all('/(.+)<\/h[1-' . $cf['menu']['levels'] . ']>/isU', $text, $matches); $pd_router->refresh_from_texteditor($matches[1], $s); } /** * Second: check for hanges from MenuManager */ if (isset($menumanager) && $menumanager && $action == 'saverearranged' && (isset($text) ? strlen($text) : 0 ) > 0) { $pd_router->refresh_from_menu_manager($text); } /** * Finally check for some changed page infos */ if ($s > -1 && isset($_POST['save_page_data'])) { $params = $_POST; if (get_magic_quotes_gpc() === 1) { array_walk($params, create_function('&$data', '$data=stripslashes($data);')); } unset($params['save_page_data']); $pd_router->update($s, $params); } } /** * Now we are up to date * If no page has been selected yet, we * are on the start page: Get its index */ if ($s == -1 && !$f && $o == '' && $su == '') { $pd_s = 0; } else { $pd_s = $s; } /** * Get the infos about the current page */ $pd_current = $pd_router->find_page($pd_s); ?>