Example #1
0
 /**
  * LazyestAdmin::media_upload_lazyestgallery()
  * Handles the user submit
  * Display the upload tab for lazyest gallery
  * 
  * @since 1.1.0
  * @return void
  */
 function media_upload_lazyestgallery()
 {
     require_once $this->plugin_dir . '/inc/uploadtab.php';
     $uploadtab = new LazyestUploadTab();
     if (isset($_POST['folder_slide'])) {
         $result = $uploadtab->folder_to_editor('slideshow');
         unset($uploadtab);
         return $result;
     }
     if (isset($_POST['folder_short'])) {
         $result = $uploadtab->folder_to_editor('shortcode');
         unset($uploadtab);
         return $result;
     }
     if (isset($_POST['image_short'])) {
         $result = $uploadtab->image_to_editor('shortcode');
         unset($uploadtab);
         return $result;
     }
     $uploadtab->display();
     unset($uploadtab);
 }
Example #2
0
/**
 * lg_insert_image_shortcode()
 * Insert an image shortcode in a post
 * 
 * @since 1.1.0
 * @return void
 */
function lg_insert_image_shortcode()
{
    global $lg_gallery;
    if (isset($_POST['image'])) {
        $file = urldecode($_POST['image']);
        $folder = new LazyestFolder(dirname($file));
        if ($folder->valid()) {
            $image = $folder->single_image(basename($file), 'thumbs');
            require_once $lg_gallery->plugin_dir . '/inc/uploadtab.php';
            $uploadtab = new LazyestUploadTab();
            $uploadtab->insert_image_shortcode($image);
        }
    }
    die;
}