Changeset 998050
- Timestamp:
- 09/28/2014 05:09:47 PM (12 years ago)
- Location:
- remote-medias-lite/trunk
- Files:
-
- 29 edited
-
autoload.php (modified) (1 diff)
-
src/RemoteMediaExt/AccountPostType.php (modified) (2 diffs)
-
src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php (modified) (6 diffs)
-
src/RemoteMediaExt/Accounts/AbstractRemoteClient.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/AbstractRemoteMedia.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Dailymotion/RemoteMedia.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Dailymotion/Service.php (modified) (3 diffs)
-
src/RemoteMediaExt/Accounts/Flickr/Client.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Flickr/RemoteMedia.php (modified) (2 diffs)
-
src/RemoteMediaExt/Accounts/MetaBoxSaveAccount.php (modified) (3 diffs)
-
src/RemoteMediaExt/Accounts/MetaBoxService.php (modified) (4 diffs)
-
src/RemoteMediaExt/Accounts/MetaBoxServiceLoader.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/RemoteAccount.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/RemoteServiceFactory.php (modified) (3 diffs)
-
src/RemoteMediaExt/Accounts/Vimeo/Client.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Vimeo/RemoteMedia.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Vimeo/Service.php (modified) (3 diffs)
-
src/RemoteMediaExt/Accounts/Youtube/Client.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Youtube/RemoteMedia.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Youtube/Service.php (modified) (1 diff)
-
src/RemoteMediaExt/Ajax/AjaxQueryAttachments.php (modified) (4 diffs)
-
src/RemoteMediaExt/Ajax/AjaxSendRemoteToEditor.php (modified) (1 diff)
-
src/RemoteMediaExt/Ajax/AjaxUserInfo.php (modified) (1 diff)
-
src/RemoteMediaExt/FRemoteMediaExt.php (modified) (5 diffs)
-
src/RemoteMediaExt/Library/MediaArraySettings.php (modified) (1 diff)
-
src/RemoteMediaExt/Library/MediaLibrarySection.php (modified) (1 diff)
-
src/RemoteMediaExt/Library/MediaSettings.php (modified) (2 diffs)
-
src/RemoteMediaExt/Library/MediaStrings.php (modified) (1 diff)
-
src/RemoteMediaExt/Library/MediaTemplate.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
remote-medias-lite/trunk/autoload.php
r992903 r998050 4 4 class PluginAutoloader 5 5 { 6 private static $loader;6 private static $loader; 7 7 8 public static function getLoader() 9 { 10 if (null !== self::$loader) { 11 return self::$loader; 8 public static function getLoader() 9 { 10 if (null !== self::$loader) { 11 return self::$loader; 12 } 13 14 $vendorDir = __DIR__.'/vendor'; 15 16 if (!class_exists('\Composer\Autoload\ClassLoader')) { 17 require $vendorDir . '/composer/ClassLoader.php'; 18 } 19 $loaderClass = __NAMESPACE__.'\WPCore\WPpluginLoader'; 20 if (!class_exists($loaderClass)) { 21 require $vendorDir.'/loumray/wpcore/src/WPpluginLoader.php'; 22 } 23 24 self::$loader = $loader = new $loaderClass; 25 26 $map = require $vendorDir . '/composer/autoload_namespaces.php'; 27 foreach ($map as $namespace => $path) { 28 $loader->add(__NAMESPACE__.'\\'.$namespace, $path); 29 } 30 31 $map = require $vendorDir . '/composer/autoload_psr4.php'; 32 foreach ($map as $namespace => $path) { 33 //If namespace already start with wrapper namespace 34 if (strpos($namespace, __NAMESPACE__) === 0) { 35 $loader->addPsr4($namespace, $path); 36 } else { 37 $loader->addPsr4(__NAMESPACE__.'\\'.$namespace, $path); 38 } 39 } 40 41 $classMap = require $vendorDir . '/composer/autoload_classmap.php'; 42 if ($classMap) { 43 $loader->addClassMap($classMap); 44 } 45 $loader->register(true); 46 47 return $loader; 12 48 } 13 14 $vendorDir = __DIR__.'/vendor';15 $baseDir = __DIR__;16 17 if(!class_exists('\Composer\Autoload\ClassLoader'))18 {19 require $vendorDir . '/composer/ClassLoader.php';20 }21 $loaderClass = __NAMESPACE__.'\WPCore\WPpluginLoader';22 if(!class_exists($loaderClass))23 {24 require $vendorDir.'/loumray/wpcore/src/WPpluginLoader.php';25 }26 27 self::$loader = $loader = new $loaderClass;28 29 $map = require $vendorDir . '/composer/autoload_namespaces.php';30 foreach ($map as $namespace => $path) {31 $loader->add(__NAMESPACE__.'\\'.$namespace, $path);32 }33 34 $map = require $vendorDir . '/composer/autoload_psr4.php';35 foreach ($map as $namespace => $path) {36 //If namespace already start with wrapper namespace37 if (strpos($namespace, __NAMESPACE__) === 0) {38 $loader->addPsr4($namespace, $path);39 } else {40 $loader->addPsr4(__NAMESPACE__.'\\'.$namespace, $path);41 }42 }43 44 $classMap = require $vendorDir . '/composer/autoload_classmap.php';45 if ($classMap) {46 $loader->addClassMap($classMap);47 }48 $loader->register(true);49 50 return $loader;51 }52 49 } 53 50 return PluginAutoloader::getLoader(); 54 -
remote-medias-lite/trunk/src/RemoteMediaExt/AccountPostType.php
r997433 r998050 54 54 } 55 55 56 public function addPostUpdateMsgParam($link) { 56 public function addPostUpdateMsgParam($link) 57 { 57 58 $params = array(); 58 if (isset($_REQUEST['rmlmsg'])) {59 if (isset($_REQUEST['rmlmsg'])) { 59 60 $params['rmlmsg'] = absint($_REQUEST['rmlmsg']); 60 61 } … … 70 71 $messages[$this->getSlug()] = array( 71 72 0 => '', // Unused. Messages start at index 1. 72 1 => __( 'Remote library settings updated.', 'remote-medias-lite'),73 4 => __( 'Remote library settings updated.', 'remote-medias-lite'),73 1 => __('Remote library settings updated.', 'remote-medias-lite'), 74 4 => __('Remote library settings updated.', 'remote-medias-lite'), 74 75 /* translators: %s: date and time of the revision */ 75 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Remote library settings restored to revision from %s', 'remote-medias-lite' ), wp_post_revision_title( (int) $_GET['revision'], false )) : false,76 6 => __( 'Remote library settings published.', 'remote-medias-lite'),77 7 => __( 'Remote library settings saved.', 'remote-medias-lite'),78 8 => __( 'Remote library settings submitted.', 'remote-medias-lite'),76 5 => isset( $_GET['revision'] ) ? sprintf(__('Remote library settings restored to revision from %s', 'remote-medias-lite'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 77 6 => __('Remote library settings published.', 'remote-medias-lite'), 78 7 => __('Remote library settings saved.', 'remote-medias-lite'), 79 8 => __('Remote library settings submitted.', 'remote-medias-lite'), 79 80 9 => sprintf( 80 __( 'Remote library settings scheduled for: <strong>%1$s</strong>.', 'remote-medias-lite'),81 __('Remote library settings scheduled for: <strong>%1$s</strong>.', 'remote-medias-lite'), 81 82 // translators: Publish box date format, see http://php.net/date 82 date_i18n( __( 'M j, Y @ G:i', 'remote-medias-lite' ), strtotime( $post->post_date ))83 date_i18n(__('M j, Y @ G:i', 'remote-medias-lite'), strtotime($post->post_date)) 83 84 ), 84 10 => __( 'Remote library settings draft updated.', 'remote-medias-lite')85 10 => __('Remote library settings draft updated.', 'remote-medias-lite') 85 86 ); 86 87 -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php
r997433 r998050 14 14 protected $service; 15 15 16 public static function getType($ id)16 public static function getType($aid) 17 17 { 18 $type = get_post_meta($ id,'remote_account_type', true);18 $type = get_post_meta($aid, 'remote_account_type', true); 19 19 20 20 if (empty($type)) { … … 24 24 } 25 25 26 public function __construct($ id = null, $type = null)26 public function __construct($aid = null, $type = null) 27 27 { 28 $this->localID = (int)$ id;28 $this->localID = (int)$aid; 29 29 $this->type = $type; 30 30 $this->fetch(); … … 67 67 $this->validate(); 68 68 69 $return = update_post_meta($this->localID, 'remote_attr',$this->attributes);70 $return = update_post_meta($this->localID, 'remote_account_type',$this->type) && $return;69 $return = update_post_meta($this->localID, 'remote_attr', $this->attributes); 70 $return = update_post_meta($this->localID, 'remote_account_type', $this->type) && $return; 71 71 72 72 return $return; … … 76 76 { 77 77 $this->service = $service; 78 if (!is_null($this->service)) {78 if (!is_null($this->service)) { 79 79 $this->service->setAccount($this); 80 80 } … … 87 87 } 88 88 89 public function get($name) { 89 public function get($name) 90 { 90 91 if ($name === null) { 91 92 return $this->attributes; … … 142 143 public function validate() 143 144 { 144 if (!($this->service instanceof AbstractRemoteService)) {145 return false;146 }145 if (!($this->service instanceof AbstractRemoteService)) { 146 return false; 147 } 147 148 148 $return = array(); 149 $return = array(); 150 $return['validate'] = false; 151 152 try { 153 $return['validate'] = $this->service->validate($this); 154 } catch (ClientErrorResponseException $e) { 155 $return['error'] = true; 156 $return['statuscode'] = $e->getResponse()->getStatusCode(); 157 $return['msg'] = $e->getResponse()->getReasonPhrase(); 158 } catch (\Exception $e) { 159 $return['error'] = true; 160 $return['statuscode'] = $e->getCode(); 161 $return['msg'] = $e->getMessage(); 162 } 149 163 150 $response = array(); 151 $return['validate'] = false; 152 try { 153 $return['validate'] = $this->service->validate($this); 154 } catch(ClientErrorResponseException $e) { 155 $return['error'] = true; 156 $return['statuscode'] = $e->getResponse()->getStatusCode(); 157 $return['msg'] = $e->getResponse()->getReasonPhrase(); 158 } catch(\Exception $e) { 159 $return['error'] = true; 160 $return['statuscode'] = $e->getCode(); 161 $return['msg'] = $e->getMessage(); 162 } 164 $lastValidQuery = null; 163 165 164 $lastValidQuery = null; 166 if ($return['validate'] === true) { 167 $lastValidQuery = $this->get('remote_user_id'); 168 $this->set('isValid', true); 169 } else { 170 $this->set('isValid', false); 171 } 165 172 166 if ($return['validate'] === true) { 167 $lastValidQuery = $this->get('remote_user_id'); 168 $this->set('isValid', true); 169 } else { 170 $this->set('isValid', false); 171 } 173 $this->set('last_valid_query', $lastValidQuery); 172 174 173 $this->set('last_valid_query', $lastValidQuery); 174 175 return $return['validate']; 175 return $return['validate']; 176 176 } 177 177 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/AbstractRemoteClient.php
r992903 r998050 6 6 abstract class AbstractRemoteClient extends Client 7 7 { 8 /** 9 * Factory method to create a new RemoteClient 10 * 11 * @param array|Collection $config Configuration data 12 * 13 * @return self 14 */ 15 8 /** 9 * Factory method to create a new RemoteClient 10 * 11 * @param array|Collection $config Configuration data 12 * 13 * @return self 14 */ 16 15 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/AbstractRemoteMedia.php
r997748 r998050 131 131 */ 132 132 abstract public function toMediaManagerAttachment(); 133 134 133 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Dailymotion/RemoteMedia.php
r997433 r998050 19 19 { 20 20 $attachment = array_merge( 21 $this->getBasicAttachment(), 21 $this->getBasicAttachment(), 22 22 $attachment = array( 23 23 'id' => $this->metadata['id'], -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Dailymotion/Service.php
r997433 r998050 52 52 'fields' => 'id,screenname,status,username' 53 53 ); 54 $command = $this->client->getCommand('UserRequest', $params);54 $command = $this->client->getCommand('UserRequest', $params); 55 55 $response = $this->client->execute($command); 56 56 … … 72 72 'fields' => 'id,title,description,created_time,modified_time,owner,thumbnail_120_url,thumbnail_url,url' 73 73 ); 74 $command = $this->client->getCommand('UserRequest', $params);74 $command = $this->client->getCommand('UserRequest', $params); 75 75 $response = $this->client->execute($command); 76 76 … … 84 84 'fields' => 'id,title,description,created_time,modified_time,owner,thumbnail_120_url,thumbnail_url,url' 85 85 ); 86 $command = $this->client->getCommand('UserVideosRequest', $params);86 $command = $this->client->getCommand('UserVideosRequest', $params); 87 87 $response = $this->client->execute($command); 88 88 -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Flickr/Client.php
r997433 r998050 8 8 class Client extends AbstractRemoteClient 9 9 { 10 /**11 * Factory method to create a new VimeoClient12 *13 */14 public static function factory($config = array())15 {10 /** 11 * Factory method to create a new VimeoClient 12 * 13 */ 14 public static function factory($config = array()) 15 { 16 16 17 $default = array(18 'base_url' => '{scheme}://api.flickr.com/services/feeds',19 'scheme' => 'https',20 'curl.options' => array(21 CURLOPT_TIMEOUT => 30,22 CURLOPT_CONNECTTIMEOUT => 30,23 )24 );25 $required = array('base_url');17 $default = array( 18 'base_url' => '{scheme}://api.flickr.com/services/feeds', 19 'scheme' => 'https', 20 'curl.options' => array( 21 CURLOPT_TIMEOUT => 30, 22 CURLOPT_CONNECTTIMEOUT => 30, 23 ) 24 ); 25 $required = array('base_url'); 26 26 27 $config = Collection::fromConfig($config, $default, $required);27 $config = Collection::fromConfig($config, $default, $required); 28 28 29 $client = new self($config->get('base_url'), $config);29 $client = new self($config->get('base_url'), $config); 30 30 31 // Attach a service description to the client32 $description = ServiceDescription::factory(__DIR__ .'/ServiceDescription.json');33 $client->setDescription($description);31 // Attach a service description to the client 32 $description = ServiceDescription::factory(__DIR__ .'/ServiceDescription.json'); 33 $client->setDescription($description); 34 34 35 return $client;36 }35 return $client; 36 } 37 37 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Flickr/RemoteMedia.php
r997433 r998050 3 3 4 4 use WPRemoteMediaExt\RemoteMediaExt\Accounts\AbstractRemoteMedia; 5 5 6 /* 6 7 * Flickr Media Class … … 101 102 { 102 103 $attachment = array_merge( 103 $this->getBasicAttachment(), 104 $this->getBasicAttachment(), 104 105 array( 105 106 'id' => basename($this->metadata['guid']), -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/MetaBoxSaveAccount.php
r997433 r998050 5 5 use WPRemoteMediaExt\WPCore\admin\WPmetabox; 6 6 use WPRemoteMediaExt\WPCore\admin\WPSaveMetabox; 7 8 7 9 8 class MetaBoxSaveAccount extends WPSaveMetabox … … 16 15 $verify = parent::action($post_id, $post); 17 16 if (!$verify) { 18 return;17 return; 19 18 } 20 19 … … 48 47 } 49 48 } 50 51 49 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/MetaBoxService.php
r997433 r998050 20 20 public function __construct( 21 21 View $view, 22 $ id,22 $mbId, 23 23 $title, 24 24 $post_type, 25 $context = 'advanced',25 $context = 'advanced', 26 26 $priority = 'default', 27 27 $callback_args = null … … 29 29 30 30 parent::__construct( 31 $ id,31 $mbId, 32 32 $title, 33 33 $post_type, … … 49 49 public function action() 50 50 { 51 $postType = func_get_arg(0);52 $post = func_get_arg(1);53 $account = RemoteAccountFactory::create($post->ID);51 // $postType = func_get_arg(0); 52 // $post = func_get_arg(1); 53 // $account = RemoteAccountFactory::create($post->ID); 54 54 55 55 parent::action(); … … 70 70 $this->view->show(); 71 71 } 72 73 72 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/MetaBoxServiceLoader.php
r992903 r998050 9 9 class MetaBoxServiceLoader extends WPmetaboxLoader 10 10 { 11 protected $metabox;11 protected $metabox; 12 12 13 public function __construct(WPmetabox $metabox)14 {15 parent::__construct($metabox, new MetaBoxSaveAccount());16 }13 public function __construct(WPmetabox $metabox) 14 { 15 parent::__construct($metabox, new MetaBoxSaveAccount()); 16 } 17 17 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/RemoteAccount.php
r992903 r998050 4 4 class RemoteAccount extends AbstractRemoteAccount 5 5 { 6 public function __construct($id = null, $type = null) 7 { 8 parent::__construct($id,$type); 9 } 10 6 public function __construct($raId = null, $type = null) 7 { 8 parent::__construct($raId, $type); 9 } 11 10 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/RemoteServiceFactory.php
r997433 r998050 4 4 class RemoteServiceFactory 5 5 { 6 static $classes = array();6 public static $classes = array(); 7 7 8 8 public static function create($class) … … 25 25 } 26 26 27 public static function className($class) 27 public static function className($class) 28 28 { 29 29 switch ($class) { … … 45 45 public static function getDbClassName($classname) 46 46 { 47 return str_replace('\\', '_',$classname);47 return str_replace('\\', '_', $classname); 48 48 } 49 49 50 50 public static function retrieveClassName($dbclassname) 51 51 { 52 $retrievedClass = str_replace('_', '\\',$dbclassname);52 $retrievedClass = str_replace('_', '\\', $dbclassname); 53 53 $retrievedClass = self::className($retrievedClass); 54 54 return $retrievedClass; -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Vimeo/Client.php
r997433 r998050 8 8 class Client extends AbstractRemoteClient 9 9 { 10 /**11 * Factory method to create a new VimeoClient12 *13 */14 public static function factory($config = array())15 {10 /** 11 * Factory method to create a new VimeoClient 12 * 13 */ 14 public static function factory($config = array()) 15 { 16 16 17 $default = array(18 'base_url' => '{scheme}://vimeo.com/api/{version}/',19 'scheme' => 'http',20 'version' => 'v2',21 'curl.options' => array(22 CURLOPT_TIMEOUT => 30,23 CURLOPT_CONNECTTIMEOUT => 30,24 )25 );26 $required = array('base_url');17 $default = array( 18 'base_url' => '{scheme}://vimeo.com/api/{version}/', 19 'scheme' => 'http', 20 'version' => 'v2', 21 'curl.options' => array( 22 CURLOPT_TIMEOUT => 30, 23 CURLOPT_CONNECTTIMEOUT => 30, 24 ) 25 ); 26 $required = array('base_url'); 27 27 28 $config = Collection::fromConfig($config, $default, $required);28 $config = Collection::fromConfig($config, $default, $required); 29 29 30 $client = new self($config->get('base_url'), $config);30 $client = new self($config->get('base_url'), $config); 31 31 32 // Attach a service description to the client33 $description = ServiceDescription::factory(__DIR__ . '/ServiceDescription.json');34 $client->setDescription($description);32 // Attach a service description to the client 33 $description = ServiceDescription::factory(__DIR__ . '/ServiceDescription.json'); 34 $client->setDescription($description); 35 35 36 return $client;37 }36 return $client; 37 } 38 38 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Vimeo/RemoteMedia.php
r997433 r998050 19 19 { 20 20 $attachment = array_merge( 21 $this->getBasicAttachment(), 21 $this->getBasicAttachment(), 22 22 array( 23 23 'id' => $this->metadata['id'], -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Vimeo/Service.php
r997433 r998050 7 7 use WPRemoteMediaExt\WPCore\View; 8 8 use WPRemoteMediaExt\WPForms\FieldSet; 9 10 11 9 12 10 class Service extends AbstractRemoteService … … 49 47 { 50 48 51 $params = array(52 'user_id' => $this->account->get('remote_user_id'),53 'request' => 'info'54 );55 $command = $this->client->getCommand('UserRequest', $params);56 $response = $this->client->execute($command);49 $params = array( 50 'user_id' => $this->account->get('remote_user_id'), 51 'request' => 'info' 52 ); 53 $command = $this->client->getCommand('UserRequest', $params); 54 $response = $this->client->execute($command); 57 55 58 return $command->getResponse()->isSuccessful();56 return $command->getResponse()->isSuccessful(); 59 57 } 60 58 … … 91 89 $attachments = array(); 92 90 93 foreach ($medias as $i => $media) {91 foreach ($medias as $i => $media) { 94 92 $remoteMedia = new RemoteMedia($media); 95 93 $remoteMedia->setAccount($this->getAccount()); -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Youtube/Client.php
r997433 r998050 8 8 class Client extends AbstractRemoteClient 9 9 { 10 /**11 * Factory method to create a new Client12 */13 public static function factory($config = array())14 {10 /** 11 * Factory method to create a new Client 12 */ 13 public static function factory($config = array()) 14 { 15 15 16 $default = array(17 'base_url' => '{scheme}://gdata.youtube.com/feeds/api/',18 'scheme' => 'https',19 'curl.options' => array(20 CURLOPT_TIMEOUT => 30,21 CURLOPT_CONNECTTIMEOUT => 30,22 )23 );24 $required = array('base_url');16 $default = array( 17 'base_url' => '{scheme}://gdata.youtube.com/feeds/api/', 18 'scheme' => 'https', 19 'curl.options' => array( 20 CURLOPT_TIMEOUT => 30, 21 CURLOPT_CONNECTTIMEOUT => 30, 22 ) 23 ); 24 $required = array('base_url'); 25 25 26 $config = Collection::fromConfig($config, $default, $required);26 $config = Collection::fromConfig($config, $default, $required); 27 27 28 $client = new self($config->get('base_url'), $config);28 $client = new self($config->get('base_url'), $config); 29 29 30 // Attach a service description to the client31 $description = ServiceDescription::factory(__DIR__ . '/ServiceDescription.json');32 $client->setDescription($description);30 // Attach a service description to the client 31 $description = ServiceDescription::factory(__DIR__ . '/ServiceDescription.json'); 32 $client->setDescription($description); 33 33 34 return $client;35 }34 return $client; 35 } 36 36 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Youtube/RemoteMedia.php
r997433 r998050 28 28 29 29 $attachment = array_merge( 30 $this->getBasicAttachment(), 30 $this->getBasicAttachment(), 31 31 array( 32 32 'id' => $this->metadata['youtubeid'], -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Youtube/Service.php
r997433 r998050 59 59 } 60 60 61 // public function62 61 public function setAccount(AbstractRemoteAccount $account) 63 62 { -
remote-medias-lite/trunk/src/RemoteMediaExt/Ajax/AjaxQueryAttachments.php
r997433 r998050 10 10 class AjaxQueryAttachments extends WPajaxCall 11 11 { 12 13 12 public function __construct() 14 13 { … … 21 20 $accountID = 0; 22 21 if (isset($_REQUEST['query']['account_id'])) { 23 $accountID = esc_attr($_REQUEST['query']['account_id']);22 $accountID = esc_attr($_REQUEST['query']['account_id']); 24 23 } 25 24 … … 28 27 29 28 $return = array(); 30 $response = array();31 29 $return['data'] = array(); 32 30 try { 33 31 $return['data'] = $service->getUserAttachments(); 34 32 35 } catch (ClientErrorResponseException $e) {33 } catch (ClientErrorResponseException $e) { 36 34 $return['success'] = true; 37 35 $return['statuscode'] = $e->getResponse()->getStatusCode(); 38 36 $return['msg'] = $e->getResponse()->getError(); 39 37 wp_send_json($return); 40 } catch (CurlException $e) {38 } catch (CurlException $e) { 41 39 $return['success'] = false; 42 40 $return['statuscode'] = $e->getErrorNo(); 43 41 $return['msg'] = $e->getError(); 44 42 wp_send_json($return); 45 } catch (\Exception $e) {43 } catch (\Exception $e) { 46 44 $return['success'] = false; 47 45 $return['statuscode'] = $e->getResponse()->getStatusCode(); … … 50 48 } 51 49 52 wp_send_json_success( $return['data']);50 wp_send_json_success($return['data']); 53 51 } 54 52 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Ajax/AjaxSendRemoteToEditor.php
r997433 r998050 19 19 $html = ""; 20 20 21 if (empty($jsattachment['subtype']) || empty($jsattachment['remotedata'])){ 21 if (empty($jsattachment['subtype']) || 22 empty($jsattachment['remotedata']) 23 ) { 22 24 wp_send_json_error(); 23 25 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Ajax/AjaxUserInfo.php
r997433 r998050 27 27 $response = $service->GetUserInfo(esc_attr($_POST['user_id'])); 28 28 $return['data'] = $response->getAll(); 29 } catch (ClientErrorResponseException $e) {29 } catch (ClientErrorResponseException $e) { 30 30 $return['error'] = true; 31 31 $return['statuscode'] = $e->getResponse()->getStatusCode(); 32 32 $return['msg'] = $e->getResponse()->getReasonPhrase(); 33 } catch (\Exception $e) {33 } catch (\Exception $e) { 34 34 $return['error'] = true; 35 35 $return['statuscode'] = $e->getCode(); -
remote-medias-lite/trunk/src/RemoteMediaExt/FRemoteMediaExt.php
r997748 r998050 124 124 $this->hook(new MediaTemplate(new View($this->getViewsPath().'admin/media-remote-attachment.php'))); 125 125 $this->addScript(new WPscriptAdmin(array('post.php' => array(), 'post-new.php' => array()), 'media-remote-ext', $this->getJsUrl().'media-remote-ext.min.js', $this->getJsUrl().'media-remote-ext.js', array('media-editor','media-views'), $this->version)); 126 $this->addStyle(new WPstyleAdmin(array(), 'media-remote-admin-css', $this->getCssUrl().'media-remote-admin.min.css', $this->getCssUrl().'media-remote-admin.css', $deps =array(), $this->version));126 $this->addStyle(new WPstyleAdmin(array(), 'media-remote-admin-css', $this->getCssUrl().'media-remote-admin.min.css', $this->getCssUrl().'media-remote-admin.css', array(), $this->version)); 127 127 } 128 128 … … 166 166 public function initMetaboxes() 167 167 { 168 $this->addScript(new WPscriptAdmin(array('post.php' => array('post_type' => $this->accountPostType->getSlug()), 'post-new.php' => array('post_type' => $this->accountPostType->getSlug())), 'rmedias-query-test', $this->getJsUrl().'media-remote-query-test.min.js', $this->getJsUrl().'media-remote-query-test.js', array(), $this->version));168 $this->addScript(new WPscriptAdmin(array('post.php' => array('post_type' => $this->accountPostType->getSlug()), 'post-new.php' => array('post_type' => $this->accountPostType->getSlug())), 'rmedias-query-test', $this->getJsUrl().'media-remote-query-test.min.js', $this->getJsUrl().'media-remote-query-test.js', array(), $this->version)); 169 169 $this->addScript(new WPscriptAdmin(array('post.php' => array('post_type' => $this->accountPostType->getSlug()), 'post-new.php' => array('post_type' => $this->accountPostType->getSlug())), 'media-remote-account', $this->getJsUrl().'rml-account.min.js', $this->getJsUrl().'rml-account.js', array(), $this->version)); 170 170 … … 202 202 __('Status & Actions', 'remote-medias-lite'), 203 203 $this->accountPostType->getSlug(), 204 'side', //'normal', 'advanced', or 'side'205 'high' //'high', 'core', 'default' or 'low'204 'side', //'normal', 'advanced', or 'side' 205 'high' //'high', 'core', 'default' or 'low' 206 206 ); 207 207 $this->hook(new MetaBoxServiceLoader($metabox)); … … 213 213 214 214 $services = array(); 215 foreach ($this->getRemoteServices() as $service) {215 foreach ($this->getRemoteServices() as $service) { 216 216 $services[$service->getSlug()] = $service->getName(); 217 217 } … … 236 236 $uid = get_current_user_id(); 237 237 238 if (is_null($this->fPointerAccounts) || 239 is_null($this->fPointerMediaManager) 238 if (is_null($this->fPointerAccounts) || 239 is_null($this->fPointerMediaManager) 240 240 ) { 241 241 $this->initPointers(); -
remote-medias-lite/trunk/src/RemoteMediaExt/Library/MediaArraySettings.php
r992903 r998050 6 6 class MediaArraySettings extends WPfilter 7 7 { 8 protected $slug; 9 protected $setting = array(); 8 10 9 protected $slug; 10 protected $setting = array(); 11 public function __construct($slug) 12 { 13 parent::__construct('media_view_settings', 10, 2); 11 14 12 public function __construct($slug) 13 { 14 parent::__construct('media_view_settings', 10, 2); 15 $this->slug = $slug; 16 } 15 17 16 $this->slug = $slug; 17 } 18 public function getSlug() 19 { 20 return $this->slug; 21 } 18 22 19 public function getSlug()20 {21 return $this->slug;22 }23 public function addSetting($index, $value) 24 { 25 $this->setting[$index] = $value; 26 } 23 27 24 public function addSetting($index,$value) 25 { 26 $this->setting[$index] = $value; 27 } 28 public function removeSetting($index) 29 { 30 unset($this->setting[$index]); 31 } 32 public function getSetting() 33 { 34 return $this->setting; 35 } 28 36 29 public function removeSetting($index) 30 { 31 unset($this->setting[$index]); 32 } 33 public function getSetting() 34 { 35 return $this->setting; 36 } 37 public function action() 38 { 39 $settings = func_get_arg(0); 40 // $post = func_get_arg(1); 37 41 38 function action() 39 { 40 $settings = func_get_arg(0); 41 $post = func_get_arg(1); 42 $settings[$this->slug] = $this->setting; 42 43 43 $settings[$this->slug] = $this->setting; 44 45 return $settings; 46 } 47 44 return $settings; 45 } 48 46 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Library/MediaLibrarySection.php
r992903 r998050 6 6 class MediaLibrarySection implements WPhook 7 7 { 8 protected $strings = array();8 protected $strings = array(); 9 9 10 protected $title;11 protected $content;10 protected $title; 11 protected $content; 12 12 13 public function __construct($view, $slug, $title)14 {15 $this->title = new MediaStrings($slug,$title);16 $this->content = new MediaTemplate($view);17 }13 public function __construct($view, $slug, $title) 14 { 15 $this->title = new MediaStrings($slug, $title); 16 $this->content = new MediaTemplate($view); 17 } 18 18 19 public function register()20 {21 $this->title->register();22 $this->content->register();23 }19 public function register() 20 { 21 $this->title->register(); 22 $this->content->register(); 23 } 24 24 25 public function remove() 26 { 27 $this->title->remove(); 28 $this->content->remove(); 29 } 30 25 public function remove() 26 { 27 $this->title->remove(); 28 $this->content->remove(); 29 } 31 30 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Library/MediaSettings.php
r997433 r998050 28 28 } 29 29 30 function action()30 public function action() 31 31 { 32 32 $settings = func_get_arg(0); 33 $post = func_get_arg(1);33 // $post = func_get_arg(1); 34 34 35 35 $args = array( … … 58 58 return $settings; 59 59 } 60 61 60 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Library/MediaStrings.php
r992903 r998050 7 7 { 8 8 9 protected $slug;10 protected $name;9 protected $slug; 10 protected $name; 11 11 12 public function __construct($slug, $name)13 {14 parent::__construct('media_view_strings', 10, 2);12 public function __construct($slug, $name) 13 { 14 parent::__construct('media_view_strings', 10, 2); 15 15 16 $this->slug = $slug;17 $this->name = $name;18 }16 $this->slug = $slug; 17 $this->name = $name; 18 } 19 19 20 public function getSlug()21 {22 return $this->slug;23 }20 public function getSlug() 21 { 22 return $this->slug; 23 } 24 24 25 public function getName()26 {27 return $this->name;28 }25 public function getName() 26 { 27 return $this->name; 28 } 29 29 30 function action()31 {32 $strings = func_get_arg(0);33 $post = func_get_arg(1);30 public function action() 31 { 32 $strings = func_get_arg(0); 33 // $post = func_get_arg(1); 34 34 35 $strings[$this->slug] = $this->name;35 $strings[$this->slug] = $this->name; 36 36 37 return $strings; 38 } 39 37 return $strings; 38 } 40 39 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Library/MediaTemplate.php
r992903 r998050 7 7 class MediaTemplate extends WPaction 8 8 { 9 protected $view; 9 10 10 protected $view; 11 public function __construct(View $view) 12 { 13 $this->view = $view; 11 14 12 public function __construct(View $view) 13 { 14 $this->view = $view; 15 parent::__construct('print_media_templates'); 16 } 15 17 16 parent::__construct('print_media_templates'); 17 } 18 19 public function action() 20 { 21 $this->view->show(); 22 } 23 18 public function action() 19 { 20 $this->view->show(); 21 } 24 22 }
Note: See TracChangeset
for help on using the changeset viewer.