/** * Extract information about the gallery from it's html: img_count, icon_src * Call GalleryEdited when a gallery section is removed, edited * */ function GalleryEdited() { includeFile('special/special_galleries.php'); special_galleries::UpdateGalleryInfo($this->title, $this->file_sections); }
/** * Get the content of the file in the trash so we can restore file information * - resized images * - special_galleries::UpdateGalleryInfo($title,$content) * */ function RestoreFile($title, $file, $title_info) { //get the file data $file_sections = array(); ob_start(); include $file; ob_get_clean(); // Restore resized images if (count($file_sections)) { includeFile('image.php'); gp_resized::SetIndex(); foreach ($file_sections as $section => $section_data) { if (!isset($section_data['resized_imgs'])) { continue; } foreach ($section_data['resized_imgs'] as $image_index => $sizes) { if (!isset(gp_resized::$index[$image_index])) { continue; } $img = gp_resized::$index[$image_index]; foreach ($sizes as $size) { list($width, $height) = explode('x', $size); gp_edit::CreateImage($img, $width, $height); } } gp_edit::ResizedImageUse(array(), $section_data['resized_imgs']); } gp_resized::SaveIndex(); } // Restore Galleries if (strpos($title_info['type'], 'gallery') !== false) { includeFile('special/special_galleries.php'); special_galleries::UpdateGalleryInfo($title, $file_sections); } }