cmds['InlineEdit'] = ''; //added to in js $this->cmds['gallery_folder'] = 'GalleryImages'; $this->cmds['gallery_images'] = 'GalleryImages'; $this->cmds['save_inline'] = 'SaveHeaderImage'; $this->cmds['image_editor'] = '\\gp\\tool\\Editing::ImageEditor'; } /** * Load the inline editor for a theme image * */ public function InlineEdit(){ $section = array(); $section['type'] = 'image'; \gp\tool\Output\Ajax::InlineEdit($section); die(); } public function GalleryImages(){ $_GET += array('dir'=>'/headers'); \gp\admin\Content\Uploaded::InlineList($_GET['dir']); } /** * 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; } /** * Show images available in themes * */ public function ShowThemeImages(){ global $langmessage; $this->page->ajaxReplace = array(); $current_theme = false; //which theme folder if( isset($_REQUEST['theme']) && isset($this->avail_addons[$_REQUEST['theme']]) ){ $current_theme = $_REQUEST['theme']; $current_info = $this->avail_addons[$current_theme]; $current_label = $current_info['name']; $current_dir = $current_info['full_dir']; $current_url = \gp\tool::GetDir($current_info['rel']); //current layout }else{ $layout_info = \gp\tool::LayoutInfo($this->curr_layout,false); $current_label = $layout_info['theme_name']; $current_dir = $layout_info['dir']; $current_url = \gp\tool::GetDir(dirname($layout_info['path'])); } //list of themes ob_start(); echo '