Beispiel #1
0
 /**
  * Save a theme image
  * Resize image if necessary
  *
  */
 public function SaveHeaderImage()
 {
     global $gpLayouts, $langmessage;
     $this->page->ajaxReplace = array();
     $section = array();
     if (!\gp\tool\Editing::SectionFromPost_Image($section, '/data/_uploaded/headers/')) {
         return false;
     }
     $save_info = array();
     $save_info['img_rel'] = $section['attributes']['src'];
     $save_info['width'] = $section['attributes']['width'];
     $save_info['height'] = $section['attributes']['height'];
     $container = $_REQUEST['container'];
     $gpLayouts[$this->curr_layout]['images'][$container] = array();
     //prevents shuffle
     $gpLayouts[$this->curr_layout]['images'][$container][] = $save_info;
     if (!$this->SaveLayouts()) {
         return false;
     }
     $this->page->ajaxReplace[] = array('ck_saved', '', '');
     return true;
 }