Changeset 1121928
- Timestamp:
- 03/27/2015 05:44:17 AM (11 years ago)
- Location:
- remote-medias-lite/trunk
- Files:
-
- 38 edited
-
assets/css/media-remote-admin.css (modified) (1 diff)
-
assets/css/media-remote-admin.min.css (modified) (1 diff)
-
assets/js/media-remote-ext.js (modified) (13 diffs)
-
assets/js/media-remote-ext.min.js (modified) (1 diff)
-
assets/js/media-remote-query-test.js (modified) (1 diff)
-
assets/js/media-remote-query-test.min.js (modified) (1 diff)
-
lang/remote-medias-lite.pot (modified) (15 diffs)
-
readme.txt (modified) (5 diffs)
-
remote-medias-libs.php (modified) (1 diff)
-
src/RemoteMediaExt/AccountPostType.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php (modified) (10 diffs)
-
src/RemoteMediaExt/Accounts/AbstractRemoteMedia.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/AbstractRemoteService.php (modified) (3 diffs)
-
src/RemoteMediaExt/Accounts/Dailymotion/Service.php (modified) (7 diffs)
-
src/RemoteMediaExt/Accounts/Dailymotion/ServiceDescription.json (modified) (2 diffs)
-
src/RemoteMediaExt/Accounts/Flickr/Service.php (modified) (5 diffs)
-
src/RemoteMediaExt/Accounts/MetaBoxSaveAccount.php (modified) (2 diffs)
-
src/RemoteMediaExt/Accounts/RemoteAccountFactory.php (modified) (2 diffs)
-
src/RemoteMediaExt/Accounts/RemoteMediaFactory.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/RemoteServiceFactory.php (modified) (1 diff)
-
src/RemoteMediaExt/Accounts/Vimeo/Service.php (modified) (7 diffs)
-
src/RemoteMediaExt/Accounts/Vimeo/ServiceDescription.json (modified) (2 diffs)
-
src/RemoteMediaExt/Accounts/Youtube/RemoteMedia.php (modified) (2 diffs)
-
src/RemoteMediaExt/Accounts/Youtube/Service.php (modified) (7 diffs)
-
src/RemoteMediaExt/Accounts/Youtube/ServiceDescription.json (modified) (1 diff)
-
src/RemoteMediaExt/Ajax/AjaxQueryAttachments.php (modified) (2 diffs)
-
src/RemoteMediaExt/Ajax/AjaxQueryValidation.php (modified) (2 diffs)
-
src/RemoteMediaExt/Ajax/AjaxSendRemoteToEditor.php (modified) (2 diffs)
-
src/RemoteMediaExt/FRemoteMediaExt.php (modified) (5 diffs)
-
src/RemoteMediaExt/Library/MediaSettings.php (modified) (1 diff)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (3 diffs)
-
vendor/composer/autoload_classmap.php (modified) (3 diffs)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php (modified) (1 diff)
-
views/admin/media-remote-attachment.php (modified) (1 diff)
-
views/admin/metaboxes/basic-settings.php (modified) (2 diffs)
-
views/admin/metaboxes/status-actions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
remote-medias-lite/trunk/assets/css/media-remote-admin.css
r997433 r1121928 83 83 color: #a00; 84 84 } 85 86 .rmlnotice { 87 border-color: #ffba00 !important; 88 } 89 .media-frame select.rml-attachment-filters.attachment-filters { 90 max-width: 100%; 91 margin-right: 20px; 92 } 93 .ocsmorebanner { 94 display: none; 95 z-index: 999999; 96 background: rgba(0,0,0,0.8); 97 position: absolute; 98 margin: 0px 0 50px 0; 99 width: 100%; 100 height: 100%; 101 text-align: center; 102 } 103 .ocsbannerwrapper{ 104 position: relative; 105 width: 100%; 106 height: 100%; 107 } 108 .ocsbannercontent{ 109 position:absolute; 110 top:50%; 111 left:50%; 112 width: 50%; 113 margin-top:-75px; 114 margin-left: -25%; 115 } 116 .ocsbannerwrapper p{ 117 color: #ffffff; 118 font-size: 18px; 119 font-weight: bold; 120 display: block; 121 } 122 a.ocsbannerdismiss{ 123 color: #ffffff; 124 margin-top:20px; 125 display: inline-block; 126 font-size:16px; 127 text-decoration: none; 128 } 129 a.ocsbannerdismiss:hover{ 130 text-decoration: underline; 131 color: #ffffff; 132 } -
remote-medias-lite/trunk/assets/css/media-remote-admin.min.css
r997433 r1121928 1 .rm-upload-wrap .uploader-inline-content{top:10%}.rm-upload-wrap p.no-mg-top{margin-top:0}.ocs-logo{padding-top:20px}.ocs-logo small{display:inline-block}.ocs-logo img{display:inline-block;padding-top:10px}.spinner.ocs-inline-loading{float:initial;margin-top:-3px}.ocs-2x{font-size:2em}.ocs-3x{font-size:3em}.ocs-green{color:#7ad03a}.ocs-red{color:#a00}.rml-actions{padding:10px;clear:both;border-top:1px solid #ddd;background:#f5f5f5;margin:-12px}.rml-validation-actions{text-align:right;float:right;line-height:23px}.rml-status-actions{margin:-12px;padding:15px 0}.rml-status-actions label{vertical-align:baseline}.rml-status-field{font-weight:600}.rml-status-actions label[for=account_status]:before{content:"\f316";color:#888;display:inline-block;font:400 20px/1 dashicons;speak:none;left:-1px;padding:0 5px 0 0;position:relative;top:0;text-decoration:none!important;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}ul.wpform-fieldset li:last-child{border-bottom:none;padding-bottom:0}.rml-status-field.notvalid{color:#a00} 1 .rm-upload-wrap .uploader-inline-content{top:10%}.rm-upload-wrap p.no-mg-top{margin-top:0}.ocs-logo{padding-top:20px}.ocs-logo small{display:inline-block}.ocs-logo img{display:inline-block;padding-top:10px}.spinner.ocs-inline-loading{float:initial;margin-top:-3px}.ocs-2x{font-size:2em}.ocs-3x{font-size:3em}.ocs-green{color:#7ad03a}.ocs-red{color:#a00}.rml-actions{padding:10px;clear:both;border-top:1px solid #ddd;background:#f5f5f5;margin:-12px}.rml-validation-actions{text-align:right;float:right;line-height:23px}.rml-status-actions{margin:-12px;padding:15px 0}.rml-status-actions label{vertical-align:baseline}.rml-status-field{font-weight:600}.rml-status-actions label[for=account_status]:before{content:"\f316";color:#888;display:inline-block;font:400 20px/1 dashicons;speak:none;left:-1px;padding:0 5px 0 0;position:relative;top:0;text-decoration:none!important;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}ul.wpform-fieldset li:last-child{border-bottom:none;padding-bottom:0}.rml-status-field.notvalid{color:#a00}.rmlnotice{border-color:#ffba00!important}.media-frame select.rml-attachment-filters.attachment-filters{max-width:100%;margin-right:20px}.ocsmorebanner{display:none;z-index:999999;background:rgba(0,0,0,.8);position:absolute;margin:0 0 50px;width:100%;height:100%;text-align:center}.ocsbannerwrapper{position:relative;width:100%;height:100%}.ocsbannercontent{position:absolute;top:50%;left:50%;width:50%;margin-top:-75px;margin-left:-25%}.ocsbannerwrapper p{color:#fff;font-size:18px;font-weight:700;display:block}a.ocsbannerdismiss{color:#fff;margin-top:20px;display:inline-block;font-size:16px;text-decoration:none}a.ocsbannerdismiss:hover{text-decoration:underline;color:#fff} -
remote-medias-lite/trunk/assets/js/media-remote-ext.js
r997768 r1121928 63 63 'change': 'refresh' 64 64 }, 65 initialize: function() 66 { 65 initialize: function() { 67 66 _.defaults( this.options, { 68 67 message: '', … … 70 69 }); 71 70 72 var state = this.controller.state() ;73 vartemplate = state.get('uploadTemplate');71 var state = this.controller.state(), 72 template = state.get('uploadTemplate'); 74 73 if (template) { 75 74 this.template = wp.media.template(template); 76 75 } 76 77 if ( this.options.status ) { 78 this.views.set( '.upload-inline-status', new wp.media.view.UploaderStatus({ 79 controller: this.controller 80 }) ); 81 } 77 82 }, 78 79 render: function() 80 { 81 wp.media.View.prototype.render.apply( this, arguments ); 82 this.refresh(); 83 render: function() { 84 wp.media.View.prototype.render.apply( this, arguments ); 85 this.refresh(); 83 86 return this; 84 87 }, 85 86 88 refresh: function( event ) {}, 87 89 hide: function() { … … 89 91 } 90 92 }); 93 91 94 /** 92 95 * … … 156 159 delete props.query; 157 160 161 // Remove the `remotefilters` property. 162 delete props.remotefilters; 163 164 // Remove the `uioptions` property. 165 delete props.uioptions; 166 158 167 // Fill default args. 159 168 _.defaults( props, defaults ); … … 202 211 }()) 203 212 }); 204 // Extends the default MediaFrame.Post view 205 /** 206 * 213 214 /** 215 * wp.media.view.AttachmentFilters.RemoteCustom 216 * 217 */ 218 wp.media.view.AttachmentFilters.RemoteCustom = wp.media.view.AttachmentFilters.extend({ 219 className: 'rml-attachment-filters attachment-filters', 220 createFilters: function() { 221 var filters = {}, 222 remotefilters = this.model.get('remotefilters'); 223 224 _.each(remotefilters, function(remotefilter) { 225 var filter = { 226 text: remotefilter.text || 'Undefined', 227 props: remotefilter.props || {uploadedTo: null,orderby: 'date',order: 'DESC'}, 228 priority: remotefilter.priority || 10 229 } 230 if (remotefilter.slug) { 231 filters[remotefilter.slug] = (filter); 232 } 233 234 }); 235 236 this.filters = filters; 237 } 238 }); 239 240 /** 241 * wp.media.controller.RemoteLibrary 207 242 */ 208 243 wp.media.controller.RemoteLibrary = wp.media.controller.Library.extend({ … … 216 251 router: 'browse', 217 252 menu: 'default', 253 date: false, 218 254 remote: true, 219 255 searchable: true, 220 256 filterable: false, 221 257 sortable: true, 258 autoSelect: true, 222 259 223 260 // Uses a user setting to override the content mode. … … 233 270 var oldMediaFrame = wp.media.view.MediaFrame.Post; 234 271 wp.media.view.MediaFrame.Post = oldMediaFrame.extend({ 235 236 272 initialize: function() { 237 273 oldMediaFrame.prototype.initialize.apply( this, arguments ); … … 244 280 var that = this; 245 281 246 //TODO get service setting template from remote service setting object247 _.each(wp.media.view.settings.remoteMediaAccounts,function(account) {282 _.each(wp.media.view.settings.remoteMediaAccounts, function(account) { 283 var serviceSettings = wp.media.view.settings.remoteServiceSettings[account.type] || []; 248 284 that.states.add([ 249 285 new wp.media.controller.RemoteLibrary({ … … 254 290 priority: 30, 255 291 toolbar: 'main-remote', 256 uploadTemplate: _.isUndefined( wp.media.view.settings.remoteServiceSettings[account.type] ) ? null : wp.media.view.settings.remoteServiceSettings[account.type].uploadTemplate,257 filterable: 'uploaded',292 uploadTemplate: serviceSettings.uploadTemplate || '', 293 filterable: account.filterable || 'uploaded', 258 294 library: wp.media.remotequery( _.defaults({ 259 295 type: 'remote', 260 account_id: account.id 296 account_id: account.id, 297 remotefilters: account.filters || [], 298 uioptions: account.uioptions || [] 261 299 }, options.library ) ), 262 300 state: 'remote-library-'+account.id, … … 277 315 this.on( 'toolbar:render:main-remote', this.mainInsertToolbar, this ); 278 316 }, 279 280 317 uploadContent: function() { 281 318 var sectionid = this.state().get('sectionid'); … … 291 328 } 292 329 }); 293 294 330 wp.media.view.RemoteAttachmentsBrowser = wp.media.view.AttachmentsBrowser.extend({ 295 createUploader: function() {296 this.uploader = new wp.media.view.RemoteUploaderInline({297 controller: this.controller,298 status: false,299 message: this.controller.isModeActive( 'grid' ) ? '' : wp.media.view.l10n.noItemsFound,300 canClose: this.controller.isModeActive( 'grid' )301 });302 303 this.uploader.hide();304 this.views.add( this.uploader );305 },306 331 createSingle: function () { 307 332 var sidebar = this.sidebar, … … 327 352 if ( this.model.id === 'remote-library-'+this.model.get('sectionid') ) { 328 353 sidebar.$el.addClass( 'visible' ); 354 } 355 }, 356 createToolbar: function () { 357 wp.media.view.AttachmentsBrowser.prototype.createToolbar.apply( this, arguments ); 358 359 if ( 'custom' === this.options.filters ) { 360 this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.RemoteCustom({ 361 controller: this.controller, 362 model: this.collection.props, 363 priority: -80 364 }).render() ); 329 365 } 330 366 } … … 346 382 search: state.get('searchable'), 347 383 filters: state.get('filterable'), 384 date: state.get('date'), 348 385 display: state.has('display') ? state.get('display') : state.get('displaySettings'), 349 386 dragInfo: state.get('dragInfo'), -
remote-medias-lite/trunk/assets/js/media-remote-ext.min.js
r997768 r1121928 1 !function(){oldSendAttachment=wp.media.editor.send.attachment,wp.media.editor.send.attachment=function(a,b){if("remote"!==b.type)return oldSendAttachment(a,b);{var c;b.caption}return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,title:b.title,type:b.type,subtype:b.subtype,remotetype:b.remotetype,accountId:b.accountId||0,remotedata:b.remotedata||[]},a.linkUrl&&(c.url=a.linkUrl),"image"===b.remotetype&&(_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])}),c.width=b.width||0,c.height=b.height||0,c.imgurl=b.url||c.url),wp.media.post("send-remote-attachment-to-editor",{nonce:rmlSendToEditorParams.nonce,attachment:c,post_id:wp.media.view.settings.post.id})},wp.media.view.RemoteUploaderInline=wp.media.View.extend({tagName:"div",className:"remote-uploader",template:wp.media.template("remote-media-upload"),events:{input:"refresh",keyup:"refresh",change:"refresh"},initialize:function(){_.defaults(this.options,{message:"",status:!0});var a=this.controller.state(),b=a.get("uploadTemplate");b&&(this.template=wp.media.template(b)) },render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.refresh(),this},refresh:function(){},hide:function(){this.$el.addClass("hidden")}}),wp.media.remotequery=function(a){return new wp.media.model.RemoteAttachments(null,{props:_.extend(_.defaults(a||{},{orderby:"date"}),{query:!0})})},wp.media.model.RemoteAttachments=wp.media.model.Attachments.extend({initialize:function(){wp.media.model.Attachments.prototype.initialize.apply(this,arguments)},_requery:function(){this.props.get("query")&&this.mirror(wp.media.model.RemoteQuery.get(this.props.toJSON()))}}),wp.media.model.RemoteQuery=wp.media.model.Query.extend({initialize:function(){wp.media.model.Query.prototype.initialize.apply(this,arguments)},sync:function(a,b,c){var d;return"read"===a?(c=c||{},c.context=this,c.data=_.extend(c.data||{},{action:"query-remote-attachments",post_id:wp.media.model.settings.post.id,security:rmlQueryAttachmentsParams.nonce}),args=_.clone(this.args),-1!==args.posts_per_page&&(args.paged=Math.floor(this.length/args.posts_per_page)+1),c.data.query=args,wp.media.ajax(c)):(d=wp.media.model.Attachments.prototype.sync?wp.media.model.Attachments.prototype:Backbone,d.sync.apply(this,arguments))}},{get:function(){var a=[];return function(b,c){var d,e={},f=wp.media.model.RemoteQuery.orderby,g=wp.media.model.RemoteQuery.defaultProps;return delete b.query,_.defaults(b,g),b.order=b.order.toUpperCase(),"DESC"!==b.order&&"ASC"!==b.order&&(b.order=g.order.toUpperCase()),_.contains(f.allowed,b.orderby)||(b.orderby=g.orderby),_.each(b,function(a,b){_.isNull(a)||(e[wp.media.model.RemoteQuery.propmap[b]||b]=a)}),_.defaults(e,wp.media.model.RemoteQuery.defaultArgs),e.orderby=f.valuemap[b.orderby]||b.orderby,d=_.find(a,function(a){return _.isEqual(a.args,e)}),d||(d=new wp.media.model.RemoteQuery([],_.extend(c||{},{props:b,args:e})),a.push(d)),d}}()}),wp.media.controller.RemoteLibrary=wp.media.controller.Library.extend({defaults:{id:"remote-library",multiple:"add",describe:!1,toolbar:"select",sidebar:"settings",content:"upload",router:"browse",menu:"default",remote:!0,searchable:!0,filterable:!1,sortable:!0,contentUserSetting:!0,syncSelection:!0}});var a=wp.media.view.MediaFrame.Post;wp.media.view.MediaFrame.Post=a.extend({initialize:function(){a.prototype.initialize.apply(this,arguments)},createStates:function(){a.prototype.createStates.apply(this,arguments);var b=this.options,c=this;_.each(wp.media.view.settings.remoteMediaAccounts,function(a){c.states.add([new wp.media.controller.RemoteLibrary({id:"remote-library-"+a.id,sectionid:a.id,title:a.title,service:a.type,priority:30,toolbar:"main-remote",uploadTemplate:_.isUndefined(wp.media.view.settings.remoteServiceSettings[a.type])?null:wp.media.view.settings.remoteServiceSettings[a.type].uploadTemplate,filterable:"uploaded",library:wp.media.remotequery(_.defaults({type:"remote",account_id:a.id},b.library)),state:"remote-library-"+a.id,editable:!0,displaySettings:!0,displayUserSettings:!0,menu:"default",AttachmentView:wp.media.view.Attachment.RemoteLibrary})])},this)},bindHandlers:function(){a.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:create:main-remote",this.createToolbar,this),this.on("toolbar:render:main-remote",this.mainInsertToolbar,this)},uploadContent:function(){var a=this.state().get("sectionid");a?(this.$el.removeClass("hide-toolbar"),this.content.set(new wp.media.view.RemoteUploaderInline({controller:this,model:this.state().props}))):wp.media.view.MediaFrame.Select.prototype.uploadContent.apply(this,arguments)}}),wp.media.view.RemoteAttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createUploader:function(){this.uploader=new wp.media.view.RemoteUploaderInline({controller:this.controller,status:!1,message:this.controller.isModeActive("grid")?"":wp.media.view.l10n.noItemsFound,canClose:this.controller.isModeActive("grid")}),this.uploader.hide(),this.views.add(this.uploader)},createSingle:function(){var a=this.sidebar,b=this.options.selection.single(),c=b.get("type"),d=b.get("remotetype");return"remote"!==c?wp.media.view.AttachmentsBrowser.prototype.createSingle.apply(this,arguments):("image"===d?(b.set("type",d),wp.media.view.AttachmentsBrowser.prototype.createSingle.apply(this,arguments),b.set("type","remote")):wp.media.view.AttachmentsBrowser.prototype.createSingle.apply(this,arguments),void(this.model.id==="remote-library-"+this.model.get("sectionid")&&a.$el.addClass("visible")))}});var b=wp.media.view.MediaFrame.Select;wp.media.view.MediaFrame.Select.prototype.browseRemoteContent=function(a){var c=this.state(),d=c.get("remote");d===!0?(this.$el.removeClass("hide-toolbar"),a.view=new wp.media.view.RemoteAttachmentsBrowser({controller:this,collection:c.get("library"),selection:c.get("selection"),model:c,sortable:c.get("sortable"),search:c.get("searchable"),filters:c.get("filterable"),display:c.get(c.has("display")?"display":"displaySettings"),dragInfo:c.get("dragInfo"),idealColumnWidth:c.get("idealColumnWidth"),suggestedWidth:c.get("suggestedWidth"),suggestedHeight:c.get("suggestedHeight"),AttachmentView:c.get("AttachmentView")})):b.prototype.browseContent.apply(this,arguments)},wp.media.view.MediaFrame.Select=b.extend({bindHandlers:function(){this.on("router:create:browse",this.createRouter,this),this.on("router:render:browse",this.browseRouter,this),this.on("content:create:browse",this.browseRemoteContent,this),this.on("content:render:upload",this.uploadContent,this),this.on("toolbar:create:select",this.createSelectToolbar,this)}}),wp.media.view.Attachment.RemoteLibrary=wp.media.view.Attachment.Library.extend({template:wp.media.template("attachment-remote"),toggleSelection:function(){wp.media.view.Attachment.Library.prototype.toggleSelection.apply(this,arguments)}}),wp.media.view.Attachment.RemoteSelection=wp.media.view.Attachment.Selection.extend({template:wp.media.template("attachment-remote")}),oldAttachmentsSelection=wp.media.view.Attachments.Selection,wp.media.view.Attachments.Selection=oldAttachmentsSelection.extend({initialize:function(){return _.defaults(this.options,{AttachmentView:wp.media.view.Attachment.RemoteSelection}),oldAttachmentsSelection.prototype.initialize.apply(this,arguments)}})}(jQuery);1 !function(){oldSendAttachment=wp.media.editor.send.attachment,wp.media.editor.send.attachment=function(a,b){if("remote"!==b.type)return oldSendAttachment(a,b);{var c;b.caption}return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,title:b.title,type:b.type,subtype:b.subtype,remotetype:b.remotetype,accountId:b.accountId||0,remotedata:b.remotedata||[]},a.linkUrl&&(c.url=a.linkUrl),"image"===b.remotetype&&(_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])}),c.width=b.width||0,c.height=b.height||0,c.imgurl=b.url||c.url),wp.media.post("send-remote-attachment-to-editor",{nonce:rmlSendToEditorParams.nonce,attachment:c,post_id:wp.media.view.settings.post.id})},wp.media.view.RemoteUploaderInline=wp.media.View.extend({tagName:"div",className:"remote-uploader",template:wp.media.template("remote-media-upload"),events:{input:"refresh",keyup:"refresh",change:"refresh"},initialize:function(){_.defaults(this.options,{message:"",status:!0});var a=this.controller.state(),b=a.get("uploadTemplate");b&&(this.template=wp.media.template(b)),this.options.status&&this.views.set(".upload-inline-status",new wp.media.view.UploaderStatus({controller:this.controller}))},render:function(){return wp.media.View.prototype.render.apply(this,arguments),this.refresh(),this},refresh:function(){},hide:function(){this.$el.addClass("hidden")}}),wp.media.remotequery=function(a){return new wp.media.model.RemoteAttachments(null,{props:_.extend(_.defaults(a||{},{orderby:"date"}),{query:!0})})},wp.media.model.RemoteAttachments=wp.media.model.Attachments.extend({initialize:function(){wp.media.model.Attachments.prototype.initialize.apply(this,arguments)},_requery:function(){this.props.get("query")&&this.mirror(wp.media.model.RemoteQuery.get(this.props.toJSON()))}}),wp.media.model.RemoteQuery=wp.media.model.Query.extend({initialize:function(){wp.media.model.Query.prototype.initialize.apply(this,arguments)},sync:function(a,b,c){var d;return"read"===a?(c=c||{},c.context=this,c.data=_.extend(c.data||{},{action:"query-remote-attachments",post_id:wp.media.model.settings.post.id,security:rmlQueryAttachmentsParams.nonce}),args=_.clone(this.args),-1!==args.posts_per_page&&(args.paged=Math.floor(this.length/args.posts_per_page)+1),c.data.query=args,wp.media.ajax(c)):(d=wp.media.model.Attachments.prototype.sync?wp.media.model.Attachments.prototype:Backbone,d.sync.apply(this,arguments))}},{get:function(){var a=[];return function(b,c){var d,e={},f=wp.media.model.RemoteQuery.orderby,g=wp.media.model.RemoteQuery.defaultProps;return delete b.query,delete b.remotefilters,delete b.uioptions,_.defaults(b,g),b.order=b.order.toUpperCase(),"DESC"!==b.order&&"ASC"!==b.order&&(b.order=g.order.toUpperCase()),_.contains(f.allowed,b.orderby)||(b.orderby=g.orderby),_.each(b,function(a,b){_.isNull(a)||(e[wp.media.model.RemoteQuery.propmap[b]||b]=a)}),_.defaults(e,wp.media.model.RemoteQuery.defaultArgs),e.orderby=f.valuemap[b.orderby]||b.orderby,d=_.find(a,function(a){return _.isEqual(a.args,e)}),d||(d=new wp.media.model.RemoteQuery([],_.extend(c||{},{props:b,args:e})),a.push(d)),d}}()}),wp.media.view.AttachmentFilters.RemoteCustom=wp.media.view.AttachmentFilters.extend({className:"rml-attachment-filters attachment-filters",createFilters:function(){var a={},b=this.model.get("remotefilters");_.each(b,function(b){var c={text:b.text||"Undefined",props:b.props||{uploadedTo:null,orderby:"date",order:"DESC"},priority:b.priority||10};b.slug&&(a[b.slug]=c)}),this.filters=a}}),wp.media.controller.RemoteLibrary=wp.media.controller.Library.extend({defaults:{id:"remote-library",multiple:"add",describe:!1,toolbar:"select",sidebar:"settings",content:"upload",router:"browse",menu:"default",date:!1,remote:!0,searchable:!0,filterable:!1,sortable:!0,autoSelect:!0,contentUserSetting:!0,syncSelection:!0}});var a=wp.media.view.MediaFrame.Post;wp.media.view.MediaFrame.Post=a.extend({initialize:function(){a.prototype.initialize.apply(this,arguments)},createStates:function(){a.prototype.createStates.apply(this,arguments);var b=this.options,c=this;_.each(wp.media.view.settings.remoteMediaAccounts,function(a){var d=wp.media.view.settings.remoteServiceSettings[a.type]||[];c.states.add([new wp.media.controller.RemoteLibrary({id:"remote-library-"+a.id,sectionid:a.id,title:a.title,service:a.type,priority:30,toolbar:"main-remote",uploadTemplate:d.uploadTemplate||"",filterable:a.filterable||"uploaded",library:wp.media.remotequery(_.defaults({type:"remote",account_id:a.id,remotefilters:a.filters||[],uioptions:a.uioptions||[]},b.library)),state:"remote-library-"+a.id,editable:!0,displaySettings:!0,displayUserSettings:!0,menu:"default",AttachmentView:wp.media.view.Attachment.RemoteLibrary})])},this)},bindHandlers:function(){a.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:create:main-remote",this.createToolbar,this),this.on("toolbar:render:main-remote",this.mainInsertToolbar,this)},uploadContent:function(){var a=this.state().get("sectionid");a?(this.$el.removeClass("hide-toolbar"),this.content.set(new wp.media.view.RemoteUploaderInline({controller:this,model:this.state().props}))):wp.media.view.MediaFrame.Select.prototype.uploadContent.apply(this,arguments)}}),wp.media.view.RemoteAttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createSingle:function(){var a=this.sidebar,b=this.options.selection.single(),c=b.get("type"),d=b.get("remotetype");return"remote"!==c?wp.media.view.AttachmentsBrowser.prototype.createSingle.apply(this,arguments):("image"===d?(b.set("type",d),wp.media.view.AttachmentsBrowser.prototype.createSingle.apply(this,arguments),b.set("type","remote")):wp.media.view.AttachmentsBrowser.prototype.createSingle.apply(this,arguments),void(this.model.id==="remote-library-"+this.model.get("sectionid")&&a.$el.addClass("visible")))},createToolbar:function(){wp.media.view.AttachmentsBrowser.prototype.createToolbar.apply(this,arguments),"custom"===this.options.filters&&this.toolbar.set("filters",new wp.media.view.AttachmentFilters.RemoteCustom({controller:this.controller,model:this.collection.props,priority:-80}).render())}});var b=wp.media.view.MediaFrame.Select;wp.media.view.MediaFrame.Select.prototype.browseRemoteContent=function(a){var c=this.state(),d=c.get("remote");d===!0?(this.$el.removeClass("hide-toolbar"),a.view=new wp.media.view.RemoteAttachmentsBrowser({controller:this,collection:c.get("library"),selection:c.get("selection"),model:c,sortable:c.get("sortable"),search:c.get("searchable"),filters:c.get("filterable"),date:c.get("date"),display:c.get(c.has("display")?"display":"displaySettings"),dragInfo:c.get("dragInfo"),idealColumnWidth:c.get("idealColumnWidth"),suggestedWidth:c.get("suggestedWidth"),suggestedHeight:c.get("suggestedHeight"),AttachmentView:c.get("AttachmentView")})):b.prototype.browseContent.apply(this,arguments)},wp.media.view.MediaFrame.Select=b.extend({bindHandlers:function(){this.on("router:create:browse",this.createRouter,this),this.on("router:render:browse",this.browseRouter,this),this.on("content:create:browse",this.browseRemoteContent,this),this.on("content:render:upload",this.uploadContent,this),this.on("toolbar:create:select",this.createSelectToolbar,this)}}),wp.media.view.Attachment.RemoteLibrary=wp.media.view.Attachment.Library.extend({template:wp.media.template("attachment-remote"),toggleSelection:function(){wp.media.view.Attachment.Library.prototype.toggleSelection.apply(this,arguments)}}),wp.media.view.Attachment.RemoteSelection=wp.media.view.Attachment.Selection.extend({template:wp.media.template("attachment-remote")}),oldAttachmentsSelection=wp.media.view.Attachments.Selection,wp.media.view.Attachments.Selection=oldAttachmentsSelection.extend({initialize:function(){return _.defaults(this.options,{AttachmentView:wp.media.view.Attachment.RemoteSelection}),oldAttachmentsSelection.prototype.initialize.apply(this,arguments)}})}(jQuery); -
remote-medias-lite/trunk/assets/js/media-remote-query-test.js
r997433 r1121928 1 window.ocs = window.ocs || {}; 2 ocs.rml = ocs.rml || {}; 3 1 4 (function($){ 2 $(document).ready(function($) { 3 $('#rml_service_selection,#rml_account_settings select').live('change', function () { 4 $('.rml-status-field.working').hide(); 5 $('.rml-status-field.notvalid').hide(); 6 $('.rml-status-field.unknown').show(); 5 'use strict'; 6 ocs.rml.AccountStatusManager = function () { 7 this.init(); 8 } 9 10 ocs.rml.AccountStatusManager.prototype = { 11 $statusField: $('.rml-status-field'), 12 $querymsg: $('#query_msg'), 13 $loading: $('#rmlloading'), 14 $currentFields: null, 15 authInterval: null, 16 init: function () { 17 }, 18 hookevents: function () { 19 var that = this; 20 $('#rml_service_selection,#rml_account_settings select').live('change', function () { 21 that.setStatus('unknown'); 22 }); 23 $('#rml_account_settings input').live('keyup', function () { 24 that.setStatus('unknown'); 25 }); 26 $('.action_query_test').live('click', function() { 27 that.validate(); 28 }); 29 }, 30 fetchActiveFields: function () { 31 this.$currentFields = $('.rmlfields-'+$('#remote_media_type').val()); 32 }, 33 getServiceClass: function () { 34 this.fetchActiveFields(); 35 return this.$currentFields.find('#service_class').val() || ''; 36 }, 37 getPostId: function () { 38 return $('#post_ID').val(); 39 }, 40 setStatus: function (status) { 41 var $statusmsg = $('#rmlaccountstatus'); 42 43 $statusmsg.html(status); 44 this.$querymsg.html(''); 45 if (status === rmlQueryTestParams.status.invalid) { 46 this.$querymsg.html('<div class="dashicons dashicons-no ocs-3x ocs-red" style="margin-top: -3px; padding: 0 10px;"></div>'); 47 } 48 49 if (status === rmlQueryTestParams.status.enabled) { 50 this.$querymsg.html('<div class="dashicons dashicons-yes ocs-3x ocs-green" style="margin-top: -3px; padding: 0 10px;"></div>'); 51 } 52 53 return; 54 }, 55 getCurrentSettings: function () { 56 var settings = {}, 57 elements = $('.rmlfields-'+$('#remote_media_type').val()+'').find('input'); 58 $.each(elements, function () { 59 var start = this.name.indexOf('[', this.name.indexOf('[')+1)+1, 60 end = this.name.indexOf(']', this.name.indexOf(']')+1), 61 name = this.name; 62 name = name.substr(start,end-start); 63 settings[name] = $(this).val(); 64 }) 65 return settings; 66 }, 67 authenticate: function (url) { 68 var that = this, 69 authwindow; 70 71 this.$loading.css('display', 'inline-block'); 72 this.setStatus(rmlQueryTestParams.status.authProcessing); 73 if (url) { 74 authwindow = window.open(url,'rmlauthprocess','height=400,width=800'); 75 this.authInterval = window.setInterval(function() { 76 try { 77 if (authwindow === null || authwindow.closed) { 78 that.authdone(0); 79 } 80 } 81 catch (e) { 82 } 83 }, 1000); 84 } 85 86 }, 87 authdone: function (status) { 88 var status = parseInt(status) || 0; 89 window.clearInterval(this.authInterval); 90 this.$loading.hide(); 91 if (status === 1) { 92 this.setStatus(rmlQueryTestParams.status.enabled); 93 $('.rmlnotice').hide(); 94 $('#rmlstatusbutton').html(rmlQueryTestParams.button.reauth); 95 } else { 96 this.setStatus(rmlQueryTestParams.status.authfailed); 97 } 98 this.$loading.hide(); 99 }, 100 validate: function () { 101 var that = this, 102 data = { 103 action: 'rmlQueryTest', 104 security: rmlQueryTestParams.nonce, 105 post_id: this.getPostId(), 106 account: this.getCurrentSettings() 107 }; 108 109 that.$loading.css('display', 'inline-block'); 110 111 $.post(rmlQueryTestParams.ajax_url, data, function(response) { 112 that.$loading.hide(); 113 data = $.parseJSON(response); 114 115 if (data.authneeded && data.authurl) { 116 that.authenticate(data.authurl); 117 return true; 118 } 119 if(!data.authneeded && parseInt(data.validate) === 1) { 120 that.setStatus(rmlQueryTestParams.status.enabled); 121 return true; 122 } 123 124 that.setStatus(rmlQueryTestParams.status.invalid); 125 return false; 126 }); 127 return false; 128 } 129 } 130 ocs.rml.statusManager = new ocs.rml.AccountStatusManager(); 131 132 $(document).ready(function($) { 133 ocs.rml.statusManager.hookevents(); 7 134 }); 8 $('#rml_account_settings input').live('keyup', function () {9 $('.rml-status-field.working').hide();10 $('.rml-status-field.notvalid').hide();11 $('.rml-status-field.unknown').show();12 });13 $('.action_query_test').live('click', function() {14 var $metabox = $(this).closest('.rmlfields'),15 $currentFields = $('.rmlfields-'+$('#remote_media_type').val()),16 data = {17 action: 'rmlQueryTest',18 security: rmlQueryTestParams.nonce,19 post_id: $('#post_ID').val(),20 user_id: $currentFields.find('#remote_user_id').val(),21 service_class: $currentFields.find('#service_class').val()22 };23 24 $('#rmlloading').css('display', 'inline-block');25 $('#query_msg').html('');26 $('.rml-status-field.working').hide();27 $('.rml-status-field.notvalid').hide();28 $('.rml-status-field.unknown').show();29 30 if (data.user_id.length < 1) {31 $('#rmlloading').hide();32 $('.rml-status-field.notvalid').show();33 $('.rml-status-field.working').hide();34 $('.rml-status-field.unknown').hide();35 $('#query_msg').html('<div class="dashicons dashicons-no ocs-3x ocs-red" style="margin-top: -3px; padding: 0 10px;"></div>');36 return false;37 }38 $.post(rmlQueryTestParams.ajax_url, data, function(response) {39 $('#rmlloading').hide();40 data = $.parseJSON( response );41 if(data.validate) {42 $('.rml-status-field.working').show();43 $('.rml-status-field.notvalid').hide();44 $('.rml-status-field.unknown').hide();45 $('#query_msg').html('<div class="dashicons dashicons-yes ocs-3x ocs-green" style="margin-top: -3px; padding: 0 10px;"></div>');46 return true;47 }48 $('.rml-status-field.notvalid').show();49 $('.rml-status-field.working').hide();50 $('.rml-status-field.unknown').hide();51 $('#query_msg').html('<div class="dashicons dashicons-no ocs-3x ocs-red" style="margin-top: -3px; padding: 0 10px;"></div>');52 return false;53 });54 return false;55 });56 });57 135 }(jQuery)); -
remote-medias-lite/trunk/assets/js/media-remote-query-test.min.js
r997433 r1121928 1 !function(a){a(document).ready(function(a){a("#rml_service_selection,#rml_account_settings select").live("change",function(){a(".rml-status-field.working").hide(),a(".rml-status-field.notvalid").hide(),a(".rml-status-field.unknown").show()}),a("#rml_account_settings input").live("keyup",function(){a(".rml-status-field.working").hide(),a(".rml-status-field.notvalid").hide(),a(".rml-status-field.unknown").show()}),a(".action_query_test").live("click",function(){var b=(a(this).closest(".rmlfields"),a(".rmlfields-"+a("#remote_media_type").val())),c={action:"rmlQueryTest",security:rmlQueryTestParams.nonce,post_id:a("#post_ID").val(),user_id:b.find("#remote_user_id").val(),service_class:b.find("#service_class").val()};return a("#rmlloading").css("display","inline-block"),a("#query_msg").html(""),a(".rml-status-field.working").hide(),a(".rml-status-field.notvalid").hide(),a(".rml-status-field.unknown").show(),c.user_id.length<1?(a("#rmlloading").hide(),a(".rml-status-field.notvalid").show(),a(".rml-status-field.working").hide(),a(".rml-status-field.unknown").hide(),a("#query_msg").html('<div class="dashicons dashicons-no ocs-3x ocs-red" style="margin-top: -3px; padding: 0 10px;"></div>'),!1):(a.post(rmlQueryTestParams.ajax_url,c,function(b){return a("#rmlloading").hide(),c=a.parseJSON(b),c.validate?(a(".rml-status-field.working").show(),a(".rml-status-field.notvalid").hide(),a(".rml-status-field.unknown").hide(),a("#query_msg").html('<div class="dashicons dashicons-yes ocs-3x ocs-green" style="margin-top: -3px; padding: 0 10px;"></div>'),!0):(a(".rml-status-field.notvalid").show(),a(".rml-status-field.working").hide(),a(".rml-status-field.unknown").hide(),a("#query_msg").html('<div class="dashicons dashicons-no ocs-3x ocs-red" style="margin-top: -3px; padding: 0 10px;"></div>'),!1)}),!1)})})}(jQuery);1 window.ocs=window.ocs||{},ocs.rml=ocs.rml||{},function(a){"use strict";ocs.rml.AccountStatusManager=function(){this.init()},ocs.rml.AccountStatusManager.prototype={$statusField:a(".rml-status-field"),$querymsg:a("#query_msg"),$loading:a("#rmlloading"),$currentFields:null,authInterval:null,init:function(){},hookevents:function(){var b=this;a("#rml_service_selection,#rml_account_settings select").live("change",function(){b.setStatus("unknown")}),a("#rml_account_settings input").live("keyup",function(){b.setStatus("unknown")}),a(".action_query_test").live("click",function(){b.validate()})},fetchActiveFields:function(){this.$currentFields=a(".rmlfields-"+a("#remote_media_type").val())},getServiceClass:function(){return this.fetchActiveFields(),this.$currentFields.find("#service_class").val()||""},getPostId:function(){return a("#post_ID").val()},setStatus:function(b){var c=a("#rmlaccountstatus");c.html(b),this.$querymsg.html(""),b===rmlQueryTestParams.status.invalid&&this.$querymsg.html('<div class="dashicons dashicons-no ocs-3x ocs-red" style="margin-top: -3px; padding: 0 10px;"></div>'),b===rmlQueryTestParams.status.enabled&&this.$querymsg.html('<div class="dashicons dashicons-yes ocs-3x ocs-green" style="margin-top: -3px; padding: 0 10px;"></div>')},getCurrentSettings:function(){var b={},c=a(".rmlfields-"+a("#remote_media_type").val()).find("input");return a.each(c,function(){var c=this.name.indexOf("[",this.name.indexOf("[")+1)+1,d=this.name.indexOf("]",this.name.indexOf("]")+1),e=this.name;e=e.substr(c,d-c),b[e]=a(this).val()}),b},authenticate:function(a){var b,c=this;this.$loading.css("display","inline-block"),this.setStatus(rmlQueryTestParams.status.authProcessing),a&&(b=window.open(a,"rmlauthprocess","height=400,width=800"),this.authInterval=window.setInterval(function(){try{(null===b||b.closed)&&c.authdone(0)}catch(a){}},1e3))},authdone:function(b){var b=parseInt(b)||0;window.clearInterval(this.authInterval),this.$loading.hide(),1===b?(this.setStatus(rmlQueryTestParams.status.enabled),a(".rmlnotice").hide(),a("#rmlstatusbutton").html(rmlQueryTestParams.button.reauth)):this.setStatus(rmlQueryTestParams.status.authfailed),this.$loading.hide()},validate:function(){var b=this,c={action:"rmlQueryTest",security:rmlQueryTestParams.nonce,post_id:this.getPostId(),account:this.getCurrentSettings()};return b.$loading.css("display","inline-block"),a.post(rmlQueryTestParams.ajax_url,c,function(d){return b.$loading.hide(),c=a.parseJSON(d),c.authneeded&&c.authurl?(b.authenticate(c.authurl),!0):c.authneeded||1!==parseInt(c.validate)?(b.setStatus(rmlQueryTestParams.status.invalid),!1):(b.setStatus(rmlQueryTestParams.status.enabled),!0)}),!1}},ocs.rml.statusManager=new ocs.rml.AccountStatusManager,a(document).ready(function(){ocs.rml.statusManager.hookevents()})}(jQuery); -
remote-medias-lite/trunk/lang/remote-medias-lite.pot
r1006821 r1121928 7 7 msgid "" 8 8 msgstr "" 9 "Project-Id-Version: RemoteMediasLite 1.1.1\n"9 "Project-Id-Version: remote-medias-lite 1.1.1\n" 10 10 "Report-Msgid-Bugs-To: \n" 11 "POT-Creation-Date: 201 4-09-29 15:40-0400\n"11 "POT-Creation-Date: 2015-03-26 22:35-0700\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 18 18 "Content-Transfer-Encoding: 8bit\n" 19 19 20 #: remote-medias-libs.php:4120 #: bootstrap.php:33 21 21 #, php-format 22 22 msgid "" … … 25 25 msgstr "" 26 26 27 #: remote-medias-libs.php:4327 #: bootstrap.php:35 remote-medias-libs.php:13 28 28 #, php-format 29 29 msgid "" … … 81 81 82 82 #: src/RemoteMediaExt/AccountPostType.php:51 83 msgid "Remote library authentication needed. %sAuthenticate now%" 84 msgstr "" 85 86 #: src/RemoteMediaExt/AccountPostType.php:55 83 87 msgid "" 84 88 "Could not connect to remote Library. Please verify your remote library " … … 86 90 msgstr "" 87 91 88 #: src/RemoteMediaExt/AccountPostType.php: 7389 #: src/RemoteMediaExt/AccountPostType.php: 7492 #: src/RemoteMediaExt/AccountPostType.php:80 93 #: src/RemoteMediaExt/AccountPostType.php:81 90 94 msgid "Remote library settings updated." 91 95 msgstr "" 92 96 93 #: src/RemoteMediaExt/AccountPostType.php: 7697 #: src/RemoteMediaExt/AccountPostType.php:83 94 98 #, php-format 95 99 msgid "Remote library settings restored to revision from %s" 96 100 msgstr "" 97 101 98 #: src/RemoteMediaExt/AccountPostType.php: 77102 #: src/RemoteMediaExt/AccountPostType.php:84 99 103 msgid "Remote library settings published." 100 104 msgstr "" 101 105 102 #: src/RemoteMediaExt/AccountPostType.php: 78106 #: src/RemoteMediaExt/AccountPostType.php:85 103 107 msgid "Remote library settings saved." 104 108 msgstr "" 105 109 106 #: src/RemoteMediaExt/AccountPostType.php: 79110 #: src/RemoteMediaExt/AccountPostType.php:86 107 111 msgid "Remote library settings submitted." 108 112 msgstr "" 109 113 110 #: src/RemoteMediaExt/AccountPostType.php:8 1114 #: src/RemoteMediaExt/AccountPostType.php:88 111 115 #, php-format 112 116 msgid "Remote library settings scheduled for: <strong>%1$s</strong>." 113 117 msgstr "" 114 118 115 #: src/RemoteMediaExt/AccountPostType.php:83 119 #. //php.net/date 120 #: src/RemoteMediaExt/AccountPostType.php:90 116 121 msgid "M j, Y @ G:i" 117 122 msgstr "" 118 123 119 #: src/RemoteMediaExt/AccountPostType.php: 85124 #: src/RemoteMediaExt/AccountPostType.php:92 120 125 msgid "Remote library settings draft updated." 126 msgstr "" 127 128 #: src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php:219 129 #: src/RemoteMediaExt/Ajax/AjaxQueryValidation.php:25 130 msgid "Enabled" 131 msgstr "" 132 133 #: src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php:221 134 msgid "Authenticate now" 135 msgstr "" 136 137 #: src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php:223 138 #: src/RemoteMediaExt/Ajax/AjaxQueryValidation.php:23 139 msgid "Invalid" 140 msgstr "" 141 142 #: src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php:225 143 #: src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php:228 144 #: src/RemoteMediaExt/Ajax/AjaxQueryValidation.php:22 145 msgid "Unknown" 121 146 msgstr "" 122 147 … … 138 163 139 164 #: src/RemoteMediaExt/Accounts/Dailymotion/Service.php:14 140 msgid "Dailymotion Basic"165 msgid "Dailymotion" 141 166 msgstr "" 142 167 … … 150 175 151 176 #: src/RemoteMediaExt/Accounts/Flickr/Service.php:14 152 msgid "Flickr Basic"177 msgid "Flickr" 153 178 msgstr "" 154 179 … … 161 186 msgstr "" 162 187 188 #: src/RemoteMediaExt/Accounts/Instagram/Service.php:14 189 msgid "Instagram" 190 msgstr "" 191 192 #: src/RemoteMediaExt/Accounts/Instagram/Service.php:36 193 msgid "Instagram Username" 194 msgstr "" 195 196 #: src/RemoteMediaExt/Accounts/Instagram/Service.php:41 197 msgid "Insert the Instagram user for this library" 198 msgstr "" 199 163 200 #: src/RemoteMediaExt/Accounts/Vimeo/Service.php:14 164 msgid "Vimeo Basic"201 msgid "Vimeo" 165 202 msgstr "" 166 203 … … 174 211 175 212 #: src/RemoteMediaExt/Accounts/Youtube/Service.php:16 176 msgid "Youtube Basic"213 msgid "Youtube" 177 214 msgstr "" 178 215 … … 185 222 msgstr "" 186 223 187 #: src/RemoteMediaExt/FRemoteMediaExt.php:139 224 #: src/RemoteMediaExt/Ajax/AjaxQueryValidation.php:24 225 msgid "Authenticating" 226 msgstr "" 227 228 #: src/RemoteMediaExt/Ajax/AjaxQueryValidation.php:26 229 msgid "Authenticate Now" 230 msgstr "" 231 232 #: src/RemoteMediaExt/Ajax/AjaxQueryValidation.php:27 233 msgid "Failed Auth" 234 msgstr "" 235 236 #: src/RemoteMediaExt/Ajax/AjaxQueryValidation.php:29 237 msgid "Re-authenticate" 238 msgstr "" 239 240 #: src/RemoteMediaExt/FRemoteMediaExt.php:147 188 241 msgid "New Menu Added" 189 242 msgstr "" 190 243 191 #: src/RemoteMediaExt/FRemoteMediaExt.php:14 0244 #: src/RemoteMediaExt/FRemoteMediaExt.php:148 192 245 #, php-format 193 246 msgid "" … … 196 249 msgstr "" 197 250 198 #: src/RemoteMediaExt/FRemoteMediaExt.php:15 1251 #: src/RemoteMediaExt/FRemoteMediaExt.php:159 199 252 msgid "Media Manager Extended" 200 253 msgstr "" 201 254 202 #: src/RemoteMediaExt/FRemoteMediaExt.php:1 52255 #: src/RemoteMediaExt/FRemoteMediaExt.php:160 203 256 #, php-format 204 257 msgid "" … … 207 260 msgstr "" 208 261 209 #: src/RemoteMediaExt/FRemoteMediaExt.php:1 78262 #: src/RemoteMediaExt/FRemoteMediaExt.php:186 210 263 msgid "Service Selection" 211 264 msgstr "" 212 265 213 #: src/RemoteMediaExt/FRemoteMediaExt.php:19 1266 #: src/RemoteMediaExt/FRemoteMediaExt.php:198 214 267 msgid "Account Settings" 215 268 msgstr "" 216 269 217 #: src/RemoteMediaExt/FRemoteMediaExt.php:20 2270 #: src/RemoteMediaExt/FRemoteMediaExt.php:209 218 271 msgid "Status & Actions" 219 272 msgstr "" 220 273 221 #: src/RemoteMediaExt/FRemoteMediaExt.php:22 0274 #: src/RemoteMediaExt/FRemoteMediaExt.php:227 222 275 msgid "Remote Service" 223 276 msgstr "" 224 277 225 #: src/RemoteMediaExt/FRemoteMediaExt.php:2 27278 #: src/RemoteMediaExt/FRemoteMediaExt.php:234 226 279 msgid "Choose the type of service you want to connect." 227 280 msgstr "" … … 262 315 263 316 #: vendor/loumray/wpforms/src/UploadLibrary.php:129 264 #: views/admin/media-remote-attachment.php:2 7317 #: views/admin/media-remote-attachment.php:26 265 318 msgid "Remove" 266 319 msgstr "" 267 320 268 #: views/admin/media-remote-attachment.php:3 1321 #: views/admin/media-remote-attachment.php:30 269 322 msgid "Deselect" 270 323 msgstr "" 271 324 272 #: views/admin/media-remote-attachment.php:3 9325 #: views/admin/media-remote-attachment.php:37 273 326 msgid "Caption this image…" 274 327 msgstr "" 275 328 329 #: views/admin/media-remote-attachment.php:41 330 msgid "Describe this video…" 331 msgstr "" 332 276 333 #: views/admin/media-remote-attachment.php:43 277 msgid "Describe this video…"334 msgid "Describe this audio file…" 278 335 msgstr "" 279 336 280 337 #: views/admin/media-remote-attachment.php:45 281 msgid "Describe this audio file…"282 msgstr ""283 284 #: views/admin/media-remote-attachment.php:47285 338 msgid "Describe this media file…" 286 339 msgstr "" … … 312 365 msgstr "" 313 366 367 #: views/admin/media-upload-instagram.php:11 368 msgid "Get unlimited number of pictures with RML Instagram Pro" 369 msgstr "" 370 371 #: views/admin/media-upload-instagram.php:13 372 msgid "Get the extension and unlock premium features »" 373 msgstr "" 374 375 #: views/admin/media-upload-instagram.php:16 376 msgid "Add our RML Instagram Pro extension to unlock premium features." 377 msgstr "" 378 314 379 #: views/admin/media-upload-vimeo.php:11 315 380 msgid "Upload videos directly to your Vimeo account" … … 330 395 msgstr "" 331 396 332 #: views/admin/metaboxes/status-actions.php: 5397 #: views/admin/metaboxes/status-actions.php:9 333 398 msgid "Account Status:" 334 399 msgstr "" 335 400 336 #: views/admin/metaboxes/status-actions.php:29 337 msgid "Working" 338 msgstr "" 339 340 #: views/admin/metaboxes/status-actions.php:30 341 msgid "Unknown" 342 msgstr "" 343 344 #: views/admin/metaboxes/status-actions.php:31 345 msgid "Invalid" 346 msgstr "" 347 348 #: views/admin/metaboxes/status-actions.php:39 401 #: views/admin/metaboxes/status-actions.php:27 349 402 msgid "Validate" 350 403 msgstr "" -
remote-medias-lite/trunk/readme.txt
r1006821 r1121928 1 === Remote Media Libraries ===1 === Remote Media Libraries === 2 2 Contributors: loumray 3 Tags: youtube, vimeo, vimeo pro, dailymotion, flickr, API, Media Manager, Extension, Integration, direct upload, private videos, remote medias libraries, media explorer, embeds3 Tags: youtube, vimeo, vimeo pro, dailymotion, flickr, API, Media Manager, Media Library Extension, Integration, direct upload, private videos, remote medias libraries, media explorer, embeded 4 4 Requires at least: 3.5 5 Tested up to: 4. 05 Tested up to: 4.2-beta1 6 6 Stable tag: 1.1.2 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html 9 9 10 Remote Media Libraries gives you direct access to all medias accross the web directly from the Media Manager.10 Remote Media Libraries (RML) gives you access to third parties media libraries directly from the Wordpress Media Library. 11 11 12 12 == Description == 13 13 14 Remote Media Libraries gives you access to your favorite content of youtube, vimeo, dailymotion, flickr directly into the media manager.14 Remote Media Libraries (RML) gives you access to your favorite content from Youtube, Vimeo, Dailymotion, Flickr and Instagram directly into the media library. The RML plugin makes it possible to navigate, search, and inserts remote media into you posts and pages. This will increased your page load time and also save on server bandwidth. 15 15 16 The plugin makes it possible to navigate and manage all your medias from all your favorite remote services directly from wordpress media manager.16 You can create as many account as you want and they will show in the left sidebar of the Wordpress media library. 17 17 18 A LOT of service will be added for direct integration. Send us you favorite service and we will integrate it FAST. 19 20 Also, it is possible to download cheaps add-ons that will let you direct upload your media files to 3rd party services and update your media content directly from your wordpress admin panel. 21 22 = Supported Services = 18 = Currently Integrated Services = 23 19 24 20 * Youtube … … 26 22 * Dailymotion 27 23 * Flickr 24 * Instagram 25 26 = Vote for the next integration = 27 28 We need your feedback to know which will be the next integration added to RML. Please take 1 minute to fill out this quick survey: 29 30 <a href="http://onecodeshop.com/vote-for-the-next-integration/">Next integration survey »</a> 31 32 = RML Pro versions = 33 34 RML Pro versions let you access premium features: 35 36 * Albums/lists filtering 37 * Unlimited amount of media in the library 38 * Secure private content 39 * Upload from Wordpress media library to your remote service 40 * And more ... 41 42 More informations on RML pro versions: 43 44 * <a href="http://onecodeshop.com/youtube-pro-remote-media-libraries/">RML Youtube Pro</a> 45 * <a href="http://onecodeshop.com/flickr-pro-remote-media-libraries/">RML Flickr Pro</a> 46 * <a href="http://onecodeshop.com/instagram-pro-remote-media-libraries/">RML Instagram Pro</a> 47 28 48 29 49 = Upcoming Services = 30 50 31 * Vimeo Pro (make your exclusive videos private right from WP admin) 32 * Instagram 51 * Amazon S3 Services 52 * Amazon Cloud Front 53 * Vimeo Pro (Upload capability) 54 * DropBox 33 55 * Tumblr 34 56 * Photobucket 57 * Facebook 35 58 * Twitter 36 * Amazon S3 Services37 59 * Cloud files 60 * Pixabay 61 * <a href="http://onecodeshop.com/vote-for-the-next-integration/">Vote for the next integration »</a> 38 62 39 63 = Follow us! = … … 43 67 * <a href="https://twitter.com/onecodeshop">twitter.com/onecodeshop</a> 44 68 45 = Planned for Next Release=69 = Buy us a coffee! = 46 70 47 * Youtube Search & public feeds 48 * Flickr Latest public feed and favorites 49 * Instagram Basic Beta support 71 We do work hard to bring you the best of the RML plugin. As normal programmers and designers we live on coffee, support us and buy us a coffee, you will make us happy :) Humm coffee ... 72 73 <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=P9N89H4AJ5PCL">Buy us a coffee »</a> 50 74 51 75 == Changelog == 76 = 1.2.0 = 77 * Initial support of instagram 78 * Update media library attachment template in media library to match WP behavior for local medias. 79 * Added missing image size in display settings 80 * Fixed a bug that occured in the case that Youtube do not return any author 81 * Makes plugin main script parsable by PHP 5.2 to fail gracefully and display a notice. 82 * Extend plugin to support APIs that need authentication 83 52 84 = 1.1.2 = 53 85 * Fixed a bug causing bad edit links on re-activated Link Manager admin links page … … 66 98 67 99 == Upgrade Notice == 100 = 1.2.0 = 101 This version add instagram support and multiple fixes. 102 68 103 = 1.1.1 = 69 104 Improved support for remote medias images in Media Manager … … 77 112 * WordPress 3.5 or greater 78 113 * PHP version 5.3.3 or greater 114 * PHP cURl module intsalled 79 115 80 116 = Manual installation = -
remote-medias-lite/trunk/remote-medias-libs.php
r1006821 r1121928 4 4 Plugin URI: http://onecodeshop.com/ 5 5 Description: Integrates 3rd party medias to WP media manager 6 Version: 1. 1.26 Version: 1.2.0 7 7 Author: Team OneCodeShop.com 8 8 Author URI: http://onecodeshop.com/ 9 9 */ 10 namespace WPRemoteMediaExt;11 10 12 use WPRemoteMediaExt\WPCore\admin\WPadminNotice; 13 use WPRemoteMediaExt\WPCore\View; 14 use WPRemoteMediaExt\WPCore\WPpluginTextDomain; 15 use WPRemoteMediaExt\RemoteMediaExt\FRemoteMediaExt; 16 use WPRemoteMediaExt\WPCore\WPplugin; 17 18 require 'autoload.php'; 19 20 class PRemoteMedias extends WPplugin 11 function ocsRmlPhpNotice() 21 12 { 22 23 public static $instance; 24 25 public static function getInstance() 26 { 27 if (!isset(self::$instance)) { 28 self::$instance = new self(); 29 } 30 31 return self::$instance; 32 } 33 34 public function __construct() 35 { 36 load_plugin_textdomain('remote-medias-lite', false, dirname(plugin_basename(__FILE__)).'/lang'); 37 38 parent::__construct(__FILE__, 'Remote Media Libraries', 'remote-medias-lite'); 39 40 $this->setReqWpVersion("3.5"); 41 $this->setReqWPMsg(sprintf(__('%s <strong>Requirements failed.</strong> WP version must <strong>at least %s</strong>. You are using version '.$GLOBALS['wp_version'], 'remote-medias-lite'), $this->getName(), $this->reqWPVersion)); 42 $this->setReqPhpVersion("5.3.3"); 43 $this->setReqPHPMsg(sprintf(__('%s <strong>Requirements failed.</strong> PHP version must <strong>at least %s</strong>. You are using version '. PHP_VERSION, 'remote-medias-lite'), $this->getName(), $this->reqPHPVersion)); 44 45 $this->setMainFeature(FRemoteMediaExt::getInstance()); 46 parent::init(); 47 } 13 echo '<div class="message error"><p>'.sprintf(__('%s <strong>Requirements failed.</strong> PHP version must <strong>at least %s</strong>. You are using version '. PHP_VERSION, 'remote-medias-lite'), 'Remote Media Libraries', '5.3.3').'</p></div>'; 48 14 } 49 15 50 $pwebremotemediasext = PRemoteMedias::getInstance(); 51 $pwebremotemediasext->register(); 16 /* 17 * Unfortunately, while grand daddy PHP 5.2 is still hanging around this check avoid PHP error upon PHP 5.2 activation. 18 */ 19 if (version_compare(PHP_VERSION, '5.3.3', '>=')) { 20 require 'bootstrap.php'; 21 } else { 22 add_action('admin_notices', 'ocsRmlPhpNotice'); 23 } -
remote-medias-lite/trunk/src/RemoteMediaExt/AccountPostType.php
r1006821 r1121928 46 46 public function initAdminNotices() 47 47 { 48 if (isset($_REQUEST['rmlmsg']) && 49 absint($_REQUEST['rmlmsg']) === 1 50 ) { 51 $notice = new WPadminNotice(__("Could not connect to remote Library. Please verify your remote library settings. Only valid libraries are added to the media manager.", 'remote-medias-lite'), "message error"); 52 $notice->register(); 48 if (isset($_REQUEST['rmlmsg'])) { 49 switch(absint($_REQUEST['rmlmsg'])) { 50 case 1: 51 $notice = new WPadminNotice(sprintf(__("Remote library authentication needed. %sAuthenticate now%", 'remote-medias-lite'), '<a class="action_query_test" href="#">', '</a>'), "message error rmlnotice"); 52 $notice->register(); 53 break; 54 case 2: 55 $notice = new WPadminNotice(__("Could not connect to remote Library. Please verify your remote library settings. Only valid libraries are added to the media manager.", 'remote-medias-lite'), "message error"); 56 $notice->register(); 57 break; 58 } 59 53 60 } 54 61 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php
r998050 r1121928 3 3 4 4 use WPRemoteMediaExt\Guzzle\Http\Exception\ClientErrorResponseException; 5 use WPRemoteMediaExt\RemoteMediaExt\Exception; 5 6 6 7 abstract class AbstractRemoteAccount 7 8 { 9 const STATUS_UNKNOWN = 0; 10 const STATUS_AUTHNEEDED = 1; 11 const STATUS_INVALID = 2; 12 const STATUS_ENABLED = 10; 13 8 14 protected $localID; 9 15 protected $remoteID; … … 31 37 } 32 38 39 public function setId($aid) 40 { 41 $this->localID = $aid; 42 43 return $this; 44 } 45 public function setType($type) 46 { 47 $this->type = $type; 48 49 return $this; 50 } 51 33 52 public function getId() 34 53 { … … 39 58 { 40 59 return is_a($this->service, get_class($service)); 60 } 61 62 public function setServiceFromClass($serviceClass) 63 { 64 $serviceInstance = RemoteServiceFactory::create($serviceClass); 65 if (!is_null($serviceInstance) && 66 $serviceInstance instanceof AbstractRemoteService 67 ) { 68 $this->setService($serviceInstance); 69 } 41 70 } 42 71 … … 52 81 if (!empty($serviceClass)) { 53 82 $serviceClass = RemoteServiceFactory::retrieveClassName($serviceClass); 54 55 $this->setService(RemoteServiceFactory::create($serviceClass)); 83 $this->setServiceFromClass($serviceClass); 56 84 } 57 85 } … … 61 89 62 90 /* 63 * return false on failure true if success 91 * @return false on failure or no change update true on update 92 * 64 93 */ 65 94 public function save() 66 95 { 67 $this->validate(); 68 96 $this->set('service_class', RemoteServiceFactory::getDbClassName(RemoteServiceFactory::getClass($this->type))); 69 97 $return = update_post_meta($this->localID, 'remote_attr', $this->attributes); 70 98 $return = update_post_meta($this->localID, 'remote_account_type', $this->type) && $return; … … 82 110 } 83 111 112 public function getServiceNamespace() 113 { 114 $serviceclass = get_class($this->service); 115 return substr($serviceclass, 0, strrpos($serviceclass, '\\')); 116 117 } 118 84 119 public function getService() 85 120 { … … 87 122 } 88 123 89 public function get($name )124 public function get($name, $default = null) 90 125 { 91 126 if ($name === null) { … … 97 132 } 98 133 99 return isset($this->attributes[$name]) ? $this->attributes[$name] : null;134 return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; 100 135 } 101 136 … … 111 146 if ($name == 'remote_account_type') { 112 147 $this->type = $value; 113 $this->set('service_class', RemoteServiceFactory::getDbClassName(RemoteServiceFactory::getClass($this->type)));114 148 return $this; 115 149 } … … 141 175 } 142 176 177 public function isEnabled() 178 { 179 $isEnabled = $this->get('isEnabled', false); 180 if ($isEnabled === true) { 181 return true; 182 } 183 184 $isValid = $this->get('isValid', false); 185 $isAuthNeeded = $this->isAuthNeeded(); 186 if ($isAuthNeeded === false && 187 $isValid === true 188 ) { 189 return true; 190 } 191 return false; 192 } 193 194 public function isAuthNeeded() 195 { 196 if ($this->service instanceof AbstractAuthService) { 197 return true; 198 } 199 200 return false; 201 } 202 203 public function getAuthUrl() 204 { 205 if (!$this->isAuthNeeded() || 206 !$this->service instanceof AbstractAuthService 207 ) { 208 return ''; 209 } 210 211 return $this->service->getAuthUrl(); 212 } 213 214 public function getStatusDisplay() 215 { 216 $status = $this->getStatus(); 217 switch ($status) { 218 case self::STATUS_ENABLED: 219 return __('Enabled', 'remote-medias-lite'); 220 case self::STATUS_AUTHNEEDED: 221 return __('Authenticate now', 'remote-medias-lite'); 222 case self::STATUS_INVALID: 223 return __('Invalid', 'remote-medias-lite'); 224 default: 225 return __('Unknown', 'remote-medias-lite'); 226 } 227 228 return __('Unknown', 'remote-medias-lite'); 229 } 230 231 public function getStatus() 232 { 233 if ($this->isEnabled()) { 234 return self::STATUS_ENABLED; 235 } 236 237 if ($this->isAuthNeeded()) { 238 return self::STATUS_AUTHNEEDED; 239 } 240 241 $isValid = $this->get('isValid'); 242 if ($isValid === false) { 243 return self::STATUS_INVALID; 244 } 245 return self::STATUS_UNKNOWN; 246 } 247 248 /* 249 * @return 1 on validate, 0 on invalid params, -1 on error 250 */ 143 251 public function validate() 144 252 { 145 if (!($this->service instanceof AbstractRemoteService)) { 146 return false; 147 } 148 149 $return = array(); 150 $return['validate'] = false; 151 253 $isValid = 0; 254 $this->set('isValid', false); 255 152 256 try { 153 $return['validate'] = $this->service->validate($this); 257 $isServiceValid = $this->service->validate(); 258 if ($isServiceValid === true) { 259 $this->set('isValid', true); 260 $isValid = 1; 261 } 154 262 } catch (ClientErrorResponseException $e) { 155 $ return['error'] = true;156 $return['statuscode'] = $e->getResponse()->getStatusCode();157 $ return['msg'] = $e->getResponse()->getReasonPhrase();263 $isValid = 0; 264 } catch (Exception\InvalidAuthParamException $e) { 265 $isValid = 0; 158 266 } catch (\Exception $e) { 159 $return['error'] = true; 160 $return['statuscode'] = $e->getCode(); 161 $return['msg'] = $e->getMessage(); 162 } 163 164 $lastValidQuery = null; 165 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 } 172 173 $this->set('last_valid_query', $lastValidQuery); 174 175 return $return['validate']; 267 error_log('RML error occured validating account '.$this->getId().': '.$e->getMessage()); 268 $isValid = -1; 269 } 270 271 return $isValid; 176 272 } 177 273 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/AbstractRemoteMedia.php
r998050 r1121928 105 105 ); 106 106 } 107 $sizes['full'] = array('url' => $url); 107 $sizes['full'] = array( 108 'height' => $height, 109 'width' => $width, 110 'url' => $url, 111 'orientation' => $height > $width ? 'portrait' : 'landscape', 112 ); 108 113 109 114 return $sizes; -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/AbstractRemoteService.php
r998050 r1121928 25 25 { 26 26 $this->accountPostType = $postType; 27 28 return $this; 27 29 } 28 30 … … 30 32 { 31 33 $this->client = $client; 34 35 return $this; 32 36 } 33 37 … … 55 59 { 56 60 foreach ($this->fieldSet as $field) { 57 $field->attr('value', esc_attr($this->account->get($this->getSlug().'_'.$field->attr('id')))); 61 $value = $this->account->get($this->getSlug().'_'.$field->attr('id')); 62 $default = $field->attr('default'); 63 if (is_null($value) && !is_null($default)) { 64 $value = $default; 65 } 66 $field->attr('value', esc_attr($value)); 58 67 } 59 68 return $this->fieldSet; -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Dailymotion/Service.php
r998050 r1121928 12 12 public function __construct() 13 13 { 14 parent::__construct(__('Dailymotion Basic'), 'dailymotion');14 parent::__construct(__('Dailymotion', 'remote-medias-lite'), 'dailymotion'); 15 15 16 16 $client = Client::factory(); … … 38 38 'class' => $this->getSlug(), 39 39 'id' => 'remote_user_id', 40 'name' => 'account_meta['.$this->getSlug().'][ remote_user_id]',40 'name' => 'account_meta['.$this->getSlug().'][dailymotion_remote_user_id]', 41 41 'desc' => __("Insert the Dailymotion User ID for this library", 'remote-medias-lite'), 42 42 ); … … 49 49 50 50 $params = array( 51 'user_id' => $this->account->get(' remote_user_id'),51 'user_id' => $this->account->get('dailymotion_remote_user_id'), 52 52 'fields' => 'id,screenname,status,username' 53 53 ); … … 69 69 70 70 $params = array( 71 'user_id' => $this->account->get(' remote_user_id'),71 'user_id' => $this->account->get('dailymotion_remote_user_id'), 72 72 'fields' => 'id,title,description,created_time,modified_time,owner,thumbnail_120_url,thumbnail_url,url' 73 73 ); … … 81 81 { 82 82 $params = array( 83 'user_id' => $this->account->get(' remote_user_id'),84 'fields' => 'id,title,description,created_time,modified_time,owner,thumbnail_120_url,thumbnail_url,url' 83 'user_id' => $this->account->get('dailymotion_remote_user_id'), 84 'fields' => 'id,title,description,created_time,modified_time,owner,thumbnail_120_url,thumbnail_url,url', 85 85 ); 86 86 $command = $this->client->getCommand('UserVideosRequest', $params); … … 92 92 public function getUserAttachments() 93 93 { 94 $page = 1; 95 $perpage = 40; 96 $searchTerm = ''; 97 98 if (isset($_POST['query']['posts_per_page'])) { 99 $perpage = absint($_POST['query']['posts_per_page']); 100 } 101 if (isset($_POST['query']['s'])) { 102 $searchTerm = sanitize_text_field($_POST['query']['s']); 103 } 104 94 105 $response = $this->GetUserMedias(); 95 106 $medias = $response->getAll(); … … 102 113 $attachments[$i] = $remoteMedia->toMediaManagerAttachment(); 103 114 } 115 116 unset($attachments[count($attachments)-1]); 104 117 return $attachments; 105 118 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Dailymotion/ServiceDescription.json
r997433 r1121928 27 27 "UserVideosRequest": { 28 28 "httpMethod": "GET", 29 "uri": "user/{user_id}/videos ?fields={fields}",29 "uri": "user/{user_id}/videos", 30 30 "summary": "Access the videos for a specific user", 31 31 "class": "WPRemoteMediaExt\\Guzzle\\Service\\Command\\OperationCommand", … … 40 40 "fields": { 41 41 "type": "string", 42 "location": " uri",42 "location": "query", 43 43 "default": "id,title", 44 44 "description": "Fields list. See http://www.dailymotion.com/doc/api/obj-video.html" 45 }, 46 "page": { 47 "type": "string", 48 "location": "query", 49 "default": "1" 50 }, 51 "limit": { 52 "type": "string", 53 "location": "query", 54 "default": "40" 45 55 } 46 56 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Flickr/Service.php
r998050 r1121928 12 12 public function __construct() 13 13 { 14 parent::__construct(__('Flickr Basic'), 'flickr');14 parent::__construct(__('Flickr', 'remote-medias-lite'), 'flickr'); 15 15 16 16 $client = Client::factory(); … … 47 47 'id' => 'remote_user_id', 48 48 'placeholder' => 'XXXXXXXX@NXX', 49 'name' => 'account_meta['.$this->getSlug().'][ remote_user_id]',49 'name' => 'account_meta['.$this->getSlug().'][flickr_remote_user_id]', 50 50 'desc' => __("Insert the Flickr User NSID for this library", 'remote-medias-lite'), 51 51 ); … … 56 56 { 57 57 $params = array( 58 'user_id' => $this->account->get(' remote_user_id'),58 'user_id' => $this->account->get('flickr_remote_user_id'), 59 59 ); 60 60 $command = $this->client->getCommand('UserPublicPhotos', $params); 61 61 $response = $this->client->execute($command); 62 63 return $ command->getResponse()->isSuccessful();62 63 return $response->isSuccessful(); 64 64 } 65 65 … … 68 68 69 69 // $params = array( 70 // 'user_id' => $account->get(' remote_user_id'),70 // 'user_id' => $account->get('flickr_remote_user_id'), 71 71 // 'request' => 'info' 72 72 // ); … … 77 77 } 78 78 79 /* 80 * 81 * Per Flickr site: 82 * Why do I only see 20 items in RSS feeds? 83 * Flickr only shows the latest 20 items in a feed. Because of this, 84 * the first time you connect to a feed you will only see the most 85 * recent items. But if your RSS reader saves items (as most do) you 86 * will see more than 20 as the items build up over time. 87 * 88 * from: https://www.flickr.com/help/website/#109651 89 */ 79 90 public function getUserMedias() 80 91 { 81 92 $params = array( 82 'user_id' => $this->account->get(' remote_user_id'),93 'user_id' => $this->account->get('flickr_remote_user_id'), 83 94 ); 84 95 $command = $this->client->getCommand('UserPublicPhotos', $params); -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/MetaBoxSaveAccount.php
r998050 r1121928 28 28 if (is_array($value)) { 29 29 foreach ($value as $typedata => $typevalue) { 30 $account->set($ key.'_'.$typedata, sanitize_text_field($typevalue));30 $account->set($typedata, sanitize_text_field($typevalue)); 31 31 } 32 32 } else { … … 35 35 } 36 36 37 $account->set('remote_user_id', sanitize_text_field($_POST['account_meta'][$accountType]['remote_user_id']));38 37 $account->set('service_class', sanitize_text_field($_POST['account_meta'][$accountType]['service_class'])); 38 $account->setServiceFromClass(stripslashes($account->get('service_class'))); 39 39 40 $account->validate(); 40 41 $account->save(); 41 42 42 $isValid = $account->get('isValid'); 43 if (!$isValid) { 44 $_REQUEST['rmlmsg'] = 1; 43 $isEnabled = $account->isEnabled(); 44 45 if (!$isEnabled) { 46 $_REQUEST['rmlmsg'] = $account->getStatus(); 45 47 } elseif (isset($_REQUEST['rmlmsg'])) { 46 48 unset($_REQUEST['rmlmsg']); -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/RemoteAccountFactory.php
r992903 r1121928 4 4 class RemoteAccountFactory 5 5 { 6 //TODO create by id and create by type7 6 public static function create($rmID) 8 7 { … … 16 15 $newaccount = new RemoteAccount(); 17 16 $newaccount->setService($service); 17 $newaccount->setType(RemoteServiceFactory::getType($serviceClass)); 18 18 19 19 return $newaccount; -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/RemoteMediaFactory.php
r997433 r1121928 4 4 class RemoteMediaFactory 5 5 { 6 public static function createFromAccountid($accountId, $metadata = array()) 7 { 8 $account = RemoteAccountFactory::create($accountId); 9 $baseNamespace = $account->getServiceNamespace(); 10 $rmclass = $baseNamespace.'\\RemoteMedia'; 11 if (class_exists($rmclass)) { 12 return new $rmclass($metadata); 13 } 14 return null; 15 } 16 6 17 public static function create($subtype, $metadata = array()) 7 18 { -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/RemoteServiceFactory.php
r998050 r1121928 68 68 return null; 69 69 } 70 71 public static function getType($class) 72 { 73 return array_search($class, self::$classes); 74 } 70 75 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Vimeo/Service.php
r998050 r1121928 12 12 public function __construct() 13 13 { 14 parent::__construct(__('Vimeo Basic'), 'vimeo');14 parent::__construct(__('Vimeo', 'remote-medias-lite'), 'vimeo'); 15 15 16 16 $client = Client::factory(); … … 38 38 'class' => $this->getSlug(), 39 39 'id' => 'remote_user_id', 40 'name' => 'account_meta['.$this->getSlug().'][ remote_user_id]',40 'name' => 'account_meta['.$this->getSlug().'][vimeo_remote_user_id]', 41 41 'desc' => __("Insert the Vimeo User ID for this library", 'remote-medias-lite'), 42 42 ); … … 48 48 49 49 $params = array( 50 'user_id' => $this->account->get(' remote_user_id'),50 'user_id' => $this->account->get('vimeo_remote_user_id'), 51 51 'request' => 'info' 52 52 ); … … 61 61 62 62 $params = array( 63 'user_id' => $this->account->get(' remote_user_id'),63 'user_id' => $this->account->get('vimeo_remote_user_id'), 64 64 'request' => 'info' 65 65 ); … … 70 70 } 71 71 72 /* 73 * From https://developer.vimeo.com/apis/simple 74 * Simple API responses include up to 20 items per page. 75 * 76 * By adding the ?page parameter to the URL, you can retrieve up to 3 pages 77 * of data. If you need more than the maximum of 60 items, you must use the 78 * New API. 79 */ 72 80 public function getUserMedias() 73 81 { 74 82 $params = array( 75 'user_id' => $this->account->get(' remote_user_id'),83 'user_id' => $this->account->get('vimeo_remote_user_id'), 76 84 'request' => 'videos' 77 85 ); … … 84 92 public function getUserAttachments() 85 93 { 94 $perpage = 40; 95 $searchTerm = ''; 96 97 if (isset($_POST['query']['posts_per_page'])) { 98 $perpage = absint($_POST['query']['posts_per_page']); 99 } 100 if (isset($_POST['query']['s'])) { 101 $searchTerm = sanitize_text_field($_POST['query']['s']); 102 } 103 104 //Vimeo return 20 max items per page 86 105 $response = $this->GetUserMedias(); 87 106 $medias = $response->getAll(); … … 92 111 $remoteMedia = new RemoteMedia($media); 93 112 $remoteMedia->setAccount($this->getAccount()); 94 $attachments[ $i] = $remoteMedia->toMediaManagerAttachment();113 $attachments[] = $remoteMedia->toMediaManagerAttachment(); 95 114 } 115 96 116 return $attachments; 97 117 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Vimeo/ServiceDescription.json
r997433 r1121928 2 2 "name": "Vimeo", 3 3 "apiVersion": "2", 4 "description": "This API allows to connect with Vimeo web services ",4 "description": "This API allows to connect with Vimeo web services. From https://developer.vimeo.com/apis/simple", 5 5 "operations": { 6 6 "UserRequest": { … … 22 22 "description": "The data you want. Could be: info,videos,likes,appears_in,all_videos,subscriptions,albums,channels,groups", 23 23 "required": true 24 }, 25 "page": { 26 "type": "integer", 27 "location": "query" 24 28 } 25 29 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Youtube/RemoteMedia.php
r998050 r1121928 26 26 { 27 27 28 29 28 $attachment = array_merge( 30 29 $this->getBasicAttachment(), … … 36 35 'link' => $this->metadata['url'], 37 36 'alt' => '', 38 'author' => $this->metadata['author']['name'],37 'author' => isset($this->metadata['author']) && isset($this->metadata['author']['name']) ? $this->metadata['author']['name'] : '', 39 38 'description' => $this->metadata['content'], 40 39 'caption' => "", //limit word count -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Youtube/Service.php
r998050 r1121928 14 14 public function __construct() 15 15 { 16 parent::__construct(__('Youtube Basic'), 'youtube');16 parent::__construct(__('Youtube', 'remote-medias-lite'), 'youtube'); 17 17 18 18 $client = Client::factory(); … … 40 40 'class' => $this->getSlug(), 41 41 'id' => 'remote_user_id', 42 'name' => 'account_meta['.$this->getSlug().'][ remote_user_id]',42 'name' => 'account_meta['.$this->getSlug().'][youtube_remote_user_id]', 43 43 'desc' => __("Insert the Youtube User ID for this library", 'remote-medias-lite'), 44 44 ); … … 72 72 { 73 73 $params = array( 74 'user_id' => $this->account->get(' remote_user_id'),74 'user_id' => $this->account->get('youtube_remote_user_id'), 75 75 'request' => 'info' 76 76 ); … … 85 85 { 86 86 $params = array( 87 'user_id' => $this->account->get(' remote_user_id')87 'user_id' => $this->account->get('youtube_remote_user_id') 88 88 ); 89 89 $command = $this->client->getCommand($this->command, $params); … … 93 93 } 94 94 95 public function getUserMedias( )95 public function getUserMedias($perpage = 40) 96 96 { 97 97 $params = array( 98 'user_id' => $this->account->get('remote_user_id') 98 'user_id' => $this->account->get('youtube_remote_user_id'), 99 'max-results' => $perpage, 99 100 ); 100 101 $command = $this->client->getCommand($this->command, $params); … … 106 107 public function getUserAttachments() 107 108 { 108 $response = $this->GetUserMedias(); 109 $perpage = 40; 110 $searchTerm = ''; 111 112 if (isset($_POST['query']['posts_per_page'])) { 113 $perpage = absint($_POST['query']['posts_per_page']); 114 } 115 if (isset($_POST['query']['s'])) { 116 $searchTerm = sanitize_text_field($_POST['query']['s']); 117 } 118 119 $response = $this->GetUserMedias($perpage); 109 120 $medias = $response->getAll(); 110 121 … … 116 127 $attachments[$i] = $remoteMedia->toMediaManagerAttachment(); 117 128 } 129 unset($attachments[count($attachments)-1]); 118 130 return $attachments; 119 131 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Accounts/Youtube/ServiceDescription.json
r997433 r1121928 16 16 "description": "The user id you want.", 17 17 "required": true 18 }, 19 "max-results": { 20 "type": "string", 21 "location": "query", 22 "default": 40 23 }, 24 "start-index": { 25 "type": "string", 26 "location": "query", 27 "default": 1 28 }, 29 "orderby": { 30 "type": "string", 31 "location": "query", 32 "default": "published" 18 33 } 19 34 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Ajax/AjaxQueryAttachments.php
r998050 r1121928 32 32 33 33 } catch (ClientErrorResponseException $e) { 34 $return['success'] = true;34 $return['success'] = false; 35 35 $return['statuscode'] = $e->getResponse()->getStatusCode(); 36 $return['msg'] = $e->getResponse()->get Error();36 $return['msg'] = $e->getResponse()->getMessage(); 37 37 wp_send_json($return); 38 38 } catch (CurlException $e) { … … 43 43 } catch (\Exception $e) { 44 44 $return['success'] = false; 45 $return['statuscode'] = $e->get Response()->getStatusCode();46 $return['msg'] = $e->get Response()->getReasonPhrase();45 $return['statuscode'] = $e->getCode(); 46 $return['msg'] = $e->getMessage(); 47 47 wp_send_json($return); 48 48 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Ajax/AjaxQueryValidation.php
r997433 r1121928 2 2 namespace WPRemoteMediaExt\RemoteMediaExt\Ajax; 3 3 4 use WPRemoteMediaExt\Guzzle\Http\Exception\ClientErrorResponseException;5 use WPRemoteMediaExt\RemoteMediaExt\Accounts\Vimeo\VimeoClient;6 4 use WPRemoteMediaExt\RemoteMediaExt\Accounts\RemoteAccountFactory; 5 7 6 use WPRemoteMediaExt\WPCore\WPajaxCall; 8 7 … … 16 15 } 17 16 17 public function getScriptParams() 18 { 19 $params = parent::getScriptParams(); 20 21 $params['status'] = array(); 22 $params['status']['unknown'] = __('Unknown', 'remote-medias-lite'); 23 $params['status']['invalid'] = __('Invalid', 'remote-medias-lite'); 24 $params['status']['authProcessing'] = __('Authenticating', 'remote-medias-lite'); 25 $params['status']['enabled'] = __('Enabled', 'remote-medias-lite'); 26 $params['status']['authNeeded'] = __('Authenticate Now', 'remote-medias-lite'); 27 $params['status']['authfailed'] = __('Failed Auth', 'remote-medias-lite'); 28 $params['button'] = array(); 29 $params['button']['reauth'] = __('Re-authenticate', 'remote-medias-lite'); 30 31 return $params; 32 } 33 34 public function end($data) 35 { 36 echo json_encode($data); 37 die(); 38 } 39 18 40 public function callback($data) 19 41 { 20 $return = array('error' => false); 42 $return = array( 43 'error' => false, 44 'validate' => false, 45 'authneeded' => false, 46 'authurl' => '' 47 ); 21 48 22 $return['validate'] = false; 49 $data = $_POST['account']; 50 $account = RemoteAccountFactory::createFromService(stripslashes(esc_attr($data['service_class']))); 23 51 24 $account = RemoteAccountFactory::createFromService(stripslashes(esc_attr($_POST['service_class']))); 52 if (is_null($account)) { 53 $return['error'] = true; 54 $return['msg'] = 'Service type class '.stripslashes(esc_attr($data['service_class'])).' unknown'; 55 $this->end($return); 56 } 25 57 26 if (!is_null($account)) { 27 $account->set('remote_user_id', esc_attr($_POST['user_id'])); 58 unset($data['service_class']); 59 60 if (empty($_POST['post_id'])) { 61 $return['error'] = true; 62 $return['msg'] = 'post_id parameter missing'; 63 $this->end($return); 64 } 65 66 $account->setId(absint($_POST['post_id'])); 67 68 //Apply all attributes to account 69 foreach ($data as $name => $value) { 70 $account->set(esc_attr($name), esc_attr($value)); 71 } 72 73 $return['authneeded'] = $account->isAuthNeeded(); 74 //If no auth needed validate credentials 75 if ($return['authneeded'] === false) { 76 28 77 $return['validate'] = $account->validate(); 29 $return['last_valid_query'] = $account->get('last_valid_query'); 30 } else { 78 $this->end($return); 79 } 80 81 try { 82 //If auth needed, get Auth URL 83 $return['authurl'] = $account->getAuthUrl(); 84 } catch (ClientErrorResponseException $e) { 31 85 $return['error'] = true; 32 $return['msg'] = 'Service type class '.stripslashes(esc_attr($_POST['service_class'])).' unknown'; 86 $return['msg'] = 'invalid remote library parmeters'; 87 } catch (InvalidAuthParamException $e) { 88 $return['error'] = true; 89 $return['msg'] = 'invalid remote library parmeters'; 90 } catch (\Exception $e) { 91 error_log('RML could not get Auth Url:'.$e->getMessage()); 92 $return['error'] = true; 93 $return['msg'] = 'post_id parameter missing'; 33 94 } 34 95 35 36 echo htmlspecialchars(json_encode($return), ENT_NOQUOTES); 37 die(); // this is required to return a proper result 96 $this->end($return); 38 97 } 39 98 } -
remote-medias-lite/trunk/src/RemoteMediaExt/Ajax/AjaxSendRemoteToEditor.php
r998050 r1121928 19 19 $html = ""; 20 20 21 if (empty($jsattachment[' subtype']) ||21 if (empty($jsattachment['accountId']) || 22 22 empty($jsattachment['remotedata']) 23 23 ) { … … 25 25 } 26 26 27 $media = RemoteMediaFactory::create($jsattachment['subtype'], $jsattachment['remotedata']); 27 $accountId = absint($jsattachment['accountId']); 28 29 $media = RemoteMediaFactory::createFromAccountid($accountId, $jsattachment['remotedata']); 28 30 29 31 if (is_null($media)) { -
remote-medias-lite/trunk/src/RemoteMediaExt/FRemoteMediaExt.php
r1006821 r1121928 17 17 use WPRemoteMediaExt\RemoteMediaExt\Library\MediaTemplate; 18 18 use WPRemoteMediaExt\RemoteMediaExt\Library\MediaSettings; 19 use WPRemoteMediaExt\RemoteMediaExt\Library\MediaLibrarySection;20 19 21 20 use WPRemoteMediaExt\WPCore\admin\WPfeaturePointer; … … 33 32 public static $instance; 34 33 35 protected $version = '1. 1.2';34 protected $version = '1.2.0'; 36 35 protected $accountPostType; 37 36 protected $remoteServices = array(); … … 86 85 //Hook Flickr Support 87 86 $service = new RemoteService\Flickr\Service(); 87 $service->setBasePath($this->getBasePath()); 88 $service->setAccountPostType($this->accountPostType); 89 $this->hook($service); 90 $this->addRemoteService($service); 91 92 //Hook Instagram Support 93 $service = new RemoteService\Instagram\Service(); 88 94 $service->setBasePath($this->getBasePath()); 89 95 $service->setAccountPostType($this->accountPostType); … … 123 129 124 130 $this->hook(new MediaTemplate(new View($this->getViewsPath().'admin/media-remote-attachment.php'))); 131 $this->hook(new MediaTemplate(new View($this->getViewsPath().'admin/media-friendly-banner.php'))); 132 $this->addScript(new WPscriptAdmin(array('post.php' => array(), 'post-new.php' => array()), 'jquery-cookie', $this->getJsUrl().'jquery-cookie.min.js', $this->getJsUrl().'jquery-cookie.js', array('jquery'), $this->version)); 125 133 $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 134 $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)); … … 185 193 $metabox = new MetaBoxService( 186 194 new View( 187 $this->getViewsPath().'admin/metaboxes/basic-settings.php', 188 array('services' => $this->getRemoteServices()) 195 $this->getViewsPath().'admin/metaboxes/basic-settings.php' 189 196 ), 190 197 'rml_account_settings', -
remote-medias-lite/trunk/src/RemoteMediaExt/Library/MediaSettings.php
r998050 r1121928 51 51 'type' => $remoteAccount->get('type'), 52 52 'title' => 'Insert '.$account->post_title, 53 'filterable' => $remoteAccount->get('library_filterable', ''), 54 'filters' => $remoteAccount->get('library_filters', ''), 55 'remoteuploadable' => $remoteAccount->get('remoteuploadable', false), 56 'uioptions' => $remoteAccount->get('uioptions', array()) 53 57 ); 54 58 } -
remote-medias-lite/trunk/vendor/autoload.php
r1006821 r1121928 5 5 require_once __DIR__ . '/composer' . '/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 5d42ae4508dec87ab775d81cc28eb958::getLoader();7 return ComposerAutoloaderInit0750d3f245670d325db99442641da17f::getLoader(); -
remote-medias-lite/trunk/vendor/composer/ClassLoader.php
r992903 r1121928 55 55 private $classMap = array(); 56 56 57 private $classMapAuthoritative = false; 58 57 59 public function getPrefixes() 58 60 { 59 return call_user_func_array('array_merge', $this->prefixesPsr0); 61 if (!empty($this->prefixesPsr0)) { 62 return call_user_func_array('array_merge', $this->prefixesPsr0); 63 } 64 65 return array(); 60 66 } 61 67 … … 246 252 247 253 /** 254 * Turns off searching the prefix and fallback directories for classes 255 * that have not been registered with the class map. 256 * 257 * @param bool $classMapAuthoritative 258 */ 259 public function setClassMapAuthoritative($classMapAuthoritative) 260 { 261 $this->classMapAuthoritative = $classMapAuthoritative; 262 } 263 264 /** 265 * Should class lookup fail if not found in the current class map? 266 * 267 * @return bool 268 */ 269 public function isClassMapAuthoritative() 270 { 271 return $this->classMapAuthoritative; 272 } 273 274 /** 248 275 * Registers this instance as an autoloader. 249 276 * … … 295 322 if (isset($this->classMap[$class])) { 296 323 return $this->classMap[$class]; 324 } 325 if ($this->classMapAuthoritative) { 326 return false; 297 327 } 298 328 -
remote-medias-lite/trunk/vendor/composer/autoload_classmap.php
r997433 r1121928 8 8 return array( 9 9 'WPRemoteMediaExt\\RemoteMediaExt\\AccountPostType' => $baseDir . '/src/RemoteMediaExt/AccountPostType.php', 10 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\AbstractAuthService' => $baseDir . '/src/RemoteMediaExt/Accounts/AbstractAuthService.php', 10 11 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\AbstractRemoteAccount' => $baseDir . '/src/RemoteMediaExt/Accounts/AbstractRemoteAccount.php', 11 12 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\AbstractRemoteClient' => $baseDir . '/src/RemoteMediaExt/Accounts/AbstractRemoteClient.php', … … 18 19 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\Flickr\\RemoteMedia' => $baseDir . '/src/RemoteMediaExt/Accounts/Flickr/RemoteMedia.php', 19 20 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\Flickr\\Service' => $baseDir . '/src/RemoteMediaExt/Accounts/Flickr/Service.php', 21 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\Instagram\\Client' => $baseDir . '/src/RemoteMediaExt/Accounts/Instagram/Client.php', 22 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\Instagram\\RemoteMedia' => $baseDir . '/src/RemoteMediaExt/Accounts/Instagram/RemoteMedia.php', 23 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\Instagram\\Response' => $baseDir . '/src/RemoteMediaExt/Accounts/Instagram/Response.php', 24 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\Instagram\\Service' => $baseDir . '/src/RemoteMediaExt/Accounts/Instagram/Service.php', 20 25 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\MetaBoxSaveAccount' => $baseDir . '/src/RemoteMediaExt/Accounts/MetaBoxSaveAccount.php', 21 26 'WPRemoteMediaExt\\RemoteMediaExt\\Accounts\\MetaBoxService' => $baseDir . '/src/RemoteMediaExt/Accounts/MetaBoxService.php', … … 35 40 'WPRemoteMediaExt\\RemoteMediaExt\\Ajax\\AjaxSendRemoteToEditor' => $baseDir . '/src/RemoteMediaExt/Ajax/AjaxSendRemoteToEditor.php', 36 41 'WPRemoteMediaExt\\RemoteMediaExt\\Ajax\\AjaxUserInfo' => $baseDir . '/src/RemoteMediaExt/Ajax/AjaxUserInfo.php', 42 'WPRemoteMediaExt\\RemoteMediaExt\\Exception\\InvalidAuthParamException' => $baseDir . '/src/RemoteMediaExt/Exception/InvalidAuthParamException.php', 37 43 'WPRemoteMediaExt\\RemoteMediaExt\\FRemoteMediaExt' => $baseDir . '/src/RemoteMediaExt/FRemoteMediaExt.php', 38 44 'WPRemoteMediaExt\\RemoteMediaExt\\Library\\MediaArraySettings' => $baseDir . '/src/RemoteMediaExt/Library/MediaArraySettings.php', -
remote-medias-lite/trunk/vendor/composer/autoload_real.php
r1006821 r1121928 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 5d42ae4508dec87ab775d81cc28eb9585 class ComposerAutoloaderInit0750d3f245670d325db99442641da17f 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit 5d42ae4508dec87ab775d81cc28eb958', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInit0750d3f245670d325db99442641da17f', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit 5d42ae4508dec87ab775d81cc28eb958', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInit0750d3f245670d325db99442641da17f', 'loadClassLoader')); 25 25 26 26 $map = require __DIR__ . '/autoload_namespaces.php'; … … 45 45 } 46 46 47 function composerRequire 5d42ae4508dec87ab775d81cc28eb958($file)47 function composerRequire0750d3f245670d325db99442641da17f($file) 48 48 { 49 49 require $file; -
remote-medias-lite/trunk/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php
r992903 r1121928 226 226 $this->checkCurlResult($mrc); 227 227 $this->processMessages(); 228 228 229 if ($active && curl_multi_select($this->multiHandle, $selectTimeout) === -1) { 229 230 // Perform a usleep if a select returns -1: https://bugs.php.net/bug.php?id=61141 -
remote-medias-lite/trunk/views/admin/media-remote-attachment.php
r992903 r1121928 2 2 ?> 3 3 <script type="text/html" id="tmpl-attachment-remote"> 4 <div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}"> 5 <# if ( data.uploading ) { #> 6 <div class="media-progress-bar"><div></div></div> 7 <# } else if ( 'image' === data.type ) { #> 8 <div class="thumbnail"> 9 <div class="centered"> 10 <img src="{{ data.size.url }}" draggable="false" /> 11 </div> 12 </div> 13 <# } else if ('remote' === data.type) { #> 14 <div class="thumbnail"> 15 <div class="centered"> 16 <img src="{{ data.icon }}" draggable="false" /> 17 </div> 4 <div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}"> 5 <div class="thumbnail"> 6 <# if ( data.uploading ) { #> 7 <div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div> 8 <# } else if ( 'image' === data.type && data.sizes ) { #> 9 <div class="centered"> 10 <img src="{{ data.size.url }}" draggable="false" alt="" /> 18 11 </div> 19 12 <# } else { #> 20 <img src="{{ data.icon }}" class="icon" draggable="false" /> 13 <div class="centered"> 14 <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> 15 <img src="{{ data.image.src }}" class="thumbnail" draggable="false" /> 16 <# } else { #> 17 <img src="{{ data.icon }}" class="icon" draggable="false" /> 18 <# } #> 19 </div> 21 20 <div class="filename"> 22 21 <div>{{ data.filename }}</div> 23 22 </div> 24 23 <# } #> 25 26 <# if ( data.buttons.close ) { #>27 <a class="close media-modal-icon" href="#" title="<?php _e('Remove'); ?>"></a>28 <# } #>29 30 <# if ( data.buttons.check ) { #>31 <a class="check" href="#" title="<?php _e('Deselect'); ?>"><div class="media-modal-icon"></div></a>32 <# } #>33 24 </div> 34 <# 35 var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; 36 if ( data.describe ) { #> 37 <# if ( 'image' === data.type ) { #> 38 <input type="text" value="{{ data.caption }}" class="describe" data-setting="caption" 39 placeholder="<?php esc_attr_e('Caption this image…'); ?>" {{ maybeReadOnly }} /> 40 <# } else { #> 41 <input type="text" value="{{ data.title }}" class="describe" data-setting="title" 42 <# if ( 'video' === data.type ) { #> 43 placeholder="<?php esc_attr_e('Describe this video…'); ?>" 44 <# } else if ( 'audio' === data.type ) { #> 45 placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 46 <# } else { #> 47 placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 48 <# } #> {{ maybeReadOnly }} /> 49 <# } #> 25 <# if ( data.buttons.close ) { #> 26 <a class="close media-modal-icon" href="#" title="<?php esc_attr_e('Remove'); ?>"></a> 50 27 <# } #> 28 </div> 29 <# if ( data.buttons.check ) { #> 30 <a class="check" href="#" title="<?php esc_attr_e('Deselect'); ?>" tabindex="-1"><div class="media-modal-icon"></div></a> 31 <# } #> 32 <# 33 var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; 34 if ( data.describe ) { 35 if ( 'image' === data.type ) { #> 36 <input type="text" value="{{ data.caption }}" class="describe" data-setting="caption" 37 placeholder="<?php esc_attr_e('Caption this image…'); ?>" {{ maybeReadOnly }} /> 38 <# } else { #> 39 <input type="text" value="{{ data.title }}" class="describe" data-setting="title" 40 <# if ( 'video' === data.type ) { #> 41 placeholder="<?php esc_attr_e('Describe this video…'); ?>" 42 <# } else if ( 'audio' === data.type ) { #> 43 placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 44 <# } else { #> 45 placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 46 <# } #> {{ maybeReadOnly }} /> 47 <# } 48 } #> 51 49 </script> -
remote-medias-lite/trunk/views/admin/metaboxes/basic-settings.php
r997435 r1121928 5 5 //$metabox 6 6 //$account 7 //$services8 7 echo $hidden_nonce; 8 9 $rml = \WPRemoteMediaExt\RemoteMediaExt\FRemoteMediaExt::getInstance(); 10 $services = $rml->getRemoteServices(); 9 11 10 12 foreach ($services as $service) { … … 22 24 <?php 23 25 } 24 ?> -
remote-medias-lite/trunk/views/admin/metaboxes/status-actions.php
r997435 r1121928 1 <div class="rml-status-box"> 1 <?php 2 use \WPRemoteMediaExt\RemoteMediaExt\Accounts\AbstractRemoteAccount; 3 4 ?> 5 <div id="rml-status-box" class="rml-status-box"> 2 6 <div class="rml-status-minor"> 3 7 <div class="rml-status-actions"> 4 8 <div class="misc-pub-section"> 5 <label for="account_status"><?php _e('Account Status:','remote-medias-lite'); ?></label> 9 <label for="account_status"><?php _e('Account Status:', 'remote-medias-lite'); ?></label> 10 <?php 11 $status = $account->getStatus(); 12 $statusDisplay = $account->getStatusDisplay(); 13 if ($status === AbstractRemoteAccount::STATUS_AUTHNEEDED) { 14 $statusDisplay = '<a class="action_query_test" href="#">'.$statusDisplay.'</a>'; 15 } 6 16 7 <?php8 $workingStyle = "";9 $unknownStyle = "";10 $invalidStyle = "";11 $status = $account->get('isValid');12 //working13 if ($status === true) {14 $workingStyle = '';15 $unknownStyle = 'style="display: none"';16 $invalidStyle = 'style="display: none"';17 //unknown18 } elseif (is_null($status)) {19 $workingStyle = 'style="display: none"';20 $unknownStyle = '';21 $invalidStyle = 'style="display: none"';22 //invalid23 } else {24 $workingStyle = 'style="display: none"';25 $unknownStyle = 'style="display: none"';26 $invalidStyle = '';27 }28 17 ?> 29 <span class="rml-status-field working" <?php echo $workingStyle; ?>><?php _e('Working', 'remote-medias-lite'); ?></span> 30 <span class="rml-status-field unknown" <?php echo $unknownStyle; ?>><?php _e('Unknown', 'remote-medias-lite'); ?></span> 31 <span class="rml-status-field notvalid" <?php echo $invalidStyle; ?>><?php _e('Invalid', 'remote-medias-lite'); ?></span> 18 <span id="rmlaccountstatus" class="rml-status-field"><?php echo $statusDisplay; ?></span> 32 19 </div> 33 20 </div> … … 37 24 <span id="query_msg"></span> 38 25 <div id="rmlloading" class="spinner ocs-inline-loading"></div> 39 <a href="#" class="button button-large action_query_test"><?php _e('Validate', 'remote-medias-lite'); ?></a> 26 <?php 27 $buttonText = __('Validate', 'remote-medias-lite'); 28 // if ($account->isAuthNeeded() && $account->isEnabled()) { 29 // $buttonText = __('Re-authenticate', 'remote-medias-lite'); 30 // } 31 ?> 32 <a id="rmlstatusbutton" href="#" class="button button-large action_query_test"><?php echo $buttonText; ?></a> 40 33 </div> 41 34 <div class="clear"></div>
Note: See TracChangeset
for help on using the changeset viewer.