예제 #1
0
 /**
  * Perform various section editing commands
  * @return bool
  */
 public function SectionEdit()
 {
     global $langmessage, $page;
     $section_num = $_REQUEST['section'];
     if (!is_numeric($section_num) || !isset($this->file_sections[$section_num])) {
         echo 'false;';
         return false;
     }
     $page->ajaxReplace = array();
     $cmd = \gp\tool::GetCommand();
     if (!\gp\tool\Editing::SectionEdit($cmd, $this->file_sections[$section_num], $section_num, $this->title, $this->file_stats)) {
         return false;
     }
     //save if the file was changed
     if (!$this->SaveThis()) {
         msg($langmessage['OOPS'] . ' (SE3)');
         return false;
     }
     $page->ajaxReplace[] = array('ck_saved', '', '');
     //update gallery information
     switch ($this->file_sections[$section_num]['type']) {
         case 'gallery':
             $this->GalleryEdited();
             break;
     }
     return true;
 }