protected function set_customPage($data)
{
global $aidlink;
$locale = fusion_get_locale("", LOCALE . LOCALESET . "admin/custom_pages.php");
if (isset($_POST['save'])) {
$data = array('page_id' => form_sanitizer($_POST['page_id'], 0, 'page_id'), 'page_link_cat' => isset($_POST['page_link_cat']) ? form_sanitizer($_POST['page_link_cat'], 0, 'page_link_cat') : "", 'page_title' => form_sanitizer($_POST['page_title'], '', 'page_title'), 'page_access' => form_sanitizer($_POST['page_access'], 0, 'page_access'), 'page_content' => addslash($_POST['page_content']), 'page_keywords' => form_sanitizer($_POST['page_keywords'], '', 'page_keywords'), 'page_language' => isset($_POST['page_language']) ? form_sanitizer($_POST['page_language'], "", "page_language") : LANGUAGE, 'page_allow_comments' => isset($_POST['page_allow_comments']) ? 1 : 0, 'page_allow_ratings' => isset($_POST['page_allow_ratings']) ? 1 : 0);
if ($data['page_id'] == 0) {
$data += array("add_link" => isset($_POST['add_link']) ? 1 : 0, 'link_id' => form_sanitizer($_POST['link_id'], 0, 'link_id'));
}
if (self::verify_customPage($data['page_id'])) {
dbquery_insert(DB_CUSTOM_PAGES, $data, 'update');
if (\defender::safe()) {
addNotice('success', $locale['411']);
redirect(FUSION_SELF . $aidlink . "&pid=" . $data['page_id']);
}
} else {
dbquery_insert(DB_CUSTOM_PAGES, $data, 'save');
$data['page_id'] = dblastid();
if (!empty($data['add_link'])) {
self::set_customPageLinks($data);
}
if (\defender::safe()) {
addNotice('success', $locale['410']);
redirect(FUSION_SELF . $aidlink . "&pid=" . $data['page_id']);
}
}
}
return $data;
}