/** * 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; }