| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* GmediaProcessor_WordpressLibrary |
| 8 |
*/ |
| 9 |
class GmediaProcessor_WordpressLibrary extends GmediaProcessor { |
| 10 |
|
| 11 |
public static $cookie_key = false; |
| 12 |
|
| 13 |
public $selected_items = array(); |
| 14 |
|
| 15 |
private static $me = null; |
| 16 |
|
| 17 |
/** |
| 18 |
* GmediaProcessor_Library constructor. |
| 19 |
*/ |
| 20 |
public function __construct() { |
| 21 |
parent::__construct(); |
| 22 |
|
| 23 |
self::$cookie_key = 'gmedia_library:wpmedia'; |
| 24 |
$this->selected_items = parent::selected_items( self::$cookie_key ); |
| 25 |
|
| 26 |
} |
| 27 |
|
| 28 |
public static function getMe() { |
| 29 |
if ( null === self::$me ) { |
| 30 |
self::$me = new GmediaProcessor_WordpressLibrary(); |
| 31 |
} |
| 32 |
|
| 33 |
return self::$me; |
| 34 |
} |
| 35 |
|
| 36 |
protected function processor() { |
| 37 |
global $gmCore; |
| 38 |
|
| 39 |
if ( ! $gmCore->caps['gmedia_import'] ) { |
| 40 |
wp_die( esc_html__( 'You are not allowed to import media in Gmedia Library', 'grand-media' ) ); |
| 41 |
} |
| 42 |
|
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
global $gmProcessorWPMedia; |
| 47 |
$gmProcessorWPMedia = GmediaProcessor_WordpressLibrary::getMe(); |
| 48 |
|