function AltMenu_NewName() { global $langmessage; $menu_name = gp_edit::CleanTitle($_POST['menu_name'], ' '); if (empty($menu_name)) { message($langmessage['OOPS'] . ' (Empty Name)'); return false; } if (array_search($menu_name, $this->avail_menus) !== false) { message($langmessage['OOPS'] . ' (Name Exists)'); return false; } return $menu_name; }
/** * Return the name of the cleansed extra area name, create file if it doesn't already exist * */ function NewExtraArea() { global $langmessage, $dataDir; $title = gp_edit::CleanTitle($_REQUEST['extra_area']); if (empty($title)) { message($langmessage['OOPS']); return false; } $data = gp_edit::DefaultContent($_POST['type']); $file = $dataDir . '/data/_extra/' . $title . '.php'; if (gpFiles::Exists($file)) { return $title; } if (!gpFiles::SaveData($file, 'extra_content', $data)) { message($langmessage['OOPS']); return false; } return $title; }
/** * @deprecated 3.0 * Use gp_edit::CleanTitle() instead * Used by Simple_Blog1 */ public static function CleanTitle($title, $spaces = '_') { trigger_error('Deprecated Function'); includeFile('tool/editing.php'); return gp_edit::CleanTitle($title, $spaces); }
function NewExtraArea() { global $dataDir, $langmessage; if (empty($_POST['extra_area'])) { return false; } $extra_name = gp_edit::CleanTitle($_POST['extra_area']); $extra_file = $dataDir . '/data/_extra/' . $extra_name . '.php'; if (file_exists($extra_file)) { return $extra_name; } $text = '<div>' . htmlspecialchars($_POST['extra_area']) . '</div>'; if (!gpFiles::SaveFile($extra_file, $text)) { return false; } return $extra_name; }
/** * Perform various section editing commands * */ function SectionEdit($cmd) { global $page, $langmessage; if (empty($_REQUEST['file'])) { message($langmessage['OOPS']); return false; } $page->ajaxReplace = array(); $file = gp_edit::CleanTitle($_REQUEST['file']); $data = gpOutput::ExtraContent($file, $file_stats); $page->file_sections = array($data); //hack so the SaveSection filter works $page->file_stats = $file_stats; if (!gp_edit::SectionEdit($cmd, $data, 0, '', $file_stats)) { return; } //save the new content $file_full = $this->folder . '/' . $file . '.php'; if (!gpFiles::SaveData($file_full, 'extra_content', $data)) { message($langmessage['OOPS']); $this->EditExtra(); return false; } $page->ajaxReplace[] = array('ck_saved', '', ''); message($langmessage['SAVED']); $this->areas[$file] = $file; $this->EditExtra(); return true; }
/** * @deprecated * Use gp_edit::CleanTitle() instead */ function CleanTitle($title, $spaces = '_') { includeFile('tool/editing.php'); return gp_edit::CleanTitle($title, $spaces); }
/** * Save the posted content for an extra content area * */ function SaveExtra() { global $langmessage, $page; //for ajax responses $page->ajaxReplace = array(); if (empty($_REQUEST['file'])) { message($langmessage['OOPS']); return false; } $title = gp_edit::CleanTitle($_REQUEST['file']); $file = $this->folder . '/' . $title . '.php'; $text =& $_POST['gpcontent']; gpFiles::cleanText($text); if (!gpFiles::SaveFile($file, $text)) { message($langmessage['OOPS']); $this->EditExtra(); return false; } $page->ajaxReplace[] = array('ck_saved', '', ''); message($langmessage['SAVED']); $this->areas[$title] = $title; return true; }