rtMedia for WordPress, BuddyPress and bbPress - Version 3.0

Version Description

  • Renamed to rtMedia for WordPress, BuddyPress and bbPress
  • Adds Anywhere uploader
  • Adds Anywhere media
  • Author page integration (in the absence of BuddyPress)
  • Fixes lightbox
  • Fixes comments and media actions in the absence of activities
Download this release

Release Info

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

Code changes from version 2.13 to 3.0

Files changed (206) hide show
  1. app/admin/BPMediaAdmin.php +0 -533
  2. app/admin/RTMediaAdmin.php +705 -0
  3. app/admin/RTMediaFormHandler.php +482 -0
  4. app/assets/css/admin.css +539 -27
  5. app/assets/css/bootstrap-switch.css +184 -0
  6. app/assets/css/font-awesome.min.css +24 -0
  7. app/assets/css/grid-foundation.css +217 -0
  8. app/assets/css/jquery.plupload.queue.css +177 -0
  9. app/assets/css/jquery.powertip.min.css +1 -0
  10. app/assets/css/jquery.sliderTabs.min.css +1 -0
  11. app/assets/css/main.css +1 -551
  12. app/assets/css/style.css +51 -0
  13. app/assets/font/FontAwesome.otf +0 -0
  14. app/assets/font/fontawesome-webfont.eot +0 -0
  15. app/assets/font/fontawesome-webfont.svg +339 -0
  16. app/assets/font/fontawesome-webfont.ttf +0 -0
  17. app/assets/font/fontawesome-webfont.woff +0 -0
  18. app/assets/img/backgrounds.gif +0 -0
  19. app/assets/img/bpm-contest-banner.jpg +0 -0
  20. app/assets/img/buttons-disabled.png +0 -0
  21. app/assets/img/buttons.png +0 -0
  22. app/assets/img/close.png +0 -0
  23. app/assets/img/delete.gif +0 -0
  24. app/assets/img/donate.gif +0 -0
  25. app/assets/img/donate.png +0 -0
  26. app/assets/img/done.gif +0 -0
  27. app/assets/img/error.gif +0 -0
  28. app/assets/img/indicator.png +0 -0
  29. app/assets/img/indicatorActive.png +0 -0
  30. app/assets/img/leftArrow.png +0 -0
  31. app/assets/img/leftPanelArrow.png +0 -0
  32. app/assets/img/mask-square.png +0 -0
  33. app/assets/img/mask.png +0 -0
  34. app/assets/img/rightArrow.png +0 -0
  35. app/assets/img/rightPanelArrow.png +0 -0
  36. app/assets/img/rtCamp-bullet.png +0 -0
  37. app/assets/img/throbber.gif +0 -0
  38. app/assets/img/thumb_default.png +0 -0
  39. app/assets/img/transp50.png +0 -0
  40. app/assets/img/wpmini-grey.png +0 -0
  41. app/assets/js/admin.js +186 -82
  42. app/assets/js/bootstrap-switch.js +255 -0
  43. app/assets/js/bp-media-activity-uploader.js +0 -222
  44. app/assets/js/bp-media-uploader.js +0 -119
  45. app/assets/js/jquery.observehashchange.pack.js +20 -0
  46. app/assets/js/jquery.powertip.min.js +8 -0
  47. app/assets/js/jquery.sliderTabs.min.js +1 -0
  48. app/assets/js/main.js +10 -6
  49. app/assets/js/rtMedia.backbone.js +552 -0
  50. app/assets/js/rtMedia.js +129 -0
  51. app/assets/sass/config.rb +25 -0
  52. app/assets/sass/main.scss +240 -0
  53. app/helper/BPMediaLog.php +2 -2
  54. app/helper/BPMediaSettings.php +0 -613
  55. app/helper/BPMediaUpgrade.php +0 -190
  56. app/helper/{BPMediaAddon.php → RTMediaAddon.php} +116 -31
  57. app/helper/{BPMediaAdminWidget.php → RTMediaAdminWidget.php} +7 -7
  58. app/helper/RTMediaCommentModel.php +45 -0
  59. app/helper/{BPMediaFeed.php → RTMediaFeed.php} +8 -7
  60. app/helper/RTMediaModel.php +211 -0
  61. app/helper/RTMediaSettings.php +245 -0
  62. app/helper/{BPMediaSupport.php → RTMediaSupport.php} +39 -38
  63. app/helper/RTMediaUploadException.php +66 -0
  64. app/helper/db/RTDBModel.php +168 -0
  65. app/helper/db/RTDBUpdate.php +77 -0
  66. app/helper/db/rt_plugin_info.php +57 -0
  67. app/helper/rtDimensions.php +122 -0
  68. app/helper/rtForm.php +648 -0
  69. app/helper/rtFormInvalidArgumentsException.php +29 -0
  70. app/helper/rtProgress.php +2 -0
  71. app/importers/BPMediaBPAlbumImporter.php +0 -87
  72. app/importers/BPMediaImporter.php +1 -1
  73. app/importers/RTMediaMigration.php +1021 -0
  74. app/main/BPMediaComponent.php +0 -343
  75. app/main/BPMediaGroupLoader.php +0 -313
  76. app/main/BPMediaLoader.php +0 -172
  77. app/main/BuddyPressMedia.php +0 -776
  78. app/main/RTMedia.php +702 -0
  79. app/main/activity/BPMediaActivity.php +0 -173
  80. app/main/contexts/RTMediaContext.php +103 -0
  81. app/main/controllers/activity/RTMediaActivity.php +118 -0
  82. app/main/controllers/activity/RTMediaBuddyPressActivity.php +133 -0
  83. app/main/controllers/media/RTMediaAlbum.php +506 -0
  84. app/main/controllers/media/RTMediaComment.php +80 -0
  85. app/main/controllers/media/RTMediaCoverArt.php +73 -0
  86. app/main/controllers/media/RTMediaFeatured.php +189 -0
  87. app/main/controllers/media/RTMediaLike.php +95 -0
  88. app/main/controllers/media/RTMediaMedia.php +474 -0
  89. app/main/controllers/media/RTMediaMeta.php +82 -0
  90. app/main/controllers/media/RTMediaUserInteraction.php +273 -0
  91. app/main/controllers/privacy/RTMediaFriends.php +49 -0
  92. app/main/controllers/privacy/RTMediaPrivacy.php +278 -0
  93. app/main/controllers/shortcodes/RTMediaGalleryShortcode.php +102 -0
  94. app/main/controllers/shortcodes/RTMediaUploadShortcode.php +66 -0
  95. app/main/controllers/template/RTMediaAJAX.php +41 -0
  96. app/main/controllers/template/RTMediaNav.php +311 -0
  97. app/main/controllers/template/RTMediaTemplate.php +467 -0
  98. app/main/controllers/template/RTMediaUploadTemplate.php +66 -0
  99. app/main/controllers/template/rt-template-functions.php +808 -0
  100. app/main/controllers/template/template.php +165 -0
  101. app/main/controllers/upload/RTMediaUpload.php +74 -0
  102. app/main/controllers/upload/RTMediaUploadEndpoint.php +69 -0
  103. app/main/controllers/upload/RTMediaUploadHelper.php +31 -0
  104. app/main/controllers/upload/RTMediaUploadModel.php +156 -0
  105. app/main/controllers/upload/RTMediaUploadView.php +106 -0
  106. app/main/controllers/upload/processors/RTMediaUploadFile.php +319 -0
  107. app/main/controllers/upload/processors/RTMediaUploadUrl.php +17 -0
  108. app/main/deprecated/RTMediaDeprecated.php +31 -0
  109. app/main/group/BPMediaGroupAction.php +0 -169
  110. app/main/group/BPMediaGroupElementExtension.php +0 -146
  111. app/main/group/BPMediaGroupsExtension.php +0 -167
  112. app/main/group/dummy/BPMediaGroupAlbums.php +0 -20
  113. app/main/group/dummy/BPMediaGroupAudio.php +0 -17
  114. app/main/group/dummy/BPMediaGroupImages.php +0 -17
  115. app/main/group/dummy/BPMediaGroupUpload.php +0 -20
  116. app/main/group/dummy/BPMediaGroupVideos.php +0 -17
  117. app/main/includes/BPMediaActions.php +0 -1211
  118. app/main/includes/BPMediaDownload.php +0 -68
  119. app/main/includes/BPMediaFilters.php +0 -517
  120. app/main/includes/BPMediaFunction.php +0 -277
  121. app/main/includes/BPMediaHostWordpress.php +0 -1066
  122. app/main/includes/BPMediaImage.php +0 -48
  123. app/main/includes/BPMediaTemplateFunctions.php +0 -237
  124. app/main/includes/BPMediaUpgradeScript.php +0 -133
  125. app/main/includes/bp-media-upload-handler.php +0 -35
  126. app/main/interactions/RTMediaInteraction.php +183 -0
  127. app/main/privacy/BPMediaPrivacy.php +0 -361
  128. app/main/privacy/BPMediaPrivacyScreen.php +0 -64
  129. app/main/privacy/BPMediaPrivacySettings.php +0 -100
  130. app/main/profile/BPMediaAlbum.php +0 -405
  131. app/main/profile/BPMediaAlbumScreen.php +0 -314
  132. app/main/profile/BPMediaFeatured.php +0 -177
  133. app/main/profile/BPMediaScreen.php +0 -498
  134. app/main/profile/BPMediaTemplate.php +0 -293
  135. app/main/profile/BPMediaUploadScreen.php +0 -147
  136. app/main/query/BPMediaQuery.php +0 -186
  137. app/main/routers/RTMediaRouter.php +158 -0
  138. app/main/routers/query/RTMediaQuery.php +763 -0
  139. app/main/widgets/BPMediaWidget.php +0 -229
  140. app/schema/rtm_media.schema +30 -0
  141. app/schema/rtm_media_meta.schema +7 -0
  142. app/services/BPMediaEncodingTranscoder.php +0 -148
  143. app/services/{BPMediaEncoding.php → RTMediaEncoding.php} +215 -198
  144. config/index.php +0 -6
  145. index.php +51 -15
  146. languages/buddypress-media-ar_AR.mo +0 -0
  147. languages/buddypress-media-ar_AR.po +0 -1393
  148. languages/buddypress-media-de.mo +0 -0
  149. languages/buddypress-media-de_DE.mo +0 -0
  150. languages/buddypress-media-de_DE.po +0 -1408
  151. languages/buddypress-media-es.mo +0 -0
  152. languages/buddypress-media-es_ES.mo +0 -0
  153. languages/buddypress-media-es_ES.po +0 -1406
  154. languages/buddypress-media-fa_IR.mo +0 -0
  155. languages/buddypress-media-fa_IR.po +0 -1408
  156. languages/buddypress-media-fr.mo +0 -0
  157. languages/buddypress-media-fr_FR.mo +0 -0
  158. languages/buddypress-media-fr_FR.po +0 -1399
  159. languages/buddypress-media-it.mo +0 -0
  160. languages/buddypress-media-it_IT.mo +0 -0
  161. languages/buddypress-media-it_IT.po +0 -1396
  162. languages/buddypress-media-ja.mo +0 -0
  163. languages/buddypress-media-ja_JA.mo +0 -0
  164. languages/buddypress-media-ja_JA.po +0 -1395
  165. languages/buddypress-media-nl.mo +0 -0
  166. languages/buddypress-media-nl_NL.mo +0 -0
  167. languages/buddypress-media-nl_NL.po +0 -1393
  168. languages/buddypress-media-pl.mo +0 -0
  169. languages/buddypress-media-pl_PL.mo +0 -0
  170. languages/buddypress-media-pl_PL.po +0 -1395
  171. languages/buddypress-media-pt_BR.mo +0 -0
  172. languages/buddypress-media-pt_BR.po +0 -1404
  173. languages/buddypress-media-ro_RO.mo +0 -0
  174. languages/buddypress-media-ro_RO.po +0 -1393
  175. languages/buddypress-media-sr.mo +0 -0
  176. languages/buddypress-media-sr_SR.mo +0 -0
  177. languages/buddypress-media-sr_SR.po +0 -1393
  178. languages/buddypress-media.po +0 -1550
  179. languages/rtmedia-ar_AR.mo +0 -0
  180. languages/rtmedia-de_DE.mo +0 -0
  181. languages/rtmedia-es_ES.mo +0 -0
  182. languages/rtmedia-fa_IR.mo +0 -0
  183. languages/rtmedia-fr_FR.mo +0 -0
  184. languages/rtmedia-it_IT.mo +0 -0
  185. languages/rtmedia-ja_JA.mo +0 -0
  186. languages/rtmedia-nl_NL.mo +0 -0
  187. languages/rtmedia-pl_PL.mo +0 -0
  188. languages/rtmedia-pt_BR.mo +0 -0
  189. languages/rtmedia-ro_RO.mo +0 -0
  190. languages/rtmedia-sr_SR.mo +0 -0
  191. languages/{buddypress-media.mo → rtmedia.mo} +0 -0
  192. languages/rtmedia.po +1201 -0
  193. lib/magnific/magnific.css +396 -0
  194. lib/magnific/magnific.js +3 -0
  195. lib/simple-html-dom/simple_html_dom.php +1742 -0
  196. lib/simplemodal/jquery.simplemodal-1.4.4.js +0 -758
  197. log/index.php +0 -9
  198. readme.txt +154 -68
  199. templates/media/album-gallery-item.php +16 -0
  200. templates/media/album-gallery.php +53 -0
  201. templates/media/album-single-edit.php +77 -0
  202. templates/media/media-gallery-item.php +52 -0
  203. templates/media/media-gallery.php +47 -0
  204. templates/media/media-single-edit.php +37 -0
  205. templates/media/media-single.php +41 -0
  206. templates/upload/uploader.php +53 -0
app/admin/BPMediaAdmin.php DELETED
@@ -1,533 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaAdmin
4
- *
5
- * @package BuddyPressMedia
6
- * @subpackage Admin
7
- *
8
- * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
9
- * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
10
- */
11
- if (!class_exists('BPMediaAdmin')) {
12
-
13
- class BPMediaAdmin {
14
-
15
- public $bp_media_upgrade;
16
- public $bp_media_settings;
17
- public $bp_media_encoding;
18
- public $bp_media_support;
19
- public $bp_media_feed;
20
-
21
- public function __construct() {
22
- add_action('init', array($this, 'video_transcoding_survey_response'));
23
- if (is_multisite()) {
24
- add_action('network_admin_notices', array($this, 'upload_filetypes_error'));
25
- add_action('admin_notices', array($this, 'upload_filetypes_error'));
26
- }
27
- $bp_media_feed = new BPMediaFeed();
28
- add_action('wp_ajax_bp_media_fetch_feed', array($bp_media_feed, 'fetch_feed'), 1);
29
- $this->bp_media_support = new BPMediaSupport();
30
- add_action('wp_ajax_bp_media_select_request', array($this->bp_media_support, 'get_form'), 1);
31
- add_action('wp_ajax_bp_media_cancel_request', create_function('', 'do_settings_sections("bp-media-support"); die();'), 1);
32
- add_action('wp_ajax_bp_media_submit_request', array($this->bp_media_support, 'submit_request'), 1);
33
- add_action('wp_ajax_bp_media_fetch_feed', array($bp_media_feed, 'fetch_feed'), 1);
34
- add_action('wp_ajax_bp_media_linkback', array($this, 'linkback'), 1);
35
- add_action('wp_ajax_bp_media_bp_album_deactivate', 'BPMediaAlbumimporter::bp_album_deactivate', 1);
36
- add_action('wp_ajax_bp_media_bp_album_import', 'BPMediaAlbumimporter::bpmedia_ajax_import_callback', 1);
37
- add_action('wp_ajax_bp_media_bp_album_import_favorites', 'BPMediaAlbumimporter::bpmedia_ajax_import_favorites', 1);
38
- add_action('wp_ajax_bp_media_bp_album_import_step_favorites', 'BPMediaAlbumimporter::bpmedia_ajax_import_step_favorites', 1);
39
- add_action('wp_ajax_bp_media_bp_album_cleanup', 'BPMediaAlbumimporter::cleanup_after_install');
40
- add_action('wp_ajax_bp_media_convert_videos_form', array($this, 'convert_videos_mailchimp_send'), 1);
41
- add_action('wp_ajax_bp_media_correct_upload_filetypes', array($this, 'correct_upload_filetypes'), 1);
42
- add_filter('plugin_row_meta', array($this, 'plugin_meta_premium_addon_link'), 1, 4);
43
- if (is_admin()) {
44
- add_action('admin_enqueue_scripts', array($this, 'ui'));
45
- add_action(bp_core_admin_hook(), array($this, 'menu'));
46
- if (current_user_can('manage_options'))
47
- add_action('bp_admin_tabs', array($this, 'tab'));
48
- if (is_multisite())
49
- add_action('network_admin_edit_bp_media', array($this, 'save_multisite_options'));
50
- }
51
- $this->bp_media_settings = new BPMediaSettings();
52
- if ( !class_exists('BPMediaFFMPEG') && !class_exists('BPMediaKaltura') )
53
- $this->bp_media_encoding = new BPMediaEncoding();
54
- }
55
-
56
- /**
57
- * Generates the Admin UI.
58
- *
59
- * @param string $hook
60
- */
61
-
62
- /**
63
- *
64
- * @param type $hook
65
- */
66
- public function ui($hook) {
67
- $admin_ajax = admin_url('admin-ajax.php');
68
-
69
- wp_enqueue_script('bp-media-admin', BP_MEDIA_URL . 'app/assets/js/admin.js', array('jquery-ui-dialog'), BP_MEDIA_VERSION);
70
- wp_enqueue_style ( 'wp-jquery-ui-dialog');
71
- wp_localize_script('bp-media-admin', 'bp_media_admin_ajax', $admin_ajax);
72
- wp_localize_script('bp-media-admin', 'bp_media_admin_admin_url', admin_url());
73
- $bp_media_admin_strings = array(
74
- 'no_refresh' => __('Please do not refresh this page.', 'buddypress-media'),
75
- 'something_went_wrong' => __('Something went wronng. Please <a href onclick="location.reload();">refresh</a> page.', 'buddypress-media'),
76
- 'are_you_sure' => __('This will subscribe you to the free plan.', 'buddypress-media'),
77
- 'reason_for_unsubscribe' => __('Just to improve our service we would like to know the reason for you to leave us.', 'buddypress-media')
78
- );
79
- wp_localize_script('bp-media-admin', 'bp_media_admin_strings', $bp_media_admin_strings);
80
- wp_localize_script('bp-media-admin', 'settings_url', add_query_arg(
81
- array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
82
- ) . '#privacy_enabled');
83
- wp_localize_script('bp-media-admin', 'settings_bp_album_import_url', add_query_arg(
84
- array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
85
- ));
86
- wp_enqueue_style('bp-media-admin', BP_MEDIA_URL . 'app/assets/css/main.css', '', BP_MEDIA_VERSION);
87
- }
88
-
89
- /**
90
- * Admin Menu
91
- *
92
- * @global string 'buddypress-media'
93
- */
94
- public function menu() {
95
- global $wpdb;
96
- add_menu_page(__('BuddyPress Media Component', 'buddypress-media'), __('BuddyPress Media', 'buddypress-media'), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
97
- add_submenu_page('bp-media-settings', __('BuddyPress Media Settings', 'buddypress-media'), __('Settings', 'buddypress-media'), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
98
- add_submenu_page('bp-media-settings', __('BuddyPress Media Addons', 'buddypress-media'), __('Addons', 'buddypress-media'), 'manage_options', 'bp-media-addons', array($this, 'addons_page'));
99
- add_submenu_page('bp-media-settings', __('BuddyPress Media Support', 'buddypress-media'), __('Support ', 'buddypress-media'), 'manage_options', 'bp-media-support', array($this, 'support_page'));
100
- add_submenu_page('bp-media-settings', __('Importer', 'buddypress-media'), __('Importer', 'buddypress-media'), 'manage_options', 'bp-media-importer', array($this, 'bp_importer_page'));
101
- if (!BPMediaPrivacy::is_installed()) {
102
- add_submenu_page('bp-media-settings', __('BuddyPress Media Database Update', 'buddypress-media'), __('Update Database', 'buddypress-media'), 'manage_options', 'bp-media-privacy', array($this, 'privacy_page'));
103
- }
104
- }
105
-
106
- /**
107
- * Render the BuddyPress Media Settings page
108
- */
109
- public function settings_page() {
110
- $this->render_page('bp-media-settings', 'bp_media');
111
- }
112
-
113
- public function privacy_page() {
114
- $this->render_page('bp-media-privacy');
115
- }
116
-
117
- public function bp_importer_page() {
118
- $this->render_page('bp-media-importer');
119
- }
120
-
121
- public function convert_videos_page() {
122
- $this->render_page('bp-media-convert-videos');
123
- }
124
-
125
- /**
126
- * Render the BuddyPress Media Addons page
127
- */
128
- public function addons_page() {
129
- $this->render_page('bp-media-addons');
130
- }
131
-
132
- /**
133
- * Render the BuddyPress Media Support page
134
- */
135
- public function support_page() {
136
- $this->render_page('bp-media-support');
137
- }
138
-
139
- /**
140
- *
141
- * @return type
142
- */
143
- static function get_current_tab() {
144
- return isset($_GET['page']) ? $_GET['page'] : "bp-media-settings";
145
- }
146
-
147
- /**
148
- * Render BPMedia Settings
149
- *
150
- * @global string 'buddypress-media'
151
- */
152
-
153
- /**
154
- *
155
- * @param type $page
156
- * @param type $option_group
157
- */
158
- public function render_page($page, $option_group = NULL) {
159
- ?>
160
-
161
- <div class="wrap bp-media-admin <?php echo $this->get_current_tab(); ?>">
162
- <div id="icon-buddypress" class="icon32"><br></div>
163
- <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs(__('Media', 'buddypress-media')); ?></h2>
164
- <?php settings_errors(); ?>
165
- <div class="columns-2">
166
- <h3 class="bp-media-settings-tabs"><?php
167
- $this->sub_tabs();
168
- ?>
169
- </h3>
170
-
171
- <div id="bp-media-settings-boxes">
172
- <?php
173
- $settings_url = ( is_multisite() ) ? network_admin_url('edit.php?action=' . $option_group) : 'options.php';
174
- ?>
175
- <?php if ($option_group) { ?>
176
- <form id="bp_media_settings_form" name="bp_media_settings_form" action="<?php echo $settings_url; ?>" method="post" enctype="multipart/form-data">
177
- <div class="bp-media-metabox-holder"><?php
178
- settings_fields($option_group);
179
- do_settings_sections($page);
180
- submit_button();
181
- ?><div class="rt-link alignright"><?php _e('By', 'buddypress-media'); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e('Empowering The Web With WordPress', 'buddypress-media'); ?>"><img src="<?php echo BP_MEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
182
- </div>
183
- </form><?php } else {
184
- ?>
185
- <div class="bp-media-metabox-holder"><?php do_settings_sections($page); ?>
186
- <div class="rt-link alignright"><?php _e('By', 'buddypress-media'); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e('Empowering The Web With WordPress', 'buddypress-media'); ?>"><img src="<?php echo BP_MEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
187
- </div><?php
188
- }
189
- ?>
190
-
191
-
192
- </div><!-- .bp-media-settings-boxes -->
193
- <div class="metabox-fixed metabox-holder alignright bp-media-metabox-holder">
194
- <?php $this->admin_sidebar(); ?>
195
- </div>
196
- </div><!-- .metabox-holder -->
197
- </div><!-- .bp-media-admin --><?php
198
- do_action('bp_media_admin_page_append', $page);
199
- }
200
-
201
- /**
202
- * Adds a tab for Media settings in the BuddyPress settings page
203
- *
204
- * @global type $bp_media
205
- */
206
- public function tab() {
207
-
208
- $tabs_html = '';
209
- $idle_class = 'nav-tab';
210
- $active_class = 'nav-tab nav-tab-active';
211
- $tabs = array();
212
-
213
- // Check to see which tab we are on
214
- $tab = $this->get_current_tab();
215
- /* BuddyPress Media */
216
- $tabs[] = array(
217
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
218
- 'title' => __('BuddyPress Media', 'buddypress-media'),
219
- 'name' => __('BuddyPress Media', 'buddypress-media'),
220
- 'class' => ($tab == 'bp-media-settings' || $tab == 'bp-media-addons' || $tab == 'bp-media-support') ? $active_class : $idle_class
221
- );
222
-
223
-
224
- foreach ($tabs as $tab) {
225
- $tabs_html.= '<a id="bp-media" title= "' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . '">' . $tab['name'] . '</a>';
226
- }
227
- echo $tabs_html;
228
- }
229
-
230
- /**
231
- * Adds a sub tabs to the BuddyPress Media settings page
232
- *
233
- * @global type $bp_media
234
- */
235
- public function sub_tabs() {
236
- $tabs_html = '';
237
- $idle_class = 'nav-tab';
238
- $active_class = 'nav-tab nav-tab-active';
239
- $tabs = array();
240
-
241
- // Check to see which tab we are on
242
- $tab = $this->get_current_tab();
243
- /* BuddyPress Media */
244
- $tabs[] = array(
245
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
246
- 'title' => __('BuddyPress Media Settings', 'buddypress-media'),
247
- 'name' => __('Settings', 'buddypress-media'),
248
- 'class' => ($tab == 'bp-media-settings') ? $active_class : $idle_class . ' first_tab'
249
- );
250
-
251
- $tabs[] = array(
252
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php')),
253
- 'title' => __('BuddyPress Media Addons', 'buddypress-media'),
254
- 'name' => __('Addons', 'buddypress-media'),
255
- 'class' => ($tab == 'bp-media-addons') ? $active_class : $idle_class
256
- );
257
-
258
- $tabs[] = array(
259
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php')),
260
- 'title' => __('BuddyPress Media Support', 'buddypress-media'),
261
- 'name' => __('Support', 'buddypress-media'),
262
- 'class' => ($tab == 'bp-media-support') ? $active_class : $idle_class . ' last_tab'
263
- );
264
-
265
- $tabs[] = array(
266
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-importer'), 'admin.php')),
267
- 'title' => __('Importer', 'buddypress-media'),
268
- 'name' => __('Importer', 'buddypress-media'),
269
- 'class' => ($tab == 'bp-media-importer') ? $active_class : $idle_class
270
- );
271
-
272
- $tabs = apply_filters('bp_media_add_sub_tabs', $tabs, $tab);
273
- foreach ($tabs as $tab) {
274
- $tabs_html.= '<a title="' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . ' ' . sanitize_title($tab['name']) . '">' . $tab['name'] . '</a>';
275
- }
276
- echo $tabs_html;
277
- }
278
-
279
- /*
280
- * Updates the media count of all users.
281
- */
282
-
283
- /**
284
- *
285
- * @global type $wpdb
286
- * @return boolean
287
- */
288
- public function update_count() {
289
- global $wpdb;
290
-
291
- $query =
292
- "SELECT
293
- p.post_author,pmp.meta_value,
294
- SUM(CASE WHEN post_mime_type LIKE 'image%' THEN 1 ELSE 0 END) as Images,
295
- SUM(CASE WHEN post_mime_type LIKE 'audio%' THEN 1 ELSE 0 END) as Audio,
296
- SUM(CASE WHEN post_mime_type LIKE 'video%' THEN 1 ELSE 0 END) as Videos,
297
- SUM(CASE WHEN post_type LIKE 'bp_media_album' THEN 1 ELSE 0 END) as Albums
298
- FROM
299
- $wpdb->posts p inner join $wpdb->postmeta pm on pm.post_id = p.id INNER JOIN $wpdb->postmeta pmp
300
- on pmp.post_id = p.id WHERE
301
- pm.meta_key = 'bp-media-key' AND
302
- pm.meta_value > 0 AND
303
- pmp.meta_key = 'bp_media_privacy' AND
304
- ( post_mime_type LIKE 'image%' OR post_mime_type LIKE 'audio%' OR post_mime_type LIKE 'video%' OR post_type LIKE 'bp_media_album')
305
- GROUP BY p.post_author,pmp.meta_value order by p.post_author";
306
- $result = $wpdb->get_results($query);
307
- if (!is_array($result))
308
- return false;
309
- $formatted = array();
310
- foreach ($result as $obj) {
311
- $formatted[$obj->post_author][$obj->meta_value] = array(
312
- 'image' => $obj->Images,
313
- 'video' => $obj->Videos,
314
- 'audio' => $obj->Audio,
315
- 'album' => $obj->Albums,
316
- );
317
- }
318
-
319
- foreach ($formatted as $user => $obj) {
320
- bp_update_user_meta($user, 'bp_media_count', $obj);
321
- }
322
- return true;
323
- }
324
-
325
- /* Multisite Save Options - http://wordpress.stackexchange.com/questions/64968/settings-api-in-multisite-missing-update-message#answer-72503 */
326
-
327
- /**
328
- *
329
- * @global type $bp_media_admin
330
- */
331
- public function save_multisite_options() {
332
- global $bp_media_admin;
333
- if (isset($_POST['refresh-count'])) {
334
- $bp_media_admin->update_count();
335
- }
336
- do_action('bp_media_sanitize_settings', $_POST);
337
-
338
- if (isset($_POST['bp_media_options'])) {
339
- bp_update_option('bp_media_options', $_POST['bp_media_options']);
340
- //
341
- // // redirect to settings page in network
342
- wp_redirect(
343
- add_query_arg(
344
- array('page' => 'bp-media-settings', 'updated' => 'true'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
345
- )
346
- );
347
- exit;
348
- }
349
- }
350
-
351
- /* Admin Sidebar */
352
-
353
- /**
354
- *
355
- * @global type $bp_media
356
- */
357
- public function admin_sidebar() {
358
- do_action('bp_media_before_default_admin_widgets');
359
- $current_user = wp_get_current_user();
360
-
361
- $message = sprintf(__('I use @buddypressmedia http://goo.gl/8Upmv on %s', 'buddypress-media'), home_url());
362
- $addons = '<label for="bp-media-add-linkback"><input' . checked(bp_get_option('bp_media_add_linkback', false), true, false) . ' type="checkbox" name="bp-media-add-linkback" value="1" id="bp-media-add-linkback"/> ' . __('Add link to footer', 'buddypress-media') . '</label>
363
- <a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank">' . __('Tweet', 'buddypress-media') . '</a>
364
- <a href="http://wordpress.org/support/view/plugin-reviews/buddypress-media?rate=5#postform" class="button button-rating" target= "_blank">' . __('Rate on WordPress.org', 'buddypress-media') . '</a>';
365
- new BPMediaAdminWidget('spread-the-word', __('Spread the Word', 'buddypress-media'), $addons);
366
-
367
- // $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
368
- // <!-- Identify your business so that you can collect the payments. -->
369
- // <input type="hidden" name="business"
370
- // value="paypal@rtcamp.com">
371
- // <!-- Specify a Donate button. -->
372
- // <input type="hidden" name="cmd" value="_donations">
373
- // <!-- Specify details about the contribution -->
374
- // <input type="hidden" name="item_name" value="BuddyPress Media">
375
- // <label><b>' . __('USD', 'buddypress-media') . '</b></label>
376
- // <input type="text" name="amount" size="3">
377
- // <input type="hidden" name="currency_code" value="USD">
378
- // <!-- Display the payment button. -->
379
- // <input type="hidden" name="cpp_header_image" value="' . BP_MEDIA_URL . 'app/assets/img/rtcamp-logo.png">
380
- // <input type="image" id="rt-donate-button" name="submit" border="0"
381
- // src="' . BP_MEDIA_URL . 'app/assets/img/paypal-donate-button.png"
382
- // alt="PayPal - The safer, easier way to pay online">
383
- // </form><br />
384
- // <center><b>' . __('OR', 'buddypress-media') . '</b></center><br />
385
- // <center>' . __('Use <a href="https://rtcamp.com/store/product-category/buddypress/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media">premium add-ons</a> starting from $9', 'buddypress-media') . '</center>';
386
- // ;
387
- // new BPMediaAdminWidget('donate', __('Donate', 'buddypress-media'), $donate);
388
-
389
- $branding = '<form action="http://rtcamp.us1.list-manage1.com/subscribe/post?u=85b65c9c71e2ba3fab8cb1950&amp;id=9e8ded4470" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
390
- <div class="mc-field-group">
391
- <input type="email" value="' . $current_user->user_email . '" name="EMAIL" placeholder="Email" class="required email" id="mce-EMAIL">
392
- <input style="display:none;" type="checkbox" checked="checked" value="1" name="group[1721][1]" id="mce-group[1721]-1721-0"><label for="mce-group[1721]-1721-0">
393
- <div id="mce-responses" class="clear">
394
- <div class="response" id="mce-error-response" style="display:none"></div>
395
- <div class="response" id="mce-success-response" style="display:none"></div>
396
- </div>
397
- <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
398
- </div>
399
- </form>
400
- <ul id="social">
401
- <li><a href="' . sprintf('%s', 'http://www.facebook.com/rtCamp.solutions/') . '" title="' . __('Become a fan on Facebook', 'buddypress-media') . '" class="bp-media-facebook bp-media-social">' . __('Facebook', 'buddypress-media') . '</a></li>
402
- <li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', 'buddypress-media') . '" class="bp-media-twitter bp-media-social">' . __('Twitter', 'buddypress-media') . '</a></li>
403
- <li><a href="' . sprintf('%s', 'http://feeds.feedburner.com/rtcamp/') . '" title="' . __('Subscribe to our feeds', 'buddypress-media') . '" class="bp-media-rss bp-media-social">' . __('RSS Feed', 'buddypress-media') . '</a></li>
404
- </ul>';
405
- new BPMediaAdminWidget('branding', __('Subscribe', 'buddypress-media'), $branding);
406
-
407
- $news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
408
- new BPMediaAdminWidget('latest-news', __('Latest News', 'buddypress-media'), $news);
409
- do_action('bp_media_after_default_admin_widgets');
410
- }
411
-
412
- public function linkback() {
413
- if (isset($_POST['linkback']) && $_POST['linkback']) {
414
- return bp_update_option('bp_media_add_linkback', true);
415
- } else {
416
- return bp_update_option('bp_media_add_linkback', false);
417
- }
418
- die;
419
- }
420
-
421
- public function convert_videos_mailchimp_send() {
422
- if ($_POST['interested'] == 'Yes' && !empty($_POST['choice'])) {
423
- wp_remote_get(add_query_arg(array('bp-media-convert-videos-form' => 1, 'choice' => $_POST['choice'], 'url' => urlencode($_POST['url']), 'email' => $_POST['email']), 'http://rtcamp.com/'));
424
- } else {
425
- bp_update_option('bp-media-survey', 0);
426
- }
427
- echo 'Thank you for your time.';
428
- die;
429
- }
430
-
431
- public function video_transcoding_survey_response() {
432
- if (isset($_GET['survey-done']) && ($_GET['survey-done'] == md5('survey-done'))) {
433
- bp_update_option('bp-media-survey', 0);
434
- }
435
- }
436
-
437
- public function plugin_meta_premium_addon_link($plugin_meta, $plugin_file, $plugin_data, $status) {
438
- if (plugin_basename(BP_MEDIA_PATH . 'index.php') == $plugin_file)
439
- $plugin_meta[] = '<a href="https://rtcamp.com/store/product-category/buddypress/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media" title="Premium Add-ons">Premium Add-ons</a>';
440
- return $plugin_meta;
441
- }
442
-
443
- public function upload_filetypes_error() {
444
- global $bp_media;
445
- $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
446
- $upload_filetypes = explode(' ', $upload_filetypes);
447
- $flag = false;
448
- if (isset($bp_media->options['images_enabled']) && $bp_media->options['images_enabled']) {
449
- $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
450
- if (!empty($not_supported_image)) {
451
- echo '<div class="error upload-filetype-network-settings-error">
452
- <p>
453
- ' . sprintf(__('You have images enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of %s. Click <a href="%s">here</a> to change your settings manually.', 'buddypress-media'), implode(', ', $not_supported_image), network_admin_url('settings.php#upload_filetypes')) . '
454
- <br /><strong>' . __('Recommended', 'buddypress-media') . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __('Update Network Settings Automatically', 'buddypress-media') . '"> <img style="display:none;" src="' . admin_url('images/wpspin_light.gif') . '" />
455
- </p>
456
- </div>';
457
- $flag = true;
458
- }
459
- }
460
- if (isset($bp_media->options['videos_enabled']) && $bp_media->options['videos_enabled']) {
461
- if (!in_array('mp4', $upload_filetypes)) {
462
- echo '<div class="error upload-filetype-network-settings-error">
463
- <p>
464
- ' . sprintf(__('You have video enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp4. Click <a href="%s">here</a> to change your settings manually.', 'buddypress-media'), network_admin_url('settings.php#upload_filetypes')) . '
465
- <br /><strong>' . __('Recommended', 'buddypress-media') . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __('Update Network Settings Automatically', 'buddypress-media') . '"> <img style="display:none;" src="' . admin_url('images/wpspin_light.gif') . '" />
466
- </p>
467
- </div>';
468
- $flag = true;
469
- }
470
- }
471
- if (isset($bp_media->options['audio_enabled']) && $bp_media->options['audio_enabled']) {
472
- if (!in_array('mp3', $upload_filetypes)) {
473
- echo '<div class="error upload-filetype-network-settings-error"><p>' . sprintf(__('You have audio enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp3. Click <a href="%s">here</a> to change your settings manually.', 'buddypress-media'), network_admin_url('settings.php#upload_filetypes')) . '
474
- <br /><strong>' . __('Recommended', 'buddypress-media') . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __('Update Network Settings Automatically', 'buddypress-media') . '"> <img style="display:none;" src="' . admin_url('images/wpspin_light.gif') . '" />
475
- </p>
476
- </div>';
477
- $flag = true;
478
- }
479
- }
480
- if ($flag) {
481
- ?>
482
- <script type="text/javascript">
483
- jQuery('.upload-filetype-network-settings-error').on('click','.update-network-settings-upload-filetypes', function(){
484
- jQuery('.update-network-settings-upload-filetypes').siblings('img').show();
485
- jQuery('.update-network-settings-upload-filetypes').prop('disabled',true);
486
- jQuery.post(ajaxurl,{action: 'bp_media_correct_upload_filetypes'}, function(response){
487
- if(response){
488
- jQuery('.upload-filetype-network-settings-error:first').after('<div style="display: none;" class="updated bp-media-network-settings-updated-successfully"><p><?php _e('Network settings updated successfully.', 'buddypress-media'); ?></p></div>')
489
- jQuery('.upload-filetype-network-settings-error').remove();
490
- jQuery('.bp-media-network-settings-updated-successfully').show();
491
- }
492
- });
493
- }); </script><?php
494
- }
495
- }
496
-
497
- public function correct_upload_filetypes() {
498
- global $bp_media;
499
- $upload_filetypes_orig = $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
500
- $upload_filetypes = explode(' ', $upload_filetypes);
501
- if (isset($bp_media->options['images_enabled']) && $bp_media->options['images_enabled']) {
502
- $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
503
- if (!empty($not_supported_image)) {
504
- $update_image_support = NULL;
505
- foreach ($not_supported_image as $ns) {
506
- $update_image_support .= ' ' . $ns;
507
- }
508
- if ($update_image_support) {
509
- $upload_filetypes_orig .= $update_image_support;
510
- update_site_option('upload_filetypes', $upload_filetypes_orig);
511
- }
512
- }
513
- }
514
- if (isset($bp_media->options['videos_enabled']) && $bp_media->options['videos_enabled']) {
515
- if (!in_array('mp4', $upload_filetypes)) {
516
- $upload_filetypes_orig .= ' mp4';
517
- update_site_option('upload_filetypes', $upload_filetypes_orig);
518
- }
519
- }
520
- if (isset($bp_media->options['audio_enabled']) && $bp_media->options['audio_enabled']) {
521
- if (!in_array('mp3', $upload_filetypes)) {
522
- $upload_filetypes_orig .= ' mp3';
523
- update_site_option('upload_filetypes', $upload_filetypes_orig);
524
- }
525
- }
526
- echo true;
527
- die();
528
- }
529
-
530
- }
531
-
532
- }
533
- ?>
app/admin/RTMediaAdmin.php ADDED
@@ -0,0 +1,705 @@
1
+ <?php
2
+ /**
3
+ * Description of RTMediaAdmin
4
+ *
5
+ * @package RTMedia
6
+ * @subpackage Admin
7
+ *
8
+ */
9
+ if (!class_exists('RTMediaAdmin')) {
10
+
11
+ class RTMediaAdmin {
12
+
13
+ public $rtmedia_upgrade;
14
+ public $rtmedia_settings;
15
+ public $rtmedia_encoding;
16
+ public $rtmedia_support;
17
+ public $rtmedia_feed;
18
+
19
+ public function __construct() {
20
+ add_action('init', array($this, 'video_transcoding_survey_response'));
21
+ if (is_multisite()) {
22
+ add_action('network_admin_notices', array($this, 'upload_filetypes_error'));
23
+ add_action('admin_notices', array($this, 'upload_filetypes_error'));
24
+ }
25
+ $rtmedia_feed = new RTMediaFeed();
26
+ add_filter( "plugin_action_links_". RTMEDIA_BASE_NAME, array(&$this,'plugin_add_settings_link' ));
27
+ add_action('wp_ajax_rtmedia_fetch_feed', array($rtmedia_feed, 'fetch_feed'), 1);
28
+ $this->rtmedia_support = new RTMediaSupport();
29
+ add_action('wp_ajax_rtmedia_select_request', array($this->rtmedia_support, 'get_form'), 1);
30
+ add_action('wp_ajax_rtmedia_cancel_request', create_function('', 'do_settings_sections("rtmedia-support"); die();'), 1);
31
+ add_action('wp_ajax_rtmedia_submit_request', array($this->rtmedia_support, 'submit_request'), 1);
32
+ add_action('wp_ajax_rtmedia_fetch_feed', array($rtmedia_feed, 'fetch_feed'), 1);
33
+ add_action('wp_ajax_rtmedia_linkback', array($this, 'linkback'), 1);
34
+ add_action('wp_ajax_rtmedia_rt_album_deactivate', 'BPMediaAlbumimporter::bp_album_deactivate', 1);
35
+ add_action('wp_ajax_rtmedia_rt_album_import', 'BPMediaAlbumimporter::bpmedia_ajax_import_callback', 1);
36
+ add_action('wp_ajax_rtmedia_rt_album_import_favorites', 'BPMediaAlbumimporter::bpmedia_ajax_import_favorites', 1);
37
+ add_action('wp_ajax_rtmedia_rt_album_import_step_favorites', 'BPMediaAlbumimporter::bpmedia_ajax_import_step_favorites', 1);
38
+ add_action('wp_ajax_rtmedia_rt_album_cleanup', 'BPMediaAlbumimporter::cleanup_after_install');
39
+ add_action('wp_ajax_rtmedia_convert_videos_form', array($this, 'convert_videos_mailchimp_send'), 1);
40
+ add_action('wp_ajax_rtmedia_correct_upload_filetypes', array($this, 'correct_upload_filetypes'), 1);
41
+ add_filter('plugin_row_meta', array($this, 'plugin_meta_premium_addon_link'), 1, 4);
42
+ if (is_admin()) {
43
+ add_action('admin_enqueue_scripts', array($this, 'ui'));
44
+ //bp_core_admin_hook();
45
+ add_action('admin_menu', array($this, 'menu'),1);
46
+ global $rtmedia;
47
+ if (isset($_POST["rtmedia-options"])){
48
+ if(isset($_POST["rtmedia-options"]["general_showAdminMenu"]) && $_POST["rtmedia-options"]["general_showAdminMenu"] == "1")
49
+ add_action('admin_bar_menu', array($this, 'admin_bar_menu'),100,1);
50
+ }else if(intval($rtmedia->options["general_showAdminMenu"]) == 1){
51
+ add_action('admin_bar_menu', array($this, 'admin_bar_menu'),100,1);
52
+ }
53
+
54
+ if (current_user_can('manage_options'))
55
+ add_action('bp_admin_tabs', array($this, 'tab'));
56
+ if (is_multisite())
57
+ add_action('network_admin_edit_rtmedia', array($this, 'save_multisite_options'));
58
+ }
59
+ $this->rtmedia_settings = new RTMediaSettings();
60
+ $this->rtmedia_encoding = new RTMediaEncoding();
61
+ }
62
+ function plugin_add_settings_link( $links ) {
63
+ $settings_link = '<a href="' . admin_url('admin.php?page=rtmedia-settings') . '">Settings</a>';
64
+ array_push( $links, $settings_link );
65
+ $settings_link = '<a href="' . admin_url('admin.php?page=rtmedia-support') . '">Support</a>';
66
+ array_push( $links, $settings_link );
67
+ return $links;
68
+ }
69
+
70
+
71
+ function admin_bar_menu($admin_bar){
72
+ $admin_bar->add_menu( array(
73
+ 'id' => 'rtMedia',
74
+ 'title' => 'rtMedia',
75
+ 'href' => admin_url('admin.php?page=rtmedia-settings'),
76
+ 'meta' => array(
77
+ 'title' => __('rtMedia'),
78
+ ),
79
+ ));
80
+ $admin_bar->add_menu( array(
81
+ 'id' => 'rt-media-dashborad',
82
+ 'parent' => 'rtMedia',
83
+ 'title' => __('Settings',"rtmedia"),
84
+ 'href' => admin_url('admin.php?page=rtmedia-settings'),
85
+ 'meta' => array(
86
+ 'title' => __('Settings'),
87
+ 'target' => '_self',
88
+ ),
89
+ ));
90
+
91
+ }
92
+ /**
93
+ * Generates the Admin UI.
94
+ *
95
+ * @param string $hook
96
+ */
97
+
98
+ /**
99
+ *
100
+ * @param type $hook
101
+ */
102
+ public function ui($hook) {
103
+ $admin_pages = array(
104
+ 'rtmedia_page_rtmedia-migration',
105
+ 'rtmedia_page_rtmedia-kaltura-settings',
106
+ 'rtmedia_page_rtmedia-ffmpeg-settings',
107
+ 'toplevel_page_rtmedia-settings',
108
+ 'rtmedia_page_rtmedia-addons',
109
+ 'rtmedia_page_rtmedia-support',
110
+ 'rtmedia_page_rtmedia-importer'
111
+ );
112
+ $admin_pages = apply_filters('rtmedia_filter_admin_pages_array', $admin_pages);
113
+
114
+ if(in_array($hook, $admin_pages)) {
115
+ $admin_ajax = admin_url('admin-ajax.php');
116
+
117
+ wp_enqueue_script('bootstrap-switch', RTMEDIA_URL . 'app/assets/js/bootstrap-switch.js', array('jquery'), RTMEDIA_VERSION);
118
+ wp_enqueue_script('slider-tabs', RTMEDIA_URL . 'app/assets/js/jquery.sliderTabs.min.js', array('jquery', 'jquery-effects-core'), RTMEDIA_VERSION);
119
+ wp_enqueue_script('power-tip', RTMEDIA_URL . 'app/assets/js/jquery.powertip.min.js', array('jquery'), RTMEDIA_VERSION);
120
+ wp_enqueue_script('observe-hashchange', RTMEDIA_URL . 'app/assets/js/jquery.observehashchange.pack.js', array('jquery'), RTMEDIA_VERSION);
121
+ wp_enqueue_script('rtmedia-admin', RTMEDIA_URL . 'app/assets/js/admin.js', array('jquery-ui-dialog'), RTMEDIA_VERSION);
122
+ wp_localize_script('rtmedia-admin', 'rtmedia_on_label', __('ON','rtmedia'));
123
+ wp_localize_script('rtmedia-admin', 'rtmedia_off_label', __('OFF','rtmedia'));
124
+ wp_localize_script('rtmedia-admin', 'rtmedia_admin_ajax', $admin_ajax);
125
+ wp_localize_script('rtmedia-admin', 'rtmedia_admin_url', admin_url());
126
+ wp_localize_script('rtmedia-admin', 'rtmedia_admin_url', admin_url());
127
+ $rtmedia_admin_strings = array(
128
+ 'no_refresh' => __('Please do not refresh this page.', 'rtmedia'),
129
+ 'something_went_wrong' => __('Something went wronng. Please <a href onclick="location.reload();">refresh</a> page.', 'rtmedia'),
130
+ 'are_you_sure' => __('This will subscribe you to the free plan.', 'rtmedia'),
131
+ 'disable_encoding' => __('Are you sure you want to disable the encoding service? Make sure you note your api key before disabling it incase you want to activate it in future.', 'rtmedia')
132
+ );
133
+ wp_localize_script('rtmedia-admin', 'rtmedia_admin_strings', $rtmedia_admin_strings);
134
+ wp_localize_script('rtmedia-admin', 'settings_url', add_query_arg(
135
+ array('page' => 'rtmedia-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
136
+ ) . '#privacy_enabled');
137
+ wp_localize_script('rtmedia-admin', 'settings_rt_album_import_url', add_query_arg(
138
+ array('page' => 'rtmedia-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
139
+ ));
140
+ wp_enqueue_style('font-awesome', RTMEDIA_URL . 'app/assets/css/font-awesome.min.css', '', RTMEDIA_VERSION);
141
+ wp_enqueue_style('bootstrap-switch', RTMEDIA_URL . 'app/assets/css/bootstrap-switch.css', '', RTMEDIA_VERSION);
142
+ wp_enqueue_style('slider-tabs', RTMEDIA_URL . 'app/assets/css/jquery.sliderTabs.min.css', '', RTMEDIA_VERSION);
143
+ wp_enqueue_style('power-tip', RTMEDIA_URL . 'app/assets/css/jquery.powertip.min.css', '', RTMEDIA_VERSION);
144
+ wp_enqueue_style('grid-foundation', RTMEDIA_URL . 'app/assets/css/grid-foundation.css', '', RTMEDIA_VERSION);
145
+ wp_enqueue_style('rtmedia-main', RTMEDIA_URL . 'app/assets/css/main.css', '', RTMEDIA_VERSION);
146
+ wp_enqueue_style('rtmedia-admin', RTMEDIA_URL . 'app/assets/css/admin.css', '', RTMEDIA_VERSION);
147
+ wp_enqueue_style('wp-jquery-ui-dialog');
148
+ }
149
+ }
150
+
151
+ /**
152
+ * Admin Menu
153
+ *
154
+ * @global string 'rtmedia'
155
+ */
156
+ public function menu() {
157
+ add_menu_page('rtMedia', 'rtMedia', 'manage_options', 'rtmedia-settings', array($this, 'settings_page'));
158
+ add_submenu_page('rtmedia-settings', __('Settings', 'rtmedia'), __('Settings', 'rtmedia'), 'manage_options', 'rtmedia-settings', array($this, 'settings_page'));
159
+ add_submenu_page('rtmedia-settings', __('Addons', 'rtmedia'), __('Addons', 'rtmedia'), 'manage_options', 'rtmedia-addons', array($this, 'addons_page'));
160
+ add_submenu_page('rtmedia-settings', __('Support', 'rtmedia'), __('Support ', 'rtmedia'), 'manage_options', 'rtmedia-support', array($this, 'support_page'));
161
+ // add_submenu_page('rtmedia-settings', __('Importer', 'rtmedia'), __('Importer', 'rtmedia'), 'manage_options', 'rtmedia-importer', array($this, 'rt_importer_page'));
162
+ // if (!BPMediaPrivacy::is_installed()) {
163
+ // add_submenu_page('rtmedia-settings', __('rtMedia Database Update', 'rtmedia'), __('Update Database', 'rtmedia'), 'manage_options', 'rtmedia-db-update', array($this, 'privacy_page'));
164
+ // }
165
+ }
166
+
167
+ /**
168
+ * Render the BuddyPress Media Settings page
169
+ */
170
+ public function settings_page() {
171
+ $this->render_page('rtmedia-settings', 'rtmedia');
172
+ }
173
+
174
+ public function privacy_page() {
175
+ $this->render_page('rtmedia-privacy');
176
+ }
177
+
178
+ public function rt_importer_page() {
179
+ $this->render_page('rtmedia-importer');
180
+ }
181
+
182
+ public function convert_videos_page() {
183
+ $this->render_page('rtmedia-convert-videos');
184
+ }
185
+
186
+ /**
187
+ * Render the BuddyPress Media Addons page
188
+ */
189
+ public function addons_page() {
190
+ $this->render_page('rtmedia-addons');
191
+ }
192
+
193
+ /**
194
+ * Render the BuddyPress Media Support page
195
+ */
196
+ public function support_page() {
197
+ $this->render_page('rtmedia-support');
198
+ }
199
+
200
+ /**
201
+ *
202
+ * @return type
203
+ */
204
+ static function get_current_tab() {
205
+ return isset($_GET['page']) ? $_GET['page'] : "rtmedia-settings";
206
+ }
207
+
208
+ /**
209
+ * Render BPMedia Settings
210
+ *
211
+ * @global string 'rtmedia'
212
+ */
213
+
214
+ /**
215
+ *
216
+ * @param type $page
217
+ * @param type $option_group
218
+ */
219
+ public function render_page($page, $option_group = NULL) {
220
+ ?>
221
+
222
+ <div class="wrap bp-media-admin <?php echo $this->get_current_tab(); ?>">
223
+ <div id="icon-buddypress-media" class="icon32"><br></div>
224
+ <h2 class="nav-tab-wrapper"><?php $this->rtmedia_tabs(); ?></h2>
225
+ <?php settings_errors(); ?>
226
+ <div class="row">
227
+ <div id="bp-media-settings-boxes" class="columns large-7">
228
+ <?php
229
+ $settings_url = ( is_multisite() ) ? network_admin_url('edit.php?action=' . $option_group) : 'options.php';
230
+ ?>
231
+ <?php if ($option_group) { //$option_group if ($page == "bp-media-settings") action="<?php echo $settings_url; ?>
232
+ <form id="bp_media_settings_form" name="bp_media_settings_form" method="post" enctype="multipart/form-data">
233
+ <div class="bp-media-metabox-holder"><?php
234
+ settings_fields($option_group);
235
+ if ($page == "rtmedia-settings") {
236
+
237
+
238
+ echo '<div id="bpm-settings-tabs">';
239
+ $sub_tabs = $this->settings_sub_tabs();
240
+ RTMediaFormHandler::rtForm_settings_tabs_content($page,$sub_tabs);
241
+ echo '</div>';
242
+ }else{
243
+ do_settings_sections($page);
244
+ }?>
245
+ <div class="clearfix">&nbsp;</div>
246
+ <div class="row">
247
+ <input type="hidden" name="rtmedia-options-save" value="true">
248
+ <input type="submit" id="rtmedia-settings-submit" class="rtmedia-settings-submit button" value="<?php echo __("Save Settings","rtmedia"); ?>">
249
+ </div>
250
+ <div class="rt-link alignright"><?php _e('By', 'rtmedia'); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e('Empowering The Web With WordPress', 'rtmedia'); ?>"><img src="<?php echo RTMEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
251
+ </div>
252
+ </form><?php } else {
253
+ ?>
254
+ <div class="bp-media-metabox-holder">
255
+
256
+ <?php
257
+ if( $page == 'rtmedia-addons' )
258
+ RTMediaAddon::render_addons ($page);
259
+ else
260
+ do_settings_sections($page);
261
+ ?>
262
+ <?php
263
+ do_action('rtmedia_admin_page_insert', $page);
264
+ ?>
265
+ <div class="rt-link alignright"><?php _e('By', 'rtmedia'); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e('Empowering The Web With WordPress', 'rtmedia'); ?>"><img src="<?php echo RTMEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
266
+ </div><?php
267
+ do_action('rtmedia_admin_page_append', $page);
268
+ }
269
+ ?>
270
+
271
+
272
+ </div><!-- .bp-media-settings-boxes -->
273
+ <div class="metabox-holder bp-media-metabox-holder columns large-3">
274
+ <?php $this->admin_sidebar(); ?>
275
+ </div>
276
+ </div><!-- .metabox-holder -->
277
+ </div><!-- .bp-media-admin --><?php
278
+ }
279
+
280
+ /**
281
+ * Adds a tab for Media settings in the BuddyPress settings page
282
+ *
283
+ * @global type $bp_media
284
+ */
285
+ public function tab() {
286
+
287
+ $tabs_html = '';
288
+ $idle_class = 'nav-tab';
289
+ $active_class = 'nav-tab nav-tab-active';
290
+ $tabs = array();
291
+
292
+ // Check to see which tab we are on
293
+ $tab = $this->get_current_tab();
294
+ /* rtMedia */
295
+ $tabs[] = array(
296
+ 'href' => get_admin_url(null,add_query_arg(array('page' => 'rtmedia-settings'), 'admin.php')),
297
+ 'title' => __('rtMedia', 'rtmedia'),
298
+ 'name' => __('rtMedia', 'rtmedia'),
299
+ 'class' => ($tab == 'rtmedia-settings' || $tab == 'rtmedia-addons' || $tab == 'rtmedia-support' || $tab == 'rtmedia-importer') ? $active_class : $idle_class
300
+ );
301
+
302
+
303
+ foreach ($tabs as $tab) {
304
+ $tabs_html.= '<a id="bp-media" title= "' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . '">' . $tab['name'] . '</a>';
305
+ }
306
+ echo $tabs_html;
307
+ }
308
+
309
+ public function rtmedia_tabs($active_tab = '') {
310
+ // Declare local variables
311
+ $tabs_html = '';
312
+ $idle_class = 'nav-tab';
313
+ $active_class = 'nav-tab nav-tab-active';
314
+
315
+ // Setup core admin tabs
316
+ $tabs = array(
317
+ array(
318
+ 'href' => get_admin_url(null, add_query_arg(array('page' => 'rtmedia-settings'), 'admin.php')),
319
+ 'name' => __('Settings', 'rtmedia'),
320
+ 'slug' => 'rtmedia-settings'
321
+ ),
322
+ array(
323
+ 'href' => get_admin_url(null, add_query_arg(array('page' => 'rtmedia-addons'), 'admin.php')),
324
+ 'name' => __('Addons', 'rtmedia'),
325
+ 'slug' => 'rtmedia-addons'
326
+ ),
327
+ array(
328
+ 'href' => get_admin_url(null, add_query_arg(array('page' => 'rtmedia-support'), 'admin.php')),
329
+ 'name' => __('Support', 'rtmedia'),
330
+ 'slug' => 'rtmedia-support'
331
+ )//,
332
+ // array(
333
+ // 'href' => get_admin_url(null, add_query_arg(array('page' => 'rtmedia-importer'), 'admin.php')),
334
+ // 'name' => __('Importer', 'rtmedia'),
335
+ // 'slug' => 'rtmedia-importer'
336
+ // )
337
+ );
338
+
339
+ $tabs = apply_filters('media_add_tabs', $tabs);
340
+
341
+ // Loop through tabs and build navigation
342
+ foreach (array_values($tabs) as $tab_data) {
343
+ $is_current = (bool) ( $tab_data['slug'] == $this->get_current_tab() );
344
+ $tab_class = $is_current ? $active_class : $idle_class;
345
+ $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
346
+ }
347
+
348
+ // Output the tabs
349
+ echo $tabs_html;
350
+
351
+ // // Do other fun things
352
+ // do_action('bp_media_admin_tabs');
353
+ }
354
+
355
+ public function settings_content_tabs($page) {
356
+ global $wp_settings_sections, $wp_settings_fields;
357
+
358
+ if (!isset($wp_settings_sections) || !isset($wp_settings_sections[$page]))
359
+ return;
360
+
361
+ foreach ((array) $wp_settings_sections[$page] as $section) {
362
+ if ($section['title'])
363
+ echo "<h3>{$section['title']}</h3>\n";
364
+
365
+ if ($section['callback'])
366
+ call_user_func($section['callback'], $section);
367
+
368
+ if (!isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]))
369
+ continue;
370
+ echo '<table class="form-table">';
371
+ do_settings_fields($page, $section['id']);
372
+ echo '</table>';
373
+ }
374
+ }
375
+
376
+ /**
377
+ * Adds a sub tabs to the BuddyPress Media settings page
378
+ *
379
+ * @global type $bp_media
380
+ */
381
+ public function settings_sub_tabs() {
382
+ $tabs_html = '';
383
+ $tabs = array();
384
+
385
+ // Check to see which tab we are on
386
+ $tab = $this->get_current_tab();
387
+ /* rtMedia */
388
+ $tabs[] = array(
389
+ 'href' => '#rtmedia-general',
390
+ 'icon' => 'icon-cogs',
391
+ 'title' => __('rtMedia General', 'rtmedia'),
392
+ 'name' => __('General', 'rtmedia'),
393
+ 'callback' => array('RTMediaFormHandler', 'general_content')
394
+ );
395
+ $tabs[] = array(
396
+ 'href' => '#rtmedia-types',
397
+ 'icon' => 'icon-film',
398
+ 'title' => __('rtMedia Types', 'rtmedia'),
399
+ 'name' => __('Types', 'rtmedia'),
400
+ 'callback' => array('RTMediaFormHandler', 'types_content')
401
+ );
402
+
403
+ $tabs[] = array(
404
+ 'href' => '#rtmedia-sizes',
405
+ 'icon' => 'icon-resize-full',
406
+ 'title' => __('rtMedia Sizes', 'rtmedia'),
407
+ 'name' => __('Sizes', 'rtmedia'),
408
+ 'callback' => array('RTMediaFormHandler', 'sizes_content')
409
+ );
410
+
411
+ $tabs[] = array(
412
+ 'href' => '#rtmedia-privacy',
413
+ 'icon' => 'icon-lock',
414
+ 'title' => __('rtMedia Privacy', 'rtmedia'),
415
+ 'name' => __('Privacy', 'rtmedia'),
416
+ 'callback' => array('RTMediaFormHandler', 'privacy_content')
417
+ );
418
+
419
+ $tabs[] = array(
420
+ 'href' => '#rtmedia-bp',
421
+ 'icon' => 'icon-group',
422
+ 'title' => __('rtMedia BuddyPress', 'rtmedia'),
423
+ 'name' => __('BuddyPress', 'rtmedia'),
424
+ 'callback' => array('RTMediaFormHandler', 'buddypress_content') //change it to BuddyPress Content
425
+ );
426
+
427
+ $tabs = apply_filters('rtmedia_add_settings_sub_tabs', $tabs, $tab);
428
+ $tabs_html .= '<ul>';
429
+ foreach ($tabs as $tab) {
430
+
431
+ $icon = '';
432
+ if (isset($tab['icon']) && !empty($tab['icon']))
433
+ $icon = '<i class="' . $tab['icon'] . '"></i>';
434
+
435
+ $tabs_html.= '<li><a id="tab-'.substr($tab['href'], 1).'" title="' . $tab['title'] . '" href="' . $tab['href'] . '" class="rtmedia-tab-title ' . sanitize_title($tab['name']) . '">' . $icon . ' ' . $tab['name'] . '</a></li>';
436
+ }
437
+ $tabs_html .= '</ul>';
438
+
439
+ echo $tabs_html;
440
+ return $tabs;
441
+ }
442
+
443
+ /*
444
+ * Updates the media count of all users.
445
+ */
446
+
447
+ /**
448
+ *
449
+ * @global type $wpdb
450
+ * @return boolean
451
+ */
452
+ public function update_count() {
453
+ global $wpdb;
454
+
455
+ $query =
456
+ "SELECT
457
+ p.post_author,pmp.meta_value,
458
+ SUM(CASE WHEN post_mime_type LIKE 'image%' THEN 1 ELSE 0 END) as Images,
459
+ SUM(CASE WHEN post_mime_type LIKE 'music%' THEN 1 ELSE 0 END) as Music,
460
+ SUM(CASE WHEN post_mime_type LIKE 'video%' THEN 1 ELSE 0 END) as Videos,
461
+ SUM(CASE WHEN post_type LIKE 'bp_media_album' THEN 1 ELSE 0 END) as Albums
462
+ FROM
463
+ $wpdb->posts p inner join $wpdb->postmeta pm on pm.post_id = p.id INNER JOIN $wpdb->postmeta pmp
464
+ on pmp.post_id = p.id WHERE
465
+ pm.meta_key = 'bp-media-key' AND
466
+ pm.meta_value > 0 AND
467
+ pmp.meta_key = 'bp_media_privacy' AND
468
+ ( post_mime_type LIKE 'image%' OR post_mime_type LIKE 'music%' OR post_mime_type LIKE 'video%' OR post_type LIKE 'bp_media_album')
469
+ GROUP BY p.post_author,pmp.meta_value order by p.post_author";
470
+ $result = $wpdb->get_results($query);
471
+ if (!is_array($result))
472
+ return false;
473
+ $formatted = array();
474
+ foreach ($result as $obj) {
475
+ $formatted[$obj->post_author][$obj->meta_value] = array(
476
+ 'image' => $obj->Images,
477
+ 'video' => $obj->Videos,
478
+ 'music' => $obj->Music,
479
+ 'album' => $obj->Albums,
480
+ );
481
+ }
482
+
483
+ foreach ($formatted as $user => $obj) {
484
+ update_user_meta($user, 'rtmedia_count', $obj);
485
+ }
486
+ return true;
487
+ }
488
+
489
+ /* Multisite Save Options - http://wordpress.stackexchange.com/questions/64968/settings-api-in-multisite-missing-update-message#answer-72503 */
490
+
491
+ /**
492
+ *
493
+ * @global type $bp_media_admin
494
+ */
495
+ public function save_multisite_options() {
496
+ global $rtmedia_admin;
497
+ if (isset($_POST['refresh-count'])) {
498
+ $rtmedia_admin->update_count();
499
+ }
500
+ do_action('rtmedia_sanitize_settings', $_POST);
501
+
502
+ if (isset($_POST['rtmedia_options'])) {
503
+ update_site_option('rtmedia_options', $_POST['rtmedia_options']);
504
+ //
505
+ // // redirect to settings page in network
506
+ wp_redirect(
507
+ add_query_arg(
508
+ array('page' => 'rtmedia-settings', 'updated' => 'true'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
509
+ )
510
+ );
511
+ exit;
512
+ }
513
+ }
514
+
515
+ /* Admin Sidebar */
516
+
517
+ /**
518
+ *
519
+ * @global type $bp_media
520
+ */
521
+ public function admin_sidebar() {
522
+ do_action('rtmedia_before_default_admin_widgets');
523
+ $current_user = wp_get_current_user();
524
+ // echo '<p><a target="_blank" href="http://rtcamp.com/news/buddypress-media-review-contest/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media"><img src="' . RTMEDIA_URL . 'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a></p>';
525
+ // $contest = '<a target="_blank" href="http://rtcamp.com/news/buddypress-media-review-contest/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media"><img src="'.RTMEDIA_URL.'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a>';
526
+ // new BPMediaAdminWidget('bpm-contest', __('', 'rtmedia'), $contest);
527
+
528
+ $message = sprintf(__('I use @buddypressmedia http://goo.gl/8Upmv on %s', 'rtmedia'), home_url());
529
+ $addons = '<div id="social" class="row">
530
+ <label class="columns large-6 large-offset-3" for="bp-media-add-linkback"><input' . checked(get_site_option('rtmedia-add-linkback', false), true, false) . ' type="checkbox" name="bp-media-add-linkback" value="1" id="bp-media-add-linkback"/> ' . __('Add link to footer', 'rtmedia') . '</label>
531
+ <div class="row">
532
+ <div class="columns large-6"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Frtcamp.com%2Fbuddypress-media%2F&amp;send=false&amp;layout=button_count&amp;width=72&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:21px; margin-top: 5px;" allowTransparency="true"></iframe></div>
533
+ <div class="columns large-6"><a href="https://www.facebook.com/sharer/sharer.php?u=http://rtcamp.com/buddypress-media/" class="button" target="_blank"> <i class="icon-facebook"></i> ' . __('Share', 'rtmedia') . '</a></div>
534
+ <div class="columns large-6"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="//platform.twitter.com/widgets/follow_button.html?screen_name=buddypressmedia&show_count=false" style="width:62px; height:21px; margin-top: 5px;"></iframe></div>
535
+ <div class="columns large-6"><a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank"><i class="icon-twitter"></i> ' . __('Tweet', 'rtmedia') . '</a></div>
536
+ <div class="columns large-6"><a href="http://wordpress.org/support/view/plugin-reviews/buddypress-media?rate=5#postform" class="button bpm-wp-button" target= "_blank"><span class="bpm-wp-icon">&nbsp;</span> ' . __('Review', 'rtmedia') . '</a></div>
537
+ <div class="columns large-6"><a href="' . sprintf('%s', 'http://feeds.feedburner.com/rtcamp/') . '" title="' . __('Subscribe to our feeds', 'rtmedia') . '" class="button" target="_blank"><i class="bp-media-rss icon-rss"></i> ' . __('Feeds', 'rtmedia') . '</a></div>
538
+ </div>
539
+ </div>';
540
+ //<li><a href="' . sprintf('%s', 'http://www.facebook.com/rtCamp.solutions/') . '" title="' . __('Become a fan on Facebook', 'rtmedia') . '" class="bp-media-facebook bp-media-social">' . __('Facebook', 'rtmedia') . '</a></li>
541
+ //<li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', 'rtmedia') . '" class="bp-media-twitter bp-media-social">' . __('Twitter', 'rtmedia') . '</a></li> ;
542
+ new RTMediaAdminWidget('spread-the-word', __('Spread the Word', 'rtmedia'), $addons);
543
+
544
+ // $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
545
+ // <!-- Identify your business so that you can collect the payments. -->
546
+ // <input type="hidden" name="business"
547
+ // value="paypal@rtcamp.com">
548
+ // <!-- Specify a Donate button. -->
549
+ // <input type="hidden" name="cmd" value="_donations">
550
+ // <!-- Specify details about the contribution -->
551
+ // <input type="hidden" name="item_name" value="BuddyPress Media">
552
+ // <label><b>' . __('USD', 'rtmedia') . '</b></label>
553
+ // <input type="text" name="amount" size="3">
554
+ // <input type="hidden" name="currency_code" value="USD">
555
+ // <!-- Display the payment button. -->
556
+ // <input type="hidden" name="cpp_header_image" value="' . RTMEDIA_URL . 'app/assets/img/rtcamp-logo.png">
557
+ // <input type="image" id="rt-donate-button" name="submit" border="0"
558
+ // src="' . RTMEDIA_URL . 'app/assets/img/paypal-donate-button.png"
559
+ // alt="PayPal - The safer, easier way to pay online">
560
+ // </form><br />
561
+ // <center><b>' . __('OR', 'rtmedia') . '</b></center><br />
562
+ // <center>' . __('Use <a href="https://rtcamp.com/store/product-category/buddypress/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media">premium add-ons</a> starting from $9', 'rtmedia') . '</center>';
563
+ // ;
564
+ // new BPMediaAdminWidget('donate', __('Donate', 'rtmedia'), $donate);
565
+
566
+ $branding = '<form action="http://rtcamp.us1.list-manage1.com/subscribe/post?u=85b65c9c71e2ba3fab8cb1950&amp;id=9e8ded4470" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
567
+ <div class="mc-field-group">
568
+ <input type="email" value="' . $current_user->user_email . '" name="EMAIL" placeholder="Email" class="required email" id="mce-EMAIL">
569
+ <input style="display:none;" type="checkbox" checked="checked" value="1" name="group[1721][1]" id="mce-group[1721]-1721-0"><label for="mce-group[1721]-1721-0">
570
+ <div id="mce-responses" class="clear">
571
+ <div class="response" id="mce-error-response" style="display:none"></div>
572
+ <div class="response" id="mce-success-response" style="display:none"></div>
573
+ </div>
574
+ <input type="submit" value="'.__('Subscribe','rtmedia').'" name="subscribe" id="mc-embedded-subscribe" class="button">
575
+ </div>
576
+ </form>';
577
+ new RTMediaAdminWidget('branding', __('Subscribe', 'rtmedia'), $branding);
578
+
579
+ $news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
580
+ new RTMediaAdminWidget('latest-news', __('Latest News', 'rtmedia'), $news);
581
+ do_action('rtmedia_after_default_admin_widgets');
582
+ }
583
+
584
+ public function linkback() {
585
+ if (isset($_POST['linkback']) && $_POST['linkback']) {
586
+ return update_site_option('rtmedia-add-linkback', true);
587
+ } else {
588
+ return update_site_option('rtmedia-add-linkback', false);
589
+ }
590
+ die;
591
+ }
592
+
593
+ public function convert_videos_mailchimp_send() {
594
+ if ($_POST['interested'] == 'Yes' && !empty($_POST['choice'])) {
595
+ 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/'));
596
+ } else {
597
+ update_site_option('rtmedia-survey', 0);
598
+ }
599
+ echo 'Thank you for your time.';
600
+ die;
601
+ }
602
+
603
+ public function video_transcoding_survey_response() {
604
+ if (isset($_GET['survey-done']) && ($_GET['survey-done'] == md5('survey-done'))) {
605
+ update_site_option('rtmedia-survey', 0);
606
+ }
607
+ }
608
+
609
+ public function plugin_meta_premium_addon_link($plugin_meta, $plugin_file, $plugin_data, $status) {
610
+ if (plugin_basename(RTMEDIA_PATH . 'index.php') == $plugin_file)
611
+ $plugin_meta[] = '<a href="https://rtcamp.com/store/product-category/buddypress/?utm_source=dashboard&#038;utm_medium=plugin&#038;utm_campaign=buddypress-media" title="Premium Add-ons">Premium Add-ons</a>';
612
+ return $plugin_meta;
613
+ }
614
+
615
+ public function upload_filetypes_error() {
616
+ global $rtmedia;
617
+ $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
618
+ $upload_filetypes = explode(' ', $upload_filetypes);
619
+ $flag = false;
620
+ if (isset($rtmedia->options['images_enabled']) && $rtmedia->options['images_enabled']) {
621
+ $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
622
+ if (!empty($not_supported_image)) {
623
+ echo '<div class="error upload-filetype-network-settings-error">
624
+ <p>
625
+ ' . sprintf(__('You have images enabled on rtMedia but your network allowed filetypes does not allow uploading of %s. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia'), implode(', ', $not_supported_image), network_admin_url('settings.php#upload_filetypes')) . '
626
+ <br /><strong>' . __('Recommended', 'rtmedia') . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __('Update Network Settings Automatically', 'rtmedia') . '"> <img style="display:none;" src="' . admin_url('images/wpspin_light.gif') . '" />
627
+ </p>
628
+ </div>';
629
+ $flag = true;
630
+ }
631
+ }
632
+ if (isset($rtmedia->options['videos_enabled']) && $rtmedia->options['videos_enabled']) {
633
+ if (!in_array('mp4', $upload_filetypes)) {
634
+ echo '<div class="error upload-filetype-network-settings-error">
635
+ <p>
636
+ ' . sprintf(__('You have video enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp4. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia'), network_admin_url('settings.php#upload_filetypes')) . '
637
+ <br /><strong>' . __('Recommended', 'rtmedia') . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __('Update Network Settings Automatically', 'rtmedia') . '"> <img style="display:none;" src="' . admin_url('images/wpspin_light.gif') . '" />
638
+ </p>
639
+ </div>';
640
+ $flag = true;
641
+ }
642
+ }
643
+ if (isset($rtmedia->options['audio_enabled']) && $rtmedia->options['audio_enabled']) {
644
+ if (!in_array('mp3', $upload_filetypes)) {
645
+ echo '<div class="error upload-filetype-network-settings-error"><p>' . sprintf(__('You have audio enabled on BuddyPress Media but your network allowed filetypes does not allow uploading of mp3. Click <a href="%s">here</a> to change your settings manually.', 'rtmedia'), network_admin_url('settings.php#upload_filetypes')) . '
646
+ <br /><strong>' . __('Recommended', 'rtmedia') . ':</strong> <input type="button" class="button update-network-settings-upload-filetypes" class="button" value="' . __('Update Network Settings Automatically', 'rtmedia') . '"> <img style="display:none;" src="' . admin_url('images/wpspin_light.gif') . '" />
647
+ </p>
648
+ </div>';
649
+ $flag = true;
650
+ }
651
+ }
652
+ if ($flag) {
653
+ ?>
654
+ <script type="text/javascript">
655
+ jQuery('.upload-filetype-network-settings-error').on('click','.update-network-settings-upload-filetypes', function(){
656
+ jQuery('.update-network-settings-upload-filetypes').siblings('img').show();
657
+ jQuery('.update-network-settings-upload-filetypes').prop('disabled',true);
658
+ jQuery.post(ajaxurl,{action: 'rtmedia_correct_upload_filetypes'}, function(response){
659
+ if(response){
660
+ jQuery('.upload-filetype-network-settings-error:first').after('<div style="display: none;" class="updated rtmedia-network-settings-updated-successfully"><p><?php _e('Network settings updated successfully.', 'rtmedia'); ?></p></div>')
661
+ jQuery('.upload-filetype-network-settings-error').remove();
662
+ jQuery('.bp-media-network-settings-updated-successfully').show();
663
+ }
664
+ });
665
+ }); </script><?php
666
+ }
667
+ }
668
+
669
+ public function correct_upload_filetypes() {
670
+ global $rtmedia;
671
+ $upload_filetypes_orig = $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
672
+ $upload_filetypes = explode(' ', $upload_filetypes);
673
+ if (isset($rtmedia->options['images_enabled']) && $rtmedia->options['images_enabled']) {
674
+ $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
675
+ if (!empty($not_supported_image)) {
676
+ $update_image_support = NULL;
677
+ foreach ($not_supported_image as $ns) {
678
+ $update_image_support .= ' ' . $ns;
679
+ }
680
+ if ($update_image_support) {
681
+ $upload_filetypes_orig .= $update_image_support;
682
+ update_site_option('upload_filetypes', $upload_filetypes_orig);
683
+ }
684
+ }
685
+ }
686
+ if (isset($rtmedia->options['videos_enabled']) && $rtmedia->options['videos_enabled']) {
687
+ if (!in_array('mp4', $upload_filetypes)) {
688
+ $upload_filetypes_orig .= ' mp4';
689
+ update_site_option('upload_filetypes', $upload_filetypes_orig);
690
+ }
691
+ }
692
+ if (isset($rtmedia->options['audio_enabled']) && $rtmedia->options['audio_enabled']) {
693
+ if (!in_array('mp3', $upload_filetypes)) {
694
+ $upload_filetypes_orig .= ' mp3';
695
+ update_site_option('upload_filetypes', $upload_filetypes_orig);
696
+ }
697
+ }
698
+ echo true;
699
+ die();
700
+ }
701
+
702
+ }
703
+
704
+ }
705
+ ?>
app/admin/RTMediaFormHandler.php ADDED
@@ -0,0 +1,482 @@
1
+ <?php
2
+
3
+ /*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+
8
+ /**
9
+ * Description of RTMediaFormHandler
10
+ *
11
+ * @author udit
12
+ */
13
+ class RTMediaFormHandler {
14
+
15
+ public static function checkbox($args) {
16
+
17
+ global $rtmedia;
18
+ $options = $rtmedia->options;
19
+ $defaults = array(
20
+ 'key' => '',
21
+ 'desc' => '',
22
+ 'show_desc' => false
23
+ );
24
+ $args = wp_parse_args($args, $defaults);
25
+ extract($args);
26
+
27
+ if (!isset($value)) {
28
+ trigger_error(__('Please provide "value" in the argument.', 'rtmedia'));
29
+ return;
30
+ }
31
+
32
+ if (!empty($key)) {
33
+ $args['name'] = 'rtmedia-options[' . $key . ']';
34
+ }
35
+
36
+ $args['rtForm_options'] = array(array('' => 1, 'checked' => $value));
37
+
38
+ $chkObj = new rtForm();
39
+ // echo $chkObj->get_checkbox($args);
40
+ echo $chkObj->get_switch($args);
41
+ // echo $chkObj->get_switch_square($args);
42
+ }
43
+
44
+ public static function radio($args) {
45
+
46
+ global $rtmedia;
47
+ $options = $rtmedia->options;
48
+ $defaults = array(
49
+ 'key' => '',
50
+ 'radios' => array(),
51
+ 'default' => '',
52
+ 'show_desc' => false
53
+ );
54
+ $args = wp_parse_args($args, $defaults);
55
+ extract($args);
56
+
57
+ if (2 > count($radios)) {
58
+ trigger_error(__('Need to specify atleast to radios else use a checkbox instead', 'rtmedia'));
59
+ return;
60
+ }
61
+
62
+ if (!empty($key))
63
+ $args['name'] = 'rtmedia-options[' . $key . ']';
64
+
65
+ $args['rtForm_options'] = array();
66
+ foreach ($radios as $value => $key) {
67
+ $args['rtForm_options'][] = array(
68
+ $key => $value,
69
+ 'checked' => ($default == $value) ? true : false
70
+ );
71
+ }
72
+
73
+ $objRad = new rtForm();
74
+ echo $objRad->get_radio($args);
75
+ }
76
+
77
+ public static function dimensions($args) {
78
+
79
+ $dmnObj = new rtDimensions();
80
+ echo $dmnObj->get_dimensions($args);
81
+ }
82
+
83
+ public static function number($args) {
84
+ global $rtmedia;
85
+ $options = $rtmedia->options;
86
+ $defaults = array(
87
+ 'key' => '',
88
+ 'desc' => ''
89
+ );
90
+ $args = wp_parse_args($args, $defaults);
91
+ extract($args);
92
+
93
+ if (!isset($value)) {
94
+ trigger_error(__('Please provide "value" in the argument.', 'rtmedia'));
95
+ return;
96
+ }
97
+
98
+ if (!empty($key)) {
99
+ $args['name'] = 'rtmedia-options[' . $key . ']';
100
+ }
101
+
102
+ $args['value'] = $value;
103
+
104
+ $numObj = new rtForm();
105
+ echo $numObj->get_number($args);
106
+ }
107
+
108
+ static function extract_settings($section_name,$options) {
109
+ $section = array();
110
+ foreach ($options as $key => $value) {
111
+ if(strncmp($key, $section_name, strlen($section_name))==0)
112
+ $section[$key] = $value;
113
+ }
114
+ return $section;
115
+ }
116
+
117
+ static function general_render_options($options) {
118
+
119
+ $render = array(
120
+ // 'general_enableAlbums' => array(
121
+ // 'title' => __('Albums','rtmedia'),
122
+ // 'callback' => array('RTMediaFormHandler', 'checkbox'),
123
+ // 'args' => array(
124
+ // 'key' => 'general_enableAlbums',
125
+ // 'value' => $options['general_enableAlbums'],
126
+ // 'desc' => __('Enable Albums in rtMedia','rtmedia')
127
+ // )
128
+ // ),
129
+ 'general_enableComments' => array(
130
+ 'title' => __('Comments','rtmedia'),
131
+ 'callback' => array('RTMediaFormHandler', 'checkbox'),
132
+ 'args' => array(
133
+ 'key' => 'general_enableComments',
134
+ 'value' => $options['general_enableComments'],
135
+ 'desc' => __('Enable Comments in rtMedia','rtmedia')
136
+ )
137
+ ),
138
+ 'general_downloadButton' => array(
139
+ 'title' => __('Download Button','rtmedia'),
140
+ 'callback' => array('RTMediaFormHandler', 'checkbox'),
141
+ 'args' => array(
142
+ 'key' => 'general_downloadButton',
143
+ 'value' => $options['general_downloadButton'],
144
+ 'desc' => __('Display download button under media','rtmedia')
145
+ )
146
+ ),
147
+ 'general_enableLightbox' => array(
148
+ 'title' => __('Lightbox','rtmedia'),
149
+ 'callback' => array('RTMediaFormHandler', 'checkbox'),
150
+ 'args' => array(
151
+ 'key' => 'general_enableLightbox',
152
+ 'value' => $options['general_enableLightbox'],
153
+ 'desc' => __('Enable Lighbox on Media','rtmedia')
154
+ )
155
+ ),
156
+ 'general_perPageMedia' => array(
157
+ 'title' => __('Number of Media Per Page','rtmedia'),
158
+ 'callback' => array('RTMediaFormHandler', 'number'),
159
+ 'args' => array(
160
+ 'key' => 'general_perPageMedia',
161
+ 'value' => $options['general_perPageMedia']
162
+ )
163
+ ),
164
+ // 'general_enableMediaEndPoint' => array(
165
+ // 'title' => __('Enable Media End Point for users','rtmedia'),
166
+ // 'callback' => array('RTMediaFormHandler', 'checkbox'),
167
+ // 'args' => array(
168
+ // 'key' => 'general_enableMediaEndPoint',
169
+ // 'value' => $options['general_enableMediaEndPoint'],
170
+ // 'desc' => __('Users can access their media on media end point','rtmedia')
171
+ // )
172
+ // ),
173
+ 'general_showAdminMenu' => array(
174
+ 'title' => __('Admin Bar Menu','rtmedia'),
175
+ 'callback' => array('RTMediaFormHandler', 'checkbox'),
176
+ 'args' => array(
177
+ 'key' => 'general_showAdminMenu',
178
+ 'value' => $options['general_showAdminMenu'],
179
+ 'desc' => __('Enable menu in WordPress admin bar','rtmedia')
180
+ )
181
+ )
182
+ );
183
+
184
+ return $render;
185
+ }
186
+
187
+ public static function general_content() {
188
+ global $rtmedia;
189
+ $options = self::extract_settings('general', $rtmedia->options);
190
+
191
+ $render_options = self::general_render_options($options);
192
+
193
+ foreach ($render_options as $key => $option) { ?>
194
+ <div class="row section">
195
+ <div class="columns large-2"> <?php echo $option['title']; ?> </div>
196
+ <div class="columns large-4">
197
+ <?php call_user_func($option['callback'], $option['args']); ?>
198
+ </div>
199
+ </div>
200
+ <div class="clearfix">&nbsp;</div>
201
+ <?php }
202
+ }
203
+
204
+ static function get_type_details($allowed_types, $key) {
205
+ foreach ($allowed_types as $type) {
206
+ if($type['name']==$key) {
207
+ $data = array(
208
+ 'name' => $type['label'],
209
+ 'extn' => $type['extn']
210
+ );
211
+ return $data;
212
+ }
213
+ }
214
+ }
215
+
216
+ static function types_render_options($options) {
217
+ global $rtmedia;
218
+
219
+ $render = array();
220
+
221
+ foreach ($options as $key => $value) {
222
+ $data = explode('_', $key);
223
+ if(!isset($render[$data[1]]))
224
+ $render[$data[1]] = self::get_type_details($rtmedia->allowed_types, $data[1]);
225
+ }
226
+ foreach ($options as $key => $value) {
227
+ $data = explode('_', $key);
228
+ $render[$data[1]][$data[2]] = $value;
229
+ }
230
+
231
+ return $render;
232
+ }
233
+
234
+ public static function types_content() {
235
+
236
+ global $rtmedia;
237
+ $options = self::extract_settings('allowedTypes', $rtmedia->options);
238
+
239
+ $render_data = self::types_render_options($options);
240
+ ?>
241
+ <div class="rt-table large-12">
242
+ <div class="row rt-header">
243
+ <h4 class="columns large-2"><?php echo __("Media Type","rtmedia") ?></h4>
244
+ <h4 class="columns large-2 rtm-show-tooltip" title="<?php echo __("Allows you to upload a particular media type on your post.","rtmedia"); ?>"><abbr><?php echo __("Allow Upload","rtmedia"); ?></abbr></h4>
245
+ <h4 class="columns large-2 rtm-show-tooltip" title="<?php echo __("Put a specific media as a featured content on the post.","rtmedia"); ?>"><abbr><?php echo __("Set Featured","rtmedia"); ?></abbr></h4>
246
+ <h4 class="columns large-3 rtm-show-tooltip" title="<?php echo __("File extensions that can be uploaded on the website.","rtmedia"); ?>"><abbr><?php echo __("File Extensions","rtmedia"); ?></abbr></h4>
247
+ </div>
248
+ <?php
249
+ $even = 0;
250
+ foreach ($render_data as $key=>$section) {
251
+ if( ++$even%2 )
252
+ echo '<div class="row rt-odd">';
253
+ else
254
+ echo '<div class="row rt-even">';
255
+
256
+ echo '<div class="columns large-2">' . $section['name'] . '</div>';
257
+ $args = array('key' => 'allowedTypes_'.$key.'_enabled', 'value' => $section['enabled']);
258
+ echo '<div class="columns large-2">';
259
+ self::checkbox($args);
260
+ echo '</div>';
261
+ $args = array('key' => 'allowedTypes_'.$key.'_featured', 'value' => $section['featured']);
262
+ echo '<div class="columns large-2">';
263
+ self::checkbox($args);
264
+ echo '</div>';
265
+ echo '<div class="columns large-3">' . implode(', ', $section['extn']) . '</div>';
266
+ echo '</div>';
267
+ }
268
+ echo '</div>';
269
+ }
270
+
271
+ static function sizes_render_options($options) {
272
+
273
+ $render = array();
274
+ foreach ($options as $key => $value) {
275
+ $data = explode('_', $key);
276
+ if(!isset($render[$data[1]])) {
277
+ $render[$data[1]] = array();
278
+ $render[$data[1]]['title'] = __($data[1],"rtmedia");
279
+ }
280
+ if(!isset($render[$data[1]][$data[2]])) {
281
+ $render[$data[1]][$data[2]] = array();
282
+ $render[$data[1]][$data[2]]['title'] = __($data[2],"rtmedia");
283
+ }
284
+ $render[$data[1]][$data[2]][$data[3]] = $value;
285
+ }
286
+ return $render;
287
+ }
288
+
289
+ public static function sizes_content() {
290
+
291
+ global $rtmedia;
292
+ $options = self::extract_settings('defaultSizes',$rtmedia->options);
293
+ $render_data = self::sizes_render_options($options);
294
+
295
+ //container
296
+ echo '<div class="rt-table large-12">';
297
+
298
+ //header
299
+ echo '<div class="rt-header row">';
300
+ echo '<h4 class="columns large-3">' . __("Category","rtmedia") . '</h4>';
301
+ echo '<h4 class="columns large-3">' . __("Entity","rtmedia") . '</h4>';
302
+ echo '<h4 class="columns large-4"><span class="large-offset-2">' . __("Width","rtmedia") . '</span><span class="large-offset-2">' . __("Height","rtmedia") . '</span><span class="large-offset-2">' . __("Crop","rtmedia") . '</span></h4>';
303
+ echo'</div>';
304
+
305
+ //body
306
+ $even = 0;
307
+ foreach ($render_data as $parent_key => $section) {
308
+ if( ++$even%2 )
309
+ echo '<div class="row rt-odd">';
310
+ else
311
+ echo '<div class="row rt-even">';
312
+ echo '<div class="columns large-3">' . ucfirst($section['title']) . '</div>';
313
+ $entities = $section;
314
+ unset($entities['title']);
315
+ echo '<div class="columns large-3">';
316
+ foreach ($entities as $entity) {
317
+ echo '<div class="row">' . ucfirst($entity['title']) . '</div>';
318
+ }
319
+ echo '</div>';
320
+ echo '<div class="columns large-4">';
321
+ foreach ($entities as $entity) {
322
+ $args = array(
323
+ 'key' => 'defaultSizes_'.$parent_key.'_'.$entity['title'],
324
+ );
325
+ foreach ($entity as $child_key=>$value) {
326
+ if($child_key!='title') {
327
+ $args[$child_key] = $value;
328
+ }
329
+ }
330
+ self::dimensions($args);
331
+ }
332
+ echo '</div>';
333
+ echo '</div>';
334
+ }
335
+
336
+ echo '</div>';
337
+ }
338
+
339
+ static function privacy_render_options($options) {
340
+
341
+ global $rtmedia;
342
+
343
+ $render = array(
344
+ 'enable' => array(
345
+ 'title' => __("Enable Privacy","rtmedia"),
346
+ 'callback' => array("RTMediaFormHandler", "checkbox"),
347
+ 'args' => array(
348
+ 'id' => 'rtmedia-privacy-enable',
349
+ 'key' => 'privacy_enabled',
350
+ 'value' => $options['privacy_enabled']
351
+ )
352
+ ),
353
+ 'default' => array(
354
+ 'title' => __("Default Privacy","rtmedia"),
355
+ 'callback' => array("RTMediaFormHandler","radio"),
356
+ 'args' => array(
357
+ 'key' => 'privacy_default',
358
+ 'radios' => $rtmedia->privacy_settings['levels'],
359
+ 'default' => $options['privacy_default']
360
+ ),
361