rtMedia for WordPress, BuddyPress and bbPress - Version 3.7.39

Version Description

  • Fix possible XSS vulnerability
  • Update label for create album
Download this release

Release Info

Developer rtcamp
Plugin Icon 128x128 rtMedia for WordPress, BuddyPress and bbPress
Version 3.7.39
Comparing to
See all releases

Code changes from version 3.7.38 to 3.7.39

Files changed (407) hide show
  1. app/admin/RTMediaAdmin.php +12 -12
  2. app/helper/RTMediaSettings.php +1 -1
  3. app/importers/BPMediaAlbumimporter.php +1 -1
  4. app/importers/RTMediaMigration.php +1 -1
  5. app/main/controllers/media/RTMediaFeatured.php +1 -1
  6. app/main/controllers/media/RTMediaGroupFeatured.php +1 -1
  7. app/main/controllers/media/RTMediaLike.php +1 -1
  8. app/main/controllers/shortcodes/RTMediaGalleryShortcode.php +2 -2
  9. app/main/controllers/template/RTMediaTemplate.php +7 -7
  10. app/main/controllers/template/rt-template-functions.php +4 -4
  11. app/main/controllers/upload/RTMediaUploadEndpoint.php +1 -1
  12. app/services/RTMediaEncoding.php +7 -7
  13. index.php +1 -1
  14. languages/rtmedia.mo +0 -0
  15. languages/rtmedia.po +2 -2
  16. readme.txt +7 -3
  17. templates/upload/uploader.php +0 -6
  18. trunk/CONTRIBUTING.md +0 -19
  19. trunk/app/admin/RTMediaAdmin.php +0 -1920
  20. trunk/app/admin/RTMediaFormHandler.php +0 -1282
  21. trunk/app/assets/css/admin.css +0 -816
  22. trunk/app/assets/css/bootstrap-switch.css +0 -184
  23. trunk/app/assets/css/bower_components/foundation/scss/foundation.css +0 -1
  24. trunk/app/assets/css/bower_components/foundation/scss/normalize.css +0 -1
  25. trunk/app/assets/css/font-awesome.css +0 -2176
  26. trunk/app/assets/css/font-awesome.min.css +0 -4
  27. trunk/app/assets/css/grid-foundation.css +0 -222
  28. trunk/app/assets/css/image-edit.css +0 -701
  29. trunk/app/assets/css/jquery.plupload.queue.css +0 -177
  30. trunk/app/assets/css/jquery.powertip.min.css +0 -1
  31. trunk/app/assets/css/jquery.sliderTabs.min.css +0 -1
  32. trunk/app/assets/css/main.css +0 -1
  33. trunk/app/assets/css/rtmedia-icons/animation.css +0 -85
  34. trunk/app/assets/css/rtmedia-icons/rtm_font_icons-codes.css +0 -470
  35. trunk/app/assets/css/rtmedia-icons/rtm_font_icons-embedded.css +0 -523
  36. trunk/app/assets/css/rtmedia-icons/rtm_font_icons-ie7-codes.css +0 -470
  37. trunk/app/assets/css/rtmedia-icons/rtm_font_icons-ie7.css +0 -481
  38. trunk/app/assets/css/rtmedia-icons/rtm_font_icons.css +0 -521
  39. trunk/app/assets/css/rtmedia-icons/rtm_font_icons.min.css +0 -1
  40. trunk/app/assets/css/settings.css +0 -1
  41. trunk/app/assets/css/style.css +0 -51
  42. trunk/app/assets/css/vendor/bootstrap-switch.css +0 -184
  43. trunk/app/assets/css/vendor/grid-foundation.css +0 -222
  44. trunk/app/assets/css/vendor/jquery.powertip.min.css +0 -1
  45. trunk/app/assets/css/vendor/jquery.sliderTabs.min.css +0 -1
  46. trunk/app/assets/css/widget.css +0 -39
  47. trunk/app/assets/font/FontAwesome.otf +0 -0
  48. trunk/app/assets/font/fontawesome-webfont.eot +0 -0
  49. trunk/app/assets/font/fontawesome-webfont.svg +0 -520
  50. trunk/app/assets/font/fontawesome-webfont.ttf +0 -0
  51. trunk/app/assets/font/fontawesome-webfont.woff +0 -0
  52. trunk/app/assets/font/rtm_font_icons.eot +0 -0
  53. trunk/app/assets/font/rtm_font_icons.svg +0 -480
  54. trunk/app/assets/font/rtm_font_icons.ttf +0 -0
  55. trunk/app/assets/font/rtm_font_icons.woff +0 -0
  56. trunk/app/assets/img/BuddyPressMedia-Instagram.png +0 -0
  57. trunk/app/assets/img/Popup-title-bg.png +0 -0
  58. trunk/app/assets/img/admin-menu.png +0 -0
  59. trunk/app/assets/img/audio_thumb.png +0 -0
  60. trunk/app/assets/img/backgrounds.gif +0 -0
  61. trunk/app/assets/img/boxspinner.gif +0 -0
  62. trunk/app/assets/img/bp-media-modal.png +0 -0
  63. trunk/app/assets/img/bp_media_social.png +0 -0
  64. trunk/app/assets/img/bpm-contest-banner.jpg +0 -0
  65. trunk/app/assets/img/bpm-icon-16.png +0 -0
  66. trunk/app/assets/img/bpm-icon-32.png +0 -0
  67. trunk/app/assets/img/bpm-photo-tagging.png +0 -0
  68. trunk/app/assets/img/buttons-disabled.png +0 -0
  69. trunk/app/assets/img/buttons.png +0 -0
  70. trunk/app/assets/img/close.png +0 -0
  71. trunk/app/assets/img/coming-soon.png +0 -0
  72. trunk/app/assets/img/delete.gif +0 -0
  73. trunk/app/assets/img/donate.gif +0 -0
  74. trunk/app/assets/img/donate.png +0 -0
  75. trunk/app/assets/img/done.gif +0 -0
  76. trunk/app/assets/img/drag-drop-bg.png +0 -0
  77. trunk/app/assets/img/error.gif +0 -0
  78. trunk/app/assets/img/ffmpeg-logo-240x184.png +0 -0
  79. trunk/app/assets/img/image_thumb.png +0 -0
  80. trunk/app/assets/img/indicator.png +0 -0
  81. trunk/app/assets/img/indicatorActive.png +0 -0
  82. trunk/app/assets/img/leftArrow.png +0 -0
  83. trunk/app/assets/img/leftPanelArrow.png +0 -0
  84. trunk/app/assets/img/loader.gif +0 -0
  85. trunk/app/assets/img/logo_medibp_32.png +0 -0
  86. trunk/app/assets/img/mask-square.png +0 -0
  87. trunk/app/assets/img/mask.png +0 -0
  88. trunk/app/assets/img/new-buddypress-media-kaltura-logo-240x184.png +0 -0
  89. trunk/app/assets/img/paypal-donate-button.png +0 -0
  90. trunk/app/assets/img/private.png +0 -0
  91. trunk/app/assets/img/rightArrow.png +0 -0
  92. trunk/app/assets/img/rightPanelArrow.png +0 -0
  93. trunk/app/assets/img/rtCamp-bullet.png +0 -0
  94. trunk/app/assets/img/rtDating.png +0 -0
  95. trunk/app/assets/img/rtMedia-pro-ad-300x300px-2-RS.png +0 -0
  96. trunk/app/assets/img/rtMedia-pro-ad.png +0 -0
  97. trunk/app/assets/img/rtcamp-logo-old.png +0 -0
  98. trunk/app/assets/img/rtcamp-logo.png +0 -0
  99. trunk/app/assets/img/rtmedia-ffmpeg-240x184.png +0 -0
  100. trunk/app/assets/img/rtmedia-instagram-240x184.png +0 -0
  101. trunk/app/assets/img/rtmedia-kaltura-240x184.png +0 -0
  102. trunk/app/assets/img/rtmedia-logo.png +0 -0
  103. trunk/app/assets/img/rtmedia-membership-240x184.png +0 -0
  104. trunk/app/assets/img/rtmedia-phototagging-240x184.png +0 -0
  105. trunk/app/assets/img/rtmedia-social-sync-240x184.png +0 -0
  106. trunk/app/assets/img/rtmedia-theme-InspireBook.png +0 -0
  107. trunk/app/assets/img/rtmedia-theme-klein.jpg +0 -0
  108. trunk/app/assets/img/rtmedia-theme-kleo.png +0 -0
  109. trunk/app/assets/img/rtmedia-theme-sweetdate.png +0 -0
  110. trunk/app/assets/img/rtmedia-watermark-240x184.png +0 -0
  111. trunk/app/assets/img/tab-icon.png +0 -0
  112. trunk/app/assets/img/throbber.gif +0 -0
  113. trunk/app/assets/img/thumb_default.png +0 -0
  114. trunk/app/assets/img/transp50.png +0 -0
  115. trunk/app/assets/img/video_thumb.png +0 -0
  116. trunk/app/assets/img/wpmini-grey.png +0 -0
  117. trunk/app/assets/js/admin.js +0 -766
  118. trunk/app/assets/js/bootstrap-switch.js +0 -255
  119. trunk/app/assets/js/bp-media-activity-uploader.js +0 -222
  120. trunk/app/assets/js/bp-media-uploader.js +0 -119
  121. trunk/app/assets/js/jquery.observehashchange.pack.js +0 -87
  122. trunk/app/assets/js/jquery.powertip.min.js +0 -1166
  123. trunk/app/assets/js/jquery.sliderTabs.min.js +0 -831
  124. trunk/app/assets/js/main.js +0 -835
  125. trunk/app/assets/js/rtMedia.backbone.js +0 -1147
  126. trunk/app/assets/js/rtMedia.js +0 -698
  127. trunk/app/assets/js/vendor/bootstrap-switch.js +0 -255
  128. trunk/app/assets/js/vendor/jquery.observehashchange.pack.js +0 -87
  129. trunk/app/assets/js/vendor/jquery.powertip.min.js +0 -1166
  130. trunk/app/assets/js/vendor/jquery.sliderTabs.min.js +0 -831
  131. trunk/app/assets/sass/.bowerrc +0 -1
  132. trunk/app/assets/sass/_foundation_reveal_settings.scss +0 -42
  133. trunk/app/assets/sass/_foundation_section_settings.scss +0 -39
  134. trunk/app/assets/sass/bower.json +0 -6
  135. trunk/app/assets/sass/bower_components/foundation/.bower.json +0 -24
  136. trunk/app/assets/sass/bower_components/foundation/bower.json +0 -6
  137. trunk/app/assets/sass/bower_components/foundation/js/foundation.js +0 -4041
  138. trunk/app/assets/sass/bower_components/foundation/js/foundation.min.js +0 -10
  139. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.abide.js +0 -201
  140. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.accordion.js +0 -41
  141. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.alert.js +0 -34
  142. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.clearing.js +0 -450
  143. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.dropdown.js +0 -184
  144. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.interchange.js +0 -304
  145. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.joyride.js +0 -839
  146. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.js +0 -416
  147. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.magellan.js +0 -118
  148. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.offcanvas.js +0 -37
  149. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.orbit.js +0 -434
  150. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.reveal.js +0 -347
  151. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.tab.js +0 -37
  152. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.tooltip.js +0 -202
  153. trunk/app/assets/sass/bower_components/foundation/js/foundation/foundation.topbar.js +0 -380
  154. trunk/app/assets/sass/bower_components/foundation/scss/foundation.scss +0 -38
  155. trunk/app/assets/sass/bower_components/foundation/scss/foundation/_functions.scss +0 -75
  156. trunk/app/assets/sass/bower_components/foundation/scss/foundation/_settings.scss +0 -995
  157. trunk/app/assets/sass/bower_components/foundation/scss/foundation/components/_flex-video.scss +0 -47
  158. trunk/app/assets/sass/bower_components/foundation/scss/foundation/components/_global.scss +0 -389
  159. trunk/app/assets/sass/bower_components/foundation/scss/foundation/components/_grid.scss +0 -234
  160. trunk/app/assets/sass/bower_components/foundation/scss/foundation/components/_tabs.scss +0 -95
  161. trunk/app/assets/sass/bower_components/foundation/scss/foundation/components/_tooltips.scss +0 -121
  162. trunk/app/assets/sass/bower_components/foundation/scss/foundation/components/_visibility.scss +0 -661
  163. trunk/app/assets/sass/bower_components/foundation/scss/normalize.scss +0 -410
  164. trunk/app/assets/sass/bower_components/jquery/.bower.json +0 -21
  165. trunk/app/assets/sass/bower_components/jquery/.gitignore +0 -1
  166. trunk/app/assets/sass/bower_components/jquery/README.md +0 -11
  167. trunk/app/assets/sass/bower_components/jquery/bower.json +0 -11
  168. trunk/app/assets/sass/bower_components/jquery/component.json +0 -15
  169. trunk/app/assets/sass/bower_components/jquery/composer.json +0 -35
  170. trunk/app/assets/sass/bower_components/jquery/jquery-migrate.js +0 -511
  171. trunk/app/assets/sass/bower_components/jquery/jquery-migrate.min.js +0 -3
  172. trunk/app/assets/sass/bower_components/jquery/jquery.js +0 -8829
  173. trunk/app/assets/sass/bower_components/jquery/jquery.min.js +0 -6
  174. trunk/app/assets/sass/bower_components/jquery/jquery.min.map +0 -1
  175. trunk/app/assets/sass/bower_components/jquery/package.json +0 -7
  176. trunk/app/assets/sass/config.rb +0 -26
  177. trunk/app/assets/sass/main.scss +0 -1579
  178. trunk/app/assets/sass/settings.scss +0 -227
  179. trunk/app/helper/BPMediaBranding.php +0 -22
  180. trunk/app/helper/BPMediaLog.php +0 -85
  181. trunk/app/helper/RTMediaActivityModel.php +0 -53
  182. trunk/app/helper/RTMediaAddon.php +0 -365
  183. trunk/app/helper/RTMediaAdminWidget.php +0 -38
  184. trunk/app/helper/RTMediaCommentModel.php +0 -79
  185. trunk/app/helper/RTMediaFeed.php +0 -69
  186. trunk/app/helper/RTMediaInteractionModel.php +0 -82
  187. trunk/app/helper/RTMediaLicense.php +0 -33
  188. trunk/app/helper/RTMediaModel.php +0 -399
  189. trunk/app/helper/RTMediaSettings.php +0 -396
  190. trunk/app/helper/RTMediaSupport.php +0 -649
  191. trunk/app/helper/RTMediaThemes.php +0 -263
  192. trunk/app/helper/RTMediaUploadException.php +0 -66
  193. trunk/app/helper/db/RTDBModel.php +0 -230
  194. trunk/app/helper/db/RTDBUpdate.php +0 -204
  195. trunk/app/helper/db/rt_plugin_info.php +0 -87
  196. trunk/app/helper/rtDimensions.php +0 -166
  197. trunk/app/helper/rtForm.php +0 -1051
  198. trunk/app/helper/rtFormInvalidArgumentsException.php +0 -26
  199. trunk/app/helper/rtPluginInfo.php +0 -122
  200. trunk/app/helper/rtPluginUpdate.php +0 -128
  201. trunk/app/helper/rtPluginUpdateChecker.php +0 -9
  202. trunk/app/helper/rtProgress.php +0 -63
  203. trunk/app/importers/BPMediaAlbumimporter.php +0 -428
  204. trunk/app/importers/BPMediaBPActivityPlusImporter.php +0 -23
  205. trunk/app/importers/BPMediaImporter.php +0 -157
  206. trunk/app/importers/RTMediaActivityUpgrade.php +0 -263
  207. trunk/app/importers/RTMediaMediaSizeImporter.php +0 -271
  208. trunk/app/importers/RTMediaMigration.php +0 -1077
  209. trunk/app/main/RTMedia.php +0 -1157
  210. trunk/app/main/contexts/RTMediaContext.php +0 -120
  211. trunk/app/main/controllers/activity/RTMediaActivity.php +0 -148
  212. trunk/app/main/controllers/activity/RTMediaBuddyPressActivity.php +0 -334
  213. trunk/app/main/controllers/api/RTMediaApiLogin.php +0 -14
  214. trunk/app/main/controllers/api/RTMediaJsonApi.php +0 -1202
  215. trunk/app/main/controllers/api/RTMediaJsonApiFunctions.php +0 -271
  216. trunk/app/main/controllers/group/RTMediaGroup.php +0 -33
  217. trunk/app/main/controllers/group/RTMediaGroupExtension.php +0 -173
  218. trunk/app/main/controllers/media/RTMediaAlbum.php +0 -529
  219. trunk/app/main/controllers/media/RTMediaComment.php +0 -104
  220. trunk/app/main/controllers/media/RTMediaCoverArt.php +0 -73
  221. trunk/app/main/controllers/media/RTMediaFeatured.php +0 -214
  222. trunk/app/main/controllers/media/RTMediaGroupFeatured.php +0 -213
  223. trunk/app/main/controllers/media/RTMediaLike.php +0 -220
  224. trunk/app/main/controllers/media/RTMediaMedia.php +0 -623
  225. trunk/app/main/controllers/media/RTMediaMeta.php +0 -100
  226. trunk/app/main/controllers/media/RTMediaTags.php +0 -191
  227. trunk/app/main/controllers/media/RTMediaUserInteraction.php +0 -281
  228. trunk/app/main/controllers/media/RTMediaViewCount.php +0 -88
  229. trunk/app/main/controllers/privacy/RTMediaFriends.php +0 -47
  230. trunk/app/main/controllers/privacy/RTMediaPrivacy.php +0 -374
  231. trunk/app/main/controllers/shortcodes/RTMediaGalleryShortcode.php +0 -195
  232. trunk/app/main/controllers/shortcodes/RTMediaUploadShortcode.php +0 -107
  233. trunk/app/main/controllers/template/RTMediaAJAX.php +0 -70
  234. trunk/app/main/controllers/template/RTMediaNav.php +0 -366
  235. trunk/app/main/controllers/template/RTMediaTemplate.php +0 -731
  236. trunk/app/main/controllers/template/RTMediaUploadTemplate.php +0 -64
  237. trunk/app/main/controllers/template/rt-template-functions.php +0 -2913
  238. trunk/app/main/controllers/template/template.php +0 -165
  239. trunk/app/main/controllers/upload/RTMediaUpload.php +0 -81
  240. trunk/app/main/controllers/upload/RTMediaUploadEndpoint.php +0 -180
  241. trunk/app/main/controllers/upload/RTMediaUploadHelper.php +0 -27
  242. trunk/app/main/controllers/upload/RTMediaUploadModel.php +0 -179
  243. trunk/app/main/controllers/upload/RTMediaUploadView.php +0 -173
  244. trunk/app/main/controllers/upload/processors/RTMediaUploadFile.php +0 -347
  245. trunk/app/main/controllers/upload/processors/RTMediaUploadUrl.php +0 -15
  246. trunk/app/main/deprecated/RTMediaDeprecated.php +0 -29
  247. trunk/app/main/interactions/RTMediaInteraction.php +0 -288
  248. trunk/app/main/routers/RTMediaRouter.php +0 -368
  249. trunk/app/main/routers/query/RTMediaQuery.php +0 -952
  250. trunk/app/schema/rtm_activity.schema +0 -10
  251. trunk/app/schema/rtm_api.schema +0 -11
  252. trunk/app/schema/rtm_media.schema +0 -33
  253. trunk/app/schema/rtm_media_interaction.schema +0 -9
  254. trunk/app/schema/rtm_media_meta.schema +0 -7
  255. trunk/app/services/RTMediaEncoding.php +0 -718
  256. trunk/assets/banner-772x250.jpg +0 -0
  257. trunk/assets/icon-256x256.png +0 -0
  258. trunk/bootstrap_tests.php +0 -28
  259. trunk/config/index.php +0 -6
  260. trunk/index.php +0 -130
  261. trunk/languages/rtmedia-ar_AR.mo +0 -0
  262. trunk/languages/rtmedia-bg_BG.mo +0 -0
  263. trunk/languages/rtmedia-da_DA.mo +0 -0
  264. trunk/languages/rtmedia-de_DE.mo +0 -0
  265. trunk/languages/rtmedia-es_ES.mo +0 -0
  266. trunk/languages/rtmedia-fa_FA.mo +0 -0
  267. trunk/languages/rtmedia-fa_IR.mo +0 -0
  268. trunk/languages/rtmedia-fr_FR.mo +0 -0
  269. trunk/languages/rtmedia-hu_HU.mo +0 -0
  270. trunk/languages/rtmedia-it_IT.mo +0 -0
  271. trunk/languages/rtmedia-ja_JA.mo +0 -0
  272. trunk/languages/rtmedia-nb_NO.mo +0 -0
  273. trunk/languages/rtmedia-nl_NL.mo +0 -0
  274. trunk/languages/rtmedia-pl_PL.mo +0 -0
  275. trunk/languages/rtmedia-pt_BR.mo +0 -0
  276. trunk/languages/rtmedia-ro_RO.mo +0 -0
  277. trunk/languages/rtmedia-ru_RU.mo +0 -0
  278. trunk/languages/rtmedia-sk_SK.mo +0 -0
  279. trunk/languages/rtmedia-sr_SR.mo +0 -0
  280. trunk/languages/rtmedia-sv_SE.mo +0 -0
  281. trunk/languages/rtmedia-sv_SV.mo +0 -0
  282. trunk/languages/rtmedia-ta_TA.mo +0 -0
  283. trunk/languages/rtmedia-zh_CN.mo +0 -0
  284. trunk/languages/rtmedia.mo +0 -0
  285. trunk/languages/rtmedia.po +0 -2828
  286. trunk/lib/foundation/custom.modernizr.js +0 -4
  287. trunk/lib/foundation/foundation.css +0 -4271
  288. trunk/lib/foundation/foundation.js +0 -447
  289. trunk/lib/foundation/foundation.min.js +0 -15
  290. trunk/lib/foundation/foundation.reveal.js +0 -330
  291. trunk/lib/foundation/foundation.section.js +0 -422
  292. trunk/lib/foundation/normalize.css +0 -402
  293. trunk/lib/getid3/extension.cache.dbm.php +0 -211
  294. trunk/lib/getid3/extension.cache.mysql.php +0 -173
  295. trunk/lib/getid3/getid3.lib.php +0 -1317
  296. trunk/lib/getid3/getid3.php +0 -1638
  297. trunk/lib/getid3/module.archive.gzip.php +0 -280
  298. trunk/lib/getid3/module.archive.rar.php +0 -53
  299. trunk/lib/getid3/module.archive.szip.php +0 -96
  300. trunk/lib/getid3/module.archive.tar.php +0 -178
  301. trunk/lib/getid3/module.archive.zip.php +0 -424
  302. trunk/lib/getid3/module.audio-video.asf.php +0 -2021
  303. trunk/lib/getid3/module.audio-video.bink.php +0 -73
  304. trunk/lib/getid3/module.audio-video.flv.php +0 -731
  305. trunk/lib/getid3/module.audio-video.matroska.php +0 -1706
  306. trunk/lib/getid3/module.audio-video.mpeg.php +0 -299
  307. trunk/lib/getid3/module.audio-video.nsv.php +0 -226
  308. trunk/lib/getid3/module.audio-video.quicktime.php +0 -2134
  309. trunk/lib/getid3/module.audio-video.real.php +0 -530
  310. trunk/lib/getid3/module.audio-video.riff.php +0 -2409
  311. trunk/lib/getid3/module.audio-video.swf.php +0 -142
  312. trunk/lib/getid3/module.audio.aa.php +0 -59
  313. trunk/lib/getid3/module.audio.aac.php +0 -515
  314. trunk/lib/getid3/module.audio.ac3.php +0 -473
  315. trunk/lib/getid3/module.audio.au.php +0 -165
  316. trunk/lib/getid3/module.audio.avr.php +0 -127
  317. trunk/lib/getid3/module.audio.bonk.php +0 -230
  318. trunk/lib/getid3/module.audio.dss.php +0 -75
  319. trunk/lib/getid3/module.audio.dts.php +0 -246
  320. trunk/lib/getid3/module.audio.flac.php +0 -480
  321. trunk/lib/getid3/module.audio.la.php +0 -229
  322. trunk/lib/getid3/module.audio.lpac.php +0 -130
  323. trunk/lib/getid3/module.audio.midi.php +0 -526
  324. trunk/lib/getid3/module.audio.mod.php +0 -101
  325. trunk/lib/getid3/module.audio.monkey.php +0 -205
  326. trunk/lib/getid3/module.audio.mp3.php +0 -2011
  327. trunk/lib/getid3/module.audio.mpc.php +0 -509
  328. trunk/lib/getid3/module.audio.ogg.php +0 -705
  329. trunk/lib/getid3/module.audio.optimfrog.php +0 -429
  330. trunk/lib/getid3/module.audio.rkau.php +0 -94
  331. trunk/lib/getid3/module.audio.shorten.php +0 -183
  332. trunk/lib/getid3/module.audio.tta.php +0 -109
  333. trunk/lib/getid3/module.audio.voc.php +0 -207
  334. trunk/lib/getid3/module.audio.vqf.php +0 -162
  335. trunk/lib/getid3/module.audio.wavpack.php +0 -400
  336. trunk/lib/getid3/module.graphic.bmp.php +0 -690
  337. trunk/lib/getid3/module.graphic.efax.php +0 -53
  338. trunk/lib/getid3/module.graphic.gif.php +0 -184
  339. trunk/lib/getid3/module.graphic.jpg.php +0 -338
  340. trunk/lib/getid3/module.graphic.pcd.php +0 -134
  341. trunk/lib/getid3/module.graphic.png.php +0 -520
  342. trunk/lib/getid3/module.graphic.svg.php +0 -104
  343. trunk/lib/getid3/module.graphic.tiff.php +0 -227
  344. trunk/lib/getid3/module.misc.cue.php +0 -312
  345. trunk/lib/getid3/module.misc.exe.php +0 -61
  346. trunk/lib/getid3/module.misc.iso.php +0 -389
  347. trunk/lib/getid3/module.misc.msoffice.php +0 -40
  348. trunk/lib/getid3/module.misc.par2.php +0 -33
  349. trunk/lib/getid3/module.misc.pdf.php +0 -33
  350. trunk/lib/getid3/module.tag.apetag.php +0 -372
  351. trunk/lib/getid3/module.tag.id3v1.php +0 -362
  352. trunk/lib/getid3/module.tag.id3v2.php +0 -3327
  353. trunk/lib/getid3/module.tag.lyrics3.php +0 -297
  354. trunk/lib/getid3/module.tag.xmp.php +0 -766
  355. trunk/lib/getid3/write.apetag.php +0 -225
  356. trunk/lib/getid3/write.id3v1.php +0 -138
  357. trunk/lib/getid3/write.id3v2.php +0 -2050
  358. trunk/lib/getid3/write.lyrics3.php +0 -73
  359. trunk/lib/getid3/write.metaflac.php +0 -163
  360. trunk/lib/getid3/write.php +0 -615
  361. trunk/lib/getid3/write.real.php +0 -275
  362. trunk/lib/getid3/write.vorbiscomment.php +0 -121
  363. trunk/lib/index.php +0 -8
  364. trunk/lib/magnific/magnific.css +0 -363
  365. trunk/lib/magnific/magnific.js +0 -2042
  366. trunk/lib/media-element/background.png +0 -0
  367. trunk/lib/media-element/bigplay.png +0 -0
  368. trunk/lib/media-element/bigplay.svg +0 -1
  369. trunk/lib/media-element/controls-ted.png +0 -0
  370. trunk/lib/media-element/controls-wmp-bg.png +0 -0
  371. trunk/lib/media-element/controls-wmp.png +0 -0
  372. trunk/lib/media-element/controls.png +0 -0
  373. trunk/lib/media-element/controls.svg +0 -1
  374. trunk/lib/media-element/flashmediaelement.swf +0 -0
  375. trunk/lib/media-element/jquery.js +0 -9300
  376. trunk/lib/media-element/loading.gif +0 -0
  377. trunk/lib/media-element/mediaelement-and-player.js +0 -4379
  378. trunk/lib/media-element/mediaelement-and-player.min.js +0 -174
  379. trunk/lib/media-element/mediaelement.js +0 -1573
  380. trunk/lib/media-element/mediaelement.min.js +0 -61
  381. trunk/lib/media-element/mediaelementplayer.css +0 -802
  382. trunk/lib/media-element/mediaelementplayer.js +0 -2804
  383. trunk/lib/media-element/mediaelementplayer.min.css +0 -1
  384. trunk/lib/media-element/mediaelementplayer.min.js +0 -90
  385. trunk/lib/media-element/mejs-skins.css +0 -283
  386. trunk/lib/media-element/silverlightmediaelement.xap +0 -0
  387. trunk/lib/media-element/wp-mediaelement.css +0 -15
  388. trunk/lib/media-element/wp-mediaelement.js +0 -15
  389. trunk/lib/simple-html-dom/simple_html_dom.php +0 -1742
  390. trunk/lib/touchswipe/jquery.touchSwipe.min.js +0 -1
  391. trunk/log/index.php +0 -9
  392. trunk/phpunit.xml +0 -14
  393. trunk/phpunit.xml.dist +0 -8
  394. trunk/readme.txt +0 -973
  395. trunk/templates/main.php +0 -150
  396. trunk/templates/media/album-gallery-item.php +0 -32
  397. trunk/templates/media/album-gallery.php +0 -86
  398. trunk/templates/media/album-single-edit.php +0 -114
  399. trunk/templates/media/media-gallery-item.php +0 -33
  400. trunk/templates/media/media-gallery.php +0 -86
  401. trunk/templates/media/media-single-edit.php +0 -70
  402. trunk/templates/media/media-single.php +0 -145
  403. trunk/templates/upload/uploader.php +0 -99
  404. trunk/tests/MyPluginTest.php +0 -16
  405. trunk/tests/bootstrap.php +0 -20
  406. trunk/tests/rt-wp-test-case.php +0 -17
  407. trunk/tests/test_wordpress_plugin_tests.php +0 -52
app/admin/RTMediaAdmin.php CHANGED
@@ -598,7 +598,7 @@ if ( ! class_exists( 'RTMediaAdmin' ) ){
598
*/
599
public function bulk_action_handler(){
600
if ( 'bulk_video_regenerate_thumbnails' == $_REQUEST['action'] && '' != $_REQUEST['media'] ){
601
- wp_safe_redirect( add_query_arg( array( 'media_ids' => urlencode( implode( ',', $_REQUEST['media'] ) ) ), admin_url( 'admin.php?page=rtmedia-regenerate' ) ) );
602
exit;
603
}
604
}
@@ -750,8 +750,8 @@ if ( ! class_exists( 'RTMediaAdmin' ) ){
750
);
751
752
wp_localize_script( 'rtmedia-admin', 'rtmedia_admin_strings', $rtmedia_admin_strings );
753
- wp_localize_script( 'rtmedia-admin', 'settings_url', add_query_arg( array( 'page' => 'rtmedia-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) . '#privacy_enabled' );
754
- wp_localize_script( 'rtmedia-admin', 'settings_rt_album_import_url', add_query_arg( array( 'page' => 'rtmedia-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) );
755
wp_enqueue_style( 'font-awesome', RTMEDIA_URL . 'app/assets/css/font-awesome.min.css', '', RTMEDIA_VERSION );
756
wp_enqueue_style( 'bootstrap-switch', RTMEDIA_URL . 'app/assets/css/vendor/bootstrap-switch.css', '', RTMEDIA_VERSION );
757
wp_enqueue_style( 'slider-tabs', RTMEDIA_URL . 'app/assets/css/vendor/jquery.sliderTabs.min.css', '', RTMEDIA_VERSION );
@@ -1284,7 +1284,7 @@ if ( ! class_exists( 'RTMediaAdmin' ) ){
1284
$tab = $this->get_current_tab();
1285
/* rtMedia */
1286
$tabs[] = array(
1287
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ),
1288
'title' => __( 'rtMedia', 'rtmedia' ),
1289
'name' => __( 'rtMedia', 'rtmedia' ),
1290
'class' => ( $tab == 'rtmedia-settings' || $tab == 'rtmedia-addons' || $tab == 'rtmedia-support' || $tab == 'rtmedia-importer' ) ? $active_class : $idle_class,
@@ -1314,27 +1314,27 @@ if ( ! class_exists( 'RTMediaAdmin' ) ){
1314
// Setup core admin tabs
1315
$tabs = array(
1316
array(
1317
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ),
1318
'name' => __( 'Settings', 'rtmedia' ),
1319
'slug' => 'rtmedia-settings',
1320
), array(
1321
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-addons' ), 'admin.php' ) ),
1322
'name' => __( 'Addons', 'rtmedia' ),
1323
'slug' => 'rtmedia-addons',
1324
), array(
1325
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-themes' ), 'admin.php' ) ),
1326
'name' => __( 'Themes', 'rtmedia' ),
1327
'slug' => 'rtmedia-themes',
1328
), array(
1329
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-hire-us' ), 'admin.php' ) ),
1330
'name' => __( 'Hire Us', 'rtmedia' ),
1331
'slug' => 'rtmedia-hire-us',
1332
), array(
1333
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-support' ), 'admin.php' ) ),
1334
'name' => __( 'Support', 'rtmedia' ),
1335
'slug' => 'rtmedia-support',
1336
), array(
1337
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-license' ), 'admin.php' ) ),
1338
'name' => __( 'Licenses', 'rtmedia' ),
1339
'slug' => 'rtmedia-license',
1340
),
@@ -1546,7 +1546,7 @@ if ( ! class_exists( 'RTMediaAdmin' ) ){
1546
rtmedia_update_site_option( 'rtmedia_options', $_POST['rtmedia_options'] );
1547
//
1548
// redirect to settings page in network
1549
- wp_redirect( add_query_arg( array( 'page' => 'rtmedia-settings', 'updated' => 'true' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) );
1550
exit;
1551
}
1552
}
@@ -1635,7 +1635,7 @@ if ( ! class_exists( 'RTMediaAdmin' ) ){
1635
1636
public function convert_videos_mailchimp_send(){
1637
if ( 'Yes' == $_POST['interested'] && ! empty( $_POST['choice'] ) ){
1638
- wp_remote_get( add_query_arg( array( 'rtmedia-convert-videos-form' => 1, 'choice' => $_POST['choice'], 'url' => urlencode( $_POST['url'] ), 'email' => $_POST['email'] ), 'http://rtcamp.com/' ) );
1639
} else {
1640
rtmedia_update_site_option( 'rtmedia-survey', 0 );
1641
}
598
*/
599
public function bulk_action_handler(){
600
if ( 'bulk_video_regenerate_thumbnails' == $_REQUEST['action'] && '' != $_REQUEST['media'] ){
601
+ wp_safe_redirect( esc_url_raw( add_query_arg( array( 'media_ids' => urlencode( implode( ',', $_REQUEST['media'] ) ) ), admin_url( 'admin.php?page=rtmedia-regenerate' ) ) ) );
602
exit;
603
}
604
}
750
);
751
752
wp_localize_script( 'rtmedia-admin', 'rtmedia_admin_strings', $rtmedia_admin_strings );
753
+ wp_localize_script( 'rtmedia-admin', 'settings_url', esc_url( add_query_arg( array( 'page' => 'rtmedia-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) ) . '#privacy_enabled' );
754
+ wp_localize_script( 'rtmedia-admin', 'settings_rt_album_import_url', esc_url( add_query_arg( array( 'page' => 'rtmedia-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) ) );
755
wp_enqueue_style( 'font-awesome', RTMEDIA_URL . 'app/assets/css/font-awesome.min.css', '', RTMEDIA_VERSION );
756
wp_enqueue_style( 'bootstrap-switch', RTMEDIA_URL . 'app/assets/css/vendor/bootstrap-switch.css', '', RTMEDIA_VERSION );
757
wp_enqueue_style( 'slider-tabs', RTMEDIA_URL . 'app/assets/css/vendor/jquery.sliderTabs.min.css', '', RTMEDIA_VERSION );
1284
$tab = $this->get_current_tab();
1285
/* rtMedia */
1286
$tabs[] = array(
1287
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ) ),
1288
'title' => __( 'rtMedia', 'rtmedia' ),
1289
'name' => __( 'rtMedia', 'rtmedia' ),
1290
'class' => ( $tab == 'rtmedia-settings' || $tab == 'rtmedia-addons' || $tab == 'rtmedia-support' || $tab == 'rtmedia-importer' ) ? $active_class : $idle_class,
1314
// Setup core admin tabs
1315
$tabs = array(
1316
array(
1317
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ) ),
1318
'name' => __( 'Settings', 'rtmedia' ),
1319
'slug' => 'rtmedia-settings',
1320
), array(
1321
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-addons' ), 'admin.php' ) ) ),
1322
'name' => __( 'Addons', 'rtmedia' ),
1323
'slug' => 'rtmedia-addons',
1324
), array(
1325
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-themes' ), 'admin.php' ) ) ),
1326
'name' => __( 'Themes', 'rtmedia' ),
1327
'slug' => 'rtmedia-themes',
1328
), array(
1329
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-hire-us' ), 'admin.php' ) ) ),
1330
'name' => __( 'Hire Us', 'rtmedia' ),
1331
'slug' => 'rtmedia-hire-us',
1332
), array(
1333
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-support' ), 'admin.php' ) ) ),
1334
'name' => __( 'Support', 'rtmedia' ),
1335
'slug' => 'rtmedia-support',
1336
), array(
1337
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-license' ), 'admin.php' ) ) ),
1338
'name' => __( 'Licenses', 'rtmedia' ),
1339
'slug' => 'rtmedia-license',
1340
),
1546
rtmedia_update_site_option( 'rtmedia_options', $_POST['rtmedia_options'] );
1547
//
1548
// redirect to settings page in network
1549
+ wp_redirect( esc_url_raw( add_query_arg( array( 'page' => 'rtmedia-settings', 'updated' => 'true' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) ) );
1550
exit;
1551
}
1552
}
1635
1636
public function convert_videos_mailchimp_send(){
1637
if ( 'Yes' == $_POST['interested'] && ! empty( $_POST['choice'] ) ){
1638
+ wp_remote_get( esc_url_raw( add_query_arg( array( 'rtmedia-convert-videos-form' => 1, 'choice' => $_POST['choice'], 'url' => urlencode( $_POST['url'] ), 'email' => $_POST['email'] ), 'http://rtcamp.com/' ) ) );
1639
} else {
1640
rtmedia_update_site_option( 'rtmedia-survey', 0 );
1641
}
app/helper/RTMediaSettings.php CHANGED
@@ -366,7 +366,7 @@ if ( ! class_exists( 'RTMediaSettings' ) ){
366
if ( current_user_can( 'create_users' ) ){
367
// if (BPMediaPrivacy::is_installed())
368
// return;
369
- $url = add_query_arg( array( 'page' => 'rtmedia-privacy' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) );
370
371
$notice = '
372
<div class="error">
366
if ( current_user_can( 'create_users' ) ){
367
// if (BPMediaPrivacy::is_installed())
368
// return;
369
+ $url = esc_url( add_query_arg( array( 'page' => 'rtmedia-privacy' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) );
370
371
$notice = '
372
<div class="error">
app/importers/BPMediaAlbumimporter.php CHANGED
@@ -157,7 +157,7 @@ class BPMediaAlbumimporter extends BPMediaImporter {
157
echo '<button id="bpmedia-bpalbumimport-cleanup" class="button btn-warning">';
158
_e( 'Clean up Now', 'rtmedia' );
159
echo '</button>';
160
- echo ' <a href="' . add_query_arg( array( 'page' => 'bp-media-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) . '" id="bpmedia-bpalbumimport-cleanup-later" class="button">';
161
_e( 'Clean up Later', 'rtmedia' );
162
echo '</a>';
163
echo '<br />';
157
echo '<button id="bpmedia-bpalbumimport-cleanup" class="button btn-warning">';
158
_e( 'Clean up Now', 'rtmedia' );
159
echo '</button>';
160
+ echo ' <a href="' . esc_url( add_query_arg( array( 'page' => 'bp-media-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) ) . '" id="bpmedia-bpalbumimport-cleanup-later" class="button">';
161
_e( 'Clean up Later', 'rtmedia' );
162
echo '</a>';
163
echo '<br />';
app/importers/RTMediaMigration.php CHANGED
@@ -18,7 +18,7 @@ class RTMediaMigration {
18
19
if ( isset( $_REQUEST['page'] ) && 'rtmedia-migration' == $_REQUEST['page'] && isset( $_REQUEST['hide'] ) && 'true' == $_REQUEST['hide'] ){
20
$this->hide_migration_notice();
21
- wp_safe_redirect( $_SERVER['HTTP_REFERER'] );
22
}
23
if ( false !== rtmedia_get_site_option( 'rt_migration_hide_notice' ) ){
24
return true;
18
19
if ( isset( $_REQUEST['page'] ) && 'rtmedia-migration' == $_REQUEST['page'] && isset( $_REQUEST['hide'] ) && 'true' == $_REQUEST['hide'] ){
20
$this->hide_migration_notice();
21
+ wp_safe_redirect( esc_url_raw( $_SERVER['HTTP_REFERER'] ) );
22
}
23
if ( false !== rtmedia_get_site_option( 'rt_migration_hide_notice' ) ){
24
return true;
app/main/controllers/media/RTMediaFeatured.php CHANGED
@@ -185,7 +185,7 @@ class RTMediaFeatured extends RTMediaUserInteraction {
185
echo json_encode( $return );
186
die();
187
} else {
188
- wp_safe_redirect( $_SERVER['HTTP_REFERER'] );
189
}
190
}
191
185
echo json_encode( $return );
186
die();
187
} else {
188
+ wp_safe_redirect( esc_url_raw( $_SERVER['HTTP_REFERER'] ) );
189
}
190
}
191
app/main/controllers/media/RTMediaGroupFeatured.php CHANGED
@@ -197,7 +197,7 @@ class RTMediaGroupFeatured extends RTMediaUserInteraction {
197
echo json_encode( $return );
198
die();
199
} else {
200
- wp_safe_redirect( $_SERVER['HTTP_REFERER'] );
201
}
202
}
203
197
echo json_encode( $return );
198
die();
199
} else {
200
+ wp_safe_redirect( esc_url_raw( $_SERVER['HTTP_REFERER'] ) );
201
}
202
}
203
app/main/controllers/media/RTMediaLike.php CHANGED
@@ -104,7 +104,7 @@ class RTMediaLike extends RTMediaUserInteraction {
104
echo json_encode( $return );
105
die();
106
} else {
107
- wp_safe_redirect( $_SERVER[ "HTTP_REFERER" ] );
108
die();
109
}
110
104
echo json_encode( $return );
105
die();
106
} else {
107
+ wp_safe_redirect( esc_url_raw( $_SERVER[ "HTTP_REFERER" ] ) );
108
die();
109
}
110
app/main/controllers/shortcodes/RTMediaGalleryShortcode.php CHANGED
@@ -42,9 +42,9 @@ class RTMediaGalleryShortcode {
42
wp_enqueue_script ( 'rtmedia-backbone', RTMEDIA_URL . 'app/assets/js/rtMedia.backbone.js', array( 'plupload-all', 'backbone' ), false, true );
43
44
if(is_rtmedia_album_gallery()) {
45
- $template_url = add_query_arg(array("action" => 'rtmedia_get_template', "template" => "album-gallery-item"),admin_url("admin-ajax.php"));
46
}else{
47
- $template_url = add_query_arg(array("action" => 'rtmedia_get_template', "template" => apply_filters('rtmedia_backbone_template_filter',"media-gallery-item")),admin_url("admin-ajax.php"));
48
}
49
wp_localize_script ( 'rtmedia-backbone', 'template_url', $template_url );
50
$url = trailingslashit ( $_SERVER[ "REQUEST_URI" ] );
42
wp_enqueue_script ( 'rtmedia-backbone', RTMEDIA_URL . 'app/assets/js/rtMedia.backbone.js', array( 'plupload-all', 'backbone' ), false, true );
43
44
if(is_rtmedia_album_gallery()) {
45
+ $template_url = esc_url( add_query_arg( array( "action" => 'rtmedia_get_template', "template" => "album-gallery-item" ),admin_url("admin-ajax.php") ), null, '' );
46
}else{
47
+ $template_url = esc_url( add_query_arg( array( "action" => 'rtmedia_get_template', "template" => apply_filters('rtmedia_backbone_template_filter',"media-gallery-item") ),admin_url("admin-ajax.php") ), null, '' );
48
}
49
wp_localize_script ( 'rtmedia-backbone', 'template_url', $template_url );
50
$url = trailingslashit ( $_SERVER[ "REQUEST_URI" ] );
app/main/controllers/template/RTMediaTemplate.php CHANGED
@@ -330,7 +330,7 @@ class RTMediaTemplate {
330
} else {
331
$rtMediaNav->refresh_counts( $rtmedia_query->media_query['media_author'], array( "context" => "profile", 'media_author' => $rtmedia_query->media_query['media_author'] ) );
332
}
333
- wp_safe_redirect( get_rtmedia_permalink( $rtmedia_query->media_query[ 'album_id' ] ) . 'edit/' );
334
die();
335
} else {
336
_e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
@@ -369,7 +369,7 @@ class RTMediaTemplate {
369
$media->delete( $id );
370
}
371
}
372
- wp_safe_redirect( $_POST[ '_wp_http_referer' ] );
373
die();
374
}
375
@@ -415,7 +415,7 @@ class RTMediaTemplate {
415
}
416
}
417
$redirect_url = apply_filters( 'rtmedia_before_delete_media_redirect', $redirect_url );
418
- wp_safe_redirect( $redirect_url );
419
die();
420
} else {
421
_e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
@@ -437,9 +437,9 @@ class RTMediaTemplate {
437
if ( isset( $rtmedia_query->media_query[ 'context' ] ) && $rtmedia_query->media_query[ 'context' ] == "group" ){
438
global $bp;
439
$group_link = bp_get_group_permalink( $bp->groups->current_group );
440
- wp_safe_redirect( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' );
441
} else {
442
- wp_safe_redirect( trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . RTMEDIA_MEDIA_SLUG . '/album/' );
443
}
444
exit;
445
}
@@ -468,9 +468,9 @@ class RTMediaTemplate {
468
if ( isset( $rtmedia_query->media_query[ 'context' ] ) && $rtmedia_query->media_query[ 'context' ] == "group" ){
469
global $bp;
470
$group_link = bp_get_group_permalink( $bp->groups->current_group );
471
- wp_safe_redirect( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' );
472
} else {
473
- wp_safe_redirect( trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . RTMEDIA_MEDIA_SLUG . '/album/' );
474
}
475
exit;
476
}
330
} else {
331
$rtMediaNav->refresh_counts( $rtmedia_query->media_query['media_author'], array( "context" => "profile", 'media_author' => $rtmedia_query->media_query['media_author'] ) );
332
}
333
+ wp_safe_redirect( esc_url_raw( get_rtmedia_permalink( $rtmedia_query->media_query[ 'album_id' ] ) . 'edit/' ) );
334
die();
335
} else {
336
_e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
369
$media->delete( $id );
370
}
371
}
372
+ wp_safe_redirect( esc_url_raw( $_POST[ '_wp_http_referer' ] ) );
373
die();
374
}
375
415
}
416
}
417
$redirect_url = apply_filters( 'rtmedia_before_delete_media_redirect', $redirect_url );
418
+ wp_safe_redirect( esc_url_raw( $redirect_url ) );
419
die();
420
} else {
421
_e( 'Ooops !!! Invalid access. No nonce was found !!', 'rtmedia' );
437
if ( isset( $rtmedia_query->media_query[ 'context' ] ) && $rtmedia_query->media_query[ 'context' ] == "group" ){
438
global $bp;
439
$group_link = bp_get_group_permalink( $bp->groups->current_group );
440
+ wp_safe_redirect( esc_url_raw( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' ) );
441
} else {
442
+ wp_safe_redirect( esc_url_raw( trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . RTMEDIA_MEDIA_SLUG . '/album/' ) );
443
}
444
exit;
445
}
468
if ( isset( $rtmedia_query->media_query[ 'context' ] ) && $rtmedia_query->media_query[ 'context' ] == "group" ){
469
global $bp;
470
$group_link = bp_get_group_permalink( $bp->groups->current_group );
471
+ wp_safe_redirect( esc_url_raw( trailingslashit( $group_link ) . RTMEDIA_MEDIA_SLUG . '/album/' ) );
472
} else {
473
+ wp_safe_redirect( esc_url_raw( trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . RTMEDIA_MEDIA_SLUG . '/album/' ) );
474
}
475
exit;
476
}
app/main/controllers/template/rt-template-functions.php CHANGED
@@ -79,7 +79,7 @@ function get_rtmedia_gallery_title() {
79
$title = get_rtmedia_title( $id );
80
} elseif( isset( $rtmedia_query->media_query[ 'media_type' ] ) && ! is_array( $rtmedia_query->media_query[ 'media_type' ] ) && $rtmedia_query->media_query[ 'media_type' ] != "" ){
81
$current_media_type = $rtmedia_query->media_query[ 'media_type' ];
82
- if( $current_media_type != "" && is_array( $rtmedia->allowed_types ) && is_array( $rtmedia->allowed_types[ $current_media_type ] ) && isset( $rtmedia->allowed_types[ $current_media_type ][ 'plural_label' ] ) ) {
83
$title = sprintf( '%s %s', __( 'All', 'rtmedia' ), $rtmedia->allowed_types[ $current_media_type ][ 'plural_label' ] );
84
}
85
}
@@ -1756,7 +1756,7 @@ function rtmedia_create_album( $options ) {
1756
if ( $display === true ){
1757
1758
add_action( 'rtmedia_before_media_gallery', 'rtmedia_create_album_modal' );
1759
- $options[ ] = "<a href='#rtmedia-create-album-modal' class='rtmedia-reveal-modal rtmedia-modal-link' title='" . __( 'Create New Album', 'rtmedia' ) . "'><i class='rtmicon-plus-circle rtmicon-fw'></i>" . __( 'Add Album', 'rtmedia' ) . "</a>";
1760
1761
return $options;
1762
@@ -1772,7 +1772,7 @@ function rtmedia_create_album_modal() {
1772
<div class="mfp-hide rtmedia-popup" id="rtmedia-create-album-modal">
1773
<div id="rtm-modal-container">
1774
<?php do_action( "rtmedia_before_create_album_modal" ); ?>
1775
- <h2 class="rtm-modal-title"><?php _e( 'Create New Album', 'rtmedia' ); ?></h2>
1776
<p>
1777
<label class="rtm-modal-grid-title-column" for="rtmedia_album_name"><?php _e( 'Album Title : ', 'rtmedia' ); ?></label>
1778
<input type="text" id="rtmedia_album_name" value="" class="rtm-input-medium"/>
@@ -2205,7 +2205,7 @@ function rtmedia_admin_premium_tab( $tabs ) {
2205
$tabs = array();
2206
}
2207
$tabs[ ] = array(
2208
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-premium' ), 'admin.php' ) ), 'name' => __( 'Go PRO!', 'rtmedia' ), 'slug' => 'rtmedia-premium', 'class' => array( 'rtm-premium' )
2209
);
2210
2211
return $tabs;
79
$title = get_rtmedia_title( $id );
80
} elseif( isset( $rtmedia_query->media_query[ 'media_type' ] ) && ! is_array( $rtmedia_query->media_query[ 'media_type' ] ) && $rtmedia_query->media_query[ 'media_type' ] != "" ){
81
$current_media_type = $rtmedia_query->media_query[ 'media_type' ];
82
+ if( $current_media_type != "" && is_array( $rtmedia->allowed_types ) && isset( $rtmedia->allowed_types[ $current_media_type ] ) && is_array( $rtmedia->allowed_types[ $current_media_type ] ) && isset( $rtmedia->allowed_types[ $current_media_type ][ 'plural_label' ] ) ) {
83
$title = sprintf( '%s %s', __( 'All', 'rtmedia' ), $rtmedia->allowed_types[ $current_media_type ][ 'plural_label' ] );
84
}
85
}
1756
if ( $display === true ){
1757
1758
add_action( 'rtmedia_before_media_gallery', 'rtmedia_create_album_modal' );
1759
+ $options[ ] = "<a href='#rtmedia-create-album-modal' class='rtmedia-reveal-modal rtmedia-modal-link' title='" . __( 'Create an Album', 'rtmedia' ) . "'><i class='rtmicon-plus-circle rtmicon-fw'></i>" . __( 'Add Album', 'rtmedia' ) . "</a>";
1760
1761
return $options;
1762
1772
<div class="mfp-hide rtmedia-popup" id="rtmedia-create-album-modal">
1773
<div id="rtm-modal-container">
1774
<?php do_action( "rtmedia_before_create_album_modal" ); ?>
1775
+ <h2 class="rtm-modal-title"><?php _e( 'Create an Album', 'rtmedia' ); ?></h2>
1776
<p>
1777
<label class="rtm-modal-grid-title-column" for="rtmedia_album_name"><?php _e( 'Album Title : ', 'rtmedia' ); ?></label>
1778
<input type="text" id="rtmedia_album_name" value="" class="rtm-input-medium"/>
2205
$tabs = array();
2206
}
2207
$tabs[ ] = array(
2208
+ 'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-premium' ), 'admin.php' ) ) ), 'name' => __( 'Go PRO!', 'rtmedia' ), 'slug' => 'rtmedia-premium', 'class' => array( 'rtm-premium' )
2209
);
2210
2211
return $tabs;
app/main/controllers/upload/RTMediaUploadEndpoint.php CHANGED
@@ -117,7 +117,7 @@ class RTMediaUploadEndpoint {
117
$redirect_url = get_rtmedia_permalink( $media[ 0 ]->id );
118
}
119
$redirect_url = apply_filters( "rtmedia_simple_file_upload_redirect_url_filter", $redirect_url );
120
- wp_safe_redirect( $redirect_url );
121
die();
122
}
123
117
$redirect_url = get_rtmedia_permalink( $media[ 0 ]->id );
118
}
119
$redirect_url = apply_filters( "rtmedia_simple_file_upload_redirect_url_filter", $redirect_url );
120
+ wp_safe_redirect( esc_url_raw( $redirect_url ) );
121
die();
122
}
123
app/services/RTMediaEncoding.php CHANGED
@@ -90,7 +90,7 @@ class RTMediaEncoding {
90
91
$query_args = array( 'url' => urlencode( $single[ 'url' ] ), 'callbackurl' => urlencode( trailingslashit( home_url() ) . "index.php" ), 'force' => 0, 'size' => filesize( $single[ 'file' ] ), 'formats' => ( $autoformat === true ) ? ( ( $type_array[ 0 ] == 'video' ) ? 'mp4' : 'mp3' ) : $autoformat, 'thumbs' => $options_vedio_thumb, 'rt_id' => $media_ids[ $key ] );
92
$encoding_url = $this->api_url . 'job/new/';
93
- $upload_url = add_query_arg( $query_args, $encoding_url . $this->api_key );
94
//error_log(var_export($upload_url, true));
95
//var_dump($upload_url);
96
$upload_page = wp_remote_get( $upload_url, array( 'timeout' => 200 ) );
@@ -191,9 +191,9 @@ class RTMediaEncoding {
191
update_site_option( 'rtmedia-encoding-api-key', $_GET[ 'apikey' ] );
192
193
$usage_info = $this->update_usage( $_GET[ 'apikey' ] );
194
- $return_page = add_query_arg( array( 'page' => 'rtmedia-addons', 'api_key_updated' => $usage_info->plan->name ), admin_url( 'admin.php' ) );
195
196
- wp_safe_redirect( $return_page );
197
198
die();
199
}
@@ -230,7 +230,7 @@ class RTMediaEncoding {
230
if ( $this->api_key )
231
$this->update_usage( $this->api_key );
232
$action = $this->sandbox_testing ? 'https://sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
233
- $return_page = add_query_arg( array( 'page' => 'rtmedia-addons' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) );
234
235
$usage_details = get_site_option( 'rtmedia-encoding-usage' );
236
if ( isset( $usage_details[ $this->api_key ]->plan->name ) && ( strtolower( $usage_details[ $this->api_key ]->plan->name ) == strtolower( $name ) ) && $usage_details[ $this->api_key ]->sub_status && ! $force ) {
@@ -559,7 +559,7 @@ class RTMediaEncoding {
559
}
560
561
if ( $flag && $mail ) {
562
- $download_link = add_query_arg( array( 'job_id' => $_GET[ 'job_id' ], 'download_url' => $_GET[ 'download_url' ] ), home_url() );
563
$subject = __( 'rtMedia Encoding: Download Failed', 'rtmedia' );
564
$message = sprintf( __( '<p><a href="%s">Media</a> was successfully encoded but there was an error while downloading:</p>
565
<p><code>%s</code></p>
@@ -587,9 +587,9 @@ class RTMediaEncoding {
587
if ( isset( $usage_details[ $this->api_key ]->plan->name ) && ( strtolower( $usage_details[ $this->api_key ]->plan->name ) == 'free' ) ) {
588
echo json_encode( array( 'error' => 'Your free subscription is already activated.' ) );
589
} else {
590
- $free_subscription_url = add_query_arg( array( 'email' => urlencode( $email ) ), trailingslashit( $this->api_url ) . 'api/free/' );
591
if ( $this->api_key ) {
592
- $free_subscription_url = add_query_arg( array( 'email' => urlencode( $email ), 'apikey' => $this->api_key ), $free_subscription_url );
593
}
594
$free_subscribe_page = wp_remote_get( $free_subscription_url, array( 'timeout' => 120 ) );
595
if ( ! is_wp_error( $free_subscribe_page ) && ( ! isset( $free_subscribe_page[ 'headers' ][ 'status' ] ) || ( isset( $free_subscribe_page[ 'headers' ][ 'status' ] ) && ( $free_subscribe_page[ 'headers' ][ 'status' ] == 200 ) ) ) ) {
90
91
$query_args = array( 'url' => urlencode( $single[ 'url' ] ), 'callbackurl' => urlencode( trailingslashit( home_url() ) . "index.php" ), 'force' => 0, 'size' => filesize( $single[ 'file' ] ), 'formats' => ( $autoformat === true ) ? ( ( $type_array[ 0 ] == 'video' ) ? 'mp4' : 'mp3' ) : $autoformat, 'thumbs' => $options_vedio_thumb, 'rt_id' => $media_ids[ $key ] );
92
$encoding_url = $this->api_url . 'job/new/';
93
+ $upload_url = esc_url( add_query_arg( $query_args, $encoding_url . $this->api_key ) );
94
//error_log(var_export($upload_url, true));
95
//var_dump($upload_url);
96
$upload_page = wp_remote_get( $upload_url, array( 'timeout' => 200 ) );
191
update_site_option( 'rtmedia-encoding-api-key', $_GET[ 'apikey' ] );
192
193
$usage_info = $this->update_usage( $_GET[ 'apikey' ] );
194
+ $return_page = esc_url( add_query_arg( array( 'page' => 'rtmedia-addons', 'api_key_updated' => $usage_info->plan->name ), admin_url( 'admin.php' ) ) );
195
196
+ wp_safe_redirect( esc_url_raw( $return_page ) );
197
198
die();
199
}
230
if ( $this->api_key )
231
$this->update_usage( $this->api_key );
232
$action = $this->sandbox_testing ? 'https://sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
233
+ $return_page = esc_url( add_query_arg( array( 'page' => 'rtmedia-addons' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) );
234
235
$usage_details = get_site_option( 'rtmedia-encoding-usage' );
236
if ( isset( $usage_details[ $this->api_key ]->plan->name ) && ( strtolower( $usage_details[ $this->api_key ]->plan->name ) == strtolower( $name ) ) && $usage_details[ $this->api_key ]->sub_status && ! $force ) {
559
}
560
561
if ( $flag && $mail ) {
562
+ $download_link = esc_url( add_query_arg( array( 'job_id' => $_GET[ 'job_id' ], 'download_url' => $_GET[ 'download_url' ] ), home_url() ) );
563
$subject = __( 'rtMedia Encoding: Download Failed', 'rtmedia' );
564
$message = sprintf( __( '<p><a href="%s">Media</a> was successfully encoded but there was an error while downloading:</p>
565
<p><code>%s</code></p>
587
if ( isset( $usage_details[ $this->api_key ]->plan->name ) && ( strtolower( $usage_details[ $this->api_key ]->plan->name ) == 'free' ) ) {
588
echo json_encode( array( 'error' => 'Your free subscription is already activated.' ) );
589
} else {
590
+ $free_subscription_url = esc_url_raw( add_query_arg( array( 'email' => urlencode( $email ) ), trailingslashit( $this->api_url ) . 'api/free/' ) );
591
if ( $this->api_key ) {
592
+ $free_subscription_url = esc_url_raw( add_query_arg( array( 'email' => urlencode( $email ), 'apikey' => $this->api_key ), $free_subscription_url ) );
593
}
594
$free_subscribe_page = wp_remote_get( $free_subscription_url, array( 'timeout' => 120 ) );
595
if ( ! is_wp_error( $free_subscribe_page ) && ( ! isset( $free_subscribe_page[ 'headers' ][ 'status' ] ) || ( isset( $free_subscribe_page[ 'headers' ][ 'status' ] ) && ( $free_subscribe_page[ 'headers' ][ 'status' ] == 200 ) ) ) ) {
index.php CHANGED
@@ -4,7 +4,7 @@
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: http://rtcamp.com/rtmedia/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
- Version: 3.7.38
8
Author: rtCamp
9
Text Domain: rtmedia
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: http://rtcamp.com/rtmedia/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
+ Version: 3.7.39
8
Author: rtCamp
9
Text Domain: rtmedia
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
languages/rtmedia.mo CHANGED
Binary file
languages/rtmedia.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
msgstr ""
3
"Project-Id-Version: BuddyPress Media\n"
4
"Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-04-16 17:03+0530\n"
6
"PO-Revision-Date: \n"
7
"Last-Translator: \n"
8
"Language-Team: rtMedia <info@rtcamp.com>\n"
@@ -343,7 +343,7 @@ msgstr ""
343
344
#: ../app/main/controllers/template/rt-template-functions.php:1759
345
#: ../app/main/controllers/template/rt-template-functions.php:1775
346
- msgid "Create New Album"
347
msgstr ""
348
349
#: ../app/main/controllers/template/rt-template-functions.php:1759
2
msgstr ""
3
"Project-Id-Version: BuddyPress Media\n"
4
"Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-04-17 12:10+0530\n"
6
"PO-Revision-Date: \n"
7
"Last-Translator: \n"
8
"Language-Team: rtMedia <info@rtcamp.com>\n"
343
344
#: ../app/main/controllers/template/rt-template-functions.php:1759
345
#: ../app/main/controllers/template/rt-template-functions.php:1775
346
+ msgid "Create an Album"
347
msgstr ""
348
349
#: ../app/main/controllers/template/rt-template-functions.php:1759
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
Requires at least: WordPress 3.6
8
Tested up to: WordPress 4.1 + BuddyPress 2.2.0
9
- Stable tag: 3.7.38
10
11
Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works on mobile/tablets devices.
12
@@ -128,6 +128,10 @@ http://www.youtube.com/watch?v=dJrykKQGDcs
128
129
Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
130
131
= 3.7.38 =
132
* Update Danish translations and add Bulgarian translations
133
* Enable/disable encoding service
@@ -936,8 +940,8 @@ Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_sou
936
937
== Upgrade Notice ==
938
939
- = 3.7.38 =
940
- Requires BuddyPress 1.7 or higher, if using BuddyPress. Update translations, enable/disable encoding service and template update.
941
942
== Sponsors ==
943
6
License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
Requires at least: WordPress 3.6
8
Tested up to: WordPress 4.1 + BuddyPress 2.2.0
9
+ Stable tag: 3.7.39
10
11
Add albums, photo, audio/video encoding, privacy, sharing, front-end uploads & more. All this works on mobile/tablets devices.
12
128
129
Please visit [rtMedia's Roadmap page](http://rtcamp.com/rtmedia/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit rtMedia's Features page") to get some details about future releases.
130
131
+ = 3.7.39 =
132
+ * Fix possible XSS vulnerability
133
+ * Update label for create album
134
+
135
= 3.7.38 =
136
* Update Danish translations and add Bulgarian translations
137
* Enable/disable encoding service
940
941
== Upgrade Notice ==
942
943
+ = 3.7.39 =
944
+ Requires BuddyPress 1.7 or higher, if using BuddyPress. Fix possible XSS vulnerability, update label for create album.
945
946
== Sponsors ==
947
templates/upload/uploader.php CHANGED
@@ -49,12 +49,6 @@
49
<?php do_action ( 'rtmedia_before_uploader' ); ?>
50
51
<?php
52
- // $tab_html = '<ul>';
53
- // foreach ( $tabs as $key => $tab ) {
54
- // $tab_html .= '<li class="'.$key.'"><a href="'.add_query_arg(array('mode' => $key)).'" title="'.esc_attr($tab['title']).'">'.$tab['title'].'</a></li>';
55
- // }
56
- // $tab_html .= '</ul>';
57
- // echo $tab_html;
58
echo '<div class="rtm-tab-content-wrapper">';
59
echo '<div id="rtm-' . $mode . '-ui" class="rtm-tab-content">';
60
do_action ( 'rtmedia_before_' . $mode . '_ui' );
49
<?php do_action ( 'rtmedia_before_uploader' ); ?>
50
51
<?php
52
echo '<div class="rtm-tab-content-wrapper">';
53
echo '<div id="rtm-' . $mode . '-ui" class="rtm-tab-content">';
54
do_action ( 'rtmedia_before_' . $mode . '_ui' );
trunk/CONTRIBUTING.md DELETED
@@ -1,19 +0,0 @@
1
- # Contribute to rtMedia
2
-
3
- This guide details how to use issues and pull requests to improve rtMedia.
4
-
5
- ## Closing policy for issues
6
-
7
- Github issue-tracker is used **only** for developer & contributor discussion.
8
-
9
- For support-request/feature-request, please use - http://community.rtcamp.com/c/rtmedia
10
-
11
- ## Translation
12
-
13
- Please do NOT send pull-request for translations.
14
-
15
- You can contribute translations using web-interface here - http://rtcamp.com/translate/projects/rtmedia
16
-
17
- ## Pull Requests
18
-
19
- Please include your wordpress.org username while sending pull-request so that we can add you to contributors list.
trunk/app/admin/RTMediaAdmin.php DELETED
@@ -1,1920 +0,0 @@
1
- <?php
2
- /**
3
- * Description of RTMediaAdmin
4
- *
5
- * @package RTMedia
6
- * @subpackage Admin
7
- *
8
- */
9
- if ( ! class_exists( 'RTMediaAdmin' ) ){
10
-
11
- /**
12
- * RTMediaAdmin class.
13
- */
14
- class RTMediaAdmin {
15
-
16
- public $rtmedia_upgrade;
17
- public $rtmedia_settings;
18
- public $rtmedia_encoding;
19
- public $rtmedia_support;
20
- public $rtmedia_feed;
21
-
22
- /**
23
- * Constructor - get the plugin hooked in and ready
24
- *
25
- * @access public
26
- * @return void
27
- */
28
- public function __construct(){
29
- global $rtmedia;
30
-
31
- // Actions and filters
32
- add_action( 'init', array( $this, 'video_transcoding_survey_response' ) );
33
- // add_action( 'admin_init', array( $this, 'presstrends_plugin' ) );
34
-
35
- //$rtmedia_feed = new RTMediaFeed();
36
- add_filter( 'plugin_action_links_' . RTMEDIA_BASE_NAME, array( &$this, 'plugin_add_settings_link' ) );
37
- //add_action ( 'wp_ajax_rtmedia_fetch_feed', array( $rtmedia_feed, 'fetch_feed' ), 1 );
38
- $this->rtmedia_support = new RTMediaSupport();
39
- add_action( 'wp_ajax_rtmedia_select_request', array( $this->rtmedia_support, 'get_form' ), 1 );
40
- add_action( 'wp_ajax_rtmedia_cancel_request', create_function( '', 'do_settings_sections("rtmedia-support"); die();' ), 1 );
41
- add_action( 'wp_ajax_rtmedia_submit_request', array( $this->rtmedia_support, 'submit_request' ), 1 );
42
- //add_action ( 'wp_ajax_rtmedia_fetch_feed', array( $rtmedia_feed, 'fetch_feed' ), 1 );
43
- add_action( 'wp_ajax_rtmedia_linkback', array( $this, 'linkback' ), 1 );
44
- add_action( 'wp_ajax_rtmedia_rt_album_deactivate', 'BPMediaAlbumimporter::bp_album_deactivate', 1 );
45
- add_action( 'wp_ajax_rtmedia_rt_album_import', 'BPMediaAlbumimporter::bpmedia_ajax_import_callback', 1 );
46
- add_action( 'wp_ajax_rtmedia_rt_album_import_favorites', 'BPMediaAlbumimporter::bpmedia_ajax_import_favorites', 1 );
47
- add_action( 'wp_ajax_rtmedia_rt_album_import_step_favorites', 'BPMediaAlbumimporter::bpmedia_ajax_import_step_favorites', 1 );
48
- add_action( 'wp_ajax_rtmedia_rt_album_cleanup', 'BPMediaAlbumimporter::cleanup_after_install' );
49
- add_action( 'wp_ajax_rtmedia_convert_videos_form', array( $this, 'convert_videos_mailchimp_send' ), 1 );
50
- add_action( 'wp_ajax_rtmedia_correct_upload_filetypes', array( $this, 'correct_upload_filetypes' ), 1 );
51
- add_filter( 'plugin_row_meta', array( $this, 'plugin_meta_premium_addon_link' ), 1, 4 );
52
- add_action( 'wp_dashboard_setup', array( &$this, 'add_dashboard_widgets' ), 0 );
53
- add_filter( 'attachment_fields_to_edit', array( $this, 'edit_video_thumbnail' ), null, 2 );
54
- add_filter( 'attachment_fields_to_save', array( $this, 'save_video_thumbnail' ), null, 2 );
55
- add_action( 'wp_ajax_rtmedia_hide_video_thumb_admin_notice', array( $this, 'rtmedia_hide_video_thumb_admin_notice' ), 1 );
56
- add_action( 'wp_ajax_rtmedia_hide_addon_update_notice', array( $this, 'rtmedia_hide_addon_update_notice' ), 1 );
57
-
58
- $obj_encoding = new RTMediaEncoding( true );
59
-
60
- if ( $obj_encoding->api_key ){
61
- add_filter( 'media_row_actions', array( $this, 'add_reencode_link' ), null, 2 );
62
- add_action( 'admin_head-upload.php', array( $this, 'add_bulk_actions_regenerate' ) );
63
- add_action( 'admin_footer', array( $this, 'rtmedia_regenerate_thumb_js' ) );
64
- add_action( 'admin_action_bulk_video_regenerate_thumbnails', array( $this, 'bulk_action_handler' ) );
65
- add_action( 'admin_action_-1', array( $this, 'bulk_action_handler' ) );
66
- }
67
-
68
- add_action( 'wp_ajax_rt_media_regeneration', array( $this, 'rt_media_regeneration' ), 1 );
69
-
70
- if ( ! isset( $rtmedia->options ) ){
71
- $rtmedia->options = rtmedia_get_site_option( 'rtmedia-options' );
72
- }
73
-
74
- if ( isset( $_POST['rtmedia-options'] ) ){
75
- if ( isset( $_POST['rtmedia-options']['general_showAdminMenu'] ) && '1' == $_POST['rtmedia-options']['general_showAdminMenu'] ){
76
- add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100, 1 );
77
- }
78
- } else {
79
- if ( 1 == intval( $rtmedia->options['general_showAdminMenu'] ) ){
80
- add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100, 1 );
81
- }
82
- }
83
-
84
- if ( is_admin() ){
85
- add_action( 'admin_enqueue_scripts', array( $this, 'ui' ) );
86
- //bp_core_admin_hook();
87
- add_action( 'admin_menu', array( $this, 'menu' ), 1 );
88
- add_action( 'init', array( $this, 'bp_admin_tabs' ) );
89
-
90
- if ( is_multisite() ){
91
- add_action( 'network_admin_edit_rtmedia', array( $this, 'save_multisite_options' ) );
92
- }
93
- }
94
-
95
- $this->rtmedia_settings = new RTMediaSettings();
96
- $this->rtmedia_encoding = new RTMediaEncoding();
97
- // show rtmedia advertisement
98
- // if(! defined("RTMEDIA_PRO_VERSION") )
99
- // add_action ( 'rtmedia_before_default_admin_widgets', array( $this, 'rtmedia_advertisement' ),1);
100
- if ( ! class_exists( 'BuddyPress' ) ){
101
- add_action( 'admin_init', array( $this, 'check_permalink_admin_notice' ) );
102
- }
103
-
104
- add_action( 'wp_ajax_rtmedia_hide_template_override_notice', array( $this, 'rtmedia_hide_template_override_notice' ), 1 );
105
- add_action( 'admin_init', array( $this, 'rtmedia_bp_add_update_type' ) );
106
- add_action( 'wp_ajax_rtmedia_hide_inspirebook_release_notice', array( $this, 'rtmedia_hide_inspirebook_release_notice' ), 1 );
107
- add_action( 'wp_ajax_rtmedia_hide_social_sync_notice', array( $this, 'rtmedia_hide_social_sync_notice' ), 1 );
108
- $rtmedia_media_import = new RTMediaMediaSizeImporter(); // do not delete this line. We only need to create object of this class if we are in admin section
109
- if ( class_exists( 'BuddyPress' ) ){
110
- $rtmedia_activity_upgrade = new RTMediaActivityUpgrade();
111
- }
112
- add_action( 'admin_notices', array( $this, 'rtmedia_admin_notices' ) );
113
- add_action( 'network_admin_notices', array( $this, 'rtmedia_network_admin_notices' ) );
114
- add_action( 'admin_init', array( $this, 'rtmedia_addon_license_save_hook' ) );
115
- add_action( 'admin_init', array( $this, 'rtmedia_migration' ) );
116
- }
117
-
118
- function rtmedia_migration(){
119
- $rtMigration = new RTMediaMigration();
120
- }
121
-
122
- function rtmedia_addon_license_save_hook(){
123
- do_action( 'rtmedia_addon_license_save_hook' );
124
- }
125
-
126
- /**
127
- * Show rtmedia network admin notices.
128
- *
129
- * @access public
130
- *
131
- * @param void
132
- *
133
- * @return void
134
- */
135
- public function rtmedia_network_admin_notices(){
136
- if ( is_multisite() ){
137
- $this->upload_filetypes_error();
138
- }
139
- }
140
-
141
- /**
142
- * Show rtmedia admin notices.
143
- *
144
- * @access public
145
- *
146
- * @param void
147
- *
148
- * @return void
149
- */
150
- public function rtmedia_admin_notices(){
151
- if ( current_user_can( 'list_users' ) ){
152
- $this->upload_filetypes_error();
153
- $this->rtmedia_regenerate_thumbnail_notice();
154
- $this->rtmedia_addon_update_notice();
155
- $this->rtmedia_update_template_notice();
156
- $this->rtmedia_inspirebook_release_notice();
157
- $this->rtmedia_social_sync_release_notice();
158
- }
159
- }
160
-
161
- /*
162
- * Show social sync release notice admin notice.
163
- */
164
- function rtmedia_social_sync_release_notice(){
165
- $site_option = rtmedia_get_site_option( 'rtmedia_social_sync_release_notice' );
166
- $check_rtmedia_social_sync_installed = file_exists( trailingslashit( WP_PLUGIN_DIR ) . 'rtmedia-social-sync/index.php' );
167
-
168
- if ( ( ! $site_option || 'hide' != $site_option ) && !$check_rtmedia_social_sync_installed ){
169
- rtmedia_update_site_option( 'rtmedia_social_sync_release_notice', 'show' );
170
- ?>
171
- <div class="updated rtmedia-social-sync-notice">
172
- <p>
173
- <span>
174
- <b>rtMedia: </b> Meet
175
- <a href="https://rtcamp.com/products/rtmedia-social-sync/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" target="_blank">
176
- <b>rtMedia Social Sync</b>
177
- </a> which allows you to import media from your Facebook account.
178
- </span>
179
- <a href="#" onclick="rtmedia_hide_social_sync_notice()" style="float:right">Dismiss</a>
180
- </p>
181
- </div>
182
- <script type="text/javascript">
183
- function rtmedia_hide_social_sync_notice() {
184
- var data = {action: 'rtmedia_hide_social_sync_notice'};
185
- jQuery.post( ajaxurl, data, function ( response ) {
186
- response = response.trim();
187
- if ( response === "1" )
188
- jQuery( '.rtmedia-social-sync-notice' ).remove();
189
- } );
190
- }
191
- </script>
192
- <?php
193
- }
194
- }
195
-
196
- /*
197
- * Hide social sync release notice
198
- */
199
- function rtmedia_hide_social_sync_notice(){
200
- if ( rtmedia_update_site_option( 'rtmedia_social_sync_release_notice', 'hide' ) ){
201
- echo '1';
202
- } else {
203
- echo '0';
204
- }
205
- die();
206
- }
207
-
208
- /**
209
- * Show rtmedia inspirebook release notice.
210
- *
211
- * @access public
212
- *
213
- * @param void
214
- *
215
- * @return void
216
- */
217
- public function rtmedia_inspirebook_release_notice(){
218
- $site_option = rtmedia_get_site_option( 'rtmedia_inspirebook_release_notice' );
219
- if ( ( ! $site_option || 'hide' != $site_option ) && ( 'inspirebook' != get_stylesheet() ) ){
220
- rtmedia_update_site_option( 'rtmedia_inspirebook_release_notice', 'show' );
221
- ?>
222
- <div class="updated rtmedia-inspire-book-notice">
223
- <p>
224
- <span><a href="https://rtcamp.com/store/inspirebook/" target="_blank"><b>Meet
225
- InspireBook</b></a> - First official rtMedia premium theme.</span>
226
- <a href="#" onclick="rtmedia_hide_inspirebook_notice()" style="float:right">Dismiss</a>
227
- </p>
228
- </div>
229
- <script type="text/javascript">
230
- function rtmedia_hide_inspirebook_notice() {
231
- var data = {action: 'rtmedia_hide_inspirebook_release_notice'};
232
- jQuery.post( ajaxurl, data, function ( response ) {
233
- response = response.trim();
234
- if ( response === "1" )
235
- jQuery( '.rtmedia-inspire-book-notice' ).remove();
236
- } );
237
- }
238
- </script>
239
- <?php
240
- }
241
- }
242
-
243
- /**
244
- * Hide rtmedia inspirebook release notice.
245
- *
246
- * @access public
247
- *
248
- * @param void
249
- *
250
- * @return void
251
- */
252
- public function rtmedia_hide_inspirebook_release_notice(){
253
- if ( rtmedia_update_site_option( 'rtmedia_inspirebook_release_notice', 'hide' ) ){
254
- echo '1';
255
- } else {
256
- echo '0';
257
- }
258
- die();
259
- }
260
-
261
- /**
262
- * Set rtmedia buddypress update type.
263
- *
264
- * @access public
265
- *
266
- * @param void
267
- *
268
- * @return void
269
- */
270
- public function rtmedia_bp_add_update_type(){
271
- if ( class_exists( 'BuddyPress' ) && function_exists( 'bp_activity_set_action' ) ){
272
- bp_activity_set_action( 'rtmedia_update', 'rtmedia_update', 'rtMedia Update' );
273
- }
274
- }
275
-
276
- /**
277
- * Show rtmedia check permalink admin notice.
278
- *
279
- * @access public
280
- *
281
- * @param void
282
- *
283
- * @return void
284
- */
285
- public function check_permalink_admin_notice(){
286
- global $wp_rewrite;
287
- if ( empty( $wp_rewrite->permalink_structure ) ){
288
- add_action( 'admin_notices', array( $this, 'rtmedia_permalink_notice' ) );
289
- }
290
- }
291
-
292
- /**
293
- * Define rtmedia permalink notice.
294
- *
295
- * @access public
296
- *
297
- * @param void
298
- *
299
- * @return void
300
- */
301
- public function rtmedia_permalink_notice(){
302
- echo '<div class="error rtmedia-permalink-change-notice">
303
- <p> <b>' . __( 'rtMedia:' ) . '</b> ' . __( ' You must ' ) . '<a href="' . admin_url( 'options-permalink.php' ) . '">' . __( 'update permalink structure' ) . '</a>' . __( ' to something other than the default for it to work.', 'rtmedia' ) . ' </p>
304
- </div>';
305
- }
306
-
307
- /**
308
- * Define rtmedia addon update notice.
309
- *
310
- * @access public
311
- *
312
- * @param void
313
- *
314
- * @return void
315
- */
316
- public function rtmedia_addon_update_notice(){
317
- if ( ! $this->check_for_addon_update_notice() ){
318
- return;
319
- }
320
- if ( is_rt_admin() ){
321
- $site_option = rtmedia_get_site_option( 'rtmedia-addon-update-notice' );
322
- if ( ! $site_option || 'hide' != $site_option ){
323
- rtmedia_update_site_option( 'rtmedia-addon-update-notice', 'show' );
324
- echo '<div class="error rtmedia-addon-upate-notice">
325
- <p> <b>' . __( 'rtMedia:' ) . '</b> ' . __( 'Please update all premium add-ons that you have purchased from rtCamp from your ', 'rtmedia' ) . ' <a href="https://rtcamp.com/my-account/" target="_blank">' . __( 'account', 'rtmedia' ) . '</a>. <a href="#" onclick="rtmedia_hide_addon_update_notice()" style="float:right">Hide</a> </p>
326
- </div>';
327
- }
328
-
329
- ?>
330
- <script type="text/javascript">
331
- function rtmedia_hide_addon_update_notice() {
332
- var data = {
333
- action: 'rtmedia_hide_addon_update_notice'
334
- };
335
- jQuery.post( ajaxurl, data, function ( response ) {
336
- response = response.trim();
337
- if ( response === "1" )
338
- jQuery( '.rtmedia-addon-upate-notice' ).remove();
339
- } );
340
- }
341
- </script>
342
- <?php
343
- }
344
- }
345
-
346
- /**
347
- * Show rtmedia addon update notice.
348
- *
349
- * @access public
350
- *
351
- * @param void
352
- *
353
- * @return bool $return_falg
354
- */
355
- public function check_for_addon_update_notice(){
356
- $return_falg = false;
357
-
358
- if ( defined( 'RTMEDIA_INSTAGRAM_PATH' ) ){
359
- $plugin_info = get_plugin_data( RTMEDIA_INSTAGRAM_PATH . 'index.php' );
360
- if ( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < '2.1.2' ){
361
- $return_falg = true;
362
- }
363
- } else {
364
- if ( defined( 'RTMEDIA_PHOTO_TAGGING_PATH' ) ){
365
- $plugin_info = get_plugin_data( RTMEDIA_PHOTO_TAGGING_PATH . 'index.php' );
366
- if ( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < '2.2.1' ){
367
- $return_falg = true;
368
- }
369
- } else {
370
- if ( defined( 'RTMEDIA_PRO_PATH' ) ){
371
- $plugin_info = get_plugin_data( RTMEDIA_PRO_PATH . 'index.php' );
372
- if ( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < '1.8.1' ){
373
- $return_falg = true;
374
- }
375
- } else {
376
- if ( defined( 'RTMEDIA_FFMPEG_PATH' ) ){
377
- $plugin_info = get_plugin_data( RTMEDIA_FFMPEG_PATH . 'index.php' );
378
- if ( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < '2.1.1' ){
379
- $return_falg = true;
380
- }
381
- } else {
382
- if ( defined( 'RTMEDIA_KALTURA_PATH' ) ){
383
- $plugin_info = get_plugin_data( RTMEDIA_KALTURA_PATH . 'index.php' );
384
- if ( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < '3.0.3' ){
385
- $return_falg = true;
386
- }
387
- }
388
- }
389
- }
390
- }
391
- }
392
-
393
- return $return_falg;
394
- }
395
-
396
- /**
397
- * Show buddypress admin tabs.
398
- *
399
- * @access public
400
- *
401
- * @param void
402
- *
403
- * @return void
404
- */
405
- public function bp_admin_tabs(){
406
- if ( current_user_can( 'manage_options' ) ){
407
- add_action( 'bp_admin_tabs', array( $this, 'tab' ) );
408
- }
409
- }
410
-
411
- /**
412
- * Show rtmedia advertisement.
413
- *
414
- * @access public
415
- *
416
- * @param void
417
- *
418
- * @return void
419
- */
420
- public function rtmedia_advertisement(){
421
- $src = RTMEDIA_URL . 'app/assets/img/rtMedia-pro-ad.png'
422
- ?>
423
- <div class='rtmedia-admin-ad'>
424
- <a href='http://rtcamp.com/store/rtmedia-pro/' target='_blank' title='rtMedia Pro'>
425
- <img src='<?php echo $src; ?>' alt="<?php _e( 'rtMedia Pro is released', 'rtmedia' ); ?>"/>
426
- </a>
427
- </div>
428
- <?php
429
- }
430
-
431
- /**
432
- * Create the function to output the contents of our Dashboard Widget
433
- *
434
- * @access public
435
- *
436
- * @param void
437
- *
438
- * @return void
439
- */
440
- public function rtmedia_dashboard_widget_function(){
441
- ?>
442
-
443
- <div class="inside">
444
-
445
- <div class="table table_content">
446
- <p class="sub"><?php _e( 'Media Stats', 'rtmedia' ); ?></p>
447
- <table>
448
- <tbody>
449
- <?php
450
- $rtMedia_model = new RTMediaModel();
451
- $sql = "select media_type, count(id) as count from {$rtMedia_model->table_name} where blog_id='" . get_current_blog_id() . "' group by media_type";
452
- global $wpdb;
453
- $results = $wpdb->get_results( $sql );
454
- if ( $results ){
455
- foreach ( $results as $media ) {
456
- if ( defined( strtoupper( 'RTMEDIA_' . $media->media_type . '_PLURAL_LABEL' ) ) ){
457
- ?>
458
- <tr>
459
- <td class="b"> <?php echo $media->count; ?> </td>
460
- <td class="t"><?php echo constant( strtoupper( 'RTMEDIA_' . $media->media_type . '_PLURAL_LABEL' ) ); ?></td>
461
- </tr>
462
- <?php
463
- }
464
- }
465
- }
466
- ?>
467
- </tbody>
468
- </table>
469
- </div>
470
- <div class="table table_discussion">
471
- <p class="sub"><?php _e( 'Usage Stats', 'rtmedia' ); ?></p>
472
- <table>
473
- <tbody> <?php
474
- $sql = "select count(*) from {$wpdb->users}";
475
- $results = $wpdb->get_var( $sql );
476
- ?>
477
- <tr>
478
- <td class="b"> <?php echo $results; ?> </td>
479
- <td class="t"><?php _e( 'Total ', 'rtmedia' ) ?></td>
480
- </tr>
481
- <?php
482
- $sql = "select count(distinct media_author) from {$rtMedia_model->table_name}";
483
- $results = $wpdb->get_var( $sql );
484
- ?>
485
- <tr>
486
- <td class="b"> <?php echo $results; ?> </td>
487
- <td class="t"><?php _e( 'With Media', 'rtmedia' ) ?></td>
488
- </tr>
489
- <?php
490
- $sql = "select count(*) from $wpdb->comments where comment_post_ID in (select media_id from {$rtMedia_model->table_name})";
491
- $results = $wpdb->get_var( $sql );
492
- ?>
493
- <tr>
494
- <td class="b"> <?php echo $results; ?> </td>
495
- <td class="t"><?php _e( 'Comments ', 'rtmedia' ) ?></td>
496
- </tr>
497
- <?php
498
- $sql = "select sum(likes) from {$rtMedia_model->table_name}";
499
- $results = $wpdb->get_var( $sql );
500
- ?>
501
- <tr>
502
- <td class="b"> <?php echo $results; ?> </td>
503
- <td class="t"><?php _e( 'Likes', 'rtmedia' ) ?></td>
504
- </tr>
505
-
506
- </tbody>
507
- </table>
508
- </div>
509
- <div class="versions">
510
- <p>
511
- <b>rtMedia Links:</b> <a href="http://rtcamp.com"><?php _e( 'Homepage', 'rtmedia' ); ?></a> | <a
512
- href="admin.php?page=rtmedia-support#rtmedia-general"><?php _e( 'Free Support', 'rtmedia' ); ?></a>
513
- | <a href="http://rtcamp.com/rtmedia/addons/"><?php _e( 'Premium Addons', 'rtmedia' ); ?></a>
514
- </p>
515
- </div>
516
- </div>
517
- <?php
518
- }
519
-
520
- /**
521
- * Create the function use in the action hook
522
- *
523
- * @access public
524
- *
525
- * @param void
526
- *
527
- * @return void
528
- */
529
- public function add_dashboard_widgets(){
530
- wp_add_dashboard_widget( 'rtmedia_dashboard_widget', __( 'Right Now in rtMedia', 'rtmedia' ), array( &$this, 'rtmedia_dashboard_widget_function' ) );
531
- global $wp_meta_boxes;
532
-
533
- // Get the regular dashboard widgets array
534
- // (which has our new widget already but at the end)
535
-
536
- $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
537
-
538
- // Backup and delete our new dashboard widget from the end of the array
539
-
540
- $example_widget_backup = array( 'rtmedia_dashboard_widget' => $normal_dashboard['rtmedia_dashboard_widget'] );
541
- unset( $normal_dashboard['rtmedia_dashboard_widget'] );
542
-
543
- // Merge the two arrays together so our widget is at the beginning
544
-
545
- $sorted_dashboard = array_merge( $example_widget_backup, $normal_dashboard );
546
-
547
- // Save the sorted array back into the original metaboxes
548
-
549
- $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
550
- }
551
-
552
- /**
553
- * Add the plugin settings links
554
- *
555
- * @access public
556
- *
557
- * @param array $links
558
- *
559
- * @return array $links
560
- */
561
- public function plugin_add_settings_link( $links ){
562
- $settings_link = '<a href="' . admin_url( 'admin.php?page=rtmedia-settings' ) . '">Settings</a>';
563
- array_push( $links, $settings_link );
564
- $settings_link = '<a href="' . admin_url( 'admin.php?page=rtmedia-support' ) . '">Support</a>';
565
- array_push( $links, $settings_link );
566
-
567
- return $links;
568
- }
569
-
570
- /**
571
- * Add the reencode link
572
- *
573
- * @access public
574
- *
575
- * @param array $actions
576
- * @param object $post
577
- *
578
- * @return array $actions
579
- */
580
- public function add_reencode_link( $actions, $post ){
581
-
582
- $mime_type_array = explode( '/', $post->post_mime_type );
583
- if ( is_array( $mime_type_array ) && '' != $mime_type_array && 'video' == $mime_type_array[0] ){
584
- $actions['reencode'] = '<a class="submitdelete" onclick="return rtmedia_regenerate_thumbs(' . $post->ID . ')" href="#">' . __( 'Regenerate Thumbnail', 'rtmedia' ) . '</a>';
585
- }
586
-
587
- return $actions;
588
- }
589
-
590
- /**
591
- * Do the bulk video/media handler.
592
- *
593
- * @access public
594
- *
595
- * @param void
596
- *
597
- * @return void
598
- */
599
- public function bulk_action_handler(){
600
- if ( 'bulk_video_regenerate_thumbnails' == $_REQUEST['action'] && '' != $_REQUEST['media'] ){
601
- wp_safe_redirect( add_query_arg( array( 'media_ids' => urlencode( implode( ',', $_REQUEST['media'] ) ) ), admin_url( 'admin.php?page=rtmedia-regenerate' ) ) );
602
- exit;
603
- }
604
- }
605
-
606
- /**
607
- * Add admin bar menu
608
- *
609
- * @access public
610
- *
611
- * @param type $admin_bar
612
- *
613
- * @return void
614
- */
615
- public function admin_bar_menu( $admin_bar ){
616
- if ( ! current_user_can( 'manage_options' ) ){
617
- return;
618
- }
619
-
620
- $admin_bar->add_menu( array(
621
- 'id' => 'rtMedia',
622
- 'title' => 'rtMedia',
623
- 'href' => admin_url( 'admin.php?page=rtmedia-settings' ),
624
- 'meta' => array(
625
- 'title' => __( 'rtMedia', 'rtmedia' ),
626
- ),
627
- )
628
- );
629
- $admin_bar->add_menu( array(
630
- 'id' => 'rt-media-dashborad',
631
- 'parent' => 'rtMedia',
632
- 'title' => __( 'Settings', 'rtmedia' ),
633
- 'href' => admin_url( 'admin.php?page=rtmedia-settings' ),
634
- 'meta' => array(
635
- 'title' => __( 'Settings', 'rtmedia' ),
636
- 'target' => '_self',
637
- ),
638
- )
639
- );
640
- $admin_bar->add_menu( array(
641
- 'id' => 'rt-media-addons',
642
- 'parent' => 'rtMedia',
643
- 'title' => __( 'Addons', 'rtmedia' ),
644
- 'href' => admin_url( 'admin.php?page=rtmedia-addons' ),
645
- 'meta' => array(
646
- 'title' => __( 'Addons', 'rtmedia' ),
647
- 'target' => '_self',
648
- ),
649
- )
650
- );
651
- $admin_bar->add_menu( array(
652
- 'id' => 'rt-media-support',
653
- 'parent' => 'rtMedia',
654
- 'title' => __( 'Support', 'rtmedia' ),
655
- 'href' => admin_url( 'admin.php?page=rtmedia-support' ),
656
- 'meta' => array(
657
- 'title' => __( 'Support', 'rtmedia' ),
658
- 'target' => '_self',
659
- ),
660
- )
661
- );
662
- $admin_bar->add_menu( array(
663
- 'id' => 'rt-media-themes',
664
- 'parent' => 'rtMedia',
665
- 'title' => __( 'Themes', 'rtmedia' ),
666
- 'href' => admin_url( 'admin.php?page=rtmedia-themes' ),
667
- 'meta' => array(
668
- 'title' => __( 'Themes', 'rtmedia' ),
669
- 'target' => '_self',
670
- ),
671
- )
672
- );
673
- $admin_bar->add_menu( array(
674
- 'id' => 'rt-media-hire-us',
675
- 'parent' => 'rtMedia',
676
- 'title' => __( 'Hire Us', 'rtmedia' ),
677
- 'href' => admin_url( 'admin.php?page=rtmedia-hire-us' ),
678
- 'meta' => array(
679
- 'title' => __( 'Hire Us', 'rtmedia' ),
680
- 'target' => '_self',
681
- ),
682
- )
683
- );
684
- $admin_bar->add_menu( array(
685
- 'id' => 'rt-media-license',
686
- 'parent' => 'rtMedia',
687
- 'title' => __( 'Licenses', 'rtmedia' ),
688
- 'href' => admin_url( 'admin.php?page=rtmedia-license' ),
689
- 'meta' => array(
690
- 'title' => __( 'Licenses', 'rtmedia' ),
691
- 'target' => '_self',
692
- ),
693
- )
694
- );
695
- }
696
-
697
- /**
698
- * Generates the Admin UI.
699
- *
700
- * @access public
701
- *
702
- * @param string $hook
703
- *
704
- * @return void
705
- */
706
- public function ui( $hook ){
707
- $admin_pages = array(
708
- 'rtmedia_page_rtmedia-migration',
709
- 'rtmedia_page_rtmedia-kaltura-settings',
710
- 'rtmedia_page_rtmedia-ffmpeg-settings',
711
- 'toplevel_page_rtmedia-settings',
712
- 'rtmedia_page_rtmedia-addons',
713
- 'rtmedia_page_rtmedia-support',
714
- 'rtmedia_page_rtmedia-themes',
715
- 'rtmedia_page_rtmedia-hire-us',
716
- 'rtmedia_page_rtmedia-importer',
717
- 'rtmedia_page_rtmedia-regenerate',
718
- 'rtmedia_page_rtmedia-premium',
719
- 'rtmedia_page_rtmedia-license',
720
- );
721
-
722
- $admin_pages = apply_filters( 'rtmedia_filter_admin_pages_array', $admin_pages );
723
-
724
- if ( in_array( $hook, $admin_pages ) || strpos( $hook, 'rtmedia-migration' ) ){
725
-
726
- $admin_ajax = admin_url( 'admin-ajax.php' );
727
-
728
- wp_enqueue_script( 'bootstrap-switch', RTMEDIA_URL . 'app/assets/js/vendor/bootstrap-switch.js', array( 'jquery' ), RTMEDIA_VERSION );
729
- wp_enqueue_script( 'slider-tabs', RTMEDIA_URL . 'app/assets/js/vendor/jquery.sliderTabs.min.js', array( 'jquery', 'jquery-effects-core' ), RTMEDIA_VERSION );
730
- wp_enqueue_script( 'observe-hashchange', RTMEDIA_URL . 'app/assets/js/vendor/jquery.observehashchange.pack.js', array( 'jquery' ), RTMEDIA_VERSION );
731
- wp_enqueue_script( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/js/admin.js', array( 'jquery-ui-dialog' ), RTMEDIA_VERSION );
732
- wp_localize_script( 'rtmedia-admin', 'rtmedia_on_label', __( 'ON', 'rtmedia' ) );
733
- wp_localize_script( 'rtmedia-admin', 'rtmedia_off_label', __( 'OFF', 'rtmedia' ) );
734
- wp_localize_script( 'rtmedia-admin', 'rtmedia_admin_ajax', $admin_ajax );
735
- wp_localize_script( 'rtmedia-admin', 'rtmedia_admin_url', admin_url() );
736
- wp_localize_script( 'rtmedia-admin', 'rtmedia_admin_url', admin_url() );
737
-
738
- if ( isset( $_REQUEST['page'] ) && ( in_array( $_REQUEST['page'], array( 'rtmedia-settings', 'rtmedia-addons', 'rtmedia-themes', 'rtmedia-support', 'rtmedia-hire-us', 'rtmedia-license' ) ) ) ){
739
- wp_enqueue_script( 'rtmedia-foundation-modernizr', RTMEDIA_URL . 'lib/foundation/custom.modernizr.js', array( 'jquery' ), RTMEDIA_VERSION );
740
- wp_enqueue_script( 'rtmedia-foundation', RTMEDIA_BOWER_COMPONENTS_URL . 'js/foundation.js', array( 'jquery' ), RTMEDIA_VERSION );
741
- //wp_enqueue_script ( 'rtmedia-foundation-section', RTMEDIA_URL . 'lib/foundation/foundation.section.js', array('jquery'), RTMEDIA_VERSION );
742
- }
743
-
744
- $rtmedia_admin_strings = array(
745
- 'no_refresh' => __( 'Please do not refresh this page.', 'rtmedia' ),
746
- 'something_went_wrong' => __( 'Something went wrong. Please <a href onclick="location.reload();">refresh</a> page.', 'rtmedia' ),
747
- 'are_you_sure' => __( 'This will subscribe you to the free plan.', 'rtmedia' ),
748
- 'disable_encoding' => __( 'Are you sure you want to disable the encoding service?', 'rtmedia' ),
749
- 'enable_encoding' => __( 'Are you sure you want to enable the encoding service?', 'rtmedia' ),
750
- );
751
-
752
- wp_localize_script( 'rtmedia-admin', 'rtmedia_admin_strings', $rtmedia_admin_strings );
753
- wp_localize_script( 'rtmedia-admin', 'settings_url', add_query_arg( array( 'page' => 'rtmedia-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) . '#privacy_enabled' );
754
- wp_localize_script( 'rtmedia-admin', 'settings_rt_album_import_url', add_query_arg( array( 'page' => 'rtmedia-settings' ), ( is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ) );
755
- wp_enqueue_style( 'font-awesome', RTMEDIA_URL . 'app/assets/css/font-awesome.min.css', '', RTMEDIA_VERSION );
756
- wp_enqueue_style( 'bootstrap-switch', RTMEDIA_URL . 'app/assets/css/vendor/bootstrap-switch.css', '', RTMEDIA_VERSION );
757
- wp_enqueue_style( 'slider-tabs', RTMEDIA_URL . 'app/assets/css/vendor/jquery.sliderTabs.min.css', '', RTMEDIA_VERSION );
758
- wp_enqueue_style( 'grid-foundation', RTMEDIA_URL . 'app/assets/css/vendor/grid-foundation.css', '', RTMEDIA_VERSION );
759
- wp_enqueue_style( 'rtmedia-main', RTMEDIA_URL . 'app/assets/css/main.css', '', RTMEDIA_VERSION );
760
- wp_enqueue_style( 'rtmedia-admin', RTMEDIA_URL . 'app/assets/css/admin.css', '', RTMEDIA_VERSION );
761
-
762
- if ( isset( $_REQUEST['page'] ) && ( in_array( $_REQUEST['page'], array( 'rtmedia-settings', 'rtmedia-addons', 'rtmedia-themes', 'rtmedia-support', 'rtmedia-hire-us', 'rtmedia-license' ) ) ) ){
763
- wp_enqueue_style( 'foundation-admin-css', RTMEDIA_URL . 'app/assets/css/settings.css', '', RTMEDIA_VERSION );
764
- }
765
-
766
- wp_enqueue_style( 'wp-jquery-ui-dialog' );
767
-
768
- } else {
769
- wp_enqueue_style( 'rtmedia-widget', RTMEDIA_URL . 'app/assets/css/widget.css', '', RTMEDIA_VERSION );
770
- }
771
- }
772
-
773
- /**
774
- * Add Admin Menu.
775
- *
776
- * @access public
777
- * @global string 'rtmedia'
778
- *
779
- * @param void
780
- *
781
- * @return void
782
- */
783
- public function menu(){
784
- add_menu_page( 'rtMedia', 'rtMedia', 'manage_options', 'rtmedia-settings', array( $this, 'settings_page' ), RTMEDIA_URL . 'app/assets/img/rtmedia-logo.png', '40.1111' );
785
- add_submenu_page( 'rtmedia-settings', __( 'Settings', 'rtmedia' ), __( 'Settings', 'rtmedia' ), 'manage_options', 'rtmedia-settings', array( $this, 'settings_page' ) );
786
- add_submenu_page( 'rtmedia-settings', __( 'Addons', 'rtmedia' ), __( 'Addons', 'rtmedia' ), 'manage_options', 'rtmedia-addons', array( $this, 'addons_page' ) );
787
- add_submenu_page( 'rtmedia-settings', __( 'Support', 'rtmedia' ), __( 'Support', 'rtmedia' ), 'manage_options', 'rtmedia-support', array( $this, 'support_page' ) );
788
- add_submenu_page( 'rtmedia-settings', __( 'Themes', 'rtmedia' ), __( 'Themes', 'rtmedia' ), 'manage_options', 'rtmedia-themes', array( $this, 'theme_page' ) );
789
- add_submenu_page( 'rtmedia-settings', __( 'Hire Us', 'rtmedia' ), __( 'Hire Us', 'rtmedia' ), 'manage_options', 'rtmedia-hire-us', array( $this, 'hire_us_page' ) );
790
- add_submenu_page( 'rtmedia-settings', __( 'Licenses', 'rtmedia' ), __( 'Licenses', 'rtmedia' ), 'manage_options', 'rtmedia-license', array( $this, 'license_page' ) );
791
-
792
- if ( ! defined( 'RTMEDIA_PRO_VERSION' ) ){
793
- add_submenu_page( 'rtmedia-settings', __( 'Premium', 'rtmedia' ), __( 'Premium ', 'rtmedia' ), 'manage_options', 'rtmedia-premium', array( $this, 'premium_page' ) );
794
- }
795
-
796
- $obj_encoding = new RTMediaEncoding( true );
797
-
798
- if ( $obj_encoding->api_key ){
799
- add_submenu_page( 'rtmedia-settings', __( 'Regenerate Thumbnail', 'rtmedia' ), __( 'Regen. Thumbnail ', 'rtmedia' ), 'manage_options', 'rtmedia-regenerate', array( $this, 'rt_regenerate_thumbnail' ) );
800
- }
801
-
802
- // add_submenu_page('rtmedia-settings', __('Importer', 'rtmedia'), __('Importer', 'rtmedia'), 'manage_options', 'rtmedia-importer', array($this, 'rt_importer_page'));
803
- // if (!BPMediaPrivacy::is_installed()) {
804
- // add_submenu_page('rtmedia-settings', __('rtMedia Database Update', 'rtmedia'), __('Update Database', 'rtmedia'), 'manage_options', 'rtmedia-db-update', array($this, 'privacy_page'));
805
- // }
806
- }
807
-
808
- /**
809
- * Define regenerate thumbnail functionality.
810
- *
811
- * @access public
812
- *
813
- * @param void
814
- *
815
- * @return void
816
- */
817
- public function rt_regenerate_thumbnail(){
818
- $prog = new rtProgress();
819
- $done = 0;
820
- ?>
821
- <div class="wrap">
822
- <h2> rtMedia: <?php _e( 'Regenerate Video Thumbnails', 'rtmedia' ); ?> </h2>
823
- <?php
824
- if ( isset( $_REQUEST['media_ids'] ) && trim( $_REQUEST['media_ids'] ) != '' ){
825
- $requested = false;
826
- $media_ids = explode( ',', $_REQUEST['media_ids'] );
827
- $total = count( $media_ids );
828
- } else {
829
- $media_ids = $this->get_video_without_thumbs();
830
- $total = count( $media_ids );
831
- }
832
- ?>
833
- <script>
834
- var rt_thumb_all_media = <?php echo json_encode( $media_ids ); ?>;
835
- </script>
836
- <?php
837
- if ( ! isset( $requested ) ){
838
- ?>
839
- <br/>
840
- <p>You can see this page because you have <a href="<?php echo admin_url( 'admin.php?page=rtmedia-addons' ) ?>">subscribed</a> for <a href="https://rtcamp.com/rtmedia/docs/admin/addons/audio-video-encoding/" target="_blank">rtMedia audio/video encoding service</a>.</p> <p>You can regenerate thumbnails of a specific video by visiting <a href="<?php echo admin_url( 'upload.php?post_mime_type=video' ); ?>">media page</a> and clicking the <b>Regenerate Thumbnail</b> option for that particular video.</p> <p>Click <b>Regenerate Pending Thumbnails</b> to regenerate thumbnails of pending videos.</p> <p><input type="button" class="button button-primary" id="rt-start-media-regenerate" value="<?php echo __( 'Regenerate Pending Thumbnails', 'rtmedia' ) . ' (' . $total . ')'; ?>"/> </p>
841
- <?php
842
- }
843
- ?>
844
- <div id="rt-migration-progress">
845
- <br/> <br/>
846
- <?php
847
- $temp = $prog->progress( $done, $total );
848
- $prog->progress_ui( $temp, true );
849
- ?>
850
- <p> <?php _e( 'Total Videos', 'rtmedia' ) ?> : <span class='rt-total'><?php echo $total; ?></span>
851
- </p>
852
-
853
- <p> <?php _e( 'Sent of regenerate thumbails', 'rtmedia' ) ?> : <span class='rt-done'>0</span></p>
854
-
855
- <p> <?php _e( 'Fail to regenerate thumbails', 'rtmedia' ) ?> : <span class='rt-fail'>0</span></p>
856
-
857
- </div>
858
- <script>
859
-
860
- var db_done = 0;
861
- var db_fail = 0;
862
- var db_total = <?php echo $total; ?>;
863
- var indx = 0;
864
- function db_start_regenrate() {
865
- if ( indx < db_total ) {
866
- jQuery.ajax( {
867
- url: rtmedia_admin_ajax,
868
- type: 'post',
869
- data: {
870
- "action": "rt_media_regeneration",
871
- "media_id": rt_thumb_all_media[indx++]
872
- },
873
- success: function ( data ) {
874
- data = JSON.parse( data );
875
-
876
- if ( data.status == false ) {
877
- handle_regenrate_fail();
878
- } else {
879
- db_done++;
880
- var progw = Math.ceil( (db_done / db_total) * 100 );
881
- if ( progw > 100 ) {
882
- progw = 100;
883
- }
884
- jQuery( '#rtprogressbar>div' ).css( 'width', progw + '%' );
885
- jQuery( 'span.rt-done' ).html( db_done );
886
- db_start_regenrate();
887
- }
888
- },
889
- error: function () {
890
- handle_regenrate_fail();
891
- }
892
- } );
893
- } else {
894
- alert( "<?php _e( 'Regenerate Video Thumbnails Done', 'rtmedia' ); ?>" );
895
- }
896
- }
897
- function handle_regenrate_fail() {
898
- db_fail++;
899
- jQuery( 'span.rt-fail' ).html( db_fail );
900
- db_start_regenrate();
901
- }
902
- if ( jQuery( "#rt-start-media-regenerate" ).length > 0 ) {
903
- jQuery( "#rt-migration-progress" ).hide()
904
- jQuery( "#rt-start-media-regenerate" ).click( function () {
905
- jQuery( this ).hide();
906
- jQuery( "#rt-migration-progress" ).show()
907
- db_start_regenrate();
908
- } )
909
- } else {
910
- db_start_regenrate();
911
- }
912
-
913
- </script>
914
-
915
-
916
- </div> <?php
917
- }
918
-
919
- /**
920
- * Generate rtmedia thumbnail notice.
921
- *
922
- * @access public
923
- *
924
- * @param void
925
- *
926
- * @return void
927
- */
928
- public function rtmedia_regenerate_thumbnail_notice(){
929
- $obj_encoding = new RTMediaEncoding( true );
930
- if ( $obj_encoding->api_key ){
931
- $site_option = rtmedia_get_site_option( 'rtmedia-video-thumb-notice' );
932
- if ( ! $site_option || 'hide' != $site_option ){
933
- rtmedia_update_site_option( 'rtmedia-video-thumb-notice', 'show' );
934
- $videos_without_thumbs = get_video_without_thumbs();
935
- if ( isset( $videos_without_thumbs ) && is_array( $videos_without_thumbs ) && sizeof( $videos_without_thumbs ) > 0 ){
936
- echo '<div class="error rtmedia-regenerate-video-thumb-error">
937
- <p>
938
- ' . sprintf( __( "You have %s videos without thumbnails. Click <a href='%s'> here </a> to generate thumbnails. <a href='#' onclick='rtmedia_hide_video_thumb_notice()' style='float:right'>Hide</a>", 'rtmedia' ), sizeof( $videos_without_thumbs ), admin_url( 'admin.php?page=rtmedia-regenerate' ) ) . '
939
- </p>
940
- </div>';
941
- ?>
942
- <script type="text/javascript">
943
- function rtmedia_hide_video_thumb_notice() {
944
- var data = {action: 'rtmedia_hide_video_thumb_admin_notice'};
945
- jQuery.post( ajaxurl, data, function ( response ) {
946
- response = response.trim();
947
- if ( response === "1" )
948
- jQuery( '.rtmedia-regenerate-video-thumb-error' ).remove();
949
- } );
950
- }
951
- </script>
952
- <?php
953
- }
954
- }
955
- }
956
- }
957
-
958
- /**
959
- * Hide rtmedia video thumb admin notice.
960
- *
961
- * @access public
962
- *
963
- * @param void
964
- *
965
- * @return void
966
- */
967
- public function rtmedia_hide_video_thumb_admin_notice(){
968
- if ( rtmedia_update_site_option( 'rtmedia-video-thumb-notice', 'hide' ) ){
969
- echo '1';
970
- } else {
971
- echo '0';
972
- }
973
- die();
974
- }
975
-
976
- /**
977
- * Hide rtmedia addon update notice.
978
- *
979
- * @access public
980
- *
981
- * @param void
982
- *
983
- * @return void
984
- */
985
- public function rtmedia_hide_addon_update_notice(){
986
- if ( rtmedia_update_site_option( 'rtmedia-addon-update-notice', 'hide' ) ){
987
- echo '1';
988
- } else {
989
- echo '0';
990
- }
991
- die();
992
- }
993
-
994
- /**
995
- * Define rt_media_regeneration.
996
- *
997
- * @access public
998
- *
999
- * @param void
1000
- *
1001
- * @return void
1002
- */
1003
- public function rt_media_regeneration(){
1004
- if ( isset( $_POST['media_id'] ) ){
1005
- $model = new RTMediaModel();
1006
- $media = $model->get_media( array( 'media_id' => $_POST['media_id'] ), 0, 1 );
1007
- $media_type = $media[0]->media_type;
1008
- $response = array();
1009
- if ( 'video' == $media_type ){
1010
- $objRTMediaEncoding = new RTMediaEncoding( true );
1011
- $autoformat = 'thumbnails';
1012
- $objRTMediaEncoding->reencoding( intval( $_POST['media_id'] ), $autoformat );
1013
- $response['status'] = true;
1014
- } else {
1015
- $response['status'] = false;
1016
- $response['message'] = __( 'not a video ...', 'rtmedia' );
1017
- }
1018
- echo json_encode( $response );
1019
- die();
1020
- }
1021
- }
1022
-
1023
-
1024
- /**
1025
- * Get video without thumbs.
1026
- *
1027
- * @access public
1028
- *
1029
- * @param void
1030
- *
1031
- * @return object $results
1032
- */
1033
- public function get_video_without_thumbs(){
1034
- $rtmedia_model = new RTMediaModel();
1035
- $sql = "select media_id from {$rtmedia_model->table_name} where media_type = 'video' and blog_id = '" . get_current_blog_id() . "' and cover_art is null";
1036
- global $wpdb;
1037
- $results = $wpdb->get_col( $sql );
1038
-
1039
- return $results;
1040
- }
1041
-
1042
- /**
1043
- * Render the BuddyPress Media Settings page.
1044
- *
1045
- * @access public
1046
- *
1047
- * @param void
1048
- *
1049
- * @return void
1050
- */
1051
- public function settings_page(){
1052
- $this->render_page( 'rtmedia-settings', 'rtmedia' );
1053
- }
1054
-
1055
- /**
1056
- * Render the BuddyPress Privacy Settings page.
1057
- *
1058
- * @access public
1059
- *
1060
- * @param void
1061
- *
1062
- * @return void
1063
- */
1064
- public function privacy_page(){
1065
- $this->render_page( 'rtmedia-privacy' );
1066
- }
1067
-
1068
- /**
1069
- * Render the rtmedia Importer Page.
1070
- *
1071
- * @access public
1072
- *
1073
- * @param void
1074
- *
1075
- * @return void
1076
- */
1077
- public function rt_importer_page(){
1078
- $this->render_page( 'rtmedia-importer' );
1079
- }
1080
-
1081
- /**
1082
- * Render the rtmedia convert videos page.
1083
- *
1084
- * @access public
1085
- *
1086
- * @param void
1087
- *
1088
- * @return void
1089
- */
1090
- public function convert_videos_page(){
1091
- $this->render_page( 'rtmedia-convert-videos' );
1092
- }
1093
-
1094
- /**
1095
- * Render the BuddyPress Media Addons page.
1096
- *
1097
- * @access public
1098
- *
1099
- * @param void
1100
- *
1101
- * @return void
1102
- */
1103
- public function addons_page(){
1104
- $this->render_page( 'rtmedia-addons' );
1105
- }
1106
-
1107
- /**
1108
- * Render the BuddyPress Media Support page.
1109
- *
1110
- * @access public
1111
- *
1112
- * @param void
1113
- *
1114
- * @return void
1115
- */
1116
- public function support_page(){
1117
- $this->render_page( 'rtmedia-support' );
1118
- }
1119
-
1120
- /**
1121
- * Render the rtmedia premium page.
1122
- *
1123
- * @access public
1124
- *
1125
- * @param void
1126
- *
1127
- * @return void
1128
- */
1129
- public function premium_page(){
1130
- $this->render_page( 'rtmedia-premium' );
1131
- }
1132
-
1133
- /**
1134
- * Render the rtmedia theme page.
1135
- *
1136
- * @access public
1137
- *
1138
- * @param void
1139
- *
1140
- * @return void
1141
- */
1142
- public function theme_page(){
1143
- $this->render_page( 'rtmedia-themes' );
1144
- }
1145
-
1146
- /**
1147
- * Render the rtmedia hire us page.
1148
- *
1149
- * @access public
1150
- *
1151
- * @param void
1152
- *
1153
- * @return void
1154
- */
1155
- public function hire_us_page(){
1156
- $this->render_page( 'rtmedia-hire-us' );
1157
- }
1158
-
1159
- public function license_page(){
1160
- $this->render_page( 'rtmedia-license' );
1161
- }
1162
-
1163
- /**
1164
- * Render the rtmedia hire us page.
1165
- *
1166
- * @access static
1167
- *
1168
- * @param void
1169
- *
1170
- * @return type
1171
- */
1172
- static function get_current_tab(){
1173
- return isset( $_GET['page'] ) ? $_GET['page'] : 'rtmedia-settings';
1174
- }
1175
-
1176
- /**
1177
- * Render BPMedia Settings.
1178
- *
1179
- * @access public
1180
- * @global string 'rtmedia'
1181
- *
1182
- * @param type $page
1183
- * @param type $option_group
1184
- *
1185
- * @return void
1186
- */
1187
- public function render_page( $page, $option_group = null ){
1188
- ?>
1189
-
1190
- <div class="wrap bp-media-admin <?php echo $this->get_current_tab(); ?>">
1191
- <div id="icon-buddypress-media" class="icon32"><br></div>
1192
- <div>
1193
- <h2 class="nav-tab-wrapper"><?php $this->rtmedia_tabs(); ?>
1194
- <span class="alignright by">
1195
- <a class="rt-link" href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" target="_blank" title="rtCamp : <?php _e( 'Empowering The Web With WordPress', 'rtmedia' ); ?>">
1196
- <img src="<?php echo RTMEDIA_URL; ?>app/assets/img/rtcamp-logo.png">
1197
- </a>
1198
- </span>
1199
- </h2>
1200
- </div>
1201
-
1202
- <div class="row bp-media-settings-boxes-container">
1203
- <div id="bp-media-settings-boxes" class="columns large-9">
1204
-
1205
- <?php
1206
- $settings_url = ( is_multisite() ) ? network_admin_url( 'edit.php?action=' . $option_group ) : 'options.php';
1207
- if ( $option_group ){ //$option_group if ($page == "bp-media-settings") action="<?php echo $settings_url;
1208
- ?>
1209
- <form id="bp_media_settings_form" name="bp_media_settings_form" method="post"
1210
- enctype="multipart/form-data">
1211
- <div class="bp-media-metabox-holder">
1212
- <?php
1213
- settings_fields( $option_group );
1214
- if ( 'rtmedia-settings' == $page ){
1215
- echo '<div id="rtm-settings-tabs">';
1216
- $sub_tabs = $this->settings_sub_tabs();
1217
- RTMediaFormHandler::rtForm_settings_tabs_content( $page, $sub_tabs );
1218
- echo '</div>';
1219
- } else {
1220
- do_settings_sections( $page );
1221
- }
1222
- ?>
1223
- <div class="clearfix">&nbsp;</div>
1224
- <div class="row">
1225
- <input type="hidden" name="rtmedia-options-save" value="true">
1226
- <input type="submit" id="rtmedia-settings-submit" class="rtmedia-settings-submit button button-primary button-big" value="<?php _e( 'Save Settings', 'rtmedia' ); ?>">
1227
- </div>
1228
- </div>
1229
- </form><?php
1230
- } else {
1231
- ?>
1232
- <div class="bp-media-metabox-holder">
1233
- <?php
1234
- if ( 'rtmedia-addons' == $page ){
1235
- RTMediaAddon::render_addons( $page );
1236
- } else if ( 'rtmedia-support' == $page ){
1237
- $rtmedia_support = new RTMediaSupport( false );
1238
- $rtmedia_support->render_support( $page );
1239
- } else if ( 'rtmedia-themes' == $page ){
1240
- RTMediaThemes::render_themes( $page );
1241
- } else {
1242
- if ( 'rtmedia-license' == $page ){
1243
- RTMediaLicense::render_license( $page );
1244
- } else {
1245
- do_settings_sections( $page );
1246
- }
1247
- }
1248
- do_action( 'rtmedia_admin_page_insert', $page );
1249
- ?>
1250
- </div>
1251
- <?php
1252
- do_action( 'rtmedia_admin_page_append', $page );
1253
- }
1254
- ?>
1255
- </div>
1256
- <!-- .bp-media-settings-boxes -->
1257
- <div class="metabox-holder bp-media-metabox-holder columns large-3">
1258
- <?php $this->admin_sidebar(); ?>
1259
- </div>
1260
- </div>
1261
- <!-- .metabox-holder -->
1262
- </div><!-- .bp-media-admin --><?php
1263
- }
1264
-
1265
- /**
1266
- * Adds a tab for Media settings in the BuddyPress settings page
1267
- *
1268
- * @access public
1269
- * @global type $bp_media
1270
- *
1271
- * @param void
1272
- * @param void
1273
- *
1274
- * @return type $tabs_html
1275
- */
1276
- public function tab(){
1277
-
1278
- $tabs_html = '';
1279
- $idle_class = 'nav-tab';
1280
- $active_class = 'nav-tab nav-tab-active';
1281
- $tabs = array();
1282
-
1283
- // Check to see which tab we are on
1284
- $tab = $this->get_current_tab();
1285
- /* rtMedia */
1286
- $tabs[] = array(
1287
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ),
1288
- 'title' => __( 'rtMedia', 'rtmedia' ),
1289
- 'name' => __( 'rtMedia', 'rtmedia' ),
1290
- 'class' => ( $tab == 'rtmedia-settings' || $tab == 'rtmedia-addons' || $tab == 'rtmedia-support' || $tab == 'rtmedia-importer' ) ? $active_class : $idle_class,
1291
- );
1292
-
1293
- foreach ( $tabs as $tab ) {
1294
- $tabs_html .= '<a id="bp-media" title= "' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . '">' . $tab['name'] . '</a>';
1295
- }
1296
- echo $tabs_html;
1297
- }
1298
-
1299
- /**
1300
- * Create core admin tabs.
1301
- *
1302
- * @access public
1303
- *
1304
- * @param type $active_tab
1305
- *
1306
- * @return void
1307
- */
1308
- public function rtmedia_tabs( $active_tab = '' ){
1309
- // Declare local variables
1310
- $tabs_html = '';
1311
- $idle_class = 'nav-tab';
1312
- $active_class = 'nav-tab nav-tab-active';
1313
-
1314
- // Setup core admin tabs
1315
- $tabs = array(
1316
- array(
1317
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-settings' ), 'admin.php' ) ),
1318
- 'name' => __( 'Settings', 'rtmedia' ),
1319
- 'slug' => 'rtmedia-settings',
1320
- ), array(
1321
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-addons' ), 'admin.php' ) ),
1322
- 'name' => __( 'Addons', 'rtmedia' ),
1323
- 'slug' => 'rtmedia-addons',
1324
- ), array(
1325
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-themes' ), 'admin.php' ) ),
1326
- 'name' => __( 'Themes', 'rtmedia' ),
1327
- 'slug' => 'rtmedia-themes',
1328
- ), array(
1329
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-hire-us' ), 'admin.php' ) ),
1330
- 'name' => __( 'Hire Us', 'rtmedia' ),
1331
- 'slug' => 'rtmedia-hire-us',
1332
- ), array(
1333
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-support' ), 'admin.php' ) ),
1334
- 'name' => __( 'Support', 'rtmedia' ),
1335
- 'slug' => 'rtmedia-support',
1336
- ), array(
1337
- 'href' => get_admin_url( null, add_query_arg( array( 'page' => 'rtmedia-license' ), 'admin.php' ) ),
1338
- 'name' => __( 'Licenses', 'rtmedia' ),
1339
- 'slug' => 'rtmedia-license',
1340
- ),
1341
- );
1342
-
1343
- $tabs = apply_filters( 'media_add_tabs', $tabs );
1344
-
1345
- // Loop through tabs and build navigation
1346
- foreach ( array_values( $tabs ) as $tab_data ) {
1347
- $is_current = (bool) ( $tab_data['slug'] == $this->get_current_tab() );
1348
- $tab_class = $is_current ? $active_class : $idle_class;
1349
-
1350
- if ( isset( $tab_data['class'] ) && is_array( $tab_data['class'] ) ){
1351
- $tab_class .= ' ' . implode( ' ', $tab_data['class'] );
1352
- }
1353
-
1354
- $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
1355
- }
1356
-
1357
- // Output the tabs
1358
- echo $tabs_html;
1359
-
1360
- // // Do other fun things
1361
- // do_action('bp_media_admin_tabs');
1362
- }
1363
-
1364
- /**
1365
- * Create settings content tabs.
1366
- *
1367
- * @access public
1368
- *
1369
- * @param type $page
1370
- *
1371
- * @return void
1372
- */
1373
- public function settings_content_tabs( $page ){
1374
- global $wp_settings_sections, $wp_settings_fields;
1375
-
1376
- if ( ! isset( $wp_settings_sections ) || ! isset( $wp_settings_sections[ $page ] ) ){
1377
- return;
1378
- }
1379
-
1380
- foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
1381
- if ( $section['title'] ){
1382
- echo "<h3>{$section['title']}</h3>\n";
1383
- }
1384
-
1385
- if ( $section['callback'] ){
1386
- call_user_func( $section['callback'], $section );
1387
- }
1388
-
1389
- if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ){
1390
- continue;
1391
- }
1392
-
1393
- echo '<table class="form-table">';
1394
- do_settings_fields( $page, $section['id'] );
1395
- echo '</table>';
1396
- }
1397
- }
1398
-
1399
- /**
1400
- * Adds a sub tabs to the BuddyPress Media settings page
1401
- *
1402
- * @access public
1403
- * @global type $bp_media
1404
- *
1405
- * @param void
1406
- *
1407
- * @return array $tabs
1408
- */
1409
- public function settings_sub_tabs(){
1410
- $tabs_html = '';
1411
- $tabs = array();
1412
-
1413
- // Check to see which tab we are on
1414
- $tab = $this->get_current_tab();
1415
- /* rtMedia */
1416
-
1417
- $tabs[7] = array(
1418
- 'href' => '#rtmedia-display',
1419
- 'icon' => 'rtmicon-desktop',
1420
- 'title' => __( 'Display', 'rtmedia' ),
1421
- 'name' => __( 'Display', 'rtmedia' ),
1422
- 'callback' => array( 'RTMediaFormHandler', 'display_content' )
1423
- );
1424
-
1425
- if ( class_exists( 'BuddyPress' ) ){
1426
- $tabs[20] = array(
1427
- 'href' => '#rtmedia-bp',
1428
- 'icon' => 'rtmicon-group',
1429
- 'title' => __( 'rtMedia BuddyPress', 'rtmedia' ),
1430
- 'name' => __( 'BuddyPress', 'rtmedia' ),
1431
- 'callback' => array( 'RTMediaFormHandler', 'buddypress_content' ) //change it to BuddyPress Content
1432
- );
1433
- }
1434
-
1435
- $tabs[30] = array(
1436
- 'href' => '#rtmedia-types',
1437
- 'icon' => 'rtmicon-film',
1438
- 'title' => __( 'rtMedia Types', 'rtmedia' ),
1439
- 'name' => __( 'Types', 'rtmedia' ),
1440
- 'callback' => array( 'RTMediaFormHandler', 'types_content' )
1441
- );
1442
-
1443
- $tabs[40] = array(
1444
- 'href' => '#rtmedia-sizes',
1445
- 'icon' => 'rtmicon-expand',
1446
- 'title' => __( 'rtMedia Sizes', 'rtmedia' ),
1447
- 'name' => __( 'Image Sizes', 'rtmedia' ),
1448
- 'callback' => array( 'RTMediaFormHandler', 'sizes_content' )
1449
- );
1450
-
1451
- $tabs[50] = array(
1452
- 'href' => '#rtmedia-privacy',
1453
- 'icon' => 'rtmicon-lock',
1454
- 'title' => __( 'rtMedia Privacy', 'rtmedia' ),
1455
- 'name' => __( 'Privacy', 'rtmedia' ),
1456
- 'callback' => array( 'RTMediaFormHandler', 'privacy_content' )
1457
- );
1458
- $tabs[60] = array(
1459
- 'href' => '#rtmedia-custom-css-settings',
1460
- 'icon' => 'rtmicon-css3',
1461
- 'title' => __( 'rtMedia Custom CSS', 'rtmedia' ),
1462
- 'name' => __( 'Custom CSS', 'rtmedia' ),
1463
- 'callback' => array( 'RTMediaFormHandler', 'custom_css_content' )
1464
- );
1465
-
1466
- $tabs = apply_filters( 'rtmedia_add_settings_sub_tabs', $tabs, $tab );
1467
-
1468
- $tabs[] = array(
1469
- 'href' => '#rtmedia-general',
1470
- 'icon' => 'rtmicon-wrench',
1471
- 'title' => __( 'Other Settings', 'rtmedia' ),
1472
- 'name' => __( 'Other Settings', 'rtmedia' ),
1473
- 'callback' => array( 'RTMediaFormHandler', 'general_content' )
1474
- );
1475
-
1476
- return $tabs;
1477
- }
1478
-
1479
- /**
1480
- * Updates the media count of all users.
1481
- * <