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 (120) 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 -43
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
+ ),
362
+ 'user_override' => array(
363
+ 'title' => __("User Override","rtmedia"),
364
+ 'callback' => array("RTMediaFormHandler", "checkbox"),
365
+ 'args' => array(
366
+ 'key' => 'privacy_userOverride',
367
+ 'value' => $options['privacy_userOverride']
368
+ )
369
+ )
370
+ );
371
+
372
+ return $render;
373
+ }
374
+
375
+ public static function privacy_content() {
376
+
377
+ global $rtmedia;
378
+ $options = self::extract_settings('privacy', $rtmedia->options);
379
+
380
+ $render_data = self::privacy_render_options($options);
381
+
382
+ echo '<div class="large-12">';
383
+ foreach ($render_data as $key=>$privacy) {
384
+ echo '<div class="row section">';
385
+ echo '<div class="columns large-2">' . $privacy['title'] . '</div>';
386
+ echo '<div class="columns large-5">';
387
+ if($key != "enable")
388
+ call_user_func($privacy['callback'], array_merge_recursive($privacy['args'], array('class' => array("privacy-driven-disable"))));
389
+ else
390
+ call_user_func($privacy['callback'], $privacy['args']);
391
+ echo '</div>';
392
+ echo '</div>';
393
+ }
394
+ echo '</div>';
395
+ }
396
+
397
+ static function buddypress_render_options($options) {
398
+
399
+
400
+ $render = array(
401
+ 'rtmedia-enable-on-profile' => array(
402
+ 'title' => __('Enable Media in Profile','rtmedia'),
403
+ 'callback' => array('RTMediaFormHandler', 'checkbox'),
404
+ 'args' => array(
405
+ 'key' => 'buddypress_enableOnProfile',
406
+ 'value' => $options['buddypress_enableOnProfile'],
407
+ 'desc' => __('Enable Media on BuddyPress Profile','rtmedia')
408
+ )
409
+ ),
410
+ 'rtmedia-enable-on-group' => array(
411
+ 'title' => __('Enable Media in Group','rtmedia'),
412
+ 'callback' => array('RTMediaFormHandler', 'checkbox'),
413
+ 'args' => array(
414
+ 'key' => 'buddypress_enableOnGroup',
415
+ 'value' => $options['buddypress_enableOnGroup'],
416
+ 'desc' => __('Enable Media on BuddyPress Groups','rtmedia')
417
+ )
418
+ ),
419
+ 'rtmedia-enable-on-activity' => array(
420
+ 'title' => __('Enable Media in Activity','rtmedia'),
421
+ 'callback' => array('RTMediaFormHandler', 'checkbox'),
422
+ 'args' => array(
423
+ 'key' => 'buddypress_enableOnActivity',
424
+ 'value' => $options['buddypress_enableOnActivity'],
425
+ 'desc' => __('Enable Media on BuddyPress Activities','rtmedia')
426
+ )
427
+ )
428
+ );
429
+
430
+ return $render;
431
+ }
432
+
433
+ public static function buddypress_content() {
434
+
435
+ global $rtmedia;
436
+ $options = self::extract_settings('buddypress', $rtmedia->options);
437
+
438
+ $render_data = self::buddypress_render_options($options);
439
+
440
+ echo '<div class="large-12">';
441
+ foreach ($render_data as $option) { ?>
442
+ <div class="row section">
443
+ <div class="columns large-2"><?php echo $option['title']; ?></div>
444
+ <div class="columns large-4">
445
+ <?php call_user_func($option['callback'], $option['args']); ?>
446
+ </div>
447
+ </div>
448
+ <?php }
449
+ echo '</div>';
450
+ }
451
+
452
+ public static function rtForm_settings_tabs_content($page, $sub_tabs) {
453
+
454
+ foreach ($sub_tabs as $tab) {
455
+ echo '<div id="' . substr($tab['href'], 1) . '">';
456
+ call_user_func($tab['callback'], $page);
457
+ echo '</div>';
458
+ }
459
+ }
460
+
461
+ public static function rtForm_do_settings_fields($page, $section) {
462
+ global $wp_settings_fields;
463
+
464
+ if (!isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]))
465
+ return;
466
+
467
+ foreach ((array) $wp_settings_fields[$page][$section] as $field) {
468
+ echo '<div class="row">';
469
+ echo '<div class="large-11 columns">';
470
+
471
+ if (isset($field['args']['label_for']) && !empty($field['args']['label_for']))
472
+ call_user_func($field['callback'], array_merge($field['args'], array('label' => $field['args']['label_for'])));
473
+ else if (isset($field['title']) && !empty($field['title']))
474
+ call_user_func($field['callback'], array_merge($field['args'], array('label' => $field['title'])));
475
+ else
476
+ call_user_func($field['callback'], $field['args']);
477
+ echo '</div>';
478
+ echo '</div>';
479
+ }
480
+ }
481
+ }
482
+ ?>
app/assets/css/admin.css CHANGED
@@ -1,42 +1,53 @@
1
- #wpbody-content div.metabox-fixed{width: 280px;margin-right: -300px;float: right;}
2
- #wpbody-content div.wrap.bp-media-admin .columns-2{margin-right:300px;padding-top: 0;margin-top: 15px;width: 600px}
 
 
 
 
 
 
3
  #wpbody-content .bp-media-settings-tabs{margin-bottom: 0; }
4
  #wpbody-content .bp-media-settings-tabs .media-nav-tab{margin: 0 10px; text-decoration: underline; text-transform: capitalize}
5
  #wpbody-content .bp-media-settings-tabs .media-nav-tab.media-nav-tab-active{font-weight: bold}
6
 
7
- #wpbody-content .wrap div.bp-media-metabox-holder{padding-top: 0}
8
  .bp-media-social{background: url('../img/bp_media_social.png');height: 35px;width: 35px;display: inline-block;font-size: 0px;margin-right:5px;}
9
  .bp-media-facebook{background-position: 0px 0px;}
10
  .bp-media-facebook:hover{background-position: 0px 36px;}
11
  .bp-media-twitter{background-position: 80px 0px;}
12
  .bp-media-twitter:hover{background-position: 80px 36px;}
13
- .bp-media-rss{background-position: 35px 0px;}
14
- .bp-media-rss:hover{background-position: 35px 36px;}
15
  .bp-media-support .support_list{ margin-left: 25px}
16
  .bp-media-support .support_list li{list-style: disc;margin-bottom: 10px}
17
 
 
 
18
  #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a{background:url('../img/bpm-icon-16.png') center 1px no-repeat;}
19
  #adminmenu li.toplevel_page_bp-media-settings:hover .wp-menu-image a,
20
  #adminmenu li.current.toplevel_page_bp-media-settings .wp-menu-image a{background-position: center 1px;}
21
  #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a img{display:none;}
22
- #bp-media-settings-boxes{border:1px solid #CCC; overflow: hidden; padding: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 98%;}
23
- #debug-info{border:1px solid #CCC; overflow: hidden; padding: 10px; margin-top: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 588px;}
 
24
  .nav-tab-wrapper a#bp-media{background:url('../img/bpm-icon-32.png') transparent no-repeat; padding-left:32px;}
25
  .nav-tab-wrapper a#bp-media:hover,.nav-tab-wrapper a#bp-media.nav-tab-active{background-position:left -96px;}
26
- .metabox-holder .postbox#latest-news .inside ul li{background: transparent url('../img/bpm-icon-32.png') -5px 0px no-repeat; padding-left: 32px;}
27
- .metabox-holder .postbox#latest-news .inside ul li:hover{background-position-y: -96px;}
 
 
 
28
  #branding #logo{text-align:center;padding: 10px 0;display:block;}
29
- ul#social{display:block;text-align:center;margin:0;clear: both;}
30
  #branding #mc-embedded-subscribe-form{float: left;width: 100%;}
31
  #branding label{float: right;}
32
  #branding #mc-embedded-subscribe{float: right;padding: 0 3px;}
33
  #branding #mce-EMAIL{float: left;}
34
- ul#social li{display:inline;}
35
- #spread-the-word .button{display:inline-block; margin: 9px 5px 0 5px;}
36
  #spread-the-word label{display:block;}
37
- #spread-the-word .inside{text-align: center;}
38
- #spread-the-word .button-tweet{background: #33ACE6; border-color: #3399DD #3399DD #2288CC; color: #FFFFFF !important; text-shadow: -1px -1px 0 #3399DD;}
39
- #spread-the-word .button-tweet:hover{background: #3399DD;border-color: #2288CC;box-shadow: 0 0 4px rgba(82, 168, 236, 0.75);}
40
  #spread-the-word .button-rating{background: #8A8A8A; border-color: #222; color: #FFFFFF !important; text-shadow: -1px -1px 0 #444;}
41
  #spread-the-word .button-rating:hover{background: #7E7E7E;border-color: #444;box-shadow: 0 0 4px rgba(128,128,128, 0.75);}
42
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab{padding-left:20px;background:url('../img/tab-icon.png') 3px -4px no-repeat;}
@@ -48,6 +59,22 @@ ul#social li{display:inline;}
48
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.convert-videos{background-position-y:-214px;}
49
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.insta{background-position-y:-244px;}
50
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.watermark{background-position-y:-274px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  /* Addons page Styling */
52
 
53
  a.toplevel_page_bp-media-settings div.wp-menu-image{
@@ -86,8 +113,81 @@ a.toplevel_page_bp-media-settings div.wp-menu-image{
86
  .bp-media-addon .product_footer .product_demo_link{font-size: 16px;margin: 8px 20px; font-weight: bold}
87
 
88
  .bp-media-addon .add_to_cart_button:hover{background: none repeat scroll 0 0 #D75A00;
89
- box-shadow: 0 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.4) inset;
90
- color: #FFFFFF;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  /* Admin bar Menu */
93
  #wpadminbar .bp-media-settings-menu > .ab-item .ab-icon{background: url("../img/bpm-icon-16.png") no-repeat scroll -8px -7px transparent}
@@ -110,7 +210,7 @@ a.toplevel_page_bp-media-settings div.wp-menu-image{
110
  .bp-media-support-attachment .add-more-attachment-btn{clear: both;display: inline-block;margin-left: 160px;margin-top: 10px;}
111
  .template_select_label{float: left}
112
  .template_select_container{overflow-x:scroll; width:405px;float: left}
113
- #bp_media_settings_form .support_form_laoder{height: 100px; width: 200px; background: url("../img/loader.gif") no-repeat }
114
  /* Miscellaneous */
115
  #normal-sortables .postbox .bp-media-form .submit{float: none; margin-left: 150px}
116
  .rt-success{background-color: #E1FFDF;border-color: #2ACF2A;}
@@ -120,15 +220,427 @@ img.bp-media-donation-image{display:block;margin: 10px auto;}
120
  /*Transcoding Teaser*/
121
  .para-blockquote { background: #E5E5E5; padding: 10px; font-style: italic; }
122
  #latest-update img, #members-list .update img, #members-list .update {display:block; overflow: hidden;}
123
- #rtprogressbar {
124
- background-color: #444;
125
- border-radius: 13px;
126
- padding: 3px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  }
128
 
129
- #rtprogressbar div {
130
- background-color: #fb6003;
131
- width: 0;
132
- height: 20px;
133
- border-radius: 10px;
 
 
134
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Legacy
3
+ */
4
+
5
+ /*
6
+ * Default stylesheet for BuddyPress Media
7
+ */
8
+ #wpbody-content div.wrap.bp-media-admin .columns-2{margin-right:320px;padding-top: 0;margin-top: 15px;width: 620px}
9
  #wpbody-content .bp-media-settings-tabs{margin-bottom: 0; }
10
  #wpbody-content .bp-media-settings-tabs .media-nav-tab{margin: 0 10px; text-decoration: underline; text-transform: capitalize}
11
  #wpbody-content .bp-media-settings-tabs .media-nav-tab.media-nav-tab-active{font-weight: bold}
12
 
13
+ #wpbody-content .wrap div.bp-media-metabox-holder{padding-top: 0; margin-top:10px;}
14
  .bp-media-social{background: url('../img/bp_media_social.png');height: 35px;width: 35px;display: inline-block;font-size: 0px;margin-right:5px;}
15
  .bp-media-facebook{background-position: 0px 0px;}
16
  .bp-media-facebook:hover{background-position: 0px 36px;}
17
  .bp-media-twitter{background-position: 80px 0px;}
18
  .bp-media-twitter:hover{background-position: 80px 36px;}
19
+ .bp-media-rss{font-size: 14px;}
 
20
  .bp-media-support .support_list{ margin-left: 25px}
21
  .bp-media-support .support_list li{list-style: disc;margin-bottom: 10px}
22
 
23
+ div#icon-buddypress-media { background: url('../img/bpm-icon-32.png'); background-position-y: 35px; }
24
+
25
  #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a{background:url('../img/bpm-icon-16.png') center 1px no-repeat;}
26
  #adminmenu li.toplevel_page_bp-media-settings:hover .wp-menu-image a,
27
  #adminmenu li.current.toplevel_page_bp-media-settings .wp-menu-image a{background-position: center 1px;}
28
  #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a img{display:none;}
29
+ #bp-media-settings-boxes{margin:10px;}
30
+ #debug-info{clear:left;border:none; overflow: hidden; padding: 10px; margin: 10px 0 20px 0; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; }
31
+ #debug-info th, #debug-info td{ border: 1px #e5e5e5 solid; border-left:none; border-right:none;}
32
  .nav-tab-wrapper a#bp-media{background:url('../img/bpm-icon-32.png') transparent no-repeat; padding-left:32px;}
33
  .nav-tab-wrapper a#bp-media:hover,.nav-tab-wrapper a#bp-media.nav-tab-active{background-position:left -96px;}
34
+ .metabox-holder .postbox#latest-news .inside ul li{list-style: disc inside;}
35
+ /*.metabox-holder .postbox#latest-news .inside ul li{background: transparent url('../img/bpm-icon-32.png') -5px 0px no-repeat; padding-left: 32px;}*/
36
+ /*.metabox-holder .postbox#latest-news .inside ul li:hover{background-position-y: -96px;}*/
37
+ #branding{min-height: 25px;}
38
+ #branding .inside{min-height: 25px;}
39
  #branding #logo{text-align:center;padding: 10px 0;display:block;}
40
+ #social{display:block;margin:0;clear: both;}
41
  #branding #mc-embedded-subscribe-form{float: left;width: 100%;}
42
  #branding label{float: right;}
43
  #branding #mc-embedded-subscribe{float: right;padding: 0 3px;}
44
  #branding #mce-EMAIL{float: left;}
45
+ #social .row .large-6{display:inline; vertical-align: middle; padding:0; text-align:center;}
46
+ #spread-the-word .button{display:inline-block; margin: 5px 0px;}
47
  #spread-the-word label{display:block;}
48
+ #spread-the-word .inside{}
49
+ #spread-the-word .button-tweet, #bpmedia-bpalbumimporter .button-import-tweet{background: #33ACE6; border-color: #3399DD #3399DD #2288CC; color: #FFFFFF !important; text-shadow: -1px -1px 0 #3399DD;}
50
+ #spread-the-word .button-tweet:hover, #bpmedia-bpalbumimporter .button-import-tweet:hover{background: #3399DD;border-color: #2288CC;box-shadow: 0 0 4px rgba(82, 168, 236, 0.75);}
51
  #spread-the-word .button-rating{background: #8A8A8A; border-color: #222; color: #FFFFFF !important; text-shadow: -1px -1px 0 #444;}
52
  #spread-the-word .button-rating:hover{background: #7E7E7E;border-color: #444;box-shadow: 0 0 4px rgba(128,128,128, 0.75);}
53
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab{padding-left:20px;background:url('../img/tab-icon.png') 3px -4px no-repeat;}
59
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.convert-videos{background-position-y:-214px;}
60
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.insta{background-position-y:-244px;}
61
  .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.watermark{background-position-y:-274px;}
62
+
63
+ #bpm-unsubscribe-dialog { display: none; }
64
+ #bpm-unsubscribe-dialog p { margin: 10px; }
65
+
66
+ table.bp-media-encoding-table td, table.bp-media-encoding-table th {
67
+ border-left-color: #fff;
68
+ border-right-color: #dfdfdf;
69
+ border-width: 1px;
70
+ vertical-align: middle;
71
+ text-align: center;
72
+ font-family: sans-serif;
73
+ }
74
+ table.bp-media-encoding-table th {
75
+ font-weight: bold;
76
+ }
77
+
78
  /* Addons page Styling */
79
 
80
  a.toplevel_page_bp-media-settings div.wp-menu-image{
113
  .bp-media-addon .product_footer .product_demo_link{font-size: 16px;margin: 8px 20px; font-weight: bold}
114
 
115
  .bp-media-addon .add_to_cart_button:hover{background: none repeat scroll 0 0 #D75A00;
116
+ box-shadow: 0 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.4) inset;
117
+ color: #FFFFFF;}
118
+
119
+ div.i-accept{ background-color: #dff0d8 !important; }
120
+ div.bp-album-import-accept{ padding: 1px 2px; margin-bottom: 15px; }
121
+ .bp-album-importer-wizard { display: none; margin-top: 15px; }
122
+ #setting-error-bp-album-importer { line-height: 1.8em; }
123
+ .wp-core-ui .btn-warning {
124
+ color: #ffffff;
125
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
126
+ background-color: #faa732;
127
+ *background-color: #f89406;
128
+ background-image: -moz-linear-gradient(top, #fbb450, #f89406);
129
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
130
+ background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
131
+ background-image: -o-linear-gradient(top, #fbb450, #f89406);
132
+ background-image: linear-gradient(to bottom, #fbb450, #f89406);
133
+ background-repeat: repeat-x;
134
+ border-color: #f89406 #f89406 #ad6704;
135
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
136
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
137
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
138
+ }
139
+
140
+ #item-body a.btn-danger {
141
+ padding: 4px 10px;
142
+ color: #ffffff;
143
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
144
+ background-color: #da4f49;
145
+ *background-color: #bd362f;
146
+ background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
147
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
148
+ background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
149
+ background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
150
+ background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
151
+ background-repeat: repeat-x;
152
+ border-color: #bd362f #bd362f #802420;
153
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
154
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
155
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
156
+ }
157
+
158
+ #item-body a.btn-danger:hover,
159
+ #item-body a.btn-danger:focus,
160
+ #item-body a.btn-danger:active,
161
+ #item-body a.btn-danger.active,
162
+ #item-body a.btn-danger.disabled,
163
+ #item-body a.btn-danger[disabled] {
164
+ color: #ffffff;
165
+ border-color: #bd362f #bd362f #802420;
166
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
167
+ background: #bd362f;
168
+ *background: #a9302a;
169
+ }
170
+
171
+ #item-body a.btn-danger:active,
172
+ #item-body a.btn-danger.active {
173
+ border-color: #bd362f #bd362f #802420;
174
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
175
+ background: #942a25 \9;
176
+ }
177
+
178
+
179
+ .wp-core-ui .btn-warning:hover,
180
+ .wp-core-ui .btn-warning:focus,
181
+ .wp-core-ui .btn-warning:active,
182
+ .wp-core-ui .btn-warning.active,
183
+ .wp-core-ui .btn-warning.disabled,
184
+ .wp-core-ui .btn-warning[disabled] {
185
+ color: #ffffff;
186
+ background: #f89406;
187
+ background-color: #f89406;
188
+ *background: #df8505;
189
+ *background-color: #df8505;
190
+ }
191
 
192
  /* Admin bar Menu */
193
  #wpadminbar .bp-media-settings-menu > .ab-item .ab-icon{background: url("../img/bpm-icon-16.png") no-repeat scroll -8px -7px transparent}
210
  .bp-media-support-attachment .add-more-attachment-btn{clear: both;display: inline-block;margin-left: 160px;margin-top: 10px;}
211
  .template_select_label{float: left}
212
  .template_select_container{overflow-x:scroll; width:405px;float: left}
213
+ #bp_media_settings_form .support_form_loader{height: 100px; width: 200px; background: url("../img/loader.gif") no-repeat }
214
  /* Miscellaneous */
215
  #normal-sortables .postbox .bp-media-form .submit{float: none; margin-left: 150px}
216
  .rt-success{background-color: #E1FFDF;border-color: #2ACF2A;}
220
  /*Transcoding Teaser*/
221
  .para-blockquote { background: #E5E5E5; padding: 10px; font-style: italic; }
222
  #latest-update img, #members-list .update img, #members-list .update {display:block; overflow: hidden;}
223
+
224
+ .encoding-used,
225
+ .encoding-remaining { display: inline-block; width: 10px; height: 10px; margin-right: 5px;}
226
+ .encoding-used { background : #fb6003; }
227
+ .encoding-remaining { background: #444; }
228
+
229
+ .bp_media_content img{max-width:100%;}
230
+ .bp_media_content .mejs-poster img{max-width: 100%;}
231
+ .media .album-edit{display:inline;}
232
+ .media #item-body h3 {float: left;}
233
+ .media #item-body .bp-media-gallery h3 { float:none; }
234
+ .media .bp-media-album-actions {float: left; margin-left: 15px;}
235
+ .media .bulk-move, .media .bulk-delete {display: none;}
236
+ .bp-media-list h3 {display:block;font-size:20px;font-weight:bold;}
237
+ ul.bp-media-gallery{overflow: hidden}
238
+ .bp_media_description {display:block;margin-top:20px;}
239
+ #bp-media-upload-form, #message, .bp-media-action-wrapper, #bp-media-user-privacy {clear:left;}
240
+ .bp-media-album-action-ui { display:none; }
241
+ .bp-media-album-description {clear:left;font-size:1.2em}
242
+ ul.bp-media-gallery.item-list{clear:left;overflow:visible;margin: 1% 0;width: auto;}
243
+ #item-body ul.bp-media-gallery li{float: left;margin: 1% 1% 0;width: 18%;border-bottom: none;padding: 0;position: static;height:auto; display:block;}
244
+ ul.bp-media-gallery li img{max-width:150px;width:100%;height:auto;-moz-box-shadow: 1px 1px 10px #a0a0a0;-webkit-box-shadow: 1px 1px 10px #a0a0a0;box-shadow: 1px 1px 10px #a0a0a0;-moz-transition: box-shadow 0.2s linear;-webkit-transition: box-shadow 0.2s linear;transition: box-shadow 0.2s linear;}
245
+ ul.bp-media-gallery li img:hover{-moz-box-shadow: 1px 1px 10px #333;-webkit-box-shadow: 1px 1px 10px #333;box-shadow: 1px 1px 10px #333;}
246
+ ul.bp-media-gallery h3{max-width: 150px;overflow: hidden;text-align: center;font-size: 110%;white-space: nowrap;height: 20px;margin: 10px 0px;}
247
+ ul.bp-media-gallery a{width:150px;}
248
+ ul.bp-media-gallery li span img{height: 150px;}
249
+ .bp-media-single .activity-list .activity-content,.bp-media-single div.activity-comments{margin-left:0;}
250
+ #bp-media-selected-album{max-width: 320px;}
251
+ /*li.media div.activity-content div.activity-inner p{display:none;}*/
252
+ .bp-media-list h3{margin-bottom:10px;}
253
+ #bp-media-footer {color: #4D4D4D;text-align: center;text-shadow: #FAFAFA 1px 1px 0;}
254
+ /*#bp-media-upload-ui{position: relative;}*/
255
+ #item-body:after,ul.bp-media-gallery.item-list:after{content: " ";clear: both;display: block;text-indent: -9999em;}
256
+ #item-body{position: relative;}
257
+
258
+
259
+ .bp-media-ajax-spinner { display: none; vertical-align: -3px;}
260
+ #bp-media-activity-upload-ui { width: 50%;}
261
+ .bp-media-area-allocate{height: 10px;width: 100%;display: block;}
262
+ li #bp-media-upload-ui {padding: 0;max-width: 158px;position: relative;}
263
+ #bp-media-upload-ui {margin-top: 10px; clear: left;}
264
+ #upload-container .drag-drop{border: 4px dashed #DDD;text-align: center;background: #fafafa;overflow: hidden;padding: 15px 0;}
265
+ #bp-media-upload-ui.hover #drag-drop-area {border-color: #83b4d8;}
266
+ li #bp-media-upload-ui #drag-drop-area{max-width: 150px;min-height: auto;}
267
+ /*.albums li #bp-media-upload-ui #drag-drop-area{padding: 20px 0 10px;}*/
268
+ #upload-container .drag-drop-inside{float: left;width: 48%;}
269
+ .albums #bp-media-upload-ui .drag-drop-inside{float: none;width: auto;}
270
+ li #bp-media-upload-ui .drag-drop-inside,li #bp-media-upload-ui #bp-media-album-prompt{float: none;max-width: 100%;width: auto;}
271
+ li #bp-media-upload-ui #bp-media-album-prompt{margin: 8px auto 0;max-width: 144px;}
272
+ #bp-media-upload-ui #bp-media-album-prompt{float: left;width: 47%;}
273
+ #bp-media-upload-ui .drag-drop-info{font-size:16px;}
274
+ #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 20px;line-height: 100%;}
275
+ #bp-media-upload-ui .drag-drop-buttons input,#bp-media-album-prompt input.button{-moz-box-sizing: content-box;border-color: #BBBBBB;border-radius: 15px;border-style: solid;border-width: 1px;color: #464646;cursor: pointer;font-size: 13px !important;line-height: 13px;padding: 5px 10px;text-decoration: none;}
276
+ li #bp-media-album-prompt input.button{font-size: 12px !important;padding: 3px 8px;text-decoration: none;margin-top: 5px;}
277
+ #bp-media-selected-album{max-width: 140px;font-size: 14px;width: 100%;}
278
+ li #bp-media-album-prompt > p,li #bp-media-upload-ui #drag-drop-area p{display: none;}
279
+ .albums li #bp-media-album-prompt > p,.albums li #bp-media-upload-ui #drag-drop-area p{display: block;}
280
+ li #bp-media-upload-ui #drag-drop-area p.drag-drop-buttons{display: block;}
281
+ #bp-media-album-prompt div.hide{display: none;margin: 0;}
282
+ #bp-media-album-prompt > span{font-size: 16px;}
283
+ .bp-media-album-content { display: inline }
284
+ /*#bp-media-upload-ui .drag-drop-inside p,#bp-media-album-prompt #bp_media_album_new{font-size: 14px;margin: 0;}*/
285
+ #bp-media-album-prompt #bp_media_album_new{max-width: 90%;}
286
+ li #bp-media-album-prompt #bp_media_album_new{margin: 0;max-width: 134px;width: 94%;}
287
+ #bp-media-upload-ui .drag-drop-to{width: 22px;line-height: 22px;margin: 40px auto 0;float: left;}
288
+ li #bp-media-upload-ui .drag-drop-to{width: 100%;line-height: 22px;margin: 0;float: none;}
289
+ #bp-media-album-in {background-color: #333333;border-radius: 11px 11px 11px 11px;color: #FFFFFF;display: block;float: left;font-size: 14px;line-height: 22px;width: 22px;}
290
+ .upload #bp-media-album-or{font-size: 14px;}
291
+ li #bp-media-album-in, .albums li #bp-media-album-or{float: none;margin: 20px auto;}
292
+ #bp-media-album-prompt #create-new{background-color: #DF562C;color: #fff;}
293
+
294
+ #bp-media-uploaded-files{background: none repeat scroll 0 0 #DDDDDD;margin-top: 5px;width: 100%;}
295
+ li #bp-media-uploaded-files{left: 0;position: absolute;top: 155px;}
296
+ #bp-media-uploaded-files .error{padding: 5px;text-align: center;}
297
+ .bp-media-progressbar{height: 28px;margin: 6px 10px 0 0;line-height: 2em;padding: 0;overflow: hidden;margin-bottom: 2px;border: 1px solid #D1D1D1;background: white;background-image: linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -o-linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -moz-linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -webkit-linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -ms-linear-gradient(bottom,white 0,#F7F7F7 100%);-webkit-border-radius: 3px;border-radius: 3px;-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1)}
298
+ .bp-media-progress-text{z-index: 10;position: relative;width: 100%;padding: 0 8px;text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);color: rgba(0, 0, 0, 0.6);font-size:16px;line-height: 28px;height: 28px;}
299
+ .bp-media-progress-completed{z-index: 9;width: 0;height: 35px;margin-top: -35px;background-color: #83B4D8;background-image: linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -o-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -moz-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -webkit-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -ms-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);-webkit-border-radius: 3px;border-radius: 3px;-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);}
300
+ .bpm-aligncenter{display: inline-block;text-align: center;width: 100%;}
301
+ #bp-media-premium-addons ul,#bp-media-premium-addons li{list-style:disc;margin-left:10px;}
302
+ .bp-media-single div.bp_media_content{text-align:center;width: auto;
303
+ margin: 0 auto;
304
+ position: relative; clear: both; }
305
+ .bp-media-single .bp_media_content .mejs-container{margin-left:auto;margin-right:auto;}
306
+
307
+ .bp-media-actions{margin:20px 0;}
308
+ .bp-media-actions a{display:inline-block;}
309
+
310
+ .media-tabs-container .ui-tabs-panel{}
311
+ .media-tabs-container .ui-tabs-hide{display: none}
312
+
313
+ .media-tabs-container .ui-tabs-nav{clear: both;display: block;margin: 0 0 15px;overflow: hidden;}
314
+ .media-tabs-container .ui-state-default{border-left: 1px solid;float: left;line-height: 110%;padding: 0 5px; list-style: none;}
315
+ .media-tabs-container .ui-state-default:first-child{margin-left: 0px;border: 0; padding-left: 0}
316
+
317
+ .media-tabs-container .ui-state-default a{text-decoration: none}
318
+ .media-tabs-container .ui-state-default.ui-state-active a{text-decoration: underline}
319
+
320
+ .media-tabs-container .widget-item-listing li{position:relative; margin-top: 10px;overflow: hidden;min-height: 52px; float:left; width:50%;}
321
+ .media-tabs-container .widget-item-listing li img{max-width:90%; margin:0 auto; float: left; display: block }
322
+ .media-tabs-container .widget-item-listing li h3 {position:absolute; bottom:0;margin: 0; display:none; background:#fff none; width:100%;text-align:center;}
323
+ .media-tabs-container .widget-item-listing li:hover h3{display:block;}
324
+ .media-tabs-container .widget-item-listing li h3 a{font-size: 13px;font-weight: normal;word-wrap: break-word; }
325
+
326
+ #bp-media-show-more{width: 200px;margin-left: auto;margin-right: auto;display: block;height: 30px;line-height: 30px;font-size: 20px;}
327
+ #bp-media-show-more-sc {display:block; margin: 0 auto;}
328
+ #bp-media-upload-ui.activity-component{margin-left: 74px;margin-top: 10px;}
329
+ ul#activity-stream li.media.album_updated ul{}
330
+ ul#activity-stream li.media.album_updated ul li,ul.bp-media-list-media li{float: left;margin-right:2%}
331
+
332
+
333
+ body.media {overflow:auto;}
334
+ .media ul#bp-media-upload-set-privacy li input[type="radio"]{float:left;}
335
+ /* Privacy settings */
336
+ #bp-media-upload-set-privacy li{margin: 10px 0;overflow: hidden;}
337
+ #bp-media-upload-set-privacy .album-set-privacy-radio{}
338
+ #bp-media-upload-set-privacy .album-set-privacy-label{margin: 0;font-weight: normal;}
339
+
340
+ .bp-media-single .delete-activity-single,.bp-media-single .delete-activity{
341
+ color: #ff0000;
342
+ font-weight:bold;
343
+ }
344
+ .simplemodal-overlay{
345
+ background:#333 none;
346
+ z-index: 100000;
347
+ }
348
+ .simplemodal-container{
349
+ background:#fff none;
350
+ }
351
+ .bp-media-mod-title{
352
+ display:none;
353
+ }
354
+
355
+ .bp-media-ajax-single{
356
+ padding:0;
357
+ }
358
+ .bp-media-ajax-single .lightbox-spinner{
359
+ height:24px;
360
+ width:24px;
361
+ background: url("../img/boxspinner.gif") center center;
362
+ left:50%;
363
+ top:50%;
364
+ position:absolute;
365
+ }
366
+ .simplemodal-container .simplemodal-close{
367
+ background: url("../img/bp-media-modal.png") right bottom no-repeat;
368
+ width:22px;
369
+ height:22px;
370
+ display:block;
371
+ position:absolute;
372
+ right:0px;
373
+ top:0px;
374
+ cursor: pointer;
375
+ }
376
+ .simplemodal-container .simplemodal-close:hover{
377
+ background-position: right top;
378
+ }
379
+ .simplemodal-container a.modal-ctrl{
380
+ position:absolute;
381
+ height:100%;
382
+ height:100px;
383
+ width:100px;
384
+ top:50%;
385
+ margin-top:-50px;
386
+ cursor: pointer;
387
+ }
388
+ .simplemodal-container a.modal-ctrl:hover{
389
+ background: #232323 none;
390
+ }
391
+ .simplemodal-container a.modal-ctrl span.img-icon{
392
+ display: block;
393
+ height:22px;
394
+ width:22px;
395
+ margin:39px auto 39px 10px;
396
+
397
+ background: url("../img/bp-media-modal.png") left bottom no-repeat;
398
+ }
399
+ .simplemodal-container a.modal-next span.img-icon{
400
+ background-position: center bottom;
401
+ margin:39px 10px 39px auto;
402
+ }
403
+ .simplemodal-container a.modal-prev:hover span.img-icon{
404
+ background-position: left top;
405
+ }
406
+ .simplemodal-container a.modal-next:hover span.img-icon{
407
+ background-position: center top;
408
+ }
409
+ .simplemodal-container a.modal-prev:hover,
410
+ .simplemodal-container a.modal-next:hover{
411
+ background:url("../img/") no-repeat;
412
+ }
413
+ .simplemodal-container a.modal-prev{
414
+ left: 0px;
415
+ }
416
+ .simplemodal-container a.modal-next{
417
+ right: 0px;
418
+ }
419
+
420
+ .bp-media-ajax-single .bp-media-mod-title{
421
+ display:block;
422
+ margin-top:22px;
423
+ }
424
+ .bp-media-ajax-single .bp-media-mod-title h2{
425
+ margin: 5px 0;
426
+ padding:0;
427
+ }
428
+ .bp-media-ajax-single .bp-media-mod-title p{
429
+ line-height:1.4em;
430
+ }
431
+ .bp-media-ajax-single .bp_media_content img,
432
+ .bp-media-ajax-single .bp_media_content video,
433
+ .bp-media-ajax-single .bp_media_content audio{
434
+ max-width: 100%;
435
+ display:inline-block;
436
+ margin:0 auto;
437
+ vertical-align: middle;
438
+ background:#fff none;
439
+ max-height:600px;
440
+ }
441
+ .bp-media-ajax-single .bp_media_author{
442
+ position:absolute;
443
+ top:0;
444
+ left:0;
445
+ }
446
+ .bp-media-ajax-single .bp-media-content-wrap,
447
+ .bp-media-ajax-single .bp_media_content{
448
+ float:left;
449
+ width:auto;
450
+ margin:0;
451
+ position:relative;
452
+ overflow:hidden;
453
+ height:480px;
454
+ min-width:640px;
455
+ background: #333 none;
456
+ display:table;
457
+
458
+ }
459
+ .bp-media-ajax-single .bp_media_content{
460
+ display:table-cell;
461
+ vertical-align: middle;
462
+ float:none;
463
+ }
464
+ .bp-media-ajax-single .bp-media-content-wrap .bp_media_description{
465
+ display:block;
466
+ position:absolute;
467
+ bottom:0;
468
+ left:0;
469
+ }
470
+ .bp-media-ajax-single .bp-media-meta-content-wrap{
471
+ float:left;
472
+ width:250px;
473
+ margin:0;
474
+ min-height:480px;
475
+ margin-left:10px;
476
+ overflow:auto;
477
+ }
478
+ .bp-media-ajax-single .bp-media-meta-content-wrap .activity-meta{
479
+ margin:0;
480
+ }
481
+ .bp-media-ajax-single .bp-media-meta-content-wrap .activity-meta a{
482
+ padding: 2px 8px;
483
+ margin: 5px 5px 0 0;
484
+ display:inline-block;
485
+ }
486
+ .bp-media-ajax-single .bp-media-meta-content-wrap div.activity-comments ul li > ul{
487
+ margin-left:0;
488
+ padding-left:0;
489
+ }
490
+ .bp-media-ajax-single .bp-media-meta-content-wrap div.activity-comments form div.ac-reply-content{
491
+ margin-left:0;
492
+ padding-left:0;
493
+ }
494
+ /*.bp-media-ajax-single .bp-media-meta-content-wrap div.activity-meta a {
495
+ padding: 0;
496
+ float:left;
497
+ }*/
498
+ .bp-media-ajax-preloader{
499
+ display:none;
500
+ }
501
+
502
+ #adminmenu li#toplevel_page_bp-media-settings a.toplevel_page_bp-media-settings { font-size: 12px; }
503
+
504
+ @media (min-width: 981px) and (max-width: 1096px) {
505
+ li #bp-media-upload-ui #drag-drop-area{padding: 10px 0;}
506
+ /* li #bp-media-upload-ui .drag-drop-inside{margin: 0 auto;}*/
507
+ li #bp-media-album-in, .albums li #bp-media-album-or{margin: 15px auto;}
508
+ li #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 17px;}
509
+ li #bp-media-upload-ui .drag-drop-buttons input{padding: 3px 8px;}
510
+ li #bp-media-uploaded-files{top: 130px}
511
+ li #bp-media-upload-ui #bp-media-album-prompt{margin-top: 0;}
512
+ li #bp-media-album-prompt input.button{padding: 3px;}
513
+ /* .albums li #bp-media-upload-ui #drag-drop-area{padding: 10px 0 0;}*/
514
+ }
515
+ @media (max-width: 980px) {
516
+ #item-body ul.bp-media-gallery li{width: 23%;}
517
+ li #bp-media-upload-ui #drag-drop-area{min-height: auto;}
518
+ }
519
+ @media (min-width: 850px) and (max-width: 930px) {
520
+ li #bp-media-album-in, .albums li #bp-media-album-or{margin: 15px auto;}
521
+ li #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 17px;}
522
+ li #bp-media-upload-ui .drag-drop-buttons input{padding: 3px 8px;}
523
+ }
524
+ @media (max-width: 850px) {
525
+ #item-body ul.bp-media-gallery li{width: 31%;}
526
+ #bp-media-upload-ui .drag-drop-inside{width: 47%;}
527
+ #bp-media-upload-ui #bp-media-album-prompt{width: 46%;}
528
+ }
529
+ @media (min-width: 481px) and (max-width: 525px) {
530
+ li #bp-media-album-in, .albums li #bp-media-album-or{margin: 15px auto;}
531
+ li #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 17px;}
532
+ li #bp-media-upload-ui .drag-drop-buttons input{padding: 3px 8px;}
533
+ }
534
+ @media (max-width: 480px) {
535
+ #item-body ul.bp-media-gallery li{width: 48%;}
536
+ li #bp-media-upload-ui{max-width: 170px;}
537
+ ul.bp-media-gallery li img,li #bp-media-upload-ui #drag-drop-area{max-width: 170px;width: 100%;}
538
+ li #bp-media-upload-ui #drag-drop-area{max-width: 162px;padding: 20px 0;}
539
+ #bp-media-upload-ui .drag-drop-area{padding: 23px 0 10px;}
540
+ /* li #bp-media-upload-ui .drag-drop-inside{margin: 0 auto 23px;}*/
541
+ }
542
+ @media (max-width: 379px) {
543
+ #bp-media-upload-ui{min-height: 190px;}
544
+ #item-body ul.bp-media-gallery li{width: 95%;}
545
+ #bp-media-upload-ui .drag-drop-inside{float: none;width: 100%;}
546
+ #bp-media-album-in{float: none;}
547
+ #bp-media-upload-ui #bp-media-album-prompt{margin: 15px auto 15px;float: none;width: 100%}
548
+ #bp-media-upload-ui .drag-drop-inside p,#bp-media-album-prompt #bp_media_album_new{margin-bottom: 5px;}
549
+ }
550
+
551
+
552
+
553
+
554
+ /*------ custom CSS ------*/
555
+ /* line 5, ../sass/admin.scss */
556
+ .clearfix {
557
+ overflow: hidden;
558
+ *zoom: 1;
559
+ }
560
+
561
+ /* line 9, ../sass/admin.scss */
562
+ .pull-right {
563
+ float: right;
564
+ }
565
+
566
+ /* line 13, ../sass/admin.scss */
567
+ .pull-left {
568
+ float: left;
569
+ }
570
+
571
+ /* line 17, ../sass/admin.scss */
572
+ .inline {
573
+ display: inline;
574
+ }
575
+
576
+ /* line 21, ../sass/admin.scss */
577
+ .entity {
578
+ min-height: 25px !important;
579
+ }
580
+
581
+ /* line 25, ../sass/admin.scss */
582
+ .section {
583
+ margin-top: 5px !important;
584
+ margin-bottom: 5px !important;
585
  }
586
 
587
+ /* line 32, ../sass/admin.scss */
588
+ .rt-table div.rt-header {
589
+ border-bottom-color: #F3F3F3;
590
+ border-bottom-width: 1px;
591
+ border-bottom-style: solid;
592
+ margin-bottom: 5px !important;
593
+ padding-bottom: 5px !important;
594
  }
595
+ /* line 39, ../sass/admin.scss */
596
+ .rt-table div.rt-header h4 {
597
+ margin: 0;
598
+ }
599
+ /* line 44, ../sass/admin.scss */
600
+ .rt-table div.row {
601
+ margin: 2px;
602
+ padding: 2px;
603
+ }
604
+ /* line 48, ../sass/admin.scss */
605
+ .rt-table div.row.rt-odd {
606
+ background-color: #F3F3F3;
607
+ }
608
+ /* line 52, ../sass/admin.scss */
609
+ .rt-table div.row.rt-even {
610
+ background-color: #FFFFFF;
611
+ }
612
+
613
+ /* line 58, ../sass/admin.scss */
614
+ abbr {
615
+ border-bottom: dotted 1px;
616
+ }
617
+
618
+ /* line 62, ../sass/admin.scss */
619
+ .rt-description {
620
+ color: #666666;
621
+ font-style: italic;
622
+ }
623
+
624
+ /* line 69, ../sass/admin.scss */
625
+ .bpm-wp-button .bpm-wp-icon {
626
+ background-image: url(../img/wpmini-grey.png);
627
+ width: 20px;
628
+ height: 24px;
629
+ font-size: 14px;
630
+ background-repeat: no-repeat;
631
+ padding: 0 6px;
632
+ }
633
+
634
+ #rtprogressbar {
635
+ background-color: #444;
636
+ border-radius: 13px;
637
+ padding: 3px;
638
+ margin-bottom: 10px;
639
+ }
640
+
641
+ #rtprogressbar div {
642
+ background-color: #fb6003;
643
+ width: 0;
644
+ height: 20px;
645
+ border-radius: 10px;
646
+ }
app/assets/css/bootstrap-switch.css ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* line 9, ../sass/bootstrap-switch.scss */
2
+ .fui-cross,
3
+ .fui-check {
4
+ display: inline-block;
5
+ speak: none;
6
+ font-style: normal;
7
+ font-weight: normal;
8
+ font-variant: normal;
9
+ text-transform: none;
10
+ -webkit-font-smoothing: antialiased;
11
+ }
12
+
13
+ /* line 18, ../sass/bootstrap-switch.scss */
14
+ .fui-cross:before {
15
+ content: "\2716";
16
+ }
17
+
18
+ /* line 21, ../sass/bootstrap-switch.scss */
19
+ .fui-check:before {
20
+ content: "\2714";
21
+ }
22
+
23
+ /* Switch checkbox */
24
+ /* line 44, ../sass/bootstrap-switch.scss */
25
+ .has-switch {
26
+ border-radius: 30px;
27
+ display: inline-block;
28
+ cursor: pointer;
29
+ line-height: 1.231;
30
+ overflow: hidden;
31
+ position: relative;
32
+ text-align: left;
33
+ width: 55px;
34
+ height: 20px;
35
+ -webkit-mask: url("../img/mask.png") 0 0 no-repeat;
36
+ mask: url("../img/mask.png") 0 0 no-repeat;
37
+ -webkit-user-select: none;
38
+ -moz-user-select: none;
39
+ user-select: none;
40
+ }
41
+ /* line 58, ../sass/bootstrap-switch.scss */
42
+ .has-switch.deactivate {
43
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=5000);
44
+ opacity: 50;
45
+ cursor: default !important;
46
+ }
47
+ /* line 61, ../sass/bootstrap-switch.scss */
48
+ .has-switch.deactivate label, .has-switch.deactivate span {
49
+ cursor: default !important;
50
+ }
51
+ /* line 66, ../sass/bootstrap-switch.scss */
52
+ .has-switch > div {
53
+ width: 162%;
54
+ position: relative;
55
+ top: 0;
56
+ }
57
+ /* line 71, ../sass/bootstrap-switch.scss */
58
+ .has-switch > div.switch-animate {
59
+ -webkit-transition: left 0.25s ease-out;
60
+ -moz-transition: left 0.25s ease-out;
61
+ -o-transition: left 0.25s ease-out;
62
+ transition: left 0.25s ease-out;
63
+ }
64
+ /* line 75, ../sass/bootstrap-switch.scss */
65
+ .has-switch > div.switch-off {
66
+ left: -63%;
67
+ }
68
+ /* line 78, ../sass/bootstrap-switch.scss */
69
+ .has-switch > div.switch-off label {
70
+ background-color: #2a95c5;
71
+ border-color: #bdc3c7;
72
+ -webkit-box-shadow: -1px 0 0 rgba(255, 255, 255, 0.5);
73
+ -moz-box-shadow: -1px 0 0 rgba(255, 255, 255, 0.5);
74
+ box-shadow: -1px 0 0 rgba(255, 255, 255, 0.5);
75
+ }
76
+ /* line 85, ../sass/bootstrap-switch.scss */
77
+ .has-switch > div.switch-on {
78
+ left: 0%;
79
+ }
80
+ /* line 88, ../sass/bootstrap-switch.scss */
81
+ .has-switch > div.switch-on label {
82
+ background-color: #bdc3c7;
83
+ }
84
+ /* line 94, ../sass/bootstrap-switch.scss */
85
+ .has-switch input[type=checkbox] {
86
+ display: none;
87
+ }
88
+ /* line 98, ../sass/bootstrap-switch.scss */
89
+ .has-switch span {
90
+ cursor: pointer;
91
+ font-size: 10.71px;
92
+ font-weight: 700;
93
+ float: left;
94
+ height: 20px;
95
+ line-height: 19px;
96
+ margin: 0;
97
+ padding-top: 1px;
98
+ position: relative;
99
+ text-align: center;
100
+ width: 50%;
101
+ z-index: 1;
102
+ -webkit-box-sizing: border-box;
103
+ -moz-box-sizing: border-box;
104
+ box-sizing: border-box;
105
+ -webkit-transition: 0.25s ease-out;
106
+ -moz-transition: 0.25s ease-out;
107
+ -o-transition: 0.25s ease-out;
108
+ transition: 0.25s ease-out;
109
+ }
110
+ /* line 114, ../sass/bootstrap-switch.scss */
111
+ .has-switch span.switch-left {
112
+ border-radius: 30px 0 0 30px;
113
+ background-color: #2a95c5;
114
+ color: white;
115
+ border-left: 1px solid transparent;
116
+ }
117
+ /* line 121, ../sass/bootstrap-switch.scss */
118
+ .has-switch span.switch-right {
119
+ border-radius: 0 30px 30px 0;
120
+ background-color: #bdc3c7;
121
+ color: white;
122
+ text-indent: 7px;
123
+ }
124
+ /* line 127, ../sass/bootstrap-switch.scss */
125
+ .has-switch span.switch-right [class*="fui-"] {
126
+ text-indent: 0;
127
+ }
128
+ /* line 133, ../sass/bootstrap-switch.scss */
129
+ .has-switch label {
130
+ border: 4px solid #2a95c5;
131
+ border-radius: 50%;
132
+ float: left;
133
+ height: 12px;
134
+ margin: 0 -12px 0 -10px;
135
+ padding: 0;
136
+ position: relative;
137
+ vertical-align: middle;
138
+ width: 12px;
139
+ z-index: 100;
140
+ -webkit-transition: 0.25s ease-out;
141
+ -moz-transition: 0.25s ease-out;
142
+ -o-transition: 0.25s ease-out;
143
+ transition: 0.25s ease-out;
144
+ }
145
+
146
+ /* line 150, ../sass/bootstrap-switch.scss */
147
+ .switch-square {
148
+ border-radius: 6px;
149
+ -webkit-mask: url("../img/mask.png") 0 0 no-repeat;
150
+ mask: url("../img/mask.png") 0 0 no-repeat;
151
+ }
152
+ /* line 157, ../sass/bootstrap-switch.scss */
153
+ .switch-square > div.switch-off label {
154
+ border-color: #2a95c5;
155
+ border-radius: 6px 0 0 6px;
156
+ }
157
+ /* line 164, ../sass/bootstrap-switch.scss */
158
+ .switch-square span {
159
+ -webkit-transition: 0.25s ease-out;
160
+ -moz-transition: 0.25s ease-out;
161
+ -o-transition: 0.25s ease-out;
162
+ transition: 0.25s ease-out;
163
+ }
164
+ /* line 168, ../sass/bootstrap-switch.scss */
165
+ .switch-square span.switch-left {
166
+ border-radius: 6px 0 0 6px;
167
+ }
168
+ /* line 170, ../sass/bootstrap-switch.scss */
169
+ .switch-square span.switch-left [class*="fui-"] {
170
+ text-indent: -10px;
171
+ }
172
+ /* line 175, ../sass/bootstrap-switch.scss */
173
+ .switch-square span.switch-right {
174
+ border-radius: 0 6px 6px 0;
175
+ }
176
+ /* line 177, ../sass/bootstrap-switch.scss */
177
+ .switch-square span.switch-right [class*="fui-"] {
178
+ text-indent: 5px;
179
+ }
180
+ /* line 183, ../sass/bootstrap-switch.scss */
181
+ .switch-square label {
182
+ border-radius: 0 6px 6px 0;
183
+ border-color: #bdc3c7;
184
+ }
app/assets/css/font-awesome.min.css ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Font Awesome 3.1.0
3
+ * the iconic font designed for Bootstrap
4
+ * -------------------------------------------------------
5
+ * The full suite of pictographic icons, examples, and documentation
6
+ * can be found at: http://fontawesome.io
7
+ *
8
+ * License
9
+ * -------------------------------------------------------
10
+ * - The Font Awesome font is licensed under the SIL Open Font License v1.1 -
11
+ * http://scripts.sil.org/OFL
12
+ * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
13
+ * http://opensource.org/licenses/mit-license.html
14
+ * - Font Awesome documentation licensed under CC BY 3.0 License -
15
+ * http://creativecommons.org/licenses/by/3.0/
16
+ * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
17
+ * "Font Awesome by Dave Gandy - http://fontawesome.io"
18
+
19
+ * Contact
20
+ * -------------------------------------------------------
21
+ * Email: dave@fontawesome.io
22
+ * Twitter: http://twitter.com/fortaweso_me
23
+ * Work: Lead Product Designer @ http://kyruus.com
24
+ */@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot?v=3.1.0');src:url('../font/fontawesome-webfont.eot?#iefix&v=3.1.0') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.1.0') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.1.0') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.1.0') format('svg');font-weight:normal;font-style:normal}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em}[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none}.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em}a [class^="icon-"],a [class*=" icon-"],a [class^="icon-"]:before,a [class*=" icon-"]:before{display:inline}[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.2857142857142858em;text-align:center}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.5714285714285714em}ul.icons-ul{list-style-type:none;text-indent:-0.7142857142857143em;margin-left:2.142857142857143em}ul.icons-ul>li .icon-li{width:.7142857142857143em;display:inline-block;text-align:center}[class^="icon-"].hide,[class*=" icon-"].hide{display:none}.icon-muted{color:#eee}.icon-light{color:#fff}.icon-dark{color:#333}.icon-border{border:solid 1px #eee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.icon-2x{font-size:2em}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.icon-3x{font-size:3em}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.icon-4x{font-size:4em}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.icon-5x{font-size:5em}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.pull-right{float:right}.pull-left{float:left}[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em}[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em}[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none}.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em}.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block}.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em}.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em}.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em}.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em}.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em}.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em}.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em}.icon-stack .icon-stack-base{font-size:2em;*line-height:1em}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)}.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2)}.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3)}.icon-flip-horizontal:before{-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.icon-flip-vertical:before{-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before{content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-repeat:before,.icon-rotate-right:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f035"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051"}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-share-alt:before,.icon-mail-forward:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:before{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-cogs:before{content:"\f085"}.icon-comments:before{content:"\f086"}.icon-thumbs-up:before{content:"\f087"}.icon-thumbs-down:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{content:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.icon-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope-alt:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-undo:before,.icon-rotate-left:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:before{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-lightbulb:before{content:"\f0eb"}.icon-exchange:before{content:"\f0ec"}.icon-cloud-download:before{content:"\f0ed"}.icon-cloud-upload:before{content:"\f0ee"}.icon-user-md:before{content:"\f0f0"}.icon-stethoscope:before{content:"\f0f1"}.icon-suitcase:before{content:"\f0f2"}.icon-bell-alt:before{content:"\f0f3"}.icon-coffee:before{content:"\f0f4"}.icon-food:before{content:"\f0f5"}.icon-file-alt:before{content:"\f0f6"}.icon-building:before{content:"\f0f7"}.icon-hospital:before{content:"\f0f8"}.icon-ambulance:before{content:"\f0f9"}.icon-medkit:before{content:"\f0fa"}.icon-fighter-jet:before{content:"\f0fb"}.icon-beer:before{content:"\f0fc"}.icon-h-sign:before{content:"\f0fd"}.icon-plus-sign-alt:before{content:"\f0fe"}.icon-double-angle-left:before{content:"\f100"}.icon-double-angle-right:before{content:"\f101"}.icon-double-angle-up:before{content:"\f102"}.icon-double-angle-down:before{content:"\f103"}.icon-angle-left:before{content:"\f104"}.icon-angle-right:before{content:"\f105"}.icon-angle-up:before{content:"\f106"}.icon-angle-down:before{content:"\f107"}.icon-desktop:before{content:"\f108"}.icon-laptop:before{content:"\f109"}.icon-tablet:before{content:"\f10a"}.icon-mobile-phone:before{content:"\f10b"}.icon-circle-blank:before{content:"\f10c"}.icon-quote-left:before{content:"\f10d"}.icon-quote-right:before{content:"\f10e"}.icon-spinner:before{content:"\f110"}.icon-circle:before{content:"\f111"}.icon-reply:before,.icon-mail-reply:before{content:"\f112"}.icon-folder-close-alt:before{content:"\f114"}.icon-folder-open-alt:before{content:"\f115"}.icon-expand-alt:before{content:"\f116"}.icon-collapse-alt:before{content:"\f117"}.icon-smile:before{content:"\f118"}.icon-frown:before{content:"\f119"}.icon-meh:before{content:"\f11a"}.icon-gamepad:before{content:"\f11b"}.icon-keyboard:before{content:"\f11c"}.icon-flag-alt:before{content:"\f11d"}.icon-flag-checkered:before{content:"\f11e"}.icon-terminal:before{content:"\f120"}.icon-code:before{content:"\f121"}.icon-reply-all:before{content:"\f122"}.icon-mail-reply-all:before{content:"\f122"}.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123"}.icon-location-arrow:before{content:"\f124"}.icon-crop:before{content:"\f125"}.icon-code-fork:before{content:"\f126"}.icon-unlink:before{content:"\f127"}.icon-question:before{content:"\f128"}.icon-info:before{content:"\f129"}.icon-exclamation:before{content:"\f12a"}.icon-superscript:before{content:"\f12b"}.icon-subscript:before{content:"\f12c"}.icon-eraser:before{content:"\f12d"}.icon-puzzle-piece:before{content:"\f12e"}.icon-microphone:before{content:"\f130"}.icon-microphone-off:before{content:"\f131"}.icon-shield:before{content:"\f132"}.icon-calendar-empty:before{content:"\f133"}.icon-fire-extinguisher:before{content:"\f134"}.icon-rocket:before{content:"\f135"}.icon-maxcdn:before{content:"\f136"}.icon-chevron-sign-left:before{content:"\f137"}.icon-chevron-sign-right:before{content:"\f138"}.icon-chevron-sign-up:before{content:"\f139"}.icon-chevron-sign-down:before{content:"\f13a"}.icon-html5:before{content:"\f13b"}.icon-css3:before{content:"\f13c"}.icon-anchor:before{content:"\f13d"}.icon-unlock-alt:before{content:"\f13e"}.icon-bullseye:before{content:"\f140"}.icon-ellipsis-horizontal:before{content:"\f141"}.icon-ellipsis-vertical:before{content:"\f142"}.icon-rss-sign:before{content:"\f143"}.icon-play-sign:before{content:"\f144"}.icon-ticket:before{content:"\f145"}.icon-minus-sign-alt:before{content:"\f146"}.icon-check-minus:before{content:"\f147"}.icon-level-up:before{content:"\f148"}.icon-level-down:before{content:"\f149"}.icon-check-sign:before{content:"\f14a"}.icon-edit-sign:before{content:"\f14b"}.icon-external-link-sign:before{content:"\f14c"}.icon-share-sign:before{content:"\f14d"}
app/assets/css/grid-foundation.css ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ * Grid HTML Classes */
2
+ /* line 116, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
3
+ .row {
4
+ width: 100%;
5
+ margin-left: auto;
6
+ margin-right: auto;
7
+ margin-top: 0;
8
+ margin-bottom: 0;
9
+ max-width: 62.5em;
10
+ *zoom: 1;
11
+ }
12
+ /* line 101, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_global.scss */
13
+ .row:before, .row:after {
14
+ content: " ";
15
+ display: table;
16
+ }
17
+ /* line 102, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_global.scss */
18
+ .row:after {
19
+ clear: both;
20
+ }
21
+ /* line 121, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
22
+ .row.collapse .column,
23
+ .row.collapse .columns {
24
+ position: relative;
25
+ padding-left: 0;
26
+ padding-right: 0;
27
+ float: left;
28
+ }
29
+
30
+ /* line 130, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
31
+ .column,
32
+ .columns {
33
+ position: relative;
34
+ padding-left: 0.9375em;
35
+ padding-right: 0.9375em;
36
+ width: 100%;
37
+ float: left;
38
+ }
39
+
40
+ @media only screen {
41
+ /* line 135, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
42
+ .column,
43
+ .columns {
44
+ position: relative;
45
+ padding-left: 0.9375em;
46
+ padding-right: 0.9375em;
47
+ float: left;
48
+ }
49
+
50
+ /* line 149, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
51
+ .column.small-centered,
52
+ .columns.small-centered {
53
+ position: relative;
54
+ margin-left: auto;
55
+ margin-right: auto;
56
+ float: none !important;
57
+ }
58
+ }
59
+ /* Styles for screens that are atleast 768px; */
60
+ @media only screen and (min-width: 48em) {
61
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
62
+ .large-1 {
63
+ position: relative;
64
+ width: 8.33333%;
65
+ }
66
+
67
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
68
+ .large-2 {
69
+ position: relative;
70
+ width: 16.66667%;
71
+ }
72
+
73
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
74
+ .large-3 {
75
+ position: relative;
76
+ width: 25%;
77
+ }
78
+
79
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
80
+ .large-4 {
81
+ position: relative;
82
+ width: 33.33333%;
83
+ }
84
+
85
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
86
+ .large-5 {
87
+ position: relative;
88
+ width: 41.66667%;
89
+ }
90
+
91
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
92
+ .large-6 {
93
+ position: relative;
94
+ width: 50%;
95
+ }
96
+
97
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
98
+ .large-7 {
99
+ position: relative;
100
+ width: 58.33333%;
101
+ }
102
+
103
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
104
+ .large-8 {
105
+ position: relative;
106
+ width: 66.66667%;
107
+ }
108
+
109
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
110
+ .large-9 {
111
+ position: relative;
112
+ width: 75%;
113
+ }
114
+
115
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
116
+ .large-10 {
117
+ position: relative;
118
+ width: 83.33333%;
119
+ }
120
+
121
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
122
+ .large-11 {
123
+ position: relative;
124
+ width: 91.66667%;
125
+ }
126
+
127
+ /* line 156, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
128
+ .large-12 {
129
+ position: relative;
130
+ width: 100%;
131
+ }
132
+
133
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
134
+ .row .large-offset-1 {
135
+ position: relative;
136
+ margin-left: 8.33333%;
137
+ }
138
+
139
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
140
+ .row .large-offset-2 {
141
+ position: relative;
142
+ margin-left: 16.66667%;
143
+ }
144
+
145
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
146
+ .row .large-offset-3 {
147
+ position: relative;
148
+ margin-left: 25%;
149
+ }
150
+
151
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
152
+ .row .large-offset-4 {
153
+ position: relative;
154
+ margin-left: 33.33333%;
155
+ }
156
+
157
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
158
+ .row .large-offset-5 {
159
+ position: relative;
160
+ margin-left: 41.66667%;
161
+ }
162
+
163
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
164
+ .row .large-offset-6 {
165
+ position: relative;
166
+ margin-left: 50%;
167
+ }
168
+
169
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
170
+ .row .large-offset-7 {
171
+ position: relative;
172
+ margin-left: 58.33333%;
173
+ }
174
+
175
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
176
+ .row .large-offset-8 {
177
+ position: relative;
178
+ margin-left: 66.66667%;
179
+ }
180
+
181
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
182
+ .row .large-offset-9 {
183
+ position: relative;
184
+ margin-left: 75%;
185
+ }
186
+
187
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
188
+ .row .large-offset-10 {
189
+ position: relative;
190
+ margin-left: 83.33333%;
191
+ }
192
+
193
+ /* line 160, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
194
+ .row .large-offset-11 {
195
+ position: relative;
196
+ margin-left: 91.66667%;
197
+ }
198
+
199
+
200
+
201
+ /* line 174, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
202
+ .column.large-centered,
203
+ .columns.large-centered {
204
+ position: relative;
205
+ margin-left: auto;
206
+ margin-right: auto;
207
+ float: none !important;
208
+ }
209
+
210
+ /* line 177, ../../../../../../../usr/lib/ruby/gems/1.8/gems/zurb-foundation-4.1.6/scss/foundation/components/_grid.scss */
211
+ .column.large-uncentered,
212
+ .columns.large-uncentered {
213
+ margin-left: 0;
214
+ margin-right: 0;
215
+ float: none;
216
+ }
217
+ }
app/assets/css/jquery.plupload.queue.css ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Plupload
3
+ ------------------------------------------------------------------- */
4
+
5
+ .plupload_button {
6
+ display: -moz-inline-box; /* FF < 3*/
7
+ display: inline-block;
8
+ font: normal 12px sans-serif;
9
+ text-decoration: none;
10
+ color: #42454a;
11
+ border: 1px solid #bababa;
12
+ padding: 2px 8px 3px 20px;
13
+ margin-right: 4px;
14
+ background: #f3f3f3 url('../img/buttons.png') no-repeat 0 center;
15
+ outline: 0;
16
+
17
+ /* Optional rounded corners for browsers that support it */
18
+ -moz-border-radius: 3px;
19
+ -khtml-border-radius: 3px;
20
+ -webkit-border-radius: 3px;
21
+ border-radius: 3px;
22
+ }
23
+
24
+ .plupload_button:hover {
25
+ color: #000;
26
+ text-decoration: none;
27
+ }
28
+
29
+ .plupload_disabled, a.plupload_disabled:hover {
30
+ color: #737373;
31
+ border-color: #c5c5c5;
32
+ background: #ededed url('../img/buttons-disabled.png') no-repeat 0 center;
33
+ cursor: default;
34
+ }
35
+
36
+ .plupload_add {
37
+ background-position: -181px center;
38
+ }
39
+
40
+ .plupload_wrapper {
41
+ font: normal 11px Verdana,sans-serif;
42
+ width: 100%;
43
+ }
44
+
45
+ .plupload_container {
46
+ padding: 8px;
47
+ background: url('../img/transp50.png');
48
+ /*-moz-border-radius: 5px;*/
49
+ }
50
+
51
+ .plupload_container input {
52
+ border: 1px solid #DDD;
53
+ font: normal 11px Verdana,sans-serif;
54
+ width: 98%;
55
+ }
56
+
57
+ .plupload_header {background: #2A2C2E url('../img/backgrounds.gif') repeat-x;}
58
+ .plupload_header_content {
59
+ background: url('../img/backgrounds.gif') no-repeat 0 -317px;
60
+ min-height: 56px;
61
+ padding-left: 60px;
62
+ color: #FFF;
63
+ }
64
+ .plupload_header_title {
65
+ font: normal 18px sans-serif;
66
+ padding: 6px 0 3px;
67
+ }
68
+ .plupload_header_text {
69
+ font: normal 12px sans-serif;
70
+ }
71
+
72
+ .plupload_filelist {
73
+ margin: 0;
74
+ padding: 0;
75
+ list-style: none;
76
+ }
77
+
78
+ .plupload_scroll .plupload_filelist {
79
+ height: 185px;
80
+ background: #F5F5F5;
81
+ overflow-y: scroll;
82
+ }
83
+
84
+ .plupload_filelist li {
85
+ padding: 10px 8px;
86
+ background: #F5F5F5 url('../img/backgrounds.gif') repeat-x 0 -156px;
87
+ border-bottom: 1px solid #DDD;
88
+ }
89
+
90
+ .plupload_filelist_header, .plupload_filelist_footer {
91
+ background: #DFDFDF;
92
+ padding: 8px 8px;
93
+ color: #42454A;
94
+ }
95
+ .plupload_filelist_header {
96
+ border-top: 1px solid #EEE;
97
+ border-bottom: 1px solid #CDCDCD;
98
+ }
99
+
100
+ .plupload_filelist_footer {border-top: 1px solid #FFF; height: 22px; line-height: 20px; vertical-align: middle;}
101
+ .plupload_file_name {float: left; overflow: hidden}
102
+ .plupload_file_status {color: #777;}
103
+ .plupload_file_status span {color: #42454A;}
104
+ .plupload_file_size, .plupload_file_status, .plupload_progress {
105
+ float: right;
106
+ width: 80px;
107
+ }
108
+ .plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right;}
109
+
110
+ .plupload_filelist .plupload_file_name {width: 205px}
111
+
112
+ .plupload_file_action {
113
+ float: right;
114
+ width: 16px;
115
+ height: 16px;
116
+ margin-left: 15px;
117
+ }
118
+
119
+ .plupload_file_action * {
120
+ display: none;
121
+ width: 16px;
122
+ height: 16px;
123
+ }
124
+
125
+ li.plupload_uploading {background: #ECF3DC url('../img/backgrounds.gif') repeat-x 0 -238px;}
126
+ li.plupload_done {color:#AAA}
127
+
128
+ li.plupload_delete a {
129
+ background: url('../img/delete.gif');
130
+ }
131
+
132
+ li.plupload_failed a {
133
+ background: url('../img/error.gif');
134
+ cursor: default;
135
+ }
136
+
137
+ li.plupload_done a {
138
+ background: url('../img/done.gif');
139
+ cursor: default;
140
+ }
141
+
142
+ .plupload_progress, .plupload_upload_status {
143
+ display: none;
144
+ }
145
+
146
+ .plupload_progress_container {
147
+ margin-top: 3px;
148
+ border: 1px solid #CCC;
149
+ background: #FFF;
150
+ padding: 1px;
151
+ }
152
+ .plupload_progress_bar {
153
+ width: 0px;
154
+ height: 7px;
155
+ background: #CDEB8B;
156
+ }
157
+
158
+ .plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action {
159
+ margin-right: 17px;
160
+ }
161
+
162
+ /* Floats */
163
+
164
+ .plupload_clear,.plupload_clearer {clear: both;}
165
+ .plupload_clearer, .plupload_progress_bar {
166
+ display: block;
167
+ font-size: 0;
168
+ line-height: 0;
169
+ }
170
+
171
+ li.plupload_droptext {
172
+ background: transparent;
173
+ text-align: center;
174
+ vertical-align: middle;
175
+ border: 0;
176
+ line-height: 165px;
177
+ }
app/assets/css/jquery.powertip.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #powerTip{cursor:default;background-color:#333;background-color:rgba(0,0,0,.8);border-radius:6px;color:#fff;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #333;border-top:10px solid rgba(0,0,0,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #333;border-right:10px solid rgba(0,0,0,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #333;border-bottom:10px solid rgba(0,0,0,.8);top:-10px}#powerTip.w:before{border-left:10px solid #333;border-left:10px solid rgba(0,0,0,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #333;border-top:10px solid rgba(0,0,0,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #333;border-bottom:10px solid rgba(0,0,0,.8);top:-10px}#powerTip.nw-alt:before,#powerTip.ne-alt:before,#powerTip.sw-alt:before,#powerTip.se-alt:before{border-top:10px solid #333;border-top:10px solid rgba(0,0,0,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.sw-alt:before,#powerTip.se-alt:before{border-top:0;border-bottom:10px solid #333;border-bottom:10px solid rgba(0,0,0,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px}
app/assets/css/jquery.sliderTabs.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .ui-slider-tabs{}.ui-slider-tabs-list-wrapper{ position: relative;width:100%;font-family:Arial,sans-serif;margin:0 0 -1px 0;z-index:50;}.ui-slider-tabs-list-wrapper.bottom{ margin: -1px 0 0 0;}.ui-slider-tabs-list-container{ overflow: hidden;}.ui-slider-tabs-list{ padding:0;margin:0 0 0 0;list-style: none;}.ui-slider-tabs-list li{ display: inline-block;border-bottom:1px solid #cfcfcf;border-right:1px solid #cfcfcf;border-top:1px solid #cfcfcf;margin:0;font-size:13px;font-weight:bold;background:#fcfcfc;background: -moz-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#fcfcfc),color-stop(100%,#f5f5f5));background: -webkit-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: -o-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: -ms-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc',endColorstr='#f5f5f5',GradientType=0 );}.ui-slider-tabs-list li a{ display:block;padding:8px 15px;text-decoration: none;color:#555;text-shadow:0px 1px 0px #fff;margin:0;}.ui-slider-tabs-list li a:hover{ color:#000;}.ui-slider-tabs-list li.selected{ border-bottom-color:#fff;border-top-color:#cfcfcf;background:#ffffff;background: -moz-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffffff),color-stop(100%,#ffffff));background: -webkit-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: -o-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: -ms-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: linear-gradient(top,#ffffff 0%,#ffffff 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff',endColorstr='#ffffff',GradientType=0 );}.ui-slider-tabs-list-wrapper.bottom .ui-slider-tabs-list li.selected{ border-top-color:#fff;border-bottom-color:#cfcfcf;}.ui-slider-tabs-list li.selected a{ cursor:default;color:#000;}.ui-slider-tabs-list li:first-of-type{ border-left:1px solid #cfcfcf;}.ui-slider-tabs-content-container{ position: relative;border:1px solid #cfcfcf;z-index:1;overflow: hidden;background-color:#fff;}.ui-slider-tab-content{ position:absolute;display: none;top:0;left:0;padding:10px;}.ui-slider-left-arrow,.ui-slider-right-arrow,.ui-slider-left-arrow.edge:hover,.ui-slider-right-arrow.edge:hover{ display:block;position:absolute;border:1px solid #cfcfcf;background:#fcfcfc;background: -moz-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#fcfcfc),color-stop(100%,#f5f5f5));background: -webkit-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: -o-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: -ms-linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);background: linear-gradient(top,#fcfcfc 0%,#f5f5f5 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc',endColorstr='#f5f5f5',GradientType=0 );}.ui-slider-left-arrow:hover,.ui-slider-right-arrow:hover{ background:#ffffff;background: -moz-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffffff),color-stop(100%,#ffffff));background: -webkit-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: -o-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: -ms-linear-gradient(top,#ffffff 0%,#ffffff 100%);background: linear-gradient(top,#ffffff 0%,#ffffff 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff',endColorstr='#ffffff',GradientType=0 );}.ui-slider-left-arrow{ left:0;top:0;box-shadow:2px 0px 1px rgba(0,0,0,.06);border-top-left-radius:4px;}.ui-slider-left-arrow div{ background-image: url('../img/leftArrow.png');background-repeat: no-repeat;background-position:center center;height: inherit;}.ui-slider-left-arrow.edge div{ opacity: .25;}.ui-slider-left-arrow.edge{ box-shadow: none;cursor:default;}.ui-slider-tabs-list-wrapper.bottom .ui-slider-left-arrow{ border-top-left-radius:0;border-bottom-left-radius:4px;}.ui-slider-right-arrow{ top:0;right:0;box-shadow: -2px 0px 1px rgba(0,0,0,.06);border-top-right-radius:4px;}.ui-slider-right-arrow div{ background-image: url('../img/rightArrow.png');background-repeat: no-repeat;background-position:center center;height: inherit;}.ui-slider-right-arrow.edge div{ opacity: .25;}.ui-slider-right-arrow.edge{ box-shadow: none;cursor:default;}.ui-slider-tabs-list-wrapper.bottom .ui-slider-right-arrow{ border-top-right-radius:0;border-bottom-right-radius:4px;}.ui-slider-tabs-indicator-container{ position:absolute;bottom:0;left:0;width:100%;text-align:center;}.ui-slider-tabs-indicator{ width:10px;height:10px;background-image: url('../img/indicator.png');background-repeat: no-repeat;display: inline-block;margin-right:3px;cursor: pointer;}.ui-slider-tabs-indicator.selected{ background-image: url('../img/indicatorActive.png');}.ui-slider-tabs-leftPanelArrow{ position:absolute;left:0px;width:30px;height:35px;background-image: url('../img/leftPanelArrow.png');background-repeat: no-repeat;background-position:center center;cursor: pointer;opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=5);}.ui-slider-tabs-rightPanelArrow{ position:absolute;right:0px;width:30px;height:35px;background-image: url('../img/rightPanelArrow.png');background-repeat: no-repeat;background-position:center center;cursor: pointer;opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=5);}.ui-slider-tabs-rightPanelArrow.showOnHover,.ui-slider-tabs-leftPanelArrow.showOnHover{ opacity:0;display: none;}.ui-slider-tabs-content-container:hover .ui-slider-tabs-rightPanelArrow.showOnHover,.ui-slider-tabs-content-container:hover .ui-slider-tabs-leftPanelArrow.showOnHover{ opacity: .5;display: inline-block;}.ui-slider-tabs-content-container .ui-slider-tabs-rightPanelArrow:hover,.ui-slider-tabs-content-container .ui-slider-tabs-leftPanelArrow:hover,.ui-slider-tabs-content-container .ui-slider-tabs-rightPanelArrow.showOnHover:hover,.ui-slider-tabs-content-container .ui-slider-tabs-leftPanelArrow.showOnHover:hover{ opacity:1;}
app/assets/css/main.css CHANGED
@@ -1,551 +1 @@
1
- /*
2
- * Default stylesheet for BuddyPress Media
3
- */
4
- #wpbody-content div.metabox-fixed{width: 280px;margin-right: -300px;float: right;}
5
- #wpbody-content div.wrap.bp-media-admin .columns-2{margin-right:300px;padding-top: 0;margin-top: 15px;width: 600px}
6
- #wpbody-content .bp-media-settings-tabs{margin-bottom: 0; }
7
- #wpbody-content .bp-media-settings-tabs .media-nav-tab{margin: 0 10px; text-decoration: underline; text-transform: capitalize}
8
- #wpbody-content .bp-media-settings-tabs .media-nav-tab.media-nav-tab-active{font-weight: bold}
9
-
10
- #wpbody-content .wrap div.bp-media-metabox-holder{padding-top: 0}
11
- .bp-media-social{background: url('../img/bp_media_social.png');height: 35px;width: 35px;display: inline-block;font-size: 0px;margin-right:5px;}
12
- .bp-media-facebook{background-position: 0px 0px;}
13
- .bp-media-facebook:hover{background-position: 0px 36px;}
14
- .bp-media-twitter{background-position: 80px 0px;}
15
- .bp-media-twitter:hover{background-position: 80px 36px;}
16
- .bp-media-rss{background-position: 35px 0px;}
17
- .bp-media-rss:hover{background-position: 35px 36px;}
18
- .bp-media-support .support_list{ margin-left: 25px}
19
- .bp-media-support .support_list li{list-style: disc;margin-bottom: 10px}
20
-
21
- #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a{background:url('../img/bpm-icon-16.png') center 1px no-repeat;}
22
- #adminmenu li.toplevel_page_bp-media-settings:hover .wp-menu-image a,
23
- #adminmenu li.current.toplevel_page_bp-media-settings .wp-menu-image a{background-position: center 1px;}
24
- #adminmenu li.toplevel_page_bp-media-settings .wp-menu-image a img{display:none;}
25
- #bp-media-settings-boxes{border:1px solid #CCC; overflow: hidden; padding: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 98%;}
26
- #debug-info{border:1px solid #CCC; overflow: hidden; padding: 10px; margin-top: 10px; -webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px; float: left; width: 588px;}
27
- .nav-tab-wrapper a#bp-media{background:url('../img/bpm-icon-32.png') transparent no-repeat; padding-left:32px;}
28
- .nav-tab-wrapper a#bp-media:hover,.nav-tab-wrapper a#bp-media.nav-tab-active{background-position:left -96px;}
29
- .metabox-holder .postbox#latest-news .inside ul li{list-style: disc inside;}
30
- /*.metabox-holder .postbox#latest-news .inside ul li{background: transparent url('../img/bpm-icon-32.png') -5px 0px no-repeat; padding-left: 32px;}*/
31
- /*.metabox-holder .postbox#latest-news .inside ul li:hover{background-position-y: -96px;}*/
32
- #branding #logo{text-align:center;padding: 10px 0;display:block;}
33
- ul#social{display:block;text-align:center;margin:0;clear: both;}
34
- #branding #mc-embedded-subscribe-form{float: left;width: 100%;}
35
- #branding label{float: right;}
36
- #branding #mc-embedded-subscribe{float: right;padding: 0 3px;}
37
- #branding #mce-EMAIL{float: left;}
38
- ul#social li{display:inline;}
39
- #spread-the-word .button{display:inline-block; margin: 9px 5px 0 5px;}
40
- #spread-the-word label{display:block;}
41
- #spread-the-word .inside{text-align: center;}
42
- #spread-the-word .button-tweet, #bpmedia-bpalbumimporter .button-import-tweet{background: #33ACE6; border-color: #3399DD #3399DD #2288CC; color: #FFFFFF !important; text-shadow: -1px -1px 0 #3399DD;}
43
- #spread-the-word .button-tweet:hover, #bpmedia-bpalbumimporter .button-import-tweet:hover{background: #3399DD;border-color: #2288CC;box-shadow: 0 0 4px rgba(82, 168, 236, 0.75);}
44
- #spread-the-word .button-rating{background: #8A8A8A; border-color: #222; color: #FFFFFF !important; text-shadow: -1px -1px 0 #444;}
45
- #spread-the-word .button-rating:hover{background: #7E7E7E;border-color: #444;box-shadow: 0 0 4px rgba(128,128,128, 0.75);}
46
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab{padding-left:20px;background:url('../img/tab-icon.png') 3px -4px no-repeat;}
47
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.addons{background-position-y:-34px;}
48
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.support{background-position-y:-64px;}
49
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.update-database{background-position-y:-94px;}
50
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.ffmpeg{background-position-y:-154px;}
51
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.kaltura{background-position-y:-184px;}
52
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.convert-videos{background-position-y:-214px;}
53
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.insta{background-position-y:-244px;}
54
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.watermark{background-position-y:-274px;}
55
-
56
- table.bp-media-encoding-table td, table.bp-media-encoding-table th {
57
- border-left-color: #fff;
58
- border-right-color: #dfdfdf;
59
- border-width: 1px;
60
- vertical-align: middle;
61
- text-align: center;
62
- font-family: sans-serif;
63
- }
64
- table.bp-media-encoding-table th {
65
- font-weight: bold;
66
- }
67
-
68
- /* Addons page Styling */
69
-
70
- a.toplevel_page_bp-media-settings div.wp-menu-image{
71
- background:url('../img/admin-menu.png') 0 -32px no-repeat;
72
- }
73
-
74
- #rt-donate-button, .rt-link img{vertical-align: middle;}
75
- #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings div.wp-menu-image{
76
- background-position: 0 -32px;
77
- }
78
- #adminmenu .menu-icon-generic.wp-has-current-submenu.toplevel_page_bp-media-settings div.wp-menu-image,
79
- #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings:hover div.wp-menu-image{
80
- background-position-y:0;
81
- }
82
-
83
- #bp-media-addons-list_metabox {background: #ffffff}
84
- .products ul:after, ul.products:after {clear: both;content: "";display: block;}
85
- .products ul, ul.products {clear: both;list-style: none outside none;margin: 0 0 14px;padding: 0;}
86
- .bp-media-addon {margin: 0;}
87
- .bp-media-addon.first { }
88
- .bp-media-addon {margin: 20px 10px 30px;padding: 5px;position: relative;border: 1px solid #ccc;}
89
- .bp-media-addon h4 {background: none repeat scroll 0 0 transparent;border: 0 none;color: #006999;cursor: pointer;font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size: 20px;font-weight: normal;line-height: 26px;margin: 0 0 10px;}
90
- .bp-media-addon a {text-decoration: none;}
91
- .bp-media-addon a img, div.product div.images img {box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);}
92
- .bp-media-addon a img {display: block;height: auto;margin: 5px 15px 5px 5px;transition: all 0.2s ease-in-out 0s;float: left; width: 200px}
93
-
94
- .bp-media-addon .price, .bp-media-addon .price .amount, .bp-media-addon .price ins {color: #85AD74;font-size: 25px;font-weight: bold;}
95
- .bp-media-addon .price {line-height: 1.4em;color: #85AD74;display: block;font-weight: normal;margin-bottom: 0.5em;}
96
- .coming-soon { background: url("../img/coming-soon.png"); z-index: 5; position:absolute;height:191px; opacity:0.9;}
97
- .coming-soon.coming-soon-l { background-position: 0 0; width:250px; top:-12px; left:-18px;}
98
- .coming-soon.coming-soon-r { background-position: 347px 0; width:174px; bottom:-14px; right:-12px;}
99
- .coming-soon.coming-soon-r:hover{background-position: 175px 0;}
100
-
101
- .bp-media-addon .product_footer{margin: 20px 0 0;overflow: hidden;}
102
- .bp-media-addon .add_to_cart_button{background: #C45200; color: #FFFFFF;display: inline-block;font-size: 18px;font-weight: bold; line-height: 1.4em; margin: 0 20px; padding: 4px 15px;text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6)}
103
- .bp-media-addon .product_footer .product_demo_link{font-size: 16px;margin: 8px 20px; font-weight: bold}
104
-
105
- .bp-media-addon .add_to_cart_button:hover{background: none repeat scroll 0 0 #D75A00;
106
- box-shadow: 0 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.4) inset;
107
- color: #FFFFFF;}
108
-
109
- div.i-accept{ background-color: #dff0d8 !important; }
110
- div.bp-album-import-accept{ padding: 1px 2px; margin-bottom: 15px; }
111
- .bp-album-importer-wizard { display: none; margin-top: 15px; }
112
- #setting-error-bp-album-importer { line-height: 1.8em; }
113
- .wp-core-ui .btn-warning {
114
- color: #ffffff;
115
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
116
- background-color: #faa732;
117
- *background-color: #f89406;
118
- background-image: -moz-linear-gradient(top, #fbb450, #f89406);
119
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
120
- background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
121
- background-image: -o-linear-gradient(top, #fbb450, #f89406);
122
- background-image: linear-gradient(to bottom, #fbb450, #f89406);
123
- background-repeat: repeat-x;
124
- border-color: #f89406 #f89406 #ad6704;
125
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
126
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
127
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
128
- }
129
-
130
- #item-body a.btn-danger {
131
- padding: 4px 10px;
132
- color: #ffffff;
133
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
134
- background-color: #da4f49;
135
- *background-color: #bd362f;
136
- background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
137
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
138
- background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
139
- background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
140
- background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
141
- background-repeat: repeat-x;
142
- border-color: #bd362f #bd362f #802420;
143
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
144
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
145
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
146
- }
147
-
148
- #item-body a.btn-danger:hover,
149
- #item-body a.btn-danger:focus,
150
- #item-body a.btn-danger:active,
151
- #item-body a.btn-danger.active,
152
- #item-body a.btn-danger.disabled,
153
- #item-body a.btn-danger[disabled] {
154
- color: #ffffff;
155
- border-color: #bd362f #bd362f #802420;
156
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
157
- background: #bd362f;
158
- *background: #a9302a;
159
- }
160
-
161
- #item-body a.btn-danger:active,
162
- #item-body a.btn-danger.active {
163
- border-color: #bd362f #bd362f #802420;
164
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
165
- background: #942a25 \9;
166
- }
167
-
168
-
169
- .wp-core-ui .btn-warning:hover,
170
- .wp-core-ui .btn-warning:focus,
171
- .wp-core-ui .btn-warning:active,
172
- .wp-core-ui .btn-warning.active,
173
- .wp-core-ui .btn-warning.disabled,
174
- .wp-core-ui .btn-warning[disabled] {
175
- color: #ffffff;
176
- background: #f89406;
177
- background-color: #f89406;
178
- *background: #df8505;
179
- *background-color: #df8505;
180
- }
181
-
182
- /* Admin bar Menu */
183
- #wpadminbar .bp-media-settings-menu > .ab-item .ab-icon{background: url("../img/bpm-icon-16.png") no-repeat scroll -8px -7px transparent}
184
- #wpadminbar .bp-media-settings-menu:hover .ab-icon{background-position: -8px -41px}
185
-
186
- /* BuddyPress media admin support form styling */
187
- .bp-media-updated, .bp-media-error{border-radius: 3px; padding: 0 7px; margin: 5px 0 15px; border: 1px solid}
188
- .bp-media-updated p, .bp-media-error p{margin: 0.5em 0;padding: 2px;}
189
- .bp-media-updated{background-color: #FFFFE0;border-color: #E6DB55;}
190
- .bp-media-error{background-color: #FFEBE8;border-color: #CC0000;}
191
- .bp-media-form li{margin-bottom: 10px}
192
- .bp-media-form .bp-media-label{display: inline-block;margin-right: 10px;width: 150px;vertical-align: top; }
193
- .bp-media-form .bp-media-input{background-color: #FFFFFF;border: 1px solid #DFDFDF;border-radius: 3px 3px 3px 3px;color: #333333;line-height: 16px;padding: 5px;width: 220px;}
194
- .bp-media-form .bp-media-checkbox{margin-right: 10px; margin-left: 160px}
195
- .bp-media-form .bp-media-textarea{background-color: #FFFFFF;border: 1px solid #DFDFDF;border-radius: 3px 3px 3px 3px;color: #333333;height: 175px;line-height: 16px;padding: 5px;width: 400px;}
196
- .bp-media-form .bp-media-select{margin: 0;max-width: 400px;}
197
- .bp-media-support-attachment label{float: left}
198
- .bp-media-support-attachment .more-attachment{margin-left: 160px; margin-top: 10px}
199
- .bp-media-support-attachment .more-attachment:first-child{margin-top: 0px}
200
- .bp-media-support-attachment .add-more-attachment-btn{clear: both;display: inline-block;margin-left: 160px;margin-top: 10px;}
201
- .template_select_label{float: left}
202
- .template_select_container{overflow-x:scroll; width:405px;float: left}
203
- #bp_media_settings_form .support_form_loader{height: 100px; width: 200px; background: url("../img/loader.gif") no-repeat }
204
- /* Miscellaneous */
205
- #normal-sortables .postbox .bp-media-form .submit{float: none; margin-left: 150px}
206
- .rt-success{background-color: #E1FFDF;border-color: #2ACF2A;}
207
- .rt-update{background-color: #FFEAA6;border-color:#E1CA82;}
208
- img.bp-media-donation-image{display:block;margin: 10px auto;}
209
- #donate form{text-align: center;}
210
- /*Transcoding Teaser*/
211
- .para-blockquote { background: #E5E5E5; padding: 10px; font-style: italic; }
212
- #latest-update img, #members-list .update img, #members-list .update {display:block; overflow: hidden;}
213
- #rtprogressbar {
214
- background-color: #444;
215
- border-radius: 13px;
216
- padding: 3px;
217
- }
218
-
219
- #rtprogressbar div {
220
- background-color: #fb6003;
221
- width: 0;
222
- height: 20px;
223
- border-radius: 10px;
224
- }
225
-
226
- .encoding-used,
227
- .encoding-remaining { display: inline-block; width: 10px; height: 10px; margin-right: 5px;}
228
- .encoding-used { background : #fb6003; }
229
- .encoding-remaining { background: #444; }
230
-
231
- .bp_media_content img{max-width:100%;}
232
- .bp_media_content .mejs-poster img{max-width: 100%;}
233
- .media .album-edit{display:inline;}
234
- .media #item-body h3 {float: left;}
235
- .media #item-body .bp-media-gallery h3 { float:none; }
236
- .media .bp-media-album-actions {float: left; margin-left: 15px;}
237
- .media .bulk-move, .media .bulk-delete {display: none;}
238
- .media h3 {display:block;font-size:20px;font-weight:bold;}
239
- ul.bp-media-gallery{overflow: hidden}
240
- .bp_media_description {display:block;margin-top:20px;}
241
- #bp-media-upload-form, #message, .bp-media-action-wrapper, #bp-media-user-privacy {clear:left;}
242
- .bp-media-album-action-ui { display:none; }
243
- .bp-media-album-description {clear:left;font-size:1.2em}
244
- ul.bp-media-gallery.item-list{clear:left;overflow:visible;margin: 1% 0;width: auto;}
245
- #item-body ul.bp-media-gallery li{float: left;margin: 1% 1% 0;width: 18%;border-bottom: none;padding: 0;position: static;height:auto; display:block;}
246
- ul.bp-media-gallery li img{max-width:150px;width:100%;height:auto;-moz-box-shadow: 1px 1px 10px #a0a0a0;-webkit-box-shadow: 1px 1px 10px #a0a0a0;box-shadow: 1px 1px 10px #a0a0a0;-moz-transition: box-shadow 0.2s linear;-webkit-transition: box-shadow 0.2s linear;transition: box-shadow 0.2s linear;}
247
- ul.bp-media-gallery li img:hover{-moz-box-shadow: 1px 1px 10px #333;-webkit-box-shadow: 1px 1px 10px #333;box-shadow: 1px 1px 10px #333;}
248
- ul.bp-media-gallery h3{max-width: 150px;overflow: hidden;text-align: center;font-size: 110%;white-space: nowrap;height: 20px;margin: 10px 0px;}
249
- ul.bp-media-gallery a{width:150px;}
250
- ul.bp-media-gallery li span img{height: 150px;}
251
- .bp-media-single .activity-list .activity-content,.bp-media-single div.activity-comments{margin-left:0;}
252
- #bp-media-selected-album{max-width: 320px;}
253
- /*li.media div.activity-content div.activity-inner p{display:none;}*/
254
- .media h3{margin-bottom:10px;}
255
- #bp-media-footer {color: #4D4D4D;text-align: center;text-shadow: #FAFAFA 1px 1px 0;}
256
- /*#bp-media-upload-ui{position: relative;}*/
257
- #item-body:after,ul.bp-media-gallery.item-list:after{content: " ";clear: both;display: block;text-indent: -9999em;}
258
- #item-body{position: relative;}
259
-
260
-
261
- .bp-media-ajax-spinner { display: none; vertical-align: -3px;}
262
- #bp-media-activity-upload-ui { width: 50%;}
263
- .bp-media-area-allocate{height: 10px;width: 100%;display: block;}
264
- li #bp-media-upload-ui {padding: 0;max-width: 158px;position: relative;}
265
- #bp-media-upload-ui {margin-top: 10px; clear: left;}
266
- #bp-media-upload-ui #drag-drop-area{border: 4px dashed #DDD;text-align: center;background: #fafafa;overflow: hidden;padding: 15px 0;}
267
- #bp-media-upload-ui.hover #drag-drop-area {border-color: #83b4d8;}
268
- li #bp-media-upload-ui #drag-drop-area{max-width: 150px;min-height: auto;}
269
- /*.albums li #bp-media-upload-ui #drag-drop-area{padding: 20px 0 10px;}*/
270
- #bp-media-upload-ui .drag-drop-inside{float: left;width: 48%;}
271
- .albums #bp-media-upload-ui .drag-drop-inside{float: none;width: auto;}
272
- li #bp-media-upload-ui .drag-drop-inside,li #bp-media-upload-ui #bp-media-album-prompt{float: none;max-width: 100%;width: auto;}
273
- li #bp-media-upload-ui #bp-media-album-prompt{margin: 8px auto 0;max-width: 144px;}
274
- #bp-media-upload-ui #bp-media-album-prompt{float: left;width: 47%;}
275
- #bp-media-upload-ui .drag-drop-info{font-size:16px;}
276
- #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 20px;line-height: 100%;}
277
- #bp-media-upload-ui .drag-drop-buttons input,#bp-media-album-prompt input.button{-moz-box-sizing: content-box;border-color: #BBBBBB;border-radius: 15px;border-style: solid;border-width: 1px;color: #464646;cursor: pointer;font-size: 13px !important;line-height: 13px;padding: 5px 10px;text-decoration: none;}
278
- li #bp-media-album-prompt input.button{font-size: 12px !important;padding: 3px 8px;text-decoration: none;margin-top: 5px;}
279
- #bp-media-selected-album{max-width: 140px;font-size: 14px;width: 100%;}
280
- li #bp-media-album-prompt > p,li #bp-media-upload-ui #drag-drop-area p{display: none;}
281
- .albums li #bp-media-album-prompt > p,.albums li #bp-media-upload-ui #drag-drop-area p{display: block;}
282
- li #bp-media-upload-ui #drag-drop-area p.drag-drop-buttons{display: block;}
283
- #bp-media-album-prompt div.hide{display: none;margin: 0;}
284
- #bp-media-album-prompt > span{font-size: 16px;}
285
- .bp-media-album-content { display: inline }
286
- /*#bp-media-upload-ui .drag-drop-inside p,#bp-media-album-prompt #bp_media_album_new{font-size: 14px;margin: 0;}*/
287
- #bp-media-album-prompt #bp_media_album_new{max-width: 90%;}
288
- li #bp-media-album-prompt #bp_media_album_new{margin: 0;max-width: 134px;width: 94%;}
289
- #bp-media-upload-ui .drag-drop-to{width: 22px;line-height: 22px;margin: 40px auto 0;float: left;}
290
- li #bp-media-upload-ui .drag-drop-to{width: 100%;line-height: 22px;margin: 0;float: none;}
291
- #bp-media-album-in {background-color: #333333;border-radius: 11px 11px 11px 11px;color: #FFFFFF;display: block;float: left;font-size: 14px;line-height: 22px;width: 22px;}
292
- .upload #bp-media-album-or{font-size: 14px;}
293
- li #bp-media-album-in, .albums li #bp-media-album-or{float: none;margin: 20px auto;}
294
- #bp-media-album-prompt #create-new{background-color: #DF562C;color: #fff;}
295
-
296
- #bp-media-uploaded-files{background: none repeat scroll 0 0 #DDDDDD;margin-top: 5px;width: 100%;}
297
- li #bp-media-uploaded-files{left: 0;position: absolute;top: 155px;}
298
- #bp-media-uploaded-files .error{padding: 5px;text-align: center;}
299
- .bp-media-progressbar{height: 28px;margin: 6px 10px 0 0;line-height: 2em;padding: 0;overflow: hidden;margin-bottom: 2px;border: 1px solid #D1D1D1;background: white;background-image: linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -o-linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -moz-linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -webkit-linear-gradient(bottom,white 0,#F7F7F7 100%);background-image: -ms-linear-gradient(bottom,white 0,#F7F7F7 100%);-webkit-border-radius: 3px;border-radius: 3px;-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1)}
300
- .bp-media-progress-text{z-index: 10;position: relative;width: 100%;padding: 0 8px;text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);color: rgba(0, 0, 0, 0.6);font-size:16px;line-height: 28px;height: 28px;}
301
- .bp-media-progress-completed{z-index: 9;width: 0;height: 35px;margin-top: -35px;background-color: #83B4D8;background-image: linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -o-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -moz-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -webkit-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);background-image: -ms-linear-gradient(bottom,#72A7CF 0,#90C5EE 100%);-webkit-border-radius: 3px;border-radius: 3px;-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);}
302
- .bpm-aligncenter{display: inline-block;text-align: center;width: 100%;}
303
- #bp-media-premium-addons ul,#bp-media-premium-addons li{list-style:disc;margin-left:10px;}
304
- .bp-media-single div.bp_media_content{text-align:center;width: auto;
305
- margin: 0 auto;
306
- position: relative; clear: both; }
307
- .bp-media-single .bp_media_content .mejs-container{margin-left:auto;margin-right:auto;}
308
-
309
- .bp-media-actions{margin:20px 0;}
310
- .bp-media-actions a{display:inline-block;}
311
-
312
- .media-tabs-container .ui-tabs-panel{}
313
- .media-tabs-container .ui-tabs-hide{display: none}
314
-
315
- .media-tabs-container .ui-tabs-nav{clear: both;display: block;margin: 0 0 15px;overflow: hidden;}
316
- .media-tabs-container .ui-state-default{border-left: 1px solid;float: left;line-height: 110%;padding: 0 5px; list-style: none;}
317
- .media-tabs-container .ui-state-default:first-child{margin-left: 0px;border: 0; padding-left: 0}
318
-
319
- .media-tabs-container .ui-state-default a{text-decoration: none}
320
- .media-tabs-container .ui-state-default.ui-state-active a{text-decoration: underline}
321
-
322
- .media-tabs-container .widget-item-listing li{position:relative; margin-top: 10px;overflow: hidden;min-height: 52px; float:left; width:50%;}
323
- .media-tabs-container .widget-item-listing li img{max-width:90%; margin:0 auto; float: left; display: block }
324
- .media-tabs-container .widget-item-listing li h3 {position:absolute; bottom:0;margin: 0; display:none; background:#fff none; width:100%;text-align:center;}
325
- .media-tabs-container .widget-item-listing li:hover h3{display:block;}
326
- .media-tabs-container .widget-item-listing li h3 a{font-size: 13px;font-weight: normal;word-wrap: break-word; }
327
-
328
- #bp-media-show-more{width: 200px;margin-left: auto;margin-right: auto;display: block;height: 30px;line-height: 30px;font-size: 20px;}
329
- #bp-media-show-more-sc {display:block; margin: 0 auto;}
330
- #bp-media-upload-ui.activity-component{margin-left: 74px;margin-top: 10px;}
331
- ul#activity-stream li.media.album_updated ul{}
332
- ul#activity-stream li.media.album_updated ul li,ul.bp-media-list-media li{float: left;margin-right:2%}
333
-
334
-
335
- body.media {overflow:auto;}
336
- .media ul#bp-media-upload-set-privacy li input[type="radio"]{float:left;}
337
- /* Privacy settings */
338
- #bp-media-upload-set-privacy li{margin: 10px 0;overflow: hidden;}
339
- #bp-media-upload-set-privacy .album-set-privacy-radio{}
340
- #bp-media-upload-set-privacy .album-set-privacy-label{margin: 0;font-weight: normal;}
341
-
342
- .bp-media-single .delete-activity-single,.bp-media-single .delete-activity{
343
- color: #ff0000;
344
- font-weight:bold;
345
- }
346
- .simplemodal-overlay{
347
- background:#333 none;
348
- z-index: 100000;
349
- }
350
- .simplemodal-container{
351
- background:#fff none;
352
- }
353
- .bp-media-mod-title{
354
- display:none;
355
- }
356
-
357
- .bp-media-ajax-single{
358
- padding:0;
359
- }
360
- .bp-media-ajax-single .lightbox-spinner{
361
- height:24px;
362
- width:24px;
363
- background: url("../img/boxspinner.gif") center center;
364
- left:50%;
365
- top:50%;
366
- position:absolute;
367
- }
368
- .simplemodal-container .simplemodal-close{
369
- background: url("../img/bp-media-modal.png") right bottom no-repeat;
370
- width:22px;
371
- height:22px;
372
- display:block;
373
- position:absolute;
374
- right:0px;
375
- top:0px;
376
- cursor: pointer;
377
- }
378
- .simplemodal-container .simplemodal-close:hover{
379
- background-position: right top;
380
- }
381
- .simplemodal-container a.modal-ctrl{
382
- position:absolute;
383
- height:100%;
384
- height:100px;
385
- width:100px;
386
- top:50%;
387
- margin-top:-50px;
388
- cursor: pointer;
389
- }
390
- .simplemodal-container a.modal-ctrl:hover{
391
- background: #232323 none;
392
- }
393
- .simplemodal-container a.modal-ctrl span.img-icon{
394
- display: block;
395
- height:22px;
396
- width:22px;
397
- margin:39px auto 39px 10px;
398
-
399
- background: url("../img/bp-media-modal.png") left bottom no-repeat;
400
- }
401
- .simplemodal-container a.modal-next span.img-icon{
402
- background-position: center bottom;
403
- margin:39px 10px 39px auto;
404
- }
405
- .simplemodal-container a.modal-prev:hover span.img-icon{
406
- background-position: left top;
407
- }
408
- .simplemodal-container a.modal-next:hover span.img-icon{
409
- background-position: center top;
410
- }
411
- .simplemodal-container a.modal-prev:hover,
412
- .simplemodal-container a.modal-next:hover{
413
- background:url("../img/") no-repeat;
414
- }
415
- .simplemodal-container a.modal-prev{
416
- left: 0px;
417
- }
418
- .simplemodal-container a.modal-next{
419
- right: 0px;
420
- }
421
-
422
- .bp-media-ajax-single .bp-media-mod-title{
423
- display:block;
424
- margin-top:22px;
425
- }
426
- .bp-media-ajax-single .bp-media-mod-title h2{
427
- margin: 5px 0;
428
- padding:0;
429
- }
430
- .bp-media-ajax-single .bp-media-mod-title p{
431
- line-height:1.4em;
432
- }
433
- .bp-media-ajax-single .bp_media_content img,
434
- .bp-media-ajax-single .bp_media_content video,
435
- .bp-media-ajax-single .bp_media_content audio{
436
- max-width: 100%;
437
- display:inline-block;
438
- margin:0 auto;
439
- vertical-align: middle;
440
- background:#fff none;
441
- max-height:600px;
442
- }
443
- .bp-media-ajax-single .bp_media_author{
444
- position:absolute;
445
- top:0;
446
- left:0;
447
- }
448
- .bp-media-ajax-single .bp-media-content-wrap,
449
- .bp-media-ajax-single .bp_media_content{
450
- float:left;
451
- width:auto;
452
- margin:0;
453
- position:relative;
454
- overflow:hidden;
455
- height:480px;
456
- min-width:640px;
457
- background: #333 none;
458
- display:table;
459
-
460
- }
461
- .bp-media-ajax-single .bp_media_content{
462
- display:table-cell;
463
- vertical-align: middle;
464
- float:none;
465
- }
466
- .bp-media-ajax-single .bp-media-content-wrap .bp_media_description{
467
- display:block;
468
- position:absolute;
469
- bottom:0;
470
- left:0;
471
- }
472
- .bp-media-ajax-single .bp-media-meta-content-wrap{
473
- float:left;
474
- width:250px;
475
- margin:0;
476
- min-height:480px;
477
- margin-left:10px;
478
- overflow:auto;
479
- }
480
- .bp-media-ajax-single .bp-media-meta-content-wrap .activity-meta{
481
- margin:0;
482
- }
483
- .bp-media-ajax-single .bp-media-meta-content-wrap .activity-meta a{
484
- padding: 2px 8px;
485
- margin: 5px 5px 0 0;
486
- display:inline-block;
487
- }
488
- .bp-media-ajax-single .bp-media-meta-content-wrap div.activity-comments ul li > ul{
489
- margin-left:0;
490
- padding-left:0;
491
- }
492
- .bp-media-ajax-single .bp-media-meta-content-wrap div.activity-comments form div.ac-reply-content{
493
- margin-left:0;
494
- padding-left:0;
495
- }
496
- /*.bp-media-ajax-single .bp-media-meta-content-wrap div.activity-meta a {
497
- padding: 0;
498
- float:left;
499
- }*/
500
- .bp-media-ajax-preloader{
501
- display:none;
502
- }
503
-
504
- #adminmenu li#toplevel_page_bp-media-settings a.toplevel_page_bp-media-settings { font-size: 12px; }
505
-
506
- @media (min-width: 981px) and (max-width: 1096px) {
507
- li #bp-media-upload-ui #drag-drop-area{padding: 10px 0;}
508
- /* li #bp-media-upload-ui .drag-drop-inside{margin: 0 auto;}*/
509
- li #bp-media-album-in, .albums li #bp-media-album-or{margin: 15px auto;}
510
- li #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 17px;}
511
- li #bp-media-upload-ui .drag-drop-buttons input{padding: 3px 8px;}
512
- li #bp-media-uploaded-files{top: 130px}
513
- li #bp-media-upload-ui #bp-media-album-prompt{margin-top: 0;}
514
- li #bp-media-album-prompt input.button{padding: 3px;}
515
- /* .albums li #bp-media-upload-ui #drag-drop-area{padding: 10px 0 0;}*/
516
- }
517
- @media (max-width: 980px) {
518
- #item-body ul.bp-media-gallery li{width: 23%;}
519
- li #bp-media-upload-ui #drag-drop-area{min-height: auto;}
520
- }
521
- @media (min-width: 850px) and (max-width: 930px) {
522
- li #bp-media-album-in, .albums li #bp-media-album-or{margin: 15px auto;}
523
- li #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 17px;}
524
- li #bp-media-upload-ui .drag-drop-buttons input{padding: 3px 8px;}
525
- }
526
- @media (max-width: 850px) {
527
- #item-body ul.bp-media-gallery li{width: 31%;}
528
- #bp-media-upload-ui .drag-drop-inside{width: 47%;}
529
- #bp-media-upload-ui #bp-media-album-prompt{width: 46%;}
530
- }
531
- @media (min-width: 481px) and (max-width: 525px) {
532
- li #bp-media-album-in, .albums li #bp-media-album-or{margin: 15px auto;}
533
- li #bp-media-upload-ui .drag-drop-inside p.drag-drop-info{font-size: 17px;}
534
- li #bp-media-upload-ui .drag-drop-buttons input{padding: 3px 8px;}
535
- }
536
- @media (max-width: 480px) {
537
- #item-body ul.bp-media-gallery li{width: 48%;}
538
- li #bp-media-upload-ui{max-width: 170px;}
539
- ul.bp-media-gallery li img,li #bp-media-upload-ui #drag-drop-area{max-width: 170px;width: 100%;}
540
- li #bp-media-upload-ui #drag-drop-area{max-width: 162px;padding: 20px 0;}
541
- #bp-media-upload-ui .drag-drop-area{padding: 23px 0 10px;}
542
- /* li #bp-media-upload-ui .drag-drop-inside{margin: 0 auto 23px;}*/
543
- }
544
- @media (max-width: 379px) {
545
- #bp-media-upload-ui{min-height: 190px;}
546
- #item-body ul.bp-media-gallery li{width: 95%;}
547
- #bp-media-upload-ui .drag-drop-inside{float: none;width: 100%;}
548
- #bp-media-album-in{float: none;}
549
- #bp-media-upload-ui #bp-media-album-prompt{margin: 15px auto 15px;float: none;width: 100%}
550
- #bp-media-upload-ui .drag-drop-inside p,#bp-media-album-prompt #bp_media_album_new{margin-bottom: 5px;}
551
- }
1
+ .rtmedia-container,.rtmedia-activity-container{padding:5px;margin:0;clear:left}.rtmedia-container html,.rtmedia-activity-container html,.rtmedia-container body,.rtmedia-activity-container body,.rtmedia-container div,.rtmedia-activity-container div,.rtmedia-container span,.rtmedia-activity-container span,.rtmedia-container applet,.rtmedia-activity-container applet,.rtmedia-container object,.rtmedia-activity-container object,.rtmedia-container iframe,.rtmedia-activity-container iframe,.rtmedia-container h1,.rtmedia-activity-container h1,.rtmedia-container h2,.rtmedia-activity-container h2,.rtmedia-container h3,.rtmedia-activity-container h3,.rtmedia-container h4,.rtmedia-activity-container h4,.rtmedia-container h5,.rtmedia-activity-container h5,.rtmedia-container h6,.rtmedia-activity-container h6,.rtmedia-container p,.rtmedia-activity-container p,.rtmedia-container blockquote,.rtmedia-activity-container blockquote,.rtmedia-container pre,.rtmedia-activity-container pre,.rtmedia-container a,.rtmedia-activity-container a,.rtmedia-container abbr,.rtmedia-activity-container abbr,.rtmedia-container acronym,.rtmedia-activity-container acronym,.rtmedia-container address,.rtmedia-activity-container address,.rtmedia-container big,.rtmedia-activity-container big,.rtmedia-container cite,.rtmedia-activity-container cite,.rtmedia-container code,.rtmedia-activity-container code,.rtmedia-container del,.rtmedia-activity-container del,.rtmedia-container dfn,.rtmedia-activity-container dfn,.rtmedia-container em,.rtmedia-activity-container em,.rtmedia-container img,.rtmedia-activity-container img,.rtmedia-container ins,.rtmedia-activity-container ins,.rtmedia-container kbd,.rtmedia-activity-container kbd,.rtmedia-container q,.rtmedia-activity-container q,.rtmedia-container s,.rtmedia-activity-container s,.rtmedia-container samp,.rtmedia-activity-container samp,.rtmedia-container small,.rtmedia-activity-container small,.rtmedia-container strike,.rtmedia-activity-container strike,.rtmedia-container strong,.rtmedia-activity-container strong,.rtmedia-container sub,.rtmedia-activity-container sub,.rtmedia-container sup,.rtmedia-activity-container sup,.rtmedia-container tt,.rtmedia-activity-container tt,.rtmedia-container var,.rtmedia-activity-container var,.rtmedia-container b,.rtmedia-activity-container b,.rtmedia-container u,.rtmedia-activity-container u,.rtmedia-container i,.rtmedia-activity-container i,.rtmedia-container center,.rtmedia-activity-container center,.rtmedia-container dl,.rtmedia-activity-container dl,.rtmedia-container dt,.rtmedia-activity-container dt,.rtmedia-container dd,.rtmedia-activity-container dd,.rtmedia-container ol,.rtmedia-activity-container ol,.rtmedia-container ul,.rtmedia-activity-container ul,.rtmedia-container li,.rtmedia-activity-container li,.rtmedia-container fieldset,.rtmedia-activity-container fieldset,.rtmedia-container form,.rtmedia-activity-container form,.rtmedia-container label,.rtmedia-activity-container label,.rtmedia-container legend,.rtmedia-activity-container legend,.rtmedia-container table,.rtmedia-activity-container table,.rtmedia-container caption,.rtmedia-activity-container caption,.rtmedia-container tbody,.rtmedia-activity-container tbody,.rtmedia-container tfoot,.rtmedia-activity-container tfoot,.rtmedia-container thead,.rtmedia-activity-container thead,.rtmedia-container tr,.rtmedia-activity-container tr,.rtmedia-container th,.rtmedia-activity-container th,.rtmedia-container td,.rtmedia-activity-container td,.rtmedia-container article,.rtmedia-activity-container article,.rtmedia-container aside,.rtmedia-activity-container aside,.rtmedia-container canvas,.rtmedia-activity-container canvas,.rtmedia-container details,.rtmedia-activity-container details,.rtmedia-container embed,.rtmedia-activity-container embed,.rtmedia-container figure,.rtmedia-activity-container figure,.rtmedia-container figcaption,.rtmedia-activity-container figcaption,.rtmedia-container footer,.rtmedia-activity-container footer,.rtmedia-container header,.rtmedia-activity-container header,.rtmedia-container hgroup,.rtmedia-activity-container hgroup,.rtmedia-container menu,.rtmedia-activity-container menu,.rtmedia-container nav,.rtmedia-activity-container nav,.rtmedia-container output,.rtmedia-activity-container output,.rtmedia-container ruby,.rtmedia-activity-container ruby,.rtmedia-container section,.rtmedia-activity-container section,.rtmedia-container summary,.rtmedia-activity-container summary,.rtmedia-container time,.rtmedia-activity-container time,.rtmedia-container mark,.rtmedia-activity-container mark,.rtmedia-container audio,.rtmedia-activity-container audio,.rtmedia-container video,.rtmedia-activity-container video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}.rtmedia-container html,.rtmedia-activity-container html{line-height:1}.rtmedia-container ol,.rtmedia-activity-container ol,.rtmedia-container ul,.rtmedia-activity-container ul{list-style:none}.rtmedia-container table,.rtmedia-activity-container table{border-collapse:collapse;border-spacing:0}.rtmedia-container caption,.rtmedia-activity-container caption,.rtmedia-container th,.rtmedia-activity-container th,.rtmedia-container td,.rtmedia-activity-container td{text-align:left;font-weight:normal;vertical-align:middle}.rtmedia-container q,.rtmedia-activity-container q,.rtmedia-container blockquote,.rtmedia-activity-container blockquote{quotes:none}.rtmedia-container q:before,.rtmedia-activity-container q:before,.rtmedia-container q:after,.rtmedia-activity-container q:after,.rtmedia-container blockquote:before,.rtmedia-activity-container blockquote:before,.rtmedia-container blockquote:after,.rtmedia-activity-container blockquote:after{content:"";content:none}.rtmedia-container a img,.rtmedia-activity-container a img{border:none}.rtmedia-container article,.rtmedia-activity-container article,.rtmedia-container aside,.rtmedia-activity-container aside,.rtmedia-container details,.rtmedia-activity-container details,.rtmedia-container figcaption,.rtmedia-activity-container figcaption,.rtmedia-container figure,.rtmedia-activity-container figure,.rtmedia-container footer,.rtmedia-activity-container footer,.rtmedia-container header,.rtmedia-activity-container header,.rtmedia-container hgroup,.rtmedia-activity-container hgroup,.rtmedia-container menu,.rtmedia-activity-container menu,.rtmedia-container nav,.rtmedia-activity-container nav,.rtmedia-container section,.rtmedia-activity-container section,.rtmedia-container summary,.rtmedia-activity-container summary{display:block}.rtmedia-container *,.rtmedia-activity-container *,.rtmedia-container *:before,.rtmedia-activity-container *:before,.rtmedia-container *:after,.rtmedia-activity-container *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.rtmedia-container html,.rtmedia-activity-container html,.rtmedia-container body,.rtmedia-activity-container body{font-size:100%}.rtmedia-container body,.rtmedia-activity-container body{background:#fff;color:#222;padding:0;margin:0;font-family:"Helvetica Neue","Helvetica",Helvetica,Arial,sans-serif;font-weight:normal;font-style:normal;line-height:1;position:relative;cursor:default}.rtmedia-container a:hover,.rtmedia-activity-container a:hover{cursor:pointer}.rtmedia-container a:focus,.rtmedia-activity-container a:focus{outline:none}.rtmedia-container img,.rtmedia-activity-container img,.rtmedia-container object,.rtmedia-activity-container object,.rtmedia-container embed,.rtmedia-activity-container embed{max-width:100%;height:auto}.rtmedia-container object,.rtmedia-activity-container object,.rtmedia-container embed,.rtmedia-activity-container embed{height:100%}.rtmedia-container img,.rtmedia-activity-container img{-ms-interpolation-mode:bicubic}.rtmedia-container #map_canvas img,.rtmedia-activity-container #map_canvas img,.rtmedia-container #map_canvas embed,.rtmedia-activity-container #map_canvas embed,.rtmedia-container #map_canvas object,.rtmedia-activity-container #map_canvas object,.rtmedia-container .map_canvas img,.rtmedia-activity-container .map_canvas img,.rtmedia-container .map_canvas embed,.rtmedia-activity-container .map_canvas embed,.rtmedia-container .map_canvas object,.rtmedia-activity-container .map_canvas object{max-width:none !important}.rtmedia-container .left,.rtmedia-activity-container .left{float:left !important}.rtmedia-container .right,.rtmedia-activity-container .right{float:right !important}.rtmedia-container .text-left,.rtmedia-activity-container .text-left{text-align:left !important}.rtmedia-container .text-right,.rtmedia-activity-container .text-right{text-align:right !important}.rtmedia-container .text-center,.rtmedia-activity-container .text-center{text-align:center !important}.rtmedia-container .text-justify,.rtmedia-activity-container .text-justify{text-align:justify !important}.rtmedia-container .hide,.rtmedia-activity-container .hide{display:none}.rtmedia-container .antialiased,.rtmedia-activity-container .antialiased{-webkit-font-smoothing:antialiased}.rtmedia-container img,.rtmedia-activity-container img{display:inline-block;vertical-align:middle}.rtmedia-container textarea,.rtmedia-activity-container textarea{height:auto;min-height:50px}.rtmedia-container select,.rtmedia-activity-container select{width:100%}.rtmedia-container .row,.rtmedia-activity-container .row{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1}.rtmedia-container .row:before,.rtmedia-activity-container .row:before,.rtmedia-container .row:after,.rtmedia-activity-container .row:after{content:" ";display:table}.rtmedia-container .row:after,.rtmedia-activity-container .row:after{clear:both}.rtmedia-container .row.collapse .column,.rtmedia-activity-container .row.collapse .column,.rtmedia-container .row.collapse .columns,.rtmedia-activity-container .row.collapse .columns{position:relative;padding-left:0;padding-right:0;float:left}.rtmedia-container .row .row,.rtmedia-activity-container .row .row{width:auto;margin-left:-0.9375em;margin-right:-0.9375em;margin-top:0;margin-bottom:0;max-width:none;*zoom:1}.rtmedia-container .row .row:before,.rtmedia-activity-container .row .row:before,.rtmedia-container .row .row:after,.rtmedia-activity-container .row .row:after{content:" ";display:table}.rtmedia-container .row .row:after,.rtmedia-activity-container .row .row:after{clear:both}.rtmedia-container .row .row.collapse,.rtmedia-activity-container .row .row.collapse{width:auto;margin:0;max-width:none;*zoom:1}.rtmedia-container .row .row.collapse:before,.rtmedia-activity-container .row .row.collapse:before,.rtmedia-container .row .row.collapse:after,.rtmedia-activity-container .row .row.collapse:after{content:" ";display:table}.rtmedia-container .row .row.collapse:after,.rtmedia-activity-container .row .row.collapse:after{clear:both}.rtmedia-container .column,.rtmedia-activity-container .column,.rtmedia-container .columns,.rtmedia-activity-container .columns{position:relative;padding-left:0.9375em;padding-right:0.9375em;width:100%;float:left}@media only screen{.rtmedia-container .column,.rtmedia-activity-container .column,.rtmedia-container .columns,.rtmedia-activity-container .columns{position:relative;padding-left:0.9375em;padding-right:0.9375em;float:left}.rtmedia-container .small-1,.rtmedia-activity-container .small-1{position:relative;width:8.33333%}.rtmedia-container .small-2,.rtmedia-activity-container .small-2{position:relative;width:16.66667%}.rtmedia-container .small-3,.rtmedia-activity-container .small-3{position:relative;width:25%}.rtmedia-container .small-4,.rtmedia-activity-container .small-4{position:relative;width:33.33333%}.rtmedia-container .small-5,.rtmedia-activity-container .small-5{position:relative;width:41.66667%}.rtmedia-container .small-6,.rtmedia-activity-container .small-6{position:relative;width:50%}.rtmedia-container .small-7,.rtmedia-activity-container .small-7{position:relative;width:58.33333%}.rtmedia-container .small-8,.rtmedia-activity-container .small-8{position:relative;width:66.66667%}.rtmedia-container .small-9,.rtmedia-activity-container .small-9{position:relative;width:75%}.rtmedia-container .small-10,.rtmedia-activity-container .small-10{position:relative;width:83.33333%}.rtmedia-container .small-11,.rtmedia-activity-container .small-11{position:relative;width:91.66667%}.rtmedia-container .small-12,.rtmedia-activity-container .small-12{position:relative;width:100%}.rtmedia-container .small-offset-0,.rtmedia-activity-container .small-offset-0{position:relative;margin-left:0%}.rtmedia-container .small-offset-1,.rtmedia-activity-container .small-offset-1{position:relative;margin-left:8.33333%}.rtmedia-container .small-offset-2,.rtmedia-activity-container .small-offset-2{position:relative;margin-left:16.66667%}.rtmedia-container .small-offset-3,.rtmedia-activity-container .small-offset-3{position:relative;margin-left:25%}.rtmedia-container .small-offset-4,.rtmedia-activity-container .small-offset-4{position:relative;margin-left:33.33333%}.rtmedia-container .small-offset-5,.rtmedia-activity-container .small-offset-5{position:relative;margin-left:41.66667%}.rtmedia-container .small-offset-6,.rtmedia-activity-container .small-offset-6{position:relative;margin-left:50%}.rtmedia-container .small-offset-7,.rtmedia-activity-container .small-offset-7{position:relative;margin-left:58.33333%}.rtmedia-container .small-offset-8,.rtmedia-activity-container .small-offset-8{position:relative;margin-left:66.66667%}.rtmedia-container .small-offset-9,.rtmedia-activity-container .small-offset-9{position:relative;margin-left:75%}.rtmedia-container .small-offset-10,.rtmedia-activity-container .small-offset-10{position:relative;margin-left:83.33333%}.rtmedia-container [class*="column"]+[class*="column"]:last-child,.rtmedia-activity-container [class*="column"]+[class*="column"]:last-child{float:right}.rtmedia-container [class*="column"]+[class*="column"].end,.rtmedia-activity-container [class*="column"]+[class*="column"].end{float:left}.rtmedia-container .column.small-centered,.rtmedia-activity-container .column.small-centered,.rtmedia-container .columns.small-centered,.rtmedia-activity-container .columns.small-centered{position:relative;margin-left:auto;margin-right:auto;float:none !important}}@media only screen and (min-width: 768px){.rtmedia-container .large-1,.rtmedia-activity-container .large-1{position:relative;width:8.33333%}.rtmedia-container .large-2,.rtmedia-activity-container .large-2{position:relative;width:16.66667%}.rtmedia-container .large-3,.rtmedia-activity-container .large-3{position:relative;width:25%}.rtmedia-container .large-4,.rtmedia-activity-container .large-4{position:relative;width:33.33333%}.rtmedia-container .large-5,.rtmedia-activity-container .large-5{position:relative;width:41.66667%}.rtmedia-container .large-6,.rtmedia-activity-container .large-6{position:relative;width:50%}.rtmedia-container .large-7,.rtmedia-activity-container .large-7{position:relative;width:58.33333%}.rtmedia-container .large-8,.rtmedia-activity-container .large-8{position:relative;width:66.66667%}.rtmedia-container .large-9,.rtmedia-activity-container .large-9{position:relative;width:75%}.rtmedia-container .large-10,.rtmedia-activity-container .large-10{position:relative;width:83.33333%}.rtmedia-container .large-11,.rtmedia-activity-container .large-11{position:relative;width:91.66667%}.rtmedia-container .large-12,.rtmedia-activity-container .large-12{position:relative;width:100%}.rtmedia-container .row .large-offset-0,.rtmedia-activity-container .row .large-offset-0{position:relative;margin-left:0%}.rtmedia-container .row .large-offset-1,.rtmedia-activity-container .row .large-offset-1{position:relative;margin-left:8.33333%}.rtmedia-container .row .large-offset-2,.rtmedia-activity-container .row .large-offset-2{position:relative;margin-left:16.66667%}.rtmedia-container .row .large-offset-3,.rtmedia-activity-container .row .large-offset-3{position:relative;margin-left:25%}.rtmedia-container .row .large-offset-4,.rtmedia-activity-container .row .large-offset-4{position:relative;margin-left:33.33333%}.rtmedia-container .row .large-offset-5,.rtmedia-activity-container .row .large-offset-5{position:relative;margin-left:41.66667%}.rtmedia-container .row .large-offset-6,.rtmedia-activity-container .row .large-offset-6{position:relative;margin-left:50%}.rtmedia-container .row .large-offset-7,.rtmedia-activity-container .row .large-offset-7{position:relative;margin-left:58.33333%}.rtmedia-container .row .large-offset-8,.rtmedia-activity-container .row .large-offset-8{position:relative;margin-left:66.66667%}.rtmedia-container .row .large-offset-9,.rtmedia-activity-container .row .large-offset-9{position:relative;margin-left:75%}.rtmedia-container .row .large-offset-10,.rtmedia-activity-container .row .large-offset-10{position:relative;margin-left:83.33333%}.rtmedia-container .row .large-offset-11,.rtmedia-activity-container .row .large-offset-11{position:relative;margin-left:91.66667%}.rtmedia-container .push-1,.rtmedia-activity-container .push-1{position:relative;left:8.33333%;right:auto}.rtmedia-container .pull-1,.rtmedia-activity-container .pull-1{position:relative;right:8.33333%;left:auto}.rtmedia-container .push-2,.rtmedia-activity-container .push-2{position:relative;left:16.66667%;right:auto}.rtmedia-container .pull-2,.rtmedia-activity-container .pull-2{position:relative;right:16.66667%;left:auto}.rtmedia-container .push-3,.rtmedia-activity-container .push-3{position:relative;left:25%;right:auto}.rtmedia-container .pull-3,.rtmedia-activity-container .pull-3{position:relative;right:25%;left:auto}.rtmedia-container .push-4,.rtmedia-activity-container .push-4{position:relative;left:33.33333%;right:auto}.rtmedia-container .pull-4,.rtmedia-activity-container .pull-4{position:relative;right:33.33333%;left:auto}.rtmedia-container .push-5,.rtmedia-activity-container .push-5{position:relative;left:41.66667%;right:auto}.rtmedia-container .pull-5,.rtmedia-activity-container .pull-5{position:relative;right:41.66667%;left:auto}.rtmedia-container .push-6,.rtmedia-activity-container .push-6{position:relative;left:50%;right:auto}.rtmedia-container .pull-6,.rtmedia-activity-container .pull-6{position:relative;right:50%;left:auto}.rtmedia-container .push-7,.rtmedia-activity-container .push-7{position:relative;left:58.33333%;right:auto}.rtmedia-container .pull-7,.rtmedia-activity-container .pull-7{position:relative;right:58.33333%;left:auto}.rtmedia-container .push-8,.rtmedia-activity-container .push-8{position:relative;left:66.66667%;right:auto}.rtmedia-container .pull-8,.rtmedia-activity-container .pull-8{position:relative;right:66.66667%;left:auto}.rtmedia-container .push-9,.rtmedia-activity-container .push-9{position:relative;left:75%;right:auto}.rtmedia-container .pull-9,.rtmedia-activity-container .pull-9{position:relative;right:75%;left:auto}.rtmedia-container .push-10,.rtmedia-activity-container .push-10{position:relative;left:83.33333%;right:auto}.rtmedia-container .pull-10,.rtmedia-activity-container .pull-10{position:relative;right:83.33333%;left:auto}.rtmedia-container .push-11,.rtmedia-activity-container .push-11{position:relative;left:91.66667%;right:auto}.rtmedia-container .pull-11,.rtmedia-activity-container .pull-11{position:relative;right:91.66667%;left:auto}.rtmedia-container .column.large-centered,.rtmedia-activity-container .column.large-centered,.rtmedia-container .columns.large-centered,.rtmedia-activity-container .columns.large-centered{position:relative;margin-left:auto;margin-right:auto;float:none !important}.rtmedia-container .column.large-uncentered,.rtmedia-activity-container .column.large-uncentered,.rtmedia-container .columns.large-uncentered,.rtmedia-activity-container .columns.large-uncentered{margin-left:0;margin-right:0;float:left !important}.rtmedia-container .column.large-uncentered.opposite,.rtmedia-activity-container .column.large-uncentered.opposite,.rtmedia-container .columns.large-uncentered.opposite,.rtmedia-activity-container .columns.large-uncentered.opposite{float:right !important}}.rtmedia-container .show-for-small,.rtmedia-activity-container .show-for-small,.rtmedia-container .show-for-medium-down,.rtmedia-activity-container .show-for-medium-down,.rtmedia-container .show-for-large-down,.rtmedia-activity-container .show-for-large-down{display:inherit !important}.rtmedia-container .show-for-medium,.rtmedia-activity-container .show-for-medium,.rtmedia-container .show-for-medium-up,.rtmedia-activity-container .show-for-medium-up,.rtmedia-container .show-for-large,.rtmedia-activity-container .show-for-large,.rtmedia-container .show-for-large-up,.rtmedia-activity-container .show-for-large-up,.rtmedia-container .show-for-xlarge,.rtmedia-activity-container .show-for-xlarge{display:none !important}.rtmedia-container .hide-for-medium,.rtmedia-activity-container .hide-for-medium,.rtmedia-container .hide-for-medium-up,.rtmedia-activity-container .hide-for-medium-up,.rtmedia-container .hide-for-large,.rtmedia-activity-container .hide-for-large,.rtmedia-container .hide-for-large-up,.rtmedia-activity-container .hide-for-large-up,.rtmedia-container .hide-for-xlarge,.rtmedia-activity-container .hide-for-xlarge{display:inherit !important}.rtmedia-container .hide-for-small,.rtmedia-activity-container .hide-for-small,.rtmedia-container .hide-for-medium-down,.rtmedia-activity-container .hide-for-medium-down,.rtmedia-container .hide-for-large-down,.rtmedia-activity-container .hide-for-large-down{display:none !important}.rtmedia-container table.show-for-small,.rtmedia-activity-container table.show-for-small,.rtmedia-container table.show-for-medium-down,.rtmedia-activity-container table.show-for-medium-down,.rtmedia-container table.show-for-large-down,.rtmedia-activity-container table.show-for-large-down,.rtmedia-container table.hide-for-medium,.rtmedia-activity-container table.hide-for-medium,.rtmedia-container table.hide-for-medium-up,.rtmedia-activity-container table.hide-for-medium-up,.rtmedia-container table.hide-for-large,.rtmedia-activity-container table.hide-for-large,.rtmedia-container table.hide-for-large-up,.rtmedia-activity-container table.hide-for-large-up,.rtmedia-container table.hide-for-xlarge,.rtmedia-activity-container table.hide-for-xlarge{display:table}.rtmedia-container thead.show-for-small,.rtmedia-activity-container thead.show-for-small,.rtmedia-container thead.show-for-medium-down,.rtmedia-activity-container thead.show-for-medium-down,.rtmedia-container thead.show-for-large-down,.rtmedia-activity-container thead.show-for-large-down,.rtmedia-container thead.hide-for-medium,.rtmedia-activity-container thead.hide-for-medium,.rtmedia-container thead.hide-for-medium-up,.rtmedia-activity-container thead.hide-for-medium-up,.rtmedia-container thead.hide-for-large,.rtmedia-activity-container thead.hide-for-large,.rtmedia-container thead.hide-for-large-up,.rtmedia-activity-container thead.hide-for-large-up,.rtmedia-container thead.hide-for-xlarge,.rtmedia-activity-container thead.hide-for-xlarge{display:table-header-group !important}.rtmedia-container tbody.show-for-small,.rtmedia-activity-container tbody.show-for-small,.rtmedia-container tbody.show-for-medium-down,.rtmedia-activity-container tbody.show-for-medium-down,.rtmedia-container tbody.show-for-large-down,.rtmedia-activity-container tbody.show-for-large-down,.rtmedia-container tbody.hide-for-medium,.rtmedia-activity-container tbody.hide-for-medium,.rtmedia-container tbody.hide-for-medium-up,.rtmedia-activity-container tbody.hide-for-medium-up,.rtmedia-container tbody.hide-for-large,.rtmedia-activity-container tbody.hide-for-large,.rtmedia-container tbody.hide-for-large-up,.rtmedia-activity-container tbody.hide-for-large-up,.rtmedia-container tbody.hide-for-xlarge,.rtmedia-activity-container tbody.hide-for-xlarge{display:table-row-group !important}.rtmedia-container tr.show-for-small,.rtmedia-activity-container tr.show-for-small,.rtmedia-container tr.show-for-medium-down,.rtmedia-activity-container tr.show-for-medium-down,.rtmedia-container tr.show-for-large-down,.rtmedia-activity-container tr.show-for-large-down,.rtmedia-container tr.hide-for-medium,.rtmedia-activity-container tr.hide-for-medium,.rtmedia-container tr.hide-for-medium-up,.rtmedia-activity-container tr.hide-for-medium-up,.rtmedia-container tr.hide-for-large,.rtmedia-activity-container tr.hide-for-large,.rtmedia-container tr.hide-for-large-up,.rtmedia-activity-container tr.hide-for-large-up,.rtmedia-container tr.hide-for-xlarge,.rtmedia-activity-container tr.hide-for-xlarge{display:table-row !important}.rtmedia-container td.show-for-small,.rtmedia-activity-container td.show-for-small,.rtmedia-container td.show-for-medium-down,.rtmedia-activity-container td.show-for-medium-down,.rtmedia-container td.show-for-large-down,.rtmedia-activity-container td.show-for-large-down,.rtmedia-container td.hide-for-medium,.rtmedia-activity-container td.hide-for-medium,.rtmedia-container td.hide-for-medium-up,.rtmedia-activity-container td.hide-for-medium-up,.rtmedia-container td.hide-for-large,.rtmedia-activity-container td.hide-for-large,.rtmedia-container td.hide-for-large-up,.rtmedia-activity-container td.hide-for-large-up,.rtmedia-container td.hide-for-xlarge,.rtmedia-activity-container td.hide-for-xlarge,.rtmedia-container th.show-for-small,.rtmedia-activity-container th.show-for-small,.rtmedia-container th.show-for-medium-down,.rtmedia-activity-container th.show-for-medium-down,.rtmedia-container th.show-for-large-down,.rtmedia-activity-container th.show-for-large-down,.rtmedia-container th.hide-for-medium,.rtmedia-activity-container th.hide-for-medium,.rtmedia-container th.hide-for-medium-up,.rtmedia-activity-container th.hide-for-medium-up,.rtmedia-container th.hide-for-large,.rtmedia-activity-container th.hide-for-large,.rtmedia-container th.hide-for-large-up,.rtmedia-activity-container th.hide-for-large-up,.rtmedia-container th.hide-for-xlarge,.rtmedia-activity-container th.hide-for-xlarge{display:table-cell !important}@media only screen and (min-width: 768px){.rtmedia-container .show-for-medium,.rtmedia-activity-container .show-for-medium,.rtmedia-container .show-for-medium-up,.rtmedia-activity-container .show-for-medium-up{display:inherit !important}.rtmedia-container .show-for-small,.rtmedia-activity-container .show-for-small{display:none !important}.rtmedia-container .hide-for-small,.rtmedia-activity-container .hide-for-small{display:inherit !important}.rtmedia-container .hide-for-medium,.rtmedia-activity-container .hide-for-medium,.rtmedia-container .hide-for-medium-up,.rtmedia-activity-container .hide-for-medium-up{display:none !important}.rtmedia-container table.show-for-medium,.rtmedia-activity-container table.show-for-medium,.rtmedia-container table.show-for-medium-up,.rtmedia-activity-container table.show-for-medium-up,.rtmedia-container table.hide-for-small,.rtmedia-activity-container table.hide-for-small{display:table}.rtmedia-container thead.show-for-medium,.rtmedia-activity-container thead.show-for-medium,.rtmedia-container thead.show-for-medium-up,.rtmedia-activity-container thead.show-for-medium-up,.rtmedia-container thead.hide-for-small,.rtmedia-activity-container thead.hide-for-small{display:table-header-group !important}.rtmedia-container tbody.show-for-medium,.rtmedia-activity-container tbody.show-for-medium,.rtmedia-container tbody.show-for-medium-up,.rtmedia-activity-container tbody.show-for-medium-up,.rtmedia-container tbody.hide-for-small,.rtmedia-activity-container tbody.hide-for-small{display:table-row-group !important}.rtmedia-container tr.show-for-medium,.rtmedia-activity-container tr.show-for-medium,.rtmedia-container tr.show-for-medium-up,.rtmedia-activity-container tr.show-for-medium-up,.rtmedia-container tr.hide-for-small,.rtmedia-activity-container tr.hide-for-small{display:table-row !important}.rtmedia-container td.show-for-medium,.rtmedia-activity-container td.show-for-medium,.rtmedia-container td.show-for-medium-up,.rtmedia-activity-container td.show-for-medium-up,.rtmedia-container td.hide-for-small,.rtmedia-activity-container td.hide-for-small,.rtmedia-container th.show-for-medium,.rtmedia-activity-container th.show-for-medium,.rtmedia-container th.show-for-medium-up,.rtmedia-activity-container th.show-for-medium-up,.rtmedia-container th.hide-for-small,.rtmedia-activity-container th.hide-for-small{display:table-cell !important}}@media only screen and (min-width: 1280px){.rtmedia-container .show-for-large,.rtmedia-activity-container .show-for-large,.rtmedia-container .show-for-large-up,.rtmedia-activity-container .show-for-large-up{display:inherit !important}.rtmedia-container .show-for-medium,.rtmedia-activity-container .show-for-medium,.rtmedia-container .show-for-medium-down,.rtmedia-activity-container .show-for-medium-down{display:none !important}.rtmedia-container .hide-for-medium,.rtmedia-activity-container .hide-for-medium,.rtmedia-container .hide-for-medium-down,.rtmedia-activity-container .hide-for-medium-down{display:inherit !important}.rtmedia-container .hide-for-large,.rtmedia-activity-container .hide-for-large,.rtmedia-container .hide-for-large-up,.rtmedia-activity-container .hide-for-large-up{display:none !important}.rtmedia-container table.show-for-large,.rtmedia-activity-container table.show-for-large,.rtmedia-container table.show-for-large-up,.rtmedia-activity-container table.show-for-large-up,.rtmedia-container table.hide-for-medium,.rtmedia-activity-container table.hide-for-medium,.rtmedia-container table.hide-for-medium-down,.rtmedia-activity-container table.hide-for-medium-down{display:table}.rtmedia-container thead.show-for-large,.rtmedia-activity-container thead.show-for-large,.rtmedia-container thead.show-for-large-up,.rtmedia-activity-container thead.show-for-large-up,.rtmedia-container thead.hide-for-medium,.rtmedia-activity-container thead.hide-for-medium,.rtmedia-container thead.hide-for-medium-down,.rtmedia-activity-container thead.hide-for-medium-down{display:table-header-group !important}.rtmedia-container tbody.show-for-large,.rtmedia-activity-container tbody.show-for-large,.rtmedia-container tbody.show-for-large-up,.rtmedia-activity-container tbody.show-for-large-up,.rtmedia-container tbody.hide-for-medium,.rtmedia-activity-container tbody.hide-for-medium,.rtmedia-container tbody.hide-for-medium-down,.rtmedia-activity-container tbody.hide-for-medium-down{display:table-row-group !important}.rtmedia-container tr.show-for-large,.rtmedia-activity-container tr.show-for-large,.rtmedia-container tr.show-for-large-up,.rtmedia-activity-container tr.show-for-large-up,.rtmedia-container tr.hide-for-medium,.rtmedia-activity-container tr.hide-for-medium,.rtmedia-container tr.hide-for-medium-down,.rtmedia-activity-container tr.hide-for-medium-down{display:table-row !important}.rtmedia-container td.show-for-large,.rtmedia-activity-container td.show-for-large,.rtmedia-container td.show-for-large-up,.rtmedia-activity-container td.show-for-large-up,.rtmedia-container td.hide-for-medium,.rtmedia-activity-container td.hide-for-medium,.rtmedia-container td.hide-for-medium-down,.rtmedia-activity-container td.hide-for-medium-down,.rtmedia-container th.show-for-large,.rtmedia-activity-container th.show-for-large,.rtmedia-container th.show-for-large-up,.rtmedia-activity-container th.show-for-large-up,.rtmedia-container th.hide-for-medium,.rtmedia-activity-container th.hide-for-medium,.rtmedia-container th.hide-for-medium-down,.rtmedia-activity-container th.hide-for-medium-down{display:table-cell !important}}@media only screen and (min-width: 1440px){.rtmedia-container .show-for-xlarge,.rtmedia-activity-container .show-for-xlarge{display:inherit !important}.rtmedia-container .show-for-large,.rtmedia-activity-container .show-for-large,.rtmedia-container .show-for-large-down,.rtmedia-activity-container .show-for-large-down{display:none !important}.rtmedia-container .hide-for-large,.rtmedia-activity-container .hide-for-large,.rtmedia-container .hide-for-large-down,.rtmedia-activity-container .hide-for-large-down{display:inherit !important}.rtmedia-container .hide-for-xlarge,.rtmedia-activity-container .hide-for-xlarge{display:none !important}.rtmedia-container table.show-for-xlarge,.rtmedia-activity-container table.show-for-xlarge,.rtmedia-container table.hide-for-large,.rtmedia-activity-container table.hide-for-large,.rtmedia-container table.hide-for-large-down,.rtmedia-activity-container table.hide-for-large-down{display:table}.rtmedia-container thead.show-for-xlarge,.rtmedia-activity-container thead.show-for-xlarge,.rtmedia-container thead.hide-for-large,.rtmedia-activity-container thead.hide-for-large,.rtmedia-container thead.hide-for-large-down,.rtmedia-activity-container thead.hide-for-large-down{display:table-header-group !important}.rtmedia-container tbody.show-for-xlarge,.rtmedia-activity-container tbody.show-for-xlarge,.rtmedia-container tbody.hide-for-large,.rtmedia-activity-container tbody.hide-for-large,.rtmedia-container tbody.hide-for-large-down,.rtmedia-activity-container tbody.hide-for-large-down{display:table-row-group !important}.rtmedia-container tr.show-for-xlarge,.rtmedia-activity-container tr.show-for-xlarge,.rtmedia-container tr.hide-for-large,.rtmedia-activity-container tr.hide-for-large,.rtmedia-container tr.hide-for-large-down,.rtmedia-activity-container tr.hide-for-large-down{display:table-row !important}.rtmedia-container td.show-for-xlarge,.rtmedia-activity-container td.show-for-xlarge,.rtmedia-container td.hide-for-large,.rtmedia-activity-container td.hide-for-large,.rtmedia-container td.hide-for-large-down,.rtmedia-activity-container td.hide-for-large-down,.rtmedia-container th.show-for-xlarge,.rtmedia-activity-container th.show-for-xlarge,.rtmedia-container th.hide-for-large,.rtmedia-activity-container th.hide-for-large,.rtmedia-container th.hide-for-large-down,.rtmedia-activity-container th.hide-for-large-down{display:table-cell !important}}.rtmedia-container .show-for-landscape,.rtmedia-activity-container .show-for-landscape,.rtmedia-container .hide-for-portrait,.rtmedia-activity-container .hide-for-portrait{display:inherit !important}.rtmedia-container .hide-for-landscape,.rtmedia-activity-container .hide-for-landscape,.rtmedia-container .show-for-portrait,.rtmedia-activity-container .show-for-portrait{display:none !important}.rtmedia-container table.hide-for-landscape,.rtmedia-activity-container table.hide-for-landscape,.rtmedia-container table.show-for-portrait,.rtmedia-activity-container table.show-for-portrait{display:table}.rtmedia-container thead.hide-for-landscape,.rtmedia-activity-container thead.hide-for-landscape,.rtmedia-container thead.show-for-portrait,.rtmedia-activity-container thead.show-for-portrait{display:table-header-group !important}.rtmedia-container tbody.hide-for-landscape,.rtmedia-activity-container tbody.hide-for-landscape,.rtmedia-container tbody.show-for-portrait,.rtmedia-activity-container tbody.show-for-portrait{display:table-row-group !important}.rtmedia-container tr.hide-for-landscape,.rtmedia-activity-container tr.hide-for-landscape,.rtmedia-container tr.show-for-portrait,.rtmedia-activity-container tr.show-for-portrait{display:table-row !important}.rtmedia-container td.hide-for-landscape,.rtmedia-activity-container td.hide-for-landscape,.rtmedia-container td.show-for-portrait,.rtmedia-activity-container td.show-for-portrait,.rtmedia-container th.hide-for-landscape,.rtmedia-activity-container th.hide-for-landscape,.rtmedia-container th.show-for-portrait,.rtmedia-activity-container th.show-for-portrait{display:table-cell !important}@media only screen and (orientation: landscape){.rtmedia-container .show-for-landscape,.rtmedia-activity-container .show-for-landscape,.rtmedia-container .hide-for-portrait,.rtmedia-activity-container .hide-for-portrait{display:inherit !important}.rtmedia-container .hide-for-landscape,.rtmedia-activity-container .hide-for-landscape,.rtmedia-container .show-for-portrait,.rtmedia-activity-container .show-for-portrait{display:none !important}.rtmedia-container table.show-for-landscape,.rtmedia-activity-container table.show-for-landscape,.rtmedia-container table.hide-for-portrait,.rtmedia-activity-container table.hide-for-portrait{display:table}.rtmedia-container thead.show-for-landscape,.rtmedia-activity-container thead.show-for-landscape,.rtmedia-container thead.hide-for-portrait,.rtmedia-activity-container thead.hide-for-portrait{display:table-header-group !important}.rtmedia-container tbody.show-for-landscape,.rtmedia-activity-container tbody.show-for-landscape,.rtmedia-container tbody.hide-for-portrait,.rtmedia-activity-container tbody.hide-for-portrait{display:table-row-group !important}.rtmedia-container tr.show-for-landscape,.rtmedia-activity-container tr.show-for-landscape,.rtmedia-container tr.hide-for-portrait,.rtmedia-activity-container tr.hide-for-portrait{display:table-row !important}.rtmedia-container td.show-for-landscape,.rtmedia-activity-container td.show-for-landscape,.rtmedia-container td.hide-for-portrait,.rtmedia-activity-container td.hide-for-portrait,.rtmedia-container th.show-for-landscape,.rtmedia-activity-container th.show-for-landscape,.rtmedia-container th.hide-for-portrait,.rtmedia-activity-container th.hide-for-portrait{display:table-cell !important}}@media only screen and (orientation: portrait){.rtmedia-container .show-for-portrait,.rtmedia-activity-container .show-for-portrait,.rtmedia-container .hide-for-landscape,.rtmedia-activity-container .hide-for-landscape{display:inherit !important}.rtmedia-container .hide-for-portrait,.rtmedia-activity-container .hide-for-portrait,.rtmedia-container .show-for-landscape,.rtmedia-activity-container .show-for-landscape{display:none !important}.rtmedia-container table.show-for-portrait,.rtmedia-activity-container table.show-for-portrait,.rtmedia-container table.hide-for-landscape,.rtmedia-activity-container table.hide-for-landscape{display:table}.rtmedia-container thead.show-for-portrait,.rtmedia-activity-container thead.show-for-portrait,.rtmedia-container thead.hide-for-landscape,.rtmedia-activity-container thead.hide-for-landscape{display:table-header-group !important}.rtmedia-container tbody.show-for-portrait,.rtmedia-activity-container tbody.show-for-portrait,.rtmedia-container tbody.hide-for-landscape,.rtmedia-activity-container tbody.hide-for-landscape{display:table-row-group !important}.rtmedia-container tr.show-for-portrait,.rtmedia-activity-container tr.show-for-portrait,.rtmedia-container tr.hide-for-landscape,.rtmedia-activity-container tr.hide-for-landscape{display:table-row !important}.rtmedia-container td.show-for-portrait,.rtmedia-activity-container td.show-for-portrait,.rtmedia-container td.hide-for-landscape,.rtmedia-activity-container td.hide-for-landscape,.rtmedia-container th.show-for-portrait,.rtmedia-activity-container th.show-for-portrait,.rtmedia-container th.hide-for-landscape,.rtmedia-activity-container th.hide-for-landscape{display:table-cell !important}}.rtmedia-container .show-for-touch,.rtmedia-activity-container .show-for-touch{display:none !important}.rtmedia-container .hide-for-touch,.rtmedia-activity-container .hide-for-touch{display:inherit !important}.rtmedia-container .touch .show-for-touch,.rtmedia-activity-container .touch .show-for-touch{display:inherit !important}.rtmedia-container .touch .hide-for-touch,.rtmedia-activity-container .touch .hide-for-touch{display:none !important}.rtmedia-container table.hide-for-touch,.rtmedia-activity-container table.hide-for-touch{display:table}.rtmedia-container .touch table.show-for-touch,.rtmedia-activity-container .touch table.show-for-touch{display:table}.rtmedia-container thead.hide-for-touch,.rtmedia-activity-container thead.hide-for-touch{display:table-header-group !important}.rtmedia-container .touch thead.show-for-touch,.rtmedia-activity-container .touch thead.show-for-touch{display:table-header-group !important}.rtmedia-container tbody.hide-for-touch,.rtmedia-activity-container tbody.hide-for-touch{display:table-row-group !important}.rtmedia-container .touch tbody.show-for-touch,.rtmedia-activity-container .touch tbody.show-for-touch{display:table-row-group !important}.rtmedia-container tr.hide-for-touch,.rtmedia-activity-container tr.hide-for-touch{display:table-row !important}.rtmedia-container .touch tr.show-for-touch,.rtmedia-activity-container .touch tr.show-for-touch{display:table-row !important}.rtmedia-container td.hide-for-touch,.rtmedia-activity-container td.hide-for-touch{display:table-cell !important}.rtmedia-container .touch td.show-for-touch,.rtmedia-activity-container .touch td.show-for-touch{display:table-cell !important}.rtmedia-container th.hide-for-touch,.rtmedia-activity-container th.hide-for-touch{display:table-cell !important}.rtmedia-container .touch th.show-for-touch,.rtmedia-activity-container .touch th.show-for-touch{display:table-cell !important}@media only screen{.rtmedia-container [class*="block-grid-"],.rtmedia-activity-container [class*="block-grid-"]{display:block;padding:0;margin:0 -0.625em;*zoom:1}.rtmedia-container [class*="block-grid-"]:before,.rtmedia-activity-container [class*="block-grid-"]:before,.rtmedia-container [class*="block-grid-"]:after,.rtmedia-activity-container [class*="block-grid-"]:after{content:" ";display:table}.rtmedia-container [class*="block-grid-"]:after,.rtmedia-activity-container [class*="block-grid-"]:after{clear:both}.rtmedia-container [class*="block-grid-"]>li,.rtmedia-activity-container [class*="block-grid-"]>li{display:inline;height:auto;float:left;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-1>li,.rtmedia-activity-container .small-block-grid-1>li{width:100%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-1>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-1>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-1>li:nth-of-type(1n+1),.rtmedia-activity-container .small-block-grid-1>li:nth-of-type(1n+1){clear:both}.rtmedia-container .small-block-grid-2>li,.rtmedia-activity-container .small-block-grid-2>li{width:50%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-2>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-2>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-2>li:nth-of-type(2n+1),.rtmedia-activity-container .small-block-grid-2>li:nth-of-type(2n+1){clear:both}.rtmedia-container .small-block-grid-3>li,.rtmedia-activity-container .small-block-grid-3>li{width:33.33333%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-3>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-3>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-3>li:nth-of-type(3n+1),.rtmedia-activity-container .small-block-grid-3>li:nth-of-type(3n+1){clear:both}.rtmedia-container .small-block-grid-4>li,.rtmedia-activity-container .small-block-grid-4>li{width:25%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-4>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-4>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-4>li:nth-of-type(4n+1),.rtmedia-activity-container .small-block-grid-4>li:nth-of-type(4n+1){clear:both}.rtmedia-container .small-block-grid-5>li,.rtmedia-activity-container .small-block-grid-5>li{width:20%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-5>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-5>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-5>li:nth-of-type(5n+1),.rtmedia-activity-container .small-block-grid-5>li:nth-of-type(5n+1){clear:both}.rtmedia-container .small-block-grid-6>li,.rtmedia-activity-container .small-block-grid-6>li{width:16.66667%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-6>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-6>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-6>li:nth-of-type(6n+1),.rtmedia-activity-container .small-block-grid-6>li:nth-of-type(6n+1){clear:both}.rtmedia-container .small-block-grid-7>li,.rtmedia-activity-container .small-block-grid-7>li{width:14.28571%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-7>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-7>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-7>li:nth-of-type(7n+1),.rtmedia-activity-container .small-block-grid-7>li:nth-of-type(7n+1){clear:both}.rtmedia-container .small-block-grid-8>li,.rtmedia-activity-container .small-block-grid-8>li{width:12.5%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-8>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-8>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-8>li:nth-of-type(8n+1),.rtmedia-activity-container .small-block-grid-8>li:nth-of-type(8n+1){clear:both}.rtmedia-container .small-block-grid-9>li,.rtmedia-activity-container .small-block-grid-9>li{width:11.11111%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-9>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-9>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-9>li:nth-of-type(9n+1),.rtmedia-activity-container .small-block-grid-9>li:nth-of-type(9n+1){clear:both}.rtmedia-container .small-block-grid-10>li,.rtmedia-activity-container .small-block-grid-10>li{width:10%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-10>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-10>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-10>li:nth-of-type(10n+1),.rtmedia-activity-container .small-block-grid-10>li:nth-of-type(10n+1){clear:both}.rtmedia-container .small-block-grid-11>li,.rtmedia-activity-container .small-block-grid-11>li{width:9.09091%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-11>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-11>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-11>li:nth-of-type(11n+1),.rtmedia-activity-container .small-block-grid-11>li:nth-of-type(11n+1){clear:both}.rtmedia-container .small-block-grid-12>li,.rtmedia-activity-container .small-block-grid-12>li{width:8.33333%;padding:0 0.625em 1.25em}.rtmedia-container .small-block-grid-12>li:nth-of-type(n),.rtmedia-activity-container .small-block-grid-12>li:nth-of-type(n){clear:none}.rtmedia-container .small-block-grid-12>li:nth-of-type(12n+1),.rtmedia-activity-container .small-block-grid-12>li:nth-of-type(12n+1){clear:both}}@media only screen and (min-width: 768px){.rtmedia-container .small-block-grid-1>li:nth-of-type(1n+1),.rtmedia-activity-container .small-block-grid-1>li:nth-of-type(1n+1){clear:none}.rtmedia-container .small-block-grid-2>li:nth-of-type(2n+1),.rtmedia-activity-container .small-block-grid-2>li:nth-of-type(2n+1){clear:none}.rtmedia-container .small-block-grid-3>li:nth-of-type(3n+1),.rtmedia-activity-container .small-block-grid-3>li:nth-of-type(3n+1){clear:none}.rtmedia-container .small-block-grid-4>li:nth-of-type(4n+1),.rtmedia-activity-container .small-block-grid-4>li:nth-of-type(4n+1){clear:none}.rtmedia-container .small-block-grid-5>li:nth-of-type(5n+1),.rtmedia-activity-container .small-block-grid-5>li:nth-of-type(5n+1){clear:none}.rtmedia-container .small-block-grid-6>li:nth-of-type(6n+1),.rtmedia-activity-container .small-block-grid-6>li:nth-of-type(6n+1){clear:none}.rtmedia-container .small-block-grid-7>li:nth-of-type(7n+1),.rtmedia-activity-container .small-block-grid-7>li:nth-of-type(7n+1){clear:none}.rtmedia-container .small-block-grid-8>li:nth-of-type(8n+1),.rtmedia-activity-container .small-block-grid-8>li:nth-of-type(8n+1){clear:none}.rtmedia-container .small-block-grid-9>li:nth-of-type(9n+1),.rtmedia-activity-container .small-block-grid-9>li:nth-of-type(9n+1){clear:none}.rtmedia-container .small-block-grid-10>li:nth-of-type(10n+1),.rtmedia-activity-container .small-block-grid-10>li:nth-of-type(10n+1){clear:none}.rtmedia-container .small-block-grid-11>li:nth-of-type(11n+1),.rtmedia-activity-container .small-block-grid-11>li:nth-of-type(11n+1){clear:none}.rtmedia-container .small-block-grid-12>li:nth-of-type(12n+1),.rtmedia-activity-container .small-block-grid-12>li:nth-of-type(12n+1){clear:none}.rtmedia-container .large-block-grid-1>li,.rtmedia-activity-container .large-block-grid-1>li{width:100%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-1>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-1>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-1>li:nth-of-type(1n+1),.rtmedia-activity-container .large-block-grid-1>li:nth-of-type(1n+1){clear:both}.rtmedia-container .large-block-grid-2>li,.rtmedia-activity-container .large-block-grid-2>li{width:50%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-2>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-2>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-2>li:nth-of-type(2n+1),.rtmedia-activity-container .large-block-grid-2>li:nth-of-type(2n+1){clear:both}.rtmedia-container .large-block-grid-3>li,.rtmedia-activity-container .large-block-grid-3>li{width:33.33333%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-3>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-3>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-3>li:nth-of-type(3n+1),.rtmedia-activity-container .large-block-grid-3>li:nth-of-type(3n+1){clear:both}.rtmedia-container .large-block-grid-4>li,.rtmedia-activity-container .large-block-grid-4>li{width:25%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-4>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-4>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-4>li:nth-of-type(4n+1),.rtmedia-activity-container .large-block-grid-4>li:nth-of-type(4n+1){clear:both}.rtmedia-container .large-block-grid-5>li,.rtmedia-activity-container .large-block-grid-5>li{width:20%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-5>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-5>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-5>li:nth-of-type(5n+1),.rtmedia-activity-container .large-block-grid-5>li:nth-of-type(5n+1){clear:both}.rtmedia-container .large-block-grid-6>li,.rtmedia-activity-container .large-block-grid-6>li{width:16.66667%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-6>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-6>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-6>li:nth-of-type(6n+1),.rtmedia-activity-container .large-block-grid-6>li:nth-of-type(6n+1){clear:both}.rtmedia-container .large-block-grid-7>li,.rtmedia-activity-container .large-block-grid-7>li{width:14.28571%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-7>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-7>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-7>li:nth-of-type(7n+1),.rtmedia-activity-container .large-block-grid-7>li:nth-of-type(7n+1){clear:both}.rtmedia-container .large-block-grid-8>li,.rtmedia-activity-container .large-block-grid-8>li{width:12.5%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-8>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-8>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-8>li:nth-of-type(8n+1),.rtmedia-activity-container .large-block-grid-8>li:nth-of-type(8n+1){clear:both}.rtmedia-container .large-block-grid-9>li,.rtmedia-activity-container .large-block-grid-9>li{width:11.11111%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-9>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-9>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-9>li:nth-of-type(9n+1),.rtmedia-activity-container .large-block-grid-9>li:nth-of-type(9n+1){clear:both}.rtmedia-container .large-block-grid-10>li,.rtmedia-activity-container .large-block-grid-10>li{width:10%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-10>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-10>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-10>li:nth-of-type(10n+1),.rtmedia-activity-container .large-block-grid-10>li:nth-of-type(10n+1){clear:both}.rtmedia-container .large-block-grid-11>li,.rtmedia-activity-container .large-block-grid-11>li{width:9.09091%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-11>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-11>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-11>li:nth-of-type(11n+1),.rtmedia-activity-container .large-block-grid-11>li:nth-of-type(11n+1){clear:both}.rtmedia-container .large-block-grid-12>li,.rtmedia-activity-container .large-block-grid-12>li{width:8.33333%;padding:0 0.625em 1.25em}.rtmedia-container .large-block-grid-12>li:nth-of-type(n),.rtmedia-activity-container .large-block-grid-12>li:nth-of-type(n){clear:none}.rtmedia-container .large-block-grid-12>li:nth-of-type(12n+1),.rtmedia-activity-container .large-block-grid-12>li:nth-of-type(12n+1){clear:both}}.rtmedia-container .flex-video,.rtmedia-activity-container .flex-video{position:relative;padding-top:1.5625em;padding-bottom:67.5%;height:0;margin-bottom:1em;overflow:hidden}.rtmedia-container .flex-video.widescreen,.rtmedia-activity-container .flex-video.widescreen{padding-bottom:57.25%}.rtmedia-container .flex-video.vimeo,.rtmedia-activity-container .flex-video.vimeo{padding-top:0}.rtmedia-container .flex-video iframe,.rtmedia-activity-container .flex-video iframe,.rtmedia-container .flex-video object,.rtmedia-activity-container .flex-video object,.rtmedia-container .flex-video embed,.rtmedia-activity-container .flex-video embed,.rtmedia-container .flex-video video,.rtmedia-activity-container .flex-video video{position:absolute;top:0;left:0;width:100%;height:100%}.rtmedia-container .row,.rtmedia-activity-container .row{max-width:1000px}.rtmedia-container .rtmedia-item-title h4,.rtmedia-activity-container .rtmedia-item-title h4{text-overflow:ellipsis;white-space:nowrap;width:100%;overflow:hidden;font-size:1.1em;text-align:center}.rtmedia-container .rtmedia-success,.rtmedia-activity-container .rtmedia-success{display:block;padding:10px;border:1px solid #008000;background-color:#90EE90;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.rtmedia-container h2,.rtmedia-activity-container h2{font-size:1.4em;font-weight:bold;line-height:2.4em}.rtmedia-container .drag-drop,.rtmedia-activity-container .drag-drop{border:4px dashed #DDD;text-align:center;background:#fafafa;overflow:hidden;padding:15px 0}.rtmedia-container .drag-drop.dragover,.rtmedia-activity-container .drag-drop.dragover{border-color:#83b4d8}.rtmedia-container .rtmedia-action-update,.rtmedia-activity-container .rtmedia-action-update{float:left;margin-top:12px;margin-right:10px}.rtmedia-container .rtmedia-list,.rtmedia-activity-container .rtmedia-list{list-style:none}.rtmedia-container .rtmedia-list .rtmedia-list-item,.rtmedia-activity-container .rtmedia-list .rtmedia-list-item{word-wrap:break-word;padding-top:20px;padding-bottom:20px}.rtmedia-container .rtmedia-list .rtmedia-list-item a,.rtmedia-activity-container .rtmedia-list .rtmedia-list-item a{text-decoration:none}.rtmedia-container .rtmedia-list .rtmedia-list-item a h4,.rtmedia-activity-container .rtmedia-list .rtmedia-list-item a h4{line-height:1.4em;font-size:1.2em;padding-top:10px}.rtmedia-container .rtmedia-media img,.rtmedia-activity-container .rtmedia-media img{max-width:100%}.rtmedia-container .rtmedia-item-thumbnail,.rtmedia-activity-container .rtmedia-item-thumbnail{text-align:center;height:110px;line-height:110px}.rtmedia-container .rtmedia-item-thumbnail img,.rtmedia-activity-container .rtmedia-item-thumbnail img{max-width:100%;max-height:110px;vertical-align:middle}.rtmedia-container .rtmedia-item-comments-container,.rtmedia-activity-container .rtmedia-item-comments-container{margin:3% 3%}.rtmedia-container .rtmedia-comment,.rtmedia-activity-container .rtmedia-comment{list-style:none;background:#f6f6f6;border:1px solid #ddd;-moz-border-radius:3px;border-radius:3px;margin:5px 0;padding:1px 5px 25px;width:391px}.rtmedia-container .rtmedia-comment .rtmedia-comment-author,.rtmedia-activity-container .rtmedia-comment .rtmedia-comment-author{display:block}.rtmedia-container .rtmedia-comment .rtmedia-comment-content,.rtmedia-activity-container .rtmedia-comment .rtmedia-comment-content{display:block}.rtmedia-container .rtmedia-comment .rtmedia-comment-date,.rtmedia-activity-container .rtmedia-comment .rtmedia-comment-date{display:block;float:right}.rtmedia-container .rtmedia-bp-header,.rtmedia-activity-container .rtmedia-bp-header{width:460px;margin:auto}.rtmedia-container #div-attache-rtmedia,.rtmedia-activity-container #div-attache-rtmedia{display:none}.rtmedia-container #rtMedia-update-queue-list p span,.rtmedia-activity-container #rtMedia-update-queue-list p span{margin-right:20px}.rtmedia-container .rtmedia-move-container,.rtmedia-activity-container .rtmedia-move-container{display:none}.rtmedia-container #rtmedia-add-media-button-post-update,.rtmedia-activity-container #rtmedia-add-media-button-post-update{float:left;margin-top:10px;margin-right:20px}.rtmedia-container #whats-new-post-in-box,.rtmedia-activity-container #whats-new-post-in-box{float:left}.rtmedia-container .rtmedia-activity-text,.rtmedia-activity-container .rtmedia-activity-text{display:block;padding-bottom:10px}.rtmedia-container .rtmedia-merge-container,.rtmedia-activity-container .rtmedia-merge-container{display:none}.rtmedia-container .rtmedia-create-new-album-container,.rtmedia-activity-container .rtmedia-create-new-album-container{display:none}.rtmedia-container select,.rtmedia-activity-container select{width:auto}.rtmedia-container.rtmedia-single-container .row,.rtmedia-single-container.rtmedia-activity-container .row{background-color:#FFF}.rtmedia-container.rtmedia-single-container .row #rtmedia-single-media-container .rtmedia-media .mejs-overlay-button,.rtmedia-single-container.rtmedia-activity-container .row #rtmedia-single-media-container .rtmedia-media .mejs-overlay-button{margin:-50px 0 0 -50px}.rtmedia-container.rtmedia-single-container .row #rtmedia-single-media-container .rtmedia-media .mejs-controls .mejs-button button,.rtmedia-single-container.rtmedia-activity-container .row #rtmedia-single-media-container .rtmedia-media .mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:rgba(0,0,0,0) url("../../../lib/media-element/controls.png") no-repeat}.rtmedia-container.rtmedia-single-container .row #rtmedia-single-media-container .rtmedia-media .mejs-controls .mejs-mute button,.rtmedia-single-container.rtmedia-activity-container .row #rtmedia-single-media-container .rtmedia-media .mejs-controls .mejs-mute button{background-position:-16px -16px}.rtmedia-container.rtmedia-single-container .row #rtmedia-single-media-container .rtmedia-media .mejs-controls .mejs-fullscreen-button button,.rtmedia-single-container.rtmedia-activity-container .row #rtmedia-single-media-container .rtmedia-media .mejs-controls .mejs-fullscreen-button button{background-position:-32px 0}.rtmedia-container.rtmedia-single-container .row .rtmedia-single-meta,.rtmedia-single-container.rtmedia-activity-container .row .rtmedia-single-meta{padding:10px}.rtmedia-container.rtmedia-single-container .row .rtmedia-single-meta button,.rtmedia-single-container.rtmedia-activity-container .row .rtmedia-single-meta button{color:#5E5E5E;background-color:#EBEBEB;background-repeat:repeat-x;background-image:-moz-linear-gradient(top, #f9f9f9, #ebebeb);background-image:-ms-linear-gradient(top, #f9f9f9, #ebebeb);background-image:-webkit-linear-gradient(top, #f9f9f9, #ebebeb);background-image:-o-linear-gradient(top, #f9f9f9, #ebebeb);background-image:linear-gradient(to bottom, #f9f9f9,#ebebeb)}.rtmedia-container.rtmedia-single-container .row .rtmedia-single-meta>a,.rtmedia-single-container.rtmedia-activity-container .row .rtmedia-single-meta>a{float:left;margin:10px}.rtmedia-container.rtmedia-single-container .row .rtmedia-single-meta .rtmedia-item-actions>a,.rtmedia-single-container.rtmedia-activity-container .row .rtmedia-single-meta .rtmedia-item-actions>a{display:inline-block;float:left}.rtmedia-container.rtmedia-single-container .row .rtmedia-single-meta .rtmedia-item-actions>form,.rtmedia-single-container.rtmedia-activity-container .row .rtmedia-single-meta .rtmedia-item-actions>form{float:left;margin-right:5px}.rtmedia-container.rtmedia-single-container .row .rtmedia-item-comments,.rtmedia-single-container.rtmedia-activity-container .row .rtmedia-item-comments{background-color:transparent}.rtmedia-container.rtmedia-single-container .row .rtmedia-item-comments div,.rtmedia-single-container.rtmedia-activity-container .row .rtmedia-item-comments div{background-color:transparent}#rtmedia-action-update{float:left;padding-right:10px}#header{z-index:1 !important}.bp_media_content video{background-color:black}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/assets/css/style.css ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* RT MEDIA */
2
+ /* line 560, ../sass/main.scss */
3
+ .rtmedia-container {
4
+ margin: 1% 1%;
5
+ float:left;
6
+ }
7
+
8
+ /* line 564, ../sass/main.scss */
9
+ .rtmedia-list {
10
+ list-style: none;
11
+ margin: 1% 1%;
12
+ }
13
+ /* line 567, ../sass/main.scss */
14
+ .rtmedia-list-item {
15
+ display: inline-block;
16
+ margin: 3% 3% 0;
17
+ word-wrap: break-word;
18
+ }
19
+
20
+ .rtmedia-media img {
21
+ max-width: 100%;
22
+ }
23
+
24
+ .rtmedia-item-thumbnail img {
25
+ max-width: 100%;
26
+ }
27
+
28
+ .rtmedia-item-comments {
29
+ margin: 3% 3%;
30
+ }
31
+
32
+ .rtmedia-comment {
33
+ list-style: none;
34
+ background: #f6f6f6;
35
+ border: 1px solid #ddd;
36
+ -moz-border-radius: 3px;
37
+ border-radius: 3px;
38
+ margin: 3% 0;
39
+ padding: 1% 4% 8%;
40
+ position: relative;
41
+ width: 330px;
42
+ }
43
+
44
+ .rtmedia-comment-date {
45
+ float: right;
46
+ }
47
+
48
+ .rtmedia-bp-header {
49
+ width: 460px;
50
+ margin: auto;
51
+ }
app/assets/font/FontAwesome.otf ADDED
Binary file
app/assets/font/fontawesome-webfont.eot ADDED
Binary file
app/assets/font/fontawesome-webfont.svg ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata></metadata>
5
+ <defs>
6
+ <font id="fontawesomeregular" horiz-adv-x="1536" >
7
+ <font-face units-per-em="1792" ascent="1536" descent="-256" />
8
+ <missing-glyph horiz-adv-x="448" />
9
+ <glyph unicode=" " horiz-adv-x="448" />
10
+ <glyph unicode="&#x09;" horiz-adv-x="448" />
11
+ <glyph unicode="&#xa0;" horiz-adv-x="448" />
12
+ <glyph unicode="&#xa8;" horiz-adv-x="1792" />
13
+ <glyph unicode="&#xa9;" horiz-adv-x="1792" />
14
+ <glyph unicode="&#xae;" horiz-adv-x="1792" />
15
+ <glyph unicode="&#xb4;" horiz-adv-x="1792" />
16
+ <glyph unicode="&#xc6;" horiz-adv-x="1792" />
17
+ <glyph unicode="&#x2000;" horiz-adv-x="768" />
18
+ <glyph unicode="&#x2001;" />
19
+ <glyph unicode="&#x2002;" horiz-adv-x="768" />
20
+ <glyph unicode="&#x2003;" />
21
+ <glyph unicode="&#x2004;" horiz-adv-x="512" />
22
+ <glyph unicode="&#x2005;" horiz-adv-x="384" />
23
+ <glyph unicode="&#x2006;" horiz-adv-x="256" />
24
+ <glyph unicode="&#x2007;" horiz-adv-x="256" />
25
+ <glyph unicode="&#x2008;" horiz-adv-x="192" />
26
+ <glyph unicode="&#x2009;" horiz-adv-x="307" />
27
+ <glyph unicode="&#x200a;" horiz-adv-x="85" />
28
+ <glyph unicode="&#x202f;" horiz-adv-x="307" />
29
+ <glyph unicode="&#x205f;" horiz-adv-x="384" />
30
+ <glyph unicode="&#x2122;" horiz-adv-x="1792" />
31
+ <glyph unicode="&#x221e;" horiz-adv-x="1792" />
32
+ <glyph unicode="&#x2260;" horiz-adv-x="1792" />
33
+ <glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
34
+ <glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
35
+ <glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
36
+ <glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
37
+ <glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
38
+ <glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
39
+ <glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
40
+ <glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
41
+ <glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
42
+ <glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
43
+ <glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
44
+ <glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68z" />
45
+ <glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
46
+ <glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
47
+ <glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
48
+ <glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
49
+ <glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
50
+ <glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
51
+ <glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
52
+ <glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
53
+ <glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
54
+ <glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
55
+ <glyph unicode="&#xf016;" horiz-adv-x="1280" d="M128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280zM768 896h299l-299 299v-299zM1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h544q40 0 88 -20t76 -48l408 -408q28 -28 48 -76t20 -88z" />
56
+ <glyph unicode="&#xf017;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM768 96q148 0 273 73t198 198t73 273t-73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273 t73 -273t198 -198t273 -73zM1024 640q26 0 45 -19t19 -45v-96q0 -26 -19 -45t-45 -19h-416q-26 0 -45 19t-19 45v480q0 26 19 45t45 19h96q26 0 45 -19t19 -45v-320h256z" />
57
+ <glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
58
+ <glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" />
59
+ <glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
60
+ <glyph unicode="&#xf01b;" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
61
+ <glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
62
+ <glyph unicode="&#xf01d;" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
63
+ <glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
64
+ <glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
65
+ <glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
66
+ <glyph unicode="&#xf023;" horiz-adv-x="1152" d="M704 512q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5q0 -37 19 -67t51 -47l-69 -229q-5 -15 5 -28t26 -13h192q16 0 26 13t5 28l-69 229q32 17 51 47t19 67zM320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68 t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
67
+ <glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
68
+ <glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
69
+ <glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
70
+ <glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
71
+ <glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
72
+ <glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
73
+ <glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" />
74
+ <glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
75
+ <glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
76
+ <glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
77
+ <glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
78
+ <glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
79
+ <glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
80
+ <glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q73 -1 153.5 -2t119 -1.5t52.5 -0.5l29 2q-32 95 -92 241q-53 132 -92 211zM21 -128h-21l2 79q22 7 80 18q89 16 110 31q20 16 48 68l237 616l280 724h75h53l11 -21l205 -480q103 -242 124 -297q39 -102 96 -235q26 -58 65 -164q24 -67 65 -149 q22 -49 35 -57q22 -19 69 -23q47 -6 103 -27q6 -39 6 -57q0 -14 -1 -26q-80 0 -192 8q-93 8 -189 8q-79 0 -135 -2l-200 -11l-58 -2q0 45 4 78l131 28q56 13 68 23q12 12 12 27t-6 32l-47 114l-92 228l-450 2q-29 -65 -104 -274q-23 -64 -23 -84q0 -31 17 -43 q26 -21 103 -32q3 0 13.5 -2t30 -5t40.5 -6q1 -28 1 -58q0 -17 -2 -27q-66 0 -349 20l-48 -8q-81 -14 -167 -14z" />
81
+ <glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q76 -32 140 -32q131 0 216 41t122 113q38 70 38 181q0 114 -41 180q-58 94 -141 126q-80 32 -247 32q-74 0 -101 -10v-144l-1 -173l3 -270q0 -15 12 -44zM541 761q43 -7 109 -7q175 0 264 65t89 224q0 112 -85 187q-84 75 -255 75q-52 0 -130 -13q0 -44 2 -77 q7 -122 6 -279l-1 -98q0 -43 1 -77zM0 -128l2 94q45 9 68 12q77 12 123 31q17 27 21 51q9 66 9 194l-2 497q-5 256 -9 404q-1 87 -11 109q-1 4 -12 12q-18 12 -69 15q-30 2 -114 13l-4 83l260 6l380 13l45 1q5 0 14 0.5t14 0.5q1 0 21.5 -0.5t40.5 -0.5h74q88 0 191 -27 q43 -13 96 -39q57 -29 102 -76q44 -47 65 -104t21 -122q0 -70 -32 -128t-95 -105q-26 -20 -150 -77q177 -41 267 -146q92 -106 92 -236q0 -76 -29 -161q-21 -62 -71 -117q-66 -72 -140 -108q-73 -36 -203 -60q-82 -15 -198 -11l-197 4q-84 2 -298 -11q-33 -3 -272 -11z" />
82
+ <glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q4 1 77 20q76 19 116 39q29 37 41 101l27 139l56 268l12 64q8 44 17 84.5t16 67t12.5 46.5t9 30.5t3.5 11.5l29 157l16 63l22 135l8 50v38q-41 22 -144 28q-28 2 -38 4l19 103l317 -14q39 -2 73 -2q66 0 214 9q33 2 68 4.5t36 2.5q-2 -19 -6 -38 q-7 -29 -13 -51q-55 -19 -109 -31q-64 -16 -101 -31q-12 -31 -24 -88q-9 -44 -13 -82q-44 -199 -66 -306l-61 -311l-38 -158l-43 -235l-12 -45q-2 -7 1 -27q64 -15 119 -21q36 -5 66 -10q-1 -29 -7 -58q-7 -31 -9 -41q-18 0 -23 -1q-24 -2 -42 -2q-9 0 -28 3q-19 4 -145 17 l-198 2q-41 1 -174 -11q-74 -7 -98 -9z" />
83
+ <glyph unicode="&#xf034;" horiz-adv-x="1792" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l215 -1h293l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -42.5 2t-103.5 -1t-111 -1 q-34 0 -67 -5q-10 -97 -8 -136l1 -152v-332l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-88 0 -233 -14q-48 -4 -70 -4q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q8 192 6 433l-5 428q-1 62 -0.5 118.5t0.5 102.5t-2 57t-6 15q-6 5 -14 6q-38 6 -148 6q-43 0 -100 -13.5t-73 -24.5q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1744 128q33 0 42 -18.5t-11 -44.5 l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80z" />
84
+ <glyph unicode="&#xf035;" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l446 -1h318l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -58.5 2t-138.5 -1t-128 -1 q-94 0 -127 -5q-10 -97 -8 -136l1 -152v52l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-82 0 -233 -13q-45 -5 -70 -5q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q6 137 6 433l-5 44q0 265 -2 278q-2 11 -6 15q-6 5 -14 6q-38 6 -148 6q-50 0 -168.5 -14t-132.5 -24q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1505 113q26 -20 26 -49t-26 -49l-162 -126 q-26 -20 -44.5 -11t-18.5 42v80h-1024v-80q0 -33 -18.5 -42t-44.5 11l-162 126q-26 20 -26 49t26 49l162 126q26 20 44.5 11t18.5 -42v-80h1024v80q0 33 18.5 42t44.5 -11z" />
85
+ <glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
86
+ <glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
87
+ <glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
88
+ <glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
89
+ <glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
90
+ <glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
91
+ <glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
92
+ <glyph unicode="&#xf03d;" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" />
93
+ <glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
94
+ <glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
95
+ <glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
96
+ <glyph unicode="&#xf042;" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
97
+ <glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
98
+ <glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
99
+ <glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
100
+ <glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
101
+ <glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
102
+ <glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
103
+ <glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
104
+ <glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
105
+ <glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
106
+ <glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
107
+ <glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
108
+ <glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
109
+ <glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
110
+ <glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
111
+ <glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
112
+ <glyph unicode="&#xf053;" horiz-adv-x="1152" d="M742 -37l-652 651q-37 37 -37 90.5t37 90.5l652 651q37 37 90.5 37t90.5 -37l75 -75q37 -37 37 -90.5t-37 -90.5l-486 -486l486 -485q37 -38 37 -91t-37 -90l-75 -75q-37 -37 -90.5 -37t-90.5 37z" />
113
+ <glyph unicode="&#xf054;" horiz-adv-x="1152" d="M1099 704q0 -52 -37 -91l-652 -651q-37 -37 -90 -37t-90 37l-76 75q-37 39 -37 91q0 53 37 90l486 486l-486 485q-37 39 -37 91q0 53 37 90l76 75q36 38 90 38t90 -38l652 -651q37 -37 37 -90z" />
114
+ <glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
115
+ <glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
116
+ <glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
117
+ <glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
118
+ <glyph unicode="&#xf059;" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
119
+ <glyph unicode="&#xf05a;" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
120
+ <glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
121
+ <glyph unicode="&#xf05c;" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
122
+ <glyph unicode="&#xf05d;" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
123
+ <glyph unicode="&#xf05e;" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" />
124
+ <glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
125
+ <glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
126
+ <glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
127
+ <glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
128
+ <glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
129
+ <glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
130
+ <glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
131
+ <glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
132
+ <glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
133
+ <glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
134
+ <glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
135
+ <glyph unicode="&#xf06b;" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" />
136
+ <glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
137
+ <glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
138
+ <glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
139
+ <glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
140
+ <glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
141
+ <glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-225 -225l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-195 -195l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l195 195l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l224 224q76 76 172 108t148 -12z" />
142
+ <glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
143
+ <glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
144
+ <glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
145
+ <glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
146
+ <glyph unicode="&#xf077;" horiz-adv-x="1664" d="M1611 320q0 -53 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-486 485l-486 -485q-36 -38 -90 -38t-90 38l-75 75q-38 36 -38 90q0 53 38 91l651 651q37 37 90 37q52 0 91 -37l650 -651q38 -38 38 -91z" />
147
+ <glyph unicode="&#xf078;" horiz-adv-x="1664" d="M1611 832q0 -53 -37 -90l-651 -651q-38 -38 -91 -38q-54 0 -90 38l-651 651q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l486 -486l486 486q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
148
+ <glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
149
+ <glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" />
150
+ <glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
151
+ <glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
152
+ <glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
153
+ <glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
154
+ <glyph unicode="&#xf080;" horiz-adv-x="1920" d="M512 512v-384h-256v384h256zM896 1024v-896h-256v896h256zM1280 768v-640h-256v640h256zM1664 1152v-1024h-256v1024h256zM1792 32v1216q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5z M1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
155
+ <glyph unicode="&#xf081;" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
156
+ <glyph unicode="&#xf082;" d="M1307 618l23 219h-198v109q0 49 15.5 68.5t71.5 19.5h110v219h-175q-152 0 -218 -72t-66 -213v-131h-131v-219h131v-635h262v635h175zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5z" />
157
+ <glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
158
+ <glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
159
+ <glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
160
+ <glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
161
+ <glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
162
+ <glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
163
+ <glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
164
+ <glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
165
+ <glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
166
+ <glyph unicode="&#xf08c;" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
167
+ <glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
168
+ <glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
169
+ <glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
170
+ <glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
171
+ <glyph unicode="&#xf092;" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
172
+ <glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" />
173
+ <glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
174
+ <glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
175
+ <glyph unicode="&#xf096;" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
176
+ <glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
177
+ <glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
178
+ <glyph unicode="&#xf099;" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" />
179
+ <glyph unicode="&#xf09a;" horiz-adv-x="768" d="M511 980h257l-30 -284h-227v-824h-341v824h-170v284h170v171q0 182 86 275.5t283 93.5h227v-284h-142q-39 0 -62.5 -6.5t-34 -23.5t-13.5 -34.5t-3 -49.5v-142z" />
180
+ <glyph unicode="&#xf09b;" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
181
+ <glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M704 160q0 6 -15 57t-35 115.5t-20 65.5q32 16 51 47t19 67q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5q0 -36 19 -66.5t51 -47.5q0 -2 -20 -66t-35 -115t-15 -57q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1664 960v-256q0 -26 -19 -45t-45 -19 h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5z" />
182
+ <glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
183
+ <glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
184
+ <glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
185
+ <glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
186
+ <glyph unicode="&#xf0a2;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM183 128h1298q-164 181 -246.5 411.5t-82.5 484.5q0 256 -320 256t-320 -256q0 -254 -82.5 -484.5t-246.5 -411.5zM1664 128q0 -52 -38 -90t-90 -38 h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
187
+ <glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
188
+ <glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
189
+ <glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
190
+ <glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
191
+ <glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
192
+ <glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
193
+ <glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
194
+ <glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
195
+ <glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
196
+ <glyph unicode="&#xf0ac;" d="M1193 993q11 7 25 22v-1q0 -2 -9.5 -10t-11.5 -12q-1 1 -4 1zM1187 992q-1 1 -2.5 3t-1.5 3q3 -2 10 -5q-6 -4 -6 -1zM728 1175q-16 2 -26 5q1 0 6.5 -1t10.5 -2t9 -2zM773 1212q7 4 13.5 2.5t7.5 -7.5q-5 3 -21 5zM765 1206l-3 2q-2 3 -5.5 5t-4.5 2q2 -1 21 -3 q-6 -4 -8 -6zM663 1290v2q1 -2 3 -5.5t3 -5.5zM558 1250q0 -2 -1 -2l-1 2h2zM933 206v-1v1zM768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1240 162 l5 5q-7 10 -29 12q1 12 -14 26.5t-27 15.5q0 4 -10.5 11t-17.5 8q-9 2 -27 -9q-7 -3 -4 -5q-3 3 -12 11t-16 11q-2 1 -7.5 1t-8.5 2q-1 1 -6 4.5t-7 4.5t-6.5 3t-7.5 1.5t-7.5 -2.5t-8.5 -6t-4.5 -15.5t-2.5 -14.5q-8 6 -0.5 20t1.5 20q-7 7 -21 0.5t-21 -15.5 q-1 -1 -9.5 -5.5t-11.5 -7.5q-4 -6 -9 -17.5t-6 -13.5q0 2 -2.5 6.5t-2.5 6.5q-12 -2 -16 3q5 -16 8 -17l-4 2q-1 -6 3 -15t4 -11q1 -5 -1.5 -13t-2.5 -11q0 -2 5 -11q4 -19 -2 -32q0 -1 -3.5 -7t-6.5 -11l-2 -5l-2 1q-1 1 -2 0q-1 -6 -9 -13t-10 -11q-15 -23 -9 -38 q3 -8 10 -10q3 -1 3 2q1 -9 -11 -27q1 -1 4 -3q-17 0 -10 -14q202 36 352 181h-3zM680 347q16 3 30.5 -16t22.5 -23q41 -20 59 -11q0 -9 14 -28q3 -4 6.5 -11.5t5.5 -10.5q5 -7 19 -16t19 -16q6 3 9 9q13 -35 24 -34q5 0 8 8q0 -1 -0.5 -3t-1.5 -3q7 15 5 26l6 4q5 4 5 5 q-6 6 -9 -3q-30 -14 -48 22q-2 3 -4.5 8t-5 12t-1.5 11.5t6 4.5q11 0 12.5 1.5t-2.5 6t-4 7.5q-1 4 -1.5 12.5t-1.5 12.5l-5 6q-5 6 -11.5 13.5t-7.5 9.5q-4 -10 -16.5 -8.5t-18.5 9.5q1 -2 -0.5 -6.5t-1.5 -6.5q-14 0 -17 1q1 6 3 21t4 22q1 5 5.5 13.5t8 15.5t4.5 14 t-4.5 10.5t-18.5 2.5q-20 -1 -29 -22q-1 -3 -3 -11.5t-5 -12.5t-9 -7q-8 -3 -27 -2t-26 5q-14 8 -24 30.5t-11 41.5q0 10 3 27.5t3 27t-6 26.5q3 2 10 10.5t11 11.5q2 2 5 2h5t4 2t3 6q-1 1 -4 3q-3 3 -4 3q4 -3 19 -1t19 2q0 1 22 0q17 -13 24 2q0 1 -2.5 10.5t-0.5 14.5 q5 -29 32 -10q3 -4 16.5 -6t18.5 -5q3 -2 7 -5.5t6 -5t6 -0.5t9 7q11 -17 13 -25q11 -43 20 -48q8 -2 12.5 -2t5 10.5t0 15.5t-1.5 13l-2 37q-16 3 -20 12.5t1.5 20t16.5 19.5q1 1 16.5 8t21.5 12q24 19 17 39q9 -2 11 9l-5 3q-4 3 -8 5.5t-5 1.5q11 7 2 18q5 3 8 11.5 t9 11.5q9 -14 22 -3q8 9 2 18q5 8 22 11.5t20 9.5q5 -1 7 0t2 4.5v7.5t1 8.5t3 7.5q4 6 16 10.5t14 5.5l19 12q4 4 0 4q18 -2 32 11q13 12 -5 23q2 7 -4 10.5t-16 5.5q3 1 12 0.5t12 1.5q15 11 -7 17q-20 5 -47 -13q-3 -2 -13 -12t-17 -11q15 18 5 22q8 -1 22.5 9t15.5 11 q4 2 10.5 2.5t8.5 1.5q71 25 92 -1q8 11 11 15t9.5 9t15.5 8q21 7 23 9l1 23q-12 -1 -18 8t-7 22l-6 -8q0 6 -3.5 7.5t-7.5 0.5t-9.5 -2t-7.5 0q-9 2 -19.5 15.5t-14.5 16.5q9 0 9 5q-2 5 -10 8q1 6 -2 8t-9 0q-2 12 -1 13q-6 1 -11 11t-8 10q-2 0 -4.5 -2t-5 -5.5l-5 -7 t-3.5 -5.5l-2 -2q-12 6 -24 -10q-9 1 -17 -2q15 6 2 13q-11 5 -21 2q12 5 10 14t-12 16q1 0 4 -1t4 -1q-1 5 -9.5 9.5t-19.5 9t-14 6.5q-7 5 -36 10.5t-36 1.5q-5 -3 -6 -6t1.5 -8.5t3.5 -8.5q6 -23 5 -27q-1 -3 -8.5 -8t-5.5 -12q1 -4 11.5 -10t12.5 -12q5 -13 -4 -25 q-4 -5 -15 -11t-14 -10q-5 -5 -3.5 -11.5t0.5 -9.5q1 1 1 2.5t1 2.5q0 -13 11 -22q8 -6 -16 -18q-20 -11 -20 -4q1 8 -7.5 16t-10.5 12t-3.5 19t-9.5 21q-6 4 -19 4t-18 -5q0 10 -49 30q-17 8 -58 4q7 1 0 17q-8 16 -21 12q-8 25 -4 35q2 5 9 14t9 15q1 3 15.5 6t16.5 8 q1 4 -2.5 6.5t-9.5 4.5q53 -6 63 18q5 9 3 14q0 -1 2 -1t2 -1q12 3 7 17q19 8 26 8q5 -1 11 -6t10 -5q17 -3 21.5 10t-9.5 23q7 -4 7 6q-1 13 -7 19q-3 2 -6.5 2.5t-6.5 0t-7 0.5q-1 0 -8 2q-1 -1 -2 -1h-8q-4 -2 -4 -5v-1q-1 -3 4 -6l5 -1l3 -2q-1 0 -2.5 -2.5t-2.5 -2.5 q0 -3 3 -5q-2 -1 -14 -7.5t-17 -10.5q-1 -1 -4 -2.5t-4 -2.5q-2 -1 -4 2t-4 9t-4 11.5t-4.5 10t-5.5 4.5q-12 0 -18 -17q3 10 -13 17.5t-25 7.5q20 15 -9 30l-1 1q-30 -4 -45 -7q-2 -6 3 -12q-1 -7 6 -9q0 -1 0.5 -1t0.5 -1q0 1 -0.5 1t-0.5 1q3 -1 10.5 -1.5t9.5 -1.5 q3 -1 4.5 -2l7.5 -5t5.5 -6t-2.5 -5q-2 -1 -9 -4t-12.5 -5.5t-6.5 -3.5q-3 -5 0 -16t-2 -15q-5 5 -10 18.5t-8 17.5q8 -9 -30 -6l-8 1q-4 0 -15 -2t-16 -1q-7 0 -29 6q7 17 5 25q5 0 7 2l-6 3q-3 -1 -25 -9q2 -3 8 -9.5t9 -11.5q-22 6 -27 -2q0 -1 -9 0q-25 1 -24 -7 q1 -4 9 -12q0 -9 -1 -9q-27 22 -30 23q-172 -83 -276 -248q1 -2 2.5 -11t3.5 -8.5t11 4.5q9 -9 3 -21q2 2 36 -21q56 -40 22 -53v5.5t1 6.5q-9 -1 -19 5q-3 -6 0.5 -20t11.5 -14q-8 0 -10.5 -17t-2.5 -38.5t-1 -25.5l2 -1q-3 -13 6 -37.5t24 -20.5q-4 -18 5 -21q-1 -4 0 -8 t4.5 -8.5t6 -7l7.5 -7.5l6 -6q28 -11 41 -29q4 -6 10.5 -24.5t15.5 -25.5q-2 -6 10 -21.5t11 -25.5q-1 0 -2.5 -0.5t-2.5 -0.5q3 -8 16.5 -16t16.5 -14q2 -3 2.5 -10.5t3 -12t8.5 -2.5q3 24 -26 68q-16 27 -18 31q-3 5 -5.5 16.5t-4.5 15.5q27 -9 26 -13q-5 -10 26 -52 q2 -3 10 -10t11 -12q3 -4 9.5 -14.5t10.5 -15.5q-1 0 -3 -2l-3 -3q4 -2 9 -5t8 -4.5t7.5 -5t7.5 -7.5q16 -18 20 -33q1 -4 0.5 -15.5t1.5 -16.5q2 -6 6 -11t11.5 -10t11.5 -7t14.5 -6.5t11.5 -5.5q2 -1 18 -11t25 -14q10 -4 16.5 -4.5t16 2.5t15.5 4z" />
197
+ <glyph unicode="&#xf0ad;" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1028 484l-682 -682q-37 -37 -90 -37q-52 0 -91 37l-106 108q-38 36 -38 90q0 53 38 91l681 681q39 -98 114.5 -173.5t173.5 -114.5zM1662 919q0 -39 -23 -106q-47 -134 -164.5 -217.5 t-258.5 -83.5q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q58 0 121.5 -16.5t107.5 -46.5q16 -11 16 -28t-16 -28l-293 -169v-224l193 -107q5 3 79 48.5t135.5 81t70.5 35.5q15 0 23.5 -10t8.5 -25z" />
198
+ <glyph unicode="&#xf0ae;" horiz-adv-x="1792" d="M1024 128h640v128h-640v-128zM640 640h1024v128h-1024v-128zM1280 1152h384v128h-384v-128zM1792 320v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 832v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19 t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
199
+ <glyph unicode="&#xf0b0;" horiz-adv-x="1408" d="M1403 1241q17 -41 -14 -70l-493 -493v-742q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-256 256q-19 19 -19 45v486l-493 493q-31 29 -14 70q17 39 59 39h1280q42 0 59 -39z" />
200
+ <glyph unicode="&#xf0b1;" horiz-adv-x="1792" d="M640 1280h512v128h-512v-128zM1792 640v-480q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v480h672v-160q0 -26 19 -45t45 -19h320q26 0 45 19t19 45v160h672zM1024 640v-128h-256v128h256zM1792 1120v-384h-1792v384q0 66 47 113t113 47h352v160q0 40 28 68 t68 28h576q40 0 68 -28t28 -68v-160h352q66 0 113 -47t47 -113z" />
201
+ <glyph unicode="&#xf0b2;" d="M1283 995l-355 -355l355 -355l144 144q29 31 70 14q39 -17 39 -59v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l144 144l-355 355l-355 -355l144 -144q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l144 -144 l355 355l-355 355l-144 -144q-19 -19 -45 -19q-12 0 -24 5q-40 17 -40 59v448q0 26 19 45t45 19h448q42 0 59 -40q17 -39 -14 -69l-144 -144l355 -355l355 355l-144 144q-31 30 -14 69q17 40 59 40h448q26 0 45 -19t19 -45v-448q0 -42 -39 -59q-13 -5 -25 -5q-26 0 -45 19z " />
202
+ <glyph unicode="&#xf0c0;" horiz-adv-x="1920" d="M593 640q-162 -5 -265 -128h-134q-82 0 -138 40.5t-56 118.5q0 353 124 353q6 0 43.5 -21t97.5 -42.5t119 -21.5q67 0 133 23q-5 -37 -5 -66q0 -139 81 -256zM1664 3q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q10 0 43 -21.5t73 -48t107 -48t135 -21.5t135 21.5t107 48t73 48t43 21.5q61 0 111.5 -20t85.5 -53.5t62 -81t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM640 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75 t75 -181zM1344 896q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5zM1920 671q0 -78 -56 -118.5t-138 -40.5h-134q-103 123 -265 128q81 117 81 256q0 29 -5 66q66 -23 133 -23q59 0 119 21.5t97.5 42.5 t43.5 21q124 0 124 -353zM1792 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181z" />
203
+ <glyph unicode="&#xf0c1;" horiz-adv-x="1664" d="M1456 320q0 40 -28 68l-208 208q-28 28 -68 28q-42 0 -72 -32q3 -3 19 -18.5t21.5 -21.5t15 -19t13 -25.5t3.5 -27.5q0 -40 -28 -68t-68 -28q-15 0 -27.5 3.5t-25.5 13t-19 15t-21.5 21.5t-18.5 19q-33 -31 -33 -73q0 -40 28 -68l206 -207q27 -27 68 -27q40 0 68 26 l147 146q28 28 28 67zM753 1025q0 40 -28 68l-206 207q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l208 -208q27 -27 68 -27q42 0 72 31q-3 3 -19 18.5t-21.5 21.5t-15 19t-13 25.5t-3.5 27.5q0 40 28 68t68 28q15 0 27.5 -3.5t25.5 -13t19 -15 t21.5 -21.5t18.5 -19q33 31 33 73zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-206 207q-83 83 -83 203q0 123 88 209l-88 88q-86 -88 -208 -88q-120 0 -204 84l-208 208q-84 84 -84 204t85 203l147 146q83 83 203 83q121 0 204 -85l206 -207 q83 -83 83 -203q0 -123 -88 -209l88 -88q86 88 208 88q120 0 204 -84l208 -208q84 -84 84 -204z" />
204
+ <glyph unicode="&#xf0c2;" horiz-adv-x="1920" d="M1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088q-185 0 -316.5 131.5t-131.5 316.5q0 132 71 241.5t187 163.5q-2 28 -2 43q0 212 150 362t362 150q158 0 286.5 -88t187.5 -230q70 62 166 62q106 0 181 -75t75 -181q0 -75 -41 -138q129 -30 213 -134.5t84 -239.5z " />
205
+ <glyph unicode="&#xf0c3;" horiz-adv-x="1664" d="M1527 88q56 -89 21.5 -152.5t-140.5 -63.5h-1152q-106 0 -140.5 63.5t21.5 152.5l503 793v399h-64q-26 0 -45 19t-19 45t19 45t45 19h512q26 0 45 -19t19 -45t-19 -45t-45 -19h-64v-399zM748 813l-272 -429h712l-272 429l-20 31v37v399h-128v-399v-37z" />
206
+ <glyph unicode="&#xf0c4;" horiz-adv-x="1792" d="M960 640q26 0 45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45t19 45t45 19zM1260 576l507 -398q28 -20 25 -56q-5 -35 -35 -51l-128 -64q-13 -7 -29 -7q-17 0 -31 8l-690 387l-110 -66q-8 -4 -12 -5q14 -49 10 -97q-7 -77 -56 -147.5t-132 -123.5q-132 -84 -277 -84 q-136 0 -222 78q-90 84 -79 207q7 76 56 147t131 124q132 84 278 84q83 0 151 -31q9 13 22 22l122 73l-122 73q-13 9 -22 22q-68 -31 -151 -31q-146 0 -278 84q-82 53 -131 124t-56 147q-5 59 15.5 113t63.5 93q85 79 222 79q145 0 277 -84q83 -52 132 -123t56 -148 q4 -48 -10 -97q4 -1 12 -5l110 -66l690 387q14 8 31 8q16 0 29 -7l128 -64q30 -16 35 -51q3 -36 -25 -56zM579 836q46 42 21 108t-106 117q-92 59 -192 59q-74 0 -113 -36q-46 -42 -21 -108t106 -117q92 -59 192 -59q74 0 113 36zM494 91q81 51 106 117t-21 108 q-39 36 -113 36q-100 0 -192 -59q-81 -51 -106 -117t21 -108q39 -36 113 -36q100 0 192 59zM672 704l96 -58v11q0 36 33 56l14 8l-79 47l-26 -26q-3 -3 -10 -11t-12 -12q-2 -2 -4 -3.5t-3 -2.5zM896 480l96 -32l736 576l-128 64l-768 -431v-113l-160 -96l9 -8q2 -2 7 -6 q4 -4 11 -12t11 -12l26 -26zM1600 64l128 64l-520 408l-177 -138q-2 -3 -13 -7z" />
207
+ <glyph unicode="&#xf0c5;" horiz-adv-x="1792" d="M1696 1152q40 0 68 -28t28 -68v-1216q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v288h-544q-40 0 -68 28t-28 68v672q0 40 20 88t48 76l408 408q28 28 76 48t88 20h416q40 0 68 -28t28 -68v-328q68 40 128 40h416zM1152 939l-299 -299h299v299zM512 1323l-299 -299 h299v299zM708 676l316 316v416h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h512v256q0 40 20 88t48 76zM1664 -128v1152h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h896z" />
208
+ <glyph unicode="&#xf0c6;" horiz-adv-x="1408" d="M1404 151q0 -117 -79 -196t-196 -79q-135 0 -235 100l-777 776q-113 115 -113 271q0 159 110 270t269 111q158 0 273 -113l605 -606q10 -10 10 -22q0 -16 -30.5 -46.5t-46.5 -30.5q-13 0 -23 10l-606 607q-79 77 -181 77q-106 0 -179 -75t-73 -181q0 -105 76 -181 l776 -777q63 -63 145 -63q64 0 106 42t42 106q0 82 -63 145l-581 581q-26 24 -60 24q-29 0 -48 -19t-19 -48q0 -32 25 -59l410 -410q10 -10 10 -22q0 -16 -31 -47t-47 -31q-12 0 -22 10l-410 410q-63 61 -63 149q0 82 57 139t139 57q88 0 149 -63l581 -581q100 -98 100 -235 z" />
209
+ <glyph unicode="&#xf0c7;" d="M384 0h768v384h-768v-384zM1280 0h128v896q0 14 -10 38.5t-20 34.5l-281 281q-10 10 -34 20t-39 10v-416q0 -40 -28 -68t-68 -28h-576q-40 0 -68 28t-28 68v416h-128v-1280h128v416q0 40 28 68t68 28h832q40 0 68 -28t28 -68v-416zM896 928v320q0 13 -9.5 22.5t-22.5 9.5 h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1536 896v-928q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h928q40 0 88 -20t76 -48l280 -280q28 -28 48 -76t20 -88z" />
210
+ <glyph unicode="&#xf0c8;" d="M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
211
+ <glyph unicode="&#xf0c9;" d="M1536 192v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 704v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 1216v-128q0 -26 -19 -45 t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
212
+ <glyph unicode="&#xf0ca;" horiz-adv-x="1792" d="M384 128q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM384 640q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1152q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z M1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
213
+ <glyph unicode="&#xf0cb;" horiz-adv-x="1792" d="M381 -84q0 -80 -54.5 -126t-135.5 -46q-106 0 -172 66l57 88q49 -45 106 -45q29 0 50.5 14.5t21.5 42.5q0 64 -105 56l-26 56q8 10 32.5 43.5t42.5 54t37 38.5v1q-16 0 -48.5 -1t-48.5 -1v-53h-106v152h333v-88l-95 -115q51 -12 81 -49t30 -88zM383 543v-159h-362 q-6 36 -6 54q0 51 23.5 93t56.5 68t66 47.5t56.5 43.5t23.5 45q0 25 -14.5 38.5t-39.5 13.5q-46 0 -81 -58l-85 59q24 51 71.5 79.5t105.5 28.5q73 0 123 -41.5t50 -112.5q0 -50 -34 -91.5t-75 -64.5t-75.5 -50.5t-35.5 -52.5h127v60h105zM1792 224v-192q0 -13 -9.5 -22.5 t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1123v-99h-335v99h107q0 41 0.5 122t0.5 121v12h-2q-8 -17 -50 -54l-71 76l136 127h106v-404h108zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5 t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
214
+ <glyph unicode="&#xf0cc;" horiz-adv-x="1792" d="M1760 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-1728q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h1728zM483 704q-28 35 -51 80q-48 97 -48 188q0 181 134 309q133 127 393 127q50 0 167 -19q66 -12 177 -48q10 -38 21 -118q14 -123 14 -183q0 -18 -5 -45l-12 -3l-84 6 l-14 2q-50 149 -103 205q-88 91 -210 91q-114 0 -182 -59q-67 -58 -67 -146q0 -73 66 -140t279 -129q69 -20 173 -66q58 -28 95 -52h-743zM990 448h411q7 -39 7 -92q0 -111 -41 -212q-23 -55 -71 -104q-37 -35 -109 -81q-80 -48 -153 -66q-80 -21 -203 -21q-114 0 -195 23 l-140 40q-57 16 -72 28q-8 8 -8 22v13q0 108 -2 156q-1 30 0 68l2 37v44l102 2q15 -34 30 -71t22.5 -56t12.5 -27q35 -57 80 -94q43 -36 105 -57q59 -22 132 -22q64 0 139 27q77 26 122 86q47 61 47 129q0 84 -81 157q-34 29 -137 71z" />
215
+ <glyph unicode="&#xf0cd;" d="M48 1313q-37 2 -45 4l-3 88q13 1 40 1q60 0 112 -4q132 -7 166 -7q86 0 168 3q116 4 146 5q56 0 86 2l-1 -14l2 -64v-9q-60 -9 -124 -9q-60 0 -79 -25q-13 -14 -13 -132q0 -13 0.5 -32.5t0.5 -25.5l1 -229l14 -280q6 -124 51 -202q35 -59 96 -92q88 -47 177 -47 q104 0 191 28q56 18 99 51q48 36 65 64q36 56 53 114q21 73 21 229q0 79 -3.5 128t-11 122.5t-13.5 159.5l-4 59q-5 67 -24 88q-34 35 -77 34l-100 -2l-14 3l2 86h84l205 -10q76 -3 196 10l18 -2q6 -38 6 -51q0 -7 -4 -31q-45 -12 -84 -13q-73 -11 -79 -17q-15 -15 -15 -41 q0 -7 1.5 -27t1.5 -31q8 -19 22 -396q6 -195 -15 -304q-15 -76 -41 -122q-38 -65 -112 -123q-75 -57 -182 -89q-109 -33 -255 -33q-167 0 -284 46q-119 47 -179 122q-61 76 -83 195q-16 80 -16 237v333q0 188 -17 213q-25 36 -147 39zM1536 -96v64q0 14 -9 23t-23 9h-1472 q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h1472q14 0 23 9t9 23z" />
216
+ <glyph unicode="&#xf0ce;" horiz-adv-x="1664" d="M512 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23 v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 160v192 q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192 q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1664 1248v-1088q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1344q66 0 113 -47t47 -113 z" />
217
+ <glyph unicode="&#xf0d0;" horiz-adv-x="1664" d="M1190 955l293 293l-107 107l-293 -293zM1637 1248q0 -27 -18 -45l-1286 -1286q-18 -18 -45 -18t-45 18l-198 198q-18 18 -18 45t18 45l1286 1286q18 18 45 18t45 -18l198 -198q18 -18 18 -45zM286 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM636 1276 l196 -60l-196 -60l-60 -196l-60 196l-196 60l196 60l60 196zM1566 798l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM926 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98z" />
218
+ <glyph unicode="&#xf0d1;" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" />
219
+ <glyph unicode="&#xf0d2;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
220
+ <glyph unicode="&#xf0d3;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" />
221
+ <glyph unicode="&#xf0d4;" d="M678 -57q0 -38 -10 -71h-380q-95 0 -171.5 56.5t-103.5 147.5q24 45 69 77.5t100 49.5t107 24t107 7q32 0 49 -2q6 -4 30.5 -21t33 -23t31 -23t32 -25.5t27.5 -25.5t26.5 -29.5t21 -30.5t17.5 -34.5t9.5 -36t4.5 -40.5zM385 294q-234 -7 -385 -85v433q103 -118 273 -118 q32 0 70 5q-21 -61 -21 -86q0 -67 63 -149zM558 805q0 -100 -43.5 -160.5t-140.5 -60.5q-51 0 -97 26t-78 67.5t-56 93.5t-35.5 104t-11.5 99q0 96 51.5 165t144.5 69q66 0 119 -41t84 -104t47 -130t16 -128zM1536 896v-736q0 -119 -84.5 -203.5t-203.5 -84.5h-468 q39 73 39 157q0 66 -22 122.5t-55.5 93t-72 71t-72 59.5t-55.5 54.5t-22 59.5q0 36 23 68t56 61.5t65.5 64.5t55.5 93t23 131t-26.5 145.5t-75.5 118.5q-6 6 -14 11t-12.5 7.5t-10 9.5t-10.5 17h135l135 64h-437q-138 0 -244.5 -38.5t-182.5 -133.5q0 126 81 213t207 87h960 q119 0 203.5 -84.5t84.5 -203.5v-96h-256v256h-128v-256h-256v-128h256v-256h128v256h256z" />
222
+ <glyph unicode="&#xf0d5;" horiz-adv-x="1664" d="M876 71q0 21 -4.5 40.5t-9.5 36t-17.5 34.5t-21 30.5t-26.5 29.5t-27.5 25.5t-32 25.5t-31 23t-33 23t-30.5 21q-17 2 -50 2q-54 0 -106 -7t-108 -25t-98 -46t-69 -75t-27 -107q0 -68 35.5 -121.5t93 -84t120.5 -45.5t127 -15q59 0 112.5 12.5t100.5 39t74.5 73.5 t27.5 110zM756 933q0 60 -16.5 127.5t-47 130.5t-84 104t-119.5 41q-93 0 -144 -69t-51 -165q0 -47 11.5 -99t35.5 -104t56 -93.5t78 -67.5t97 -26q97 0 140.5 60.5t43.5 160.5zM625 1408h437l-135 -79h-135q71 -45 110 -126t39 -169q0 -74 -23 -131.5t-56 -92.5t-66 -64.5 t-56 -61t-23 -67.5q0 -26 16.5 -51t43 -48t58.5 -48t64 -55.5t58.5 -66t43 -85t16.5 -106.5q0 -160 -140 -282q-152 -131 -420 -131q-59 0 -119.5 10t-122 33.5t-108.5 58t-77 89t-30 121.5q0 61 37 135q32 64 96 110.5t145 71t155 36t150 13.5q-64 83 -64 149q0 12 2 23.5 t5 19.5t8 21.5t7 21.5q-40 -5 -70 -5q-149 0 -255.5 98t-106.5 246q0 140 95 250.5t234 141.5q94 20 187 20zM1664 1152v-128h-256v-256h-128v256h-256v128h256v256h128v-256h256z" />
223
+ <glyph unicode="&#xf0d6;" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" />
224
+ <glyph unicode="&#xf0d7;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
225
+ <glyph unicode="&#xf0d8;" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
226
+ <glyph unicode="&#xf0d9;" horiz-adv-x="640" d="M640 1088v-896q0 -26 -19 -45t-45 -19t-45 19l-448 448q-19 19 -19 45t19 45l448 448q19 19 45 19t45 -19t19 -45z" />
227
+ <glyph unicode="&#xf0da;" horiz-adv-x="640" d="M576 640q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19t-19 45v896q0 26 19 45t45 19t45 -19l448 -448q19 -19 19 -45z" />
228
+ <glyph unicode="&#xf0db;" horiz-adv-x="1664" d="M160 0h608v1152h-640v-1120q0 -13 9.5 -22.5t22.5 -9.5zM1536 32v1120h-640v-1152h608q13 0 22.5 9.5t9.5 22.5zM1664 1248v-1216q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1344q66 0 113 -47t47 -113z" />
229
+ <glyph unicode="&#xf0dc;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45zM1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
230
+ <glyph unicode="&#xf0dd;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
231
+ <glyph unicode="&#xf0de;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
232
+ <glyph unicode="&#xf0e0;" horiz-adv-x="1792" d="M1792 826v-794q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v794q44 -49 101 -87q362 -246 497 -345q57 -42 92.5 -65.5t94.5 -48t110 -24.5h1h1q51 0 110 24.5t94.5 48t92.5 65.5q170 123 498 345q57 39 100 87zM1792 1120q0 -79 -49 -151t-122 -123 q-376 -261 -468 -325q-10 -7 -42.5 -30.5t-54 -38t-52 -32.5t-57.5 -27t-50 -9h-1h-1q-23 0 -50 9t-57.5 27t-52 32.5t-54 38t-42.5 30.5q-91 64 -262 182.5t-205 142.5q-62 42 -117 115.5t-55 136.5q0 78 41.5 130t118.5 52h1472q65 0 112.5 -47t47.5 -113z" />
233
+ <glyph unicode="&#xf0e1;" d="M349 911v-991h-330v991h330zM370 1217q1 -73 -50.5 -122t-135.5 -49h-2q-82 0 -132 49t-50 122q0 74 51.5 122.5t134.5 48.5t133 -48.5t51 -122.5zM1536 488v-568h-329v530q0 105 -40.5 164.5t-126.5 59.5q-63 0 -105.5 -34.5t-63.5 -85.5q-11 -30 -11 -81v-553h-329 q2 399 2 647t-1 296l-1 48h329v-144h-2q20 32 41 56t56.5 52t87 43.5t114.5 15.5q171 0 275 -113.5t104 -332.5z" />
234
+ <glyph unicode="&#xf0e2;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298z" />
235
+ <glyph unicode="&#xf0e3;" horiz-adv-x="1792" d="M1771 0q0 -53 -37 -90l-107 -108q-39 -37 -91 -37q-53 0 -90 37l-363 364q-38 36 -38 90q0 53 43 96l-256 256l-126 -126q-14 -14 -34 -14t-34 14q2 -2 12.5 -12t12.5 -13t10 -11.5t10 -13.5t6 -13.5t5.5 -16.5t1.5 -18q0 -38 -28 -68q-3 -3 -16.5 -18t-19 -20.5 t-18.5 -16.5t-22 -15.5t-22 -9t-26 -4.5q-40 0 -68 28l-408 408q-28 28 -28 68q0 13 4.5 26t9 22t15.5 22t16.5 18.5t20.5 19t18 16.5q30 28 68 28q10 0 18 -1.5t16.5 -5.5t13.5 -6t13.5 -10t11.5 -10t13 -12.5t12 -12.5q-14 14 -14 34t14 34l348 348q14 14 34 14t34 -14 q-2 2 -12.5 12t-12.5 13t-10 11.5t-10 13.5t-6 13.5t-5.5 16.5t-1.5 18q0 38 28 68q3 3 16.5 18t19 20.5t18.5 16.5t22 15.5t22 9t26 4.5q40 0 68 -28l408 -408q28 -28 28 -68q0 -13 -4.5 -26t-9 -22t-15.5 -22t-16.5 -18.5t-20.5 -19t-18 -16.5q-30 -28 -68 -28 q-10 0 -18 1.5t-16.5 5.5t-13.5 6t-13.5 10t-11.5 10t-13 12.5t-12 12.5q14 -14 14 -34t-14 -34l-126 -126l256 -256q43 43 96 43q52 0 91 -37l363 -363q37 -39 37 -91z" />
236
+ <glyph unicode="&#xf0e4;" horiz-adv-x="1792" d="M384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM576 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1004 351l101 382q6 26 -7.5 48.5t-38.5 29.5 t-48 -6.5t-30 -39.5l-101 -382q-60 -5 -107 -43.5t-63 -98.5q-20 -77 20 -146t117 -89t146 20t89 117q16 60 -6 117t-72 91zM1664 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 1024q0 53 -37.5 90.5 t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1472 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1792 384q0 -261 -141 -483q-19 -29 -54 -29h-1402q-35 0 -54 29 q-141 221 -141 483q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
237
+ <glyph unicode="&#xf0e5;" horiz-adv-x="1792" d="M896 1152q-204 0 -381.5 -69.5t-282 -187.5t-104.5 -255q0 -112 71.5 -213.5t201.5 -175.5l87 -50l-27 -96q-24 -91 -70 -172q152 63 275 171l43 38l57 -6q69 -8 130 -8q204 0 381.5 69.5t282 187.5t104.5 255t-104.5 255t-282 187.5t-381.5 69.5zM1792 640 q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22h-5q-15 0 -27 10.5t-16 27.5v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281q0 174 120 321.5 t326 233t450 85.5t450 -85.5t326 -233t120 -321.5z" />
238
+ <glyph unicode="&#xf0e6;" horiz-adv-x="1792" d="M704 1152q-153 0 -286 -52t-211.5 -141t-78.5 -191q0 -82 53 -158t149 -132l97 -56l-35 -84q34 20 62 39l44 31l53 -10q78 -14 153 -14q153 0 286 52t211.5 141t78.5 191t-78.5 191t-211.5 141t-286 52zM704 1280q191 0 353.5 -68.5t256.5 -186.5t94 -257t-94 -257 t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224q0 139 94 257t256.5 186.5 t353.5 68.5zM1526 111q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129 q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230q0 -120 -71 -224.5t-195 -176.5z" />
239
+ <glyph unicode="&#xf0e7;" horiz-adv-x="896" d="M885 970q18 -20 7 -44l-540 -1157q-13 -25 -42 -25q-4 0 -14 2q-17 5 -25.5 19t-4.5 30l197 808l-406 -101q-4 -1 -12 -1q-18 0 -31 11q-18 15 -13 39l201 825q4 14 16 23t28 9h328q19 0 32 -12.5t13 -29.5q0 -8 -5 -18l-171 -463l396 98q8 2 12 2q19 0 34 -15z" />
240
+ <glyph unicode="&#xf0e8;" horiz-adv-x="1792" d="M1792 288v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192q0 52 38 90t90 38h512v192h-96q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h320q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-96v-192h512q52 0 90 -38t38 -90v-192h96q40 0 68 -28t28 -68 z" />
241
+ <glyph unicode="&#xf0e9;" horiz-adv-x="1664" d="M896 708v-580q0 -104 -76 -180t-180 -76t-180 76t-76 180q0 26 19 45t45 19t45 -19t19 -45q0 -50 39 -89t89 -39t89 39t39 89v580q33 11 64 11t64 -11zM1664 681q0 -13 -9.5 -22.5t-22.5 -9.5q-11 0 -23 10q-49 46 -93 69t-102 23q-68 0 -128 -37t-103 -97 q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -28 -17q-18 0 -29 17q-4 6 -14.5 24t-17.5 28q-43 60 -102.5 97t-127.5 37t-127.5 -37t-102.5 -97q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -29 -17q-17 0 -28 17q-4 6 -14.5 24t-17.5 28q-43 60 -103 97t-128 37q-58 0 -102 -23t-93 -69 q-12 -10 -23 -10q-13 0 -22.5 9.5t-9.5 22.5q0 5 1 7q45 183 172.5 319.5t298 204.5t360.5 68q140 0 274.5 -40t246.5 -113.5t194.5 -187t115.5 -251.5q1 -2 1 -7zM896 1408v-98q-42 2 -64 2t-64 -2v98q0 26 19 45t45 19t45 -19t19 -45z" />
242
+ <glyph unicode="&#xf0ea;" horiz-adv-x="1792" d="M768 -128h896v640h-416q-40 0 -68 28t-28 68v416h-384v-1152zM1024 1312v64q0 13 -9.5 22.5t-22.5 9.5h-704q-13 0 -22.5 -9.5t-9.5 -22.5v-64q0 -13 9.5 -22.5t22.5 -9.5h704q13 0 22.5 9.5t9.5 22.5zM1280 640h299l-299 299v-299zM1792 512v-672q0 -40 -28 -68t-68 -28 h-960q-40 0 -68 28t-28 68v160h-544q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h1088q40 0 68 -28t28 -68v-328q21 -13 36 -28l408 -408q28 -28 48 -76t20 -88z" />
243
+ <glyph unicode="&#xf0eb;" horiz-adv-x="1024" d="M736 960q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5q0 46 -54 71t-106 25q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5q50 0 99.5 -16t87 -54t37.5 -90zM896 960q0 72 -34.5 134t-90 101.5t-123 62t-136.5 22.5t-136.5 -22.5t-123 -62t-90 -101.5t-34.5 -134 q0 -101 68 -180q10 -11 30.5 -33t30.5 -33q128 -153 141 -298h228q13 145 141 298q10 11 30.5 33t30.5 33q68 79 68 180zM1024 960q0 -155 -103 -268q-45 -49 -74.5 -87t-59.5 -95.5t-34 -107.5q47 -28 47 -82q0 -37 -25 -64q25 -27 25 -64q0 -52 -45 -81q13 -23 13 -47 q0 -46 -31.5 -71t-77.5 -25q-20 -44 -60 -70t-87 -26t-87 26t-60 70q-46 0 -77.5 25t-31.5 71q0 24 13 47q-45 29 -45 81q0 37 25 64q-25 27 -25 64q0 54 47 82q-4 50 -34 107.5t-59.5 95.5t-74.5 87q-103 113 -103 268q0 99 44.5 184.5t117 142t164 89t186.5 32.5 t186.5 -32.5t164 -89t117 -142t44.5 -184.5z" />
244
+ <glyph unicode="&#xf0ec;" horiz-adv-x="1792" d="M1792 352v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5q-12 0 -24 10l-319 320q-9 9 -9 22q0 14 9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h1376q13 0 22.5 -9.5t9.5 -22.5zM1792 896q0 -14 -9 -23l-320 -320q-9 -9 -23 -9 q-13 0 -22.5 9.5t-9.5 22.5v192h-1376q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1376v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
245
+ <glyph unicode="&#xf0ed;" horiz-adv-x="1920" d="M1280 608q0 14 -9 23t-23 9h-224v352q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-352h-224q-13 0 -22.5 -9.5t-9.5 -22.5q0 -14 9 -23l352 -352q9 -9 23 -9t23 9l351 351q10 12 10 24zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
246
+ <glyph unicode="&#xf0ee;" horiz-adv-x="1920" d="M1280 672q0 14 -9 23l-352 352q-9 9 -23 9t-23 -9l-351 -351q-10 -12 -10 -24q0 -14 9 -23t23 -9h224v-352q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5v352h224q13 0 22.5 9.5t9.5 22.5zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
247
+ <glyph unicode="&#xf0f0;" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" />
248
+ <glyph unicode="&#xf0f1;" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" />
249
+ <glyph unicode="&#xf0f2;" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" />
250
+ <glyph unicode="&#xf0f3;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1664 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5 q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
251
+ <glyph unicode="&#xf0f4;" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" />
252
+ <glyph unicode="&#xf0f5;" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" />
253
+ <glyph unicode="&#xf0f6;" horiz-adv-x="1280" d="M1024 352v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM1024 608v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280z M768 896h299l-299 299v-299zM1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h544q40 0 88 -20t76 -48l408 -408q28 -28 48 -76t20 -88z" />
254
+ <glyph unicode="&#xf0f7;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" />
255
+ <glyph unicode="&#xf0f8;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" />
256
+ <glyph unicode="&#xf0f9;" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
257
+ <glyph unicode="&#xf0fa;" horiz-adv-x="1792" d="M1280 416v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM640 1152h512v128h-512v-128zM256 1152v-1280h-32 q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h32zM1440 1152v-1280h-1088v1280h160v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h160zM1792 928v-832q0 -92 -66 -158t-158 -66h-32v1280h32q92 0 158 -66t66 -158z" />
258
+ <glyph unicode="&#xf0fb;" horiz-adv-x="1920" d="M1920 576q-1 -32 -288 -96l-352 -32l-224 -64h-64l-293 -352h69q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-96h-160h-64v32h64v416h-160l-192 -224h-96l-32 32v192h32v32h128v8l-192 24v128l192 24v8h-128v32h-32v192l32 32h96l192 -224h160v416h-64v32h64h160h96 q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-69l293 -352h64l224 -64l352 -32q261 -58 287 -93z" />
259
+ <glyph unicode="&#xf0fc;" horiz-adv-x="1664" d="M640 640v384h-256v-256q0 -53 37.5 -90.5t90.5 -37.5h128zM1664 192v-192h-1152v192l128 192h-128q-159 0 -271.5 112.5t-112.5 271.5v320l-64 64l32 128h480l32 128h960l32 -192l-64 -32v-800z" />
260
+ <glyph unicode="&#xf0fd;" d="M1280 192v896q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-512v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-896q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h512v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
261
+ <glyph unicode="&#xf0fe;" d="M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
262
+ <glyph unicode="&#xf100;" horiz-adv-x="1024" d="M627 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23zM1011 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23z" />
263
+ <glyph unicode="&#xf101;" horiz-adv-x="1024" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM979 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23 l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
264
+ <glyph unicode="&#xf102;" horiz-adv-x="1152" d="M1075 224q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM1075 608q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393 q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
265
+ <glyph unicode="&#xf103;" horiz-adv-x="1152" d="M1075 672q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23zM1075 1056q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
266
+ <glyph unicode="&#xf104;" horiz-adv-x="640" d="M627 992q0 -13 -10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
267
+ <glyph unicode="&#xf105;" horiz-adv-x="640" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
268
+ <glyph unicode="&#xf106;" horiz-adv-x="1152" d="M1075 352q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
269
+ <glyph unicode="&#xf107;" horiz-adv-x="1152" d="M1075 800q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
270
+ <glyph unicode="&#xf108;" horiz-adv-x="1920" d="M1792 544v832q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5zM1920 1376v-1088q0 -66 -47 -113t-113 -47h-544q0 -37 16 -77.5t32 -71t16 -43.5q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19 t-19 45q0 14 16 44t32 70t16 78h-544q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
271
+ <glyph unicode="&#xf109;" horiz-adv-x="1920" d="M416 256q-66 0 -113 47t-47 113v704q0 66 47 113t113 47h1088q66 0 113 -47t47 -113v-704q0 -66 -47 -113t-113 -47h-1088zM384 1120v-704q0 -13 9.5 -22.5t22.5 -9.5h1088q13 0 22.5 9.5t9.5 22.5v704q0 13 -9.5 22.5t-22.5 9.5h-1088q-13 0 -22.5 -9.5t-9.5 -22.5z M1760 192h160v-96q0 -40 -47 -68t-113 -28h-1600q-66 0 -113 28t-47 68v96h160h1600zM1040 96q16 0 16 16t-16 16h-160q-16 0 -16 -16t16 -16h160z" />
272
+ <glyph unicode="&#xf10a;" horiz-adv-x="1152" d="M640 128q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1024 288v960q0 13 -9.5 22.5t-22.5 9.5h-832q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h832q13 0 22.5 9.5t9.5 22.5zM1152 1248v-1088q0 -66 -47 -113t-113 -47h-832 q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h832q66 0 113 -47t47 -113z" />
273
+ <glyph unicode="&#xf10b;" horiz-adv-x="768" d="M464 128q0 33 -23.5 56.5t-56.5 23.5t-56.5 -23.5t-23.5 -56.5t23.5 -56.5t56.5 -23.5t56.5 23.5t23.5 56.5zM672 288v704q0 13 -9.5 22.5t-22.5 9.5h-512q-13 0 -22.5 -9.5t-9.5 -22.5v-704q0 -13 9.5 -22.5t22.5 -9.5h512q13 0 22.5 9.5t9.5 22.5zM480 1136 q0 16 -16 16h-160q-16 0 -16 -16t16 -16h160q16 0 16 16zM768 1152v-1024q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v1024q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
274
+ <glyph unicode="&#xf10c;" d="M768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103 t279.5 -279.5t103 -385.5z" />
275
+ <glyph unicode="&#xf10d;" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" />
276
+ <glyph unicode="&#xf10e;" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" />
277
+ <glyph unicode="&#xf110;" horiz-adv-x="1568" d="M496 192q0 -60 -42.5 -102t-101.5 -42q-60 0 -102 42t-42 102t42 102t102 42q59 0 101.5 -42t42.5 -102zM928 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -66 -47 -113t-113 -47t-113 47t-47 113 t47 113t113 47t113 -47t47 -113zM1360 192q0 -46 -33 -79t-79 -33t-79 33t-33 79t33 79t79 33t79 -33t33 -79zM528 1088q0 -73 -51.5 -124.5t-124.5 -51.5t-124.5 51.5t-51.5 124.5t51.5 124.5t124.5 51.5t124.5 -51.5t51.5 -124.5zM992 1280q0 -80 -56 -136t-136 -56 t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1536 640q0 -40 -28 -68t-68 -28t-68 28t-28 68t28 68t68 28t68 -28t28 -68zM1328 1088q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5z" />
278
+ <glyph unicode="&#xf111;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
279
+ <glyph unicode="&#xf112;" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" />
280
+ <glyph unicode="&#xf113;" horiz-adv-x="1664" />
281
+ <glyph unicode="&#xf114;" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
282
+ <glyph unicode="&#xf115;" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " />
283
+ <glyph unicode="&#xf116;" horiz-adv-x="1152" d="M896 608v-64q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v224h-224q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v224q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-224h224q14 0 23 -9t9 -23zM1024 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 -28 t-28 -68v-704q0 -40 28 -68t68 -28h704q40 0 68 28t28 68zM1152 928v-704q0 -92 -65.5 -158t-158.5 -66h-704q-93 0 -158.5 66t-65.5 158v704q0 93 65.5 158.5t158.5 65.5h704q93 0 158.5 -65.5t65.5 -158.5z" />
284
+ <glyph unicode="&#xf117;" horiz-adv-x="1152" d="M928 1152q93 0 158.5 -65.5t65.5 -158.5v-704q0 -92 -65.5 -158t-158.5 -66h-704q-93 0 -158.5 66t-65.5 158v704q0 93 65.5 158.5t158.5 65.5h704zM1024 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 -28t-28 -68v-704q0 -40 28 -68t68 -28h704q40 0 68 28t28 68z M864 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-576q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h576z" />
285
+ <glyph unicode="&#xf118;" d="M1134 461q-37 -121 -138 -195t-228 -74t-228 74t-138 195q-8 25 4 48.5t38 31.5q25 8 48.5 -4t31.5 -38q25 -80 92.5 -129.5t151.5 -49.5t151.5 49.5t92.5 129.5q8 26 32 38t49 4t37 -31.5t4 -48.5zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5 t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
286
+ <glyph unicode="&#xf119;" d="M1134 307q8 -25 -4 -48.5t-37 -31.5t-49 4t-32 38q-25 80 -92.5 129.5t-151.5 49.5t-151.5 -49.5t-92.5 -129.5q-8 -26 -31.5 -38t-48.5 -4q-26 8 -38 31.5t-4 48.5q37 121 138 195t228 74t228 -74t138 -195zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204 t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
287
+ <glyph unicode="&#xf11a;" d="M1152 448q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h640q26 0 45 -19t19 -45zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
288
+ <glyph unicode="&#xf11b;" horiz-adv-x="1920" d="M832 448v128q0 14 -9 23t-23 9h-192v192q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-192h-192q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h192v-192q0 -14 9 -23t23 -9h128q14 0 23 9t9 23v192h192q14 0 23 9t9 23zM1408 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 640q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1920 512q0 -212 -150 -362t-362 -150q-192 0 -338 128h-220q-146 -128 -338 -128q-212 0 -362 150 t-150 362t150 362t362 150h896q212 0 362 -150t150 -362z" />
289
+ <glyph unicode="&#xf11c;" horiz-adv-x="1920" d="M384 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM512 624v-96q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h224q16 0 16 -16zM384 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 368v-96q0 -16 -16 -16 h-864q-16 0 -16 16v96q0 16 16 16h864q16 0 16 -16zM768 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM640 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1024 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16 h96q16 0 16 -16zM896 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1280 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1152 880v-96 q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 880v-352q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h112v240q0 16 16 16h96q16 0 16 -16zM1792 128v896h-1664v-896 h1664zM1920 1024v-896q0 -53 -37.5 -90.5t-90.5 -37.5h-1664q-53 0 -90.5 37.5t-37.5 90.5v896q0 53 37.5 90.5t90.5 37.5h1664q53 0 90.5 -37.5t37.5 -90.5z" />
290
+ <glyph unicode="&#xf11d;" horiz-adv-x="1792" d="M1664 491v616q-169 -91 -306 -91q-82 0 -145 32q-100 49 -184 76.5t-178 27.5q-173 0 -403 -127v-599q245 113 433 113q55 0 103.5 -7.5t98 -26t77 -31t82.5 -39.5l28 -14q44 -22 101 -22q120 0 293 92zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9 h-64q-14 0 -23 9t-9 23v1266q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102 q-15 -9 -33 -9q-16 0 -32 8q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
291
+ <glyph unicode="&#xf11e;" horiz-adv-x="1792" d="M832 536v192q-181 -16 -384 -117v-185q205 96 384 110zM832 954v197q-172 -8 -384 -126v-189q215 111 384 118zM1664 491v184q-235 -116 -384 -71v224q-20 6 -39 15q-5 3 -33 17t-34.5 17t-31.5 15t-34.5 15.5t-32.5 13t-36 12.5t-35 8.5t-39.5 7.5t-39.5 4t-44 2 q-23 0 -49 -3v-222h19q102 0 192.5 -29t197.5 -82q19 -9 39 -15v-188q42 -17 91 -17q120 0 293 92zM1664 918v189q-169 -91 -306 -91q-45 0 -78 8v-196q148 -42 384 90zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v1266 q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102q-15 -9 -33 -9q-16 0 -32 8 q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
292
+ <glyph unicode="&#xf120;" horiz-adv-x="1664" d="M585 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23zM1664 96v-64q0 -14 -9 -23t-23 -9h-960q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h960q14 0 23 -9 t9 -23z" />
293
+ <glyph unicode="&#xf121;" horiz-adv-x="1920" d="M617 137l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23zM1208 1204l-373 -1291q-4 -13 -15.5 -19.5t-23.5 -2.5l-62 17q-13 4 -19.5 15.5t-2.5 24.5 l373 1291q4 13 15.5 19.5t23.5 2.5l62 -17q13 -4 19.5 -15.5t2.5 -24.5zM1865 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23z" />
294
+ <glyph unicode="&#xf122;" horiz-adv-x="1792" d="M640 454v-70q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-69l-397 -398q-19 -19 -19 -45t19 -45zM1792 416q0 -58 -17 -133.5t-38.5 -138t-48 -125t-40.5 -90.5l-20 -40q-8 -17 -28 -17q-6 0 -9 1 q-25 8 -23 34q43 400 -106 565q-64 71 -170.5 110.5t-267.5 52.5v-251q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-262q411 -28 599 -221q169 -173 169 -509z" />
295
+ <glyph unicode="&#xf123;" horiz-adv-x="1664" d="M1186 579l257 250l-356 52l-66 10l-30 60l-159 322v-963l59 -31l318 -168l-60 355l-12 66zM1638 841l-363 -354l86 -500q5 -33 -6 -51.5t-34 -18.5q-17 0 -40 12l-449 236l-449 -236q-23 -12 -40 -12q-23 0 -34 18.5t-6 51.5l86 500l-364 354q-32 32 -23 59.5t54 34.5 l502 73l225 455q20 41 49 41q28 0 49 -41l225 -455l502 -73q45 -7 54 -34.5t-24 -59.5z" />
296
+ <glyph unicode="&#xf124;" horiz-adv-x="1408" d="M1401 1187l-640 -1280q-17 -35 -57 -35q-5 0 -15 2q-22 5 -35.5 22.5t-13.5 39.5v576h-576q-22 0 -39.5 13.5t-22.5 35.5t4 42t29 30l1280 640q13 7 29 7q27 0 45 -19q15 -14 18.5 -34.5t-6.5 -39.5z" />
297
+ <glyph unicode="&#xf125;" horiz-adv-x="1664" d="M557 256h595v595zM512 301l595 595h-595v-595zM1664 224v-192q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v224h-864q-14 0 -23 9t-9 23v864h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224v224q0 14 9 23t23 9h192q14 0 23 -9t9 -23 v-224h851l246 247q10 9 23 9t23 -9q9 -10 9 -23t-9 -23l-247 -246v-851h224q14 0 23 -9t9 -23z" />
298
+ <glyph unicode="&#xf126;" horiz-adv-x="1024" d="M288 64q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM288 1216q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM928 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1024 1088q0 -52 -26 -96.5t-70 -69.5 q-2 -287 -226 -414q-68 -38 -203 -81q-128 -40 -169.5 -71t-41.5 -100v-26q44 -25 70 -69.5t26 -96.5q0 -80 -56 -136t-136 -56t-136 56t-56 136q0 52 26 96.5t70 69.5v820q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136q0 -52 -26 -96.5t-70 -69.5v-497 q54 26 154 57q55 17 87.5 29.5t70.5 31t59 39.5t40.5 51t28 69.5t8.5 91.5q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136z" />
299
+ <glyph unicode="&#xf127;" horiz-adv-x="1664" d="M439 265l-256 -256q-10 -9 -23 -9q-12 0 -23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23zM608 224v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM384 448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23t9 23t23 9h320 q14 0 23 -9t9 -23zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-334 335q-21 21 -42 56l239 18l273 -274q27 -27 68 -27.5t68 26.5l147 146q28 28 28 67q0 40 -28 68l-274 275l18 239q35 -21 56 -42l336 -336q84 -86 84 -204zM1031 1044l-239 -18 l-273 274q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l274 -274l-18 -240q-35 21 -56 42l-336 336q-84 86 -84 204q0 120 85 203l147 146q83 83 203 83q121 0 204 -85l334 -335q21 -21 42 -56zM1664 960q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9 t-9 23t9 23t23 9h320q14 0 23 -9t9 -23zM1120 1504v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM1527 1353l-256 -256q-11 -9 -23 -9t-23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
300
+ <glyph unicode="&#xf128;" horiz-adv-x="1024" d="M704 280v-240q0 -16 -12 -28t-28 -12h-240q-16 0 -28 12t-12 28v240q0 16 12 28t28 12h240q16 0 28 -12t12 -28zM1020 880q0 -54 -15.5 -101t-35 -76.5t-55 -59.5t-57.5 -43.5t-61 -35.5q-41 -23 -68.5 -65t-27.5 -67q0 -17 -12 -32.5t-28 -15.5h-240q-15 0 -25.5 18.5 t-10.5 37.5v45q0 83 65 156.5t143 108.5q59 27 84 56t25 76q0 42 -46.5 74t-107.5 32q-65 0 -108 -29q-35 -25 -107 -115q-13 -16 -31 -16q-12 0 -25 8l-164 125q-13 10 -15.5 25t5.5 28q160 266 464 266q80 0 161 -31t146 -83t106 -127.5t41 -158.5z" />
301
+ <glyph unicode="&#xf129;" horiz-adv-x="640" d="M640 192v-128q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64v384h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-576h64q26 0 45 -19t19 -45zM512 1344v-192q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v192 q0 26 19 45t45 19h256q26 0 45 -19t19 -45z" />
302
+ <glyph unicode="&#xf12a;" horiz-adv-x="640" d="M512 288v-224q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v224q0 26 19 45t45 19h256q26 0 45 -19t19 -45zM542 1344l-28 -768q-1 -26 -20.5 -45t-45.5 -19h-256q-26 0 -45.5 19t-20.5 45l-28 768q-1 26 17.5 45t44.5 19h320q26 0 44.5 -19t17.5 -45z" />
303
+ <glyph unicode="&#xf12b;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1534 846v-206h-514l-3 27 q-4 28 -4 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q83 65 188 65q110 0 178 -59.5t68 -158.5q0 -56 -24.5 -103t-62 -76.5t-81.5 -58.5t-82 -50.5t-65.5 -51.5t-30.5 -63h232v80 h126z" />
304
+ <glyph unicode="&#xf12c;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1536 -50v-206h-514l-4 27 q-3 45 -3 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q80 65 188 65q110 0 178 -59.5t68 -158.5q0 -66 -34.5 -118.5t-84 -86t-99.5 -62.5t-87 -63t-41 -73h232v80h126z" />
305
+ <glyph unicode="&#xf12d;" horiz-adv-x="1920" d="M896 128l336 384h-768l-336 -384h768zM1909 1205q15 -34 9.5 -71.5t-30.5 -65.5l-896 -1024q-38 -44 -96 -44h-768q-38 0 -69.5 20.5t-47.5 54.5q-15 34 -9.5 71.5t30.5 65.5l896 1024q38 44 96 44h768q38 0 69.5 -20.5t47.5 -54.5z" />
306
+ <glyph unicode="&#xf12e;" horiz-adv-x="1664" d="M1664 438q0 -81 -44.5 -135t-123.5 -54q-41 0 -77.5 17.5t-59 38t-56.5 38t-71 17.5q-110 0 -110 -124q0 -39 16 -115t15 -115v-5q-22 0 -33 -1q-34 -3 -97.5 -11.5t-115.5 -13.5t-98 -5q-61 0 -103 26.5t-42 83.5q0 37 17.5 71t38 56.5t38 59t17.5 77.5q0 79 -54 123.5 t-135 44.5q-84 0 -143 -45.5t-59 -127.5q0 -43 15 -83t33.5 -64.5t33.5 -53t15 -50.5q0 -45 -46 -89q-37 -35 -117 -35q-95 0 -245 24q-9 2 -27.5 4t-27.5 4l-13 2q-1 0 -3 1q-2 0 -2 1v1024q2 -1 17.5 -3.5t34 -5t21.5 -3.5q150 -24 245 -24q80 0 117 35q46 44 46 89 q0 22 -15 50.5t-33.5 53t-33.5 64.5t-15 83q0 82 59 127.5t144 45.5q80 0 134 -44.5t54 -123.5q0 -41 -17.5 -77.5t-38 -59t-38 -56.5t-17.5 -71q0 -57 42 -83.5t103 -26.5q64 0 180 15t163 17v-2q-1 -2 -3.5 -17.5t-5 -34t-3.5 -21.5q-24 -150 -24 -245q0 -80 35 -117 q44 -46 89 -46q22 0 50.5 15t53 33.5t64.5 33.5t83 15q82 0 127.5 -59t45.5 -143z" />
307
+ <glyph unicode="&#xf130;" horiz-adv-x="1152" d="M1152 832v-128q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-217 24 -364.5 187.5t-147.5 384.5v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -185 131.5 -316.5t316.5 -131.5 t316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45zM896 1216v-512q0 -132 -94 -226t-226 -94t-226 94t-94 226v512q0 132 94 226t226 94t226 -94t94 -226z" />
308
+ <glyph unicode="&#xf131;" horiz-adv-x="1408" d="M271 591l-101 -101q-42 103 -42 214v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -53 15 -113zM1385 1193l-361 -361v-128q0 -132 -94 -226t-226 -94q-55 0 -109 19l-96 -96q97 -51 205 -51q185 0 316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45v-128 q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-125 13 -235 81l-254 -254q-10 -10 -23 -10t-23 10l-82 82q-10 10 -10 23t10 23l1234 1234q10 10 23 10t23 -10l82 -82q10 -10 10 -23 t-10 -23zM1005 1325l-621 -621v512q0 132 94 226t226 94q102 0 184.5 -59t116.5 -152z" />
309
+ <glyph unicode="&#xf132;" horiz-adv-x="1280" d="M1088 576v640h-448v-1137q119 63 213 137q235 184 235 360zM1280 1344v-768q0 -86 -33.5 -170.5t-83 -150t-118 -127.5t-126.5 -103t-121 -77.5t-89.5 -49.5t-42.5 -20q-12 -6 -26 -6t-26 6q-16 7 -42.5 20t-89.5 49.5t-121 77.5t-126.5 103t-118 127.5t-83 150 t-33.5 170.5v768q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
310
+ <glyph unicode="&#xf133;" horiz-adv-x="1664" d="M128 -128h1408v1024h-1408v-1024zM512 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1280 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1664 1152v-1280 q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
311
+ <glyph unicode="&#xf134;" horiz-adv-x="1408" d="M512 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 1376v-320q0 -16 -12 -25q-8 -7 -20 -7q-4 0 -7 1l-448 96q-11 2 -18 11t-7 20h-256v-102q111 -23 183.5 -111t72.5 -203v-800q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v800 q0 106 62.5 190.5t161.5 114.5v111h-32q-59 0 -115 -23.5t-91.5 -53t-66 -66.5t-40.5 -53.5t-14 -24.5q-17 -35 -57 -35q-16 0 -29 7q-23 12 -31.5 37t3.5 49q5 10 14.5 26t37.5 53.5t60.5 70t85 67t108.5 52.5q-25 42 -25 86q0 66 47 113t113 47t113 -47t47 -113 q0 -33 -14 -64h302q0 11 7 20t18 11l448 96q3 1 7 1q12 0 20 -7q12 -9 12 -25z" />
312
+ <glyph unicode="&#xf135;" horiz-adv-x="1664" d="M1440 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1664 1376q0 -249 -75.5 -430.5t-253.5 -360.5q-81 -80 -195 -176l-20 -379q-2 -16 -16 -26l-384 -224q-7 -4 -16 -4q-12 0 -23 9l-64 64q-13 14 -8 32l85 276l-281 281l-276 -85q-3 -1 -9 -1 q-14 0 -23 9l-64 64q-17 19 -5 39l224 384q10 14 26 16l379 20q96 114 176 195q188 187 358 258t431 71q14 0 24 -9.5t10 -22.5z" />
313
+ <glyph unicode="&#xf136;" horiz-adv-x="1792" d="M1708 881l-188 -881h-304l181 849q4 21 1 43q-4 20 -16 35q-10 14 -28 24q-18 9 -40 9h-197l-205 -960h-303l204 960h-304l-205 -960h-304l272 1280h1139q157 0 245 -118q86 -116 52 -281z" />
314
+ <glyph unicode="&#xf137;" d="M909 141l102 102q19 19 19 45t-19 45l-307 307l307 307q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
315
+ <glyph unicode="&#xf138;" d="M717 141l454 454q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l307 -307l-307 -307q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
316
+ <glyph unicode="&#xf139;" d="M1165 397l102 102q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l307 307l307 -307q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
317
+ <glyph unicode="&#xf13a;" d="M813 237l454 454q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-307 -307l-307 307q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
318
+ <glyph unicode="&#xf13b;" horiz-adv-x="1408" d="M1130 939l16 175h-884l47 -534h612l-22 -228l-197 -53l-196 53l-13 140h-175l22 -278l362 -100h4v1l359 99l50 544h-644l-15 181h674zM0 1408h1408l-128 -1438l-578 -162l-574 162z" />
319
+ <glyph unicode="&#xf13c;" horiz-adv-x="1792" d="M275 1408h1505l-266 -1333l-804 -267l-698 267l71 356h297l-29 -147l422 -161l486 161l68 339h-1208l58 297h1209l38 191h-1208z" />
320
+ <glyph unicode="&#xf13d;" horiz-adv-x="1792" d="M960 1280q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1790 276q-8 -20 -30 -20h-112q0 -137 -99.5 -251t-272 -179.5t-380.5 -65.5t-380.5 65.5t-272 179.5t-99.5 251h-112q-22 0 -30 20q-8 19 7 35l224 224q10 9 23 9q12 0 23 -9l224 -224 q15 -16 7 -35q-8 -20 -30 -20h-112q0 -85 112.5 -162.5t287.5 -100.5v647h-192q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h192v163q-58 34 -93 92.5t-35 128.5q0 106 75 181t181 75t181 -75t75 -181q0 -70 -35 -128.5t-93 -92.5v-163h192q26 0 45 -19t19 -45v-128 q0 -26 -19 -45t-45 -19h-192v-647q175 23 287.5 100.5t112.5 162.5h-112q-22 0 -30 20q-8 19 7 35l224 224q11 9 23 9t23 -9l224 -224q15 -16 7 -35z" />
321
+ <glyph unicode="&#xf13e;" horiz-adv-x="1152" d="M1056 768q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v320q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45q0 106 -75 181t-181 75t-181 -75t-75 -181 v-320h736zM703 169l-69 229q32 17 51 47t19 67q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5q0 -37 19 -67t51 -47l-69 -229q-5 -15 5 -28t26 -13h192q16 0 26 13t5 28z" />
322
+ <glyph unicode="&#xf140;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM1152 640q0 159 -112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM1280 640q0 -212 -150 -362t-362 -150t-362 150 t-150 362t150 362t362 150t362 -150t150 -362zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
323
+ <glyph unicode="&#xf141;" horiz-adv-x="1408" d="M384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM896 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM1408 800v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
324
+ <glyph unicode="&#xf142;" horiz-adv-x="384" d="M384 288v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 1312v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
325
+ <glyph unicode="&#xf143;" d="M512 256q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM863 162q-13 232 -177 396t-396 177q-14 1 -24 -9t-10 -23v-128q0 -13 8.5 -22t21.5 -10q154 -11 264 -121t121 -264q1 -13 10 -21.5t22 -8.5h128q13 0 23 10 t9 24zM1247 161q-5 154 -56 297.5t-139.5 260t-205 205t-260 139.5t-297.5 56q-14 1 -23 -9q-10 -10 -10 -23v-128q0 -13 9 -22t22 -10q204 -7 378 -111.5t278.5 -278.5t111.5 -378q1 -13 10 -22t22 -9h128q13 0 23 10q11 9 9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
326
+ <glyph unicode="&#xf144;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1152 585q32 18 32 55t-32 55l-544 320q-31 19 -64 1q-32 -19 -32 -56v-640q0 -37 32 -56 q16 -8 32 -8q17 0 32 9z" />
327
+ <glyph unicode="&#xf145;" horiz-adv-x="1792" d="M1024 1084l316 -316l-572 -572l-316 316zM813 105l618 618q19 19 19 45t-19 45l-362 362q-18 18 -45 18t-45 -18l-618 -618q-19 -19 -19 -45t19 -45l362 -362q18 -18 45 -18t45 18zM1702 742l-907 -908q-37 -37 -90.5 -37t-90.5 37l-126 126q56 56 56 136t-56 136 t-136 56t-136 -56l-125 126q-37 37 -37 90.5t37 90.5l907 906q37 37 90.5 37t90.5 -37l125 -125q-56 -56 -56 -136t56 -136t136 -56t136 56l126 -125q37 -37 37 -90.5t-37 -90.5z" />
328
+ <glyph unicode="&#xf146;" d="M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
329
+ <glyph unicode="&#xf147;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h832q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5 t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
330
+ <glyph unicode="&#xf148;" horiz-adv-x="1024" d="M1018 933q-18 -37 -58 -37h-192v-864q0 -14 -9 -23t-23 -9h-704q-21 0 -29 18q-8 20 4 35l160 192q9 11 25 11h320v640h-192q-40 0 -58 37q-17 37 9 68l320 384q18 22 49 22t49 -22l320 -384q27 -32 9 -68z" />
331
+ <glyph unicode="&#xf149;" horiz-adv-x="1024" d="M32 1280h704q13 0 22.5 -9.5t9.5 -23.5v-863h192q40 0 58 -37t-9 -69l-320 -384q-18 -22 -49 -22t-49 22l-320 384q-26 31 -9 69q18 37 58 37h192v640h-320q-14 0 -25 11l-160 192q-13 14 -4 34q9 19 29 19z" />
332
+ <glyph unicode="&#xf14a;" d="M685 237l614 614q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-467 -467l-211 211q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l358 -358q19 -19 45 -19t45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5 t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
333
+ <glyph unicode="&#xf14b;" d="M404 428l152 -152l-52 -52h-56v96h-96v56zM818 818q14 -13 -3 -30l-291 -291q-17 -17 -30 -3q-14 13 3 30l291 291q17 17 30 3zM544 128l544 544l-288 288l-544 -544v-288h288zM1152 736l92 92q28 28 28 68t-28 68l-152 152q-28 28 -68 28t-68 -28l-92 -92zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
334
+ <glyph unicode="&#xf14c;" d="M1280 608v480q0 26 -19 45t-45 19h-480q-42 0 -59 -39q-17 -41 14 -70l144 -144l-534 -534q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l534 534l144 -144q18 -19 45 -19q12 0 25 5q39 17 39 59zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
335
+ <glyph unicode="&#xf14d;" d="M1005 435l352 352q19 19 19 45t-19 45l-352 352q-30 31 -69 14q-40 -17 -40 -59v-160q-119 0 -216 -19.5t-162.5 -51t-114 -79t-76.5 -95.5t-44.5 -109t-21.5 -111.5t-5 -110.5q0 -181 167 -404q10 -12 25 -12q7 0 13 3q22 9 19 33q-44 354 62 473q46 52 130 75.5 t224 23.5v-160q0 -42 40 -59q12 -5 24 -5q26 0 45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
336
+ <glyph unicode="&#xf14e;" horiz-adv-x="1792" />
337
+ <glyph unicode="&#xf500;" horiz-adv-x="1792" />
338
+ </font>
339
+ </defs></svg>
app/assets/font/fontawesome-webfont.ttf ADDED
Binary file
app/assets/font/fontawesome-webfont.woff ADDED
Binary file
app/assets/img/backgrounds.gif ADDED
Binary file
app/assets/img/bpm-contest-banner.jpg ADDED
Binary file
app/assets/img/buttons-disabled.png ADDED
Binary file
app/assets/img/buttons.png ADDED
Binary file
app/assets/img/close.png DELETED
Binary file
app/assets/img/delete.gif ADDED
Binary file
app/assets/img/donate.gif DELETED
Binary file
app/assets/img/donate.png DELETED
Binary file
app/assets/img/done.gif ADDED
Binary file
app/assets/img/error.gif ADDED
Binary file
app/assets/img/indicator.png ADDED
Binary file
app/assets/img/indicatorActive.png ADDED
Binary file
app/assets/img/leftArrow.png ADDED
Binary file
app/assets/img/leftPanelArrow.png ADDED
Binary file
app/assets/img/mask-square.png ADDED
Binary file
app/assets/img/mask.png ADDED
Binary file
app/assets/img/rightArrow.png ADDED
Binary file
app/assets/img/rightPanelArrow.png ADDED
Binary file
app/assets/img/rtCamp-bullet.png DELETED
Binary file
app/assets/img/throbber.gif ADDED
Binary file
app/assets/img/thumb_default.png ADDED
Binary file
app/assets/img/transp50.png ADDED
Binary file
app/assets/img/wpmini-grey.png ADDED
Binary file
app/assets/js/admin.js CHANGED
@@ -1,23 +1,23 @@
1
- jQuery(document).ready(function(){
2
 
3
  /* Linkback */
4
  jQuery('#spread-the-word').on('click','#bp-media-add-linkback',function(){
5
  var data = {
6
- action: 'bp_media_linkback',
7
  linkback: jQuery('#bp-media-add-linkback:checked').length
8
  };
9
- jQuery.post(bp_media_admin_ajax,data,function(response){
10
  });
11
  })
12
 
13
  /* Fetch Feed */
14
- var bp_media_news_section = jQuery('#latest-news');
15
- if(bp_media_news_section.length>0){
16
  var data = {
17
- action: 'bp_media_fetch_feed'
18
  };
19
- jQuery.post(bp_media_admin_ajax,data,function(response){
20
- bp_media_news_section.find('.inside').html(response);
21
  });
22
  }
23
 
@@ -27,7 +27,7 @@ jQuery(document).ready(function(){
27
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html()
28
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html('<div class="support_form_loader"></div>');
29
  var data = {
30
- action: 'bp_media_select_request',
31
  form: jQuery(this).val()
32
  };
33
 
@@ -45,7 +45,7 @@ jQuery(document).ready(function(){
45
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html()
46
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html('<div class="support_form_loader"></div>');
47
  var data = {
48
- action: 'bp_media_cancel_request'
49
  };
50
 
51
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
@@ -60,7 +60,7 @@ jQuery(document).ready(function(){
60
  jQuery('.bp-media-support').on('submit', '#bp_media_settings_form', function(e){
61
  e.preventDefault();
62
  var data = {
63
- action: 'bp_media_submit_request',
64
  form_data: jQuery('form').serialize()
65
  };
66
 
@@ -70,72 +70,119 @@ jQuery(document).ready(function(){
70
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html(response).fadeIn('slow');
71
  });
72
  });
73
-
74
- jQuery('#encoding-try-now-form').on('click','.encoding-try-now',function(e){
75
  e.preventDefault();
76
- if(confirm(bp_media_admin_strings.are_you_sure)){
77
- jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_admin_url+'images/wpspin_light.gif" />')
78
- var data = {
79
- action: 'bp_media_free_encoding_subscribe'
80
- };
81
 
82
- // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
83
- jQuery.getJSON(ajaxurl, data, function(response) {
84
- if(response.error===undefined && response.apikey){
85
- document.location.href = document.URL+'&apikey='+response.apikey;
86
- }else{
87
- jQuery('.encoding-try-now').next().remove();
88
- jQuery('#settings-error-encoding-error').remove();
89
- jQuery('h2:first').after('<div class="error" id="settings-error-encoding-error"><p>'+response.error+'</p></div>');
90
- }
91
- });
92
  }
93
  });
94
-
95
- jQuery('.bp-media-encoding').on('click','#api-key-submit',function(e){
96
  e.preventDefault();
97
- jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_admin_url+'images/wpspin_light.gif" />')
98
  var data = {
99
- action: 'bp_media_enter_api_key',
100
  apikey: jQuery('#new-api-key').val()
101
  };
102
 
103
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
104
  jQuery.getJSON(ajaxurl, data, function(response) {
105
  if(response.error===undefined && response.apikey){
106
- document.location.href = document.URL+'&update=true&apikey='+response.apikey;
 
 
 
 
 
 
107
  }else{
108
  jQuery('#settings-error-api-key-error').remove();
109
  jQuery('h2:first').after('<div class="error" id="settings-error-api-key-error"><p>'+response.error+'</p></div>');
110
  }
111
  });
112
  });
113
-
114
- jQuery('.bp-media-encoding-table').on('click','.bpm-unsubscribe',function(e){
115
  e.preventDefault();
116
- // var note=prompt(bp_media_admin_strings.reason_for_unsubscribe);
117
- jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_admin_url+'images/wpspin_light.gif" />')
118
  var data = {
119
- action: 'bp_media_unsubscribe_encoding_service'
120
  };
121
 
122
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
123
- jQuery.getJSON(ajaxurl, data, function(response) {
124
- if(response.error===undefined && response.updated){
125
- jQuery('.bpm-unsubscribe').next().remove();
126
- jQuery('.bpm-unsubscribe').remove();
127
- jQuery('#settings-unsubscribed-successfully').remove();
128
- jQuery('#settings-unsubscribe-error').remove();
129
- jQuery('h2:first').after('<div class="updated" id="settings-unsubscribed-successfully"><p>'+response.updated+'</p></div>');
 
130
  }else{
131
- jQuery('.bpm-unsubscribe').next().remove();
132
- jQuery('#settings-unsubscribed-successfully').remove();
133
- jQuery('#settings-unsubscribe-error').remove();
134
- jQuery('h2:first').after('<div class="error" id="settings-unsubscribe-error"><p>'+response.error+'</p></div>');
135
  }
136
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  });
138
-
139
  function fireRequest(data) {
140
  return jQuery.post(ajaxurl, data, function(response){
141
  if(response != 0){
@@ -150,7 +197,7 @@ jQuery(document).ready(function(){
150
  jQuery('#rtprivacyinstaller span.finished').html(parseInt(finished)+data.count);
151
  if ( redirect ) {
152
  jQuery.post(ajaxurl, {
153
- action: 'bp_media_privacy_redirect'
154
  }, function(response){
155
  window.location = settings_url;
156
  });
@@ -160,7 +207,7 @@ jQuery(document).ready(function(){
160
  }
161
  });
162
  }
163
-
164
  jQuery('#bpmedia-bpalbumimporter').on('change','#bp-album-import-accept',function(){
165
  jQuery('.bp-album-import-accept').toggleClass('i-accept');
166
  jQuery('.bp-album-importer-wizard').slideToggle();
@@ -189,7 +236,7 @@ jQuery(document).ready(function(){
189
  }
190
  newvals = {
191
  'page':i,
192
- 'action':'bp_media_privacy_install',
193
  'count':$count,
194
  'values':$values
195
  }
@@ -235,7 +282,7 @@ jQuery(document).ready(function(){
235
  jQuery('#bpmedia-bpalbumimporter .bp-album-users span.finished').html(parseInt(response.users));
236
  if ( favorites ) {
237
  favorite_data = {
238
- 'action':'bp_media_bp_album_import_favorites'
239
  }
240
  jQuery.post(ajaxurl,favorite_data,function(response){
241
  if(response.favorites!==0||response.favorites!=='0'){
@@ -254,9 +301,9 @@ jQuery(document).ready(function(){
254
  $count=1;
255
  }
256
  }
257
-
258
  newvals = {
259
- 'action':'bp_media_bp_album_import_step_favorites',
260
  'offset':(i-1)*1,
261
  'redirect':i==response.users
262
  }
@@ -269,7 +316,7 @@ jQuery(document).ready(function(){
269
  return fireimportfavoriteRequest(v);
270
  });
271
  });
272
-
273
  } else {
274
  window.setTimeout(reload_url, 2000);
275
  }
@@ -295,10 +342,10 @@ jQuery(document).ready(function(){
295
  jQuery('.bp-album-favorites #rtprogressbar>div').css('width',favorites_progw+'%');
296
  if(redirect){
297
  window.setTimeout(reload_url, 2000);
298
- }
299
  });
300
  }
301
-
302
  function reload_url(){
303
  window.location = document.URL;
304
  }
@@ -306,9 +353,9 @@ jQuery(document).ready(function(){
306
  jQuery('#bpmedia-bpalbumimport-cleanup').click(function(e){
307
  e.preventDefault();
308
  jQuery.post(ajaxurl, {
309
- action: 'bp_media_bp_album_cleanup'
310
  }, function(response){
311
- window.location = settings_bp_album_import_url;
312
  });
313
 
314
  });
@@ -325,7 +372,7 @@ jQuery(document).ready(function(){
325
  i = 3; //counter
326
 
327
  (function loop() { //recurisve IIFE
328
- $el.css("background-color", "#EE0000");
329
  setTimeout(function () {
330
  $el.css("background-color", originalColor);
331
  if (--i) setTimeout(loop, x); //restart loop
@@ -337,16 +384,16 @@ jQuery(document).ready(function(){
337
  }
338
  wp_admin_url = ajaxurl.replace('admin-ajax.php','');
339
  if (!jQuery('.bpm-ajax-loader').length)
340
- jQuery(this).after(' <img class="bpm-ajax-loader" src="'+wp_admin_url+'images/wpspin_light.gif" /> <strong>'+bp_media_admin_strings.no_refresh+'</strong>');
341
-
342
-
343
  $progress_parent = jQuery('#bpmedia-bpalbumimport');
344
  $values=[];
345
  jQuery(this).parent().find('input').each(function(){
346
  $values [jQuery(this).attr('name')]=[jQuery(this).val()];
347
 
348
  });
349
-
350
  if ( $values['steps'][0] == 0 )
351
  $values['steps'][0]=1;
352
 
@@ -361,7 +408,7 @@ jQuery(document).ready(function(){
361
  }
362
  newvals = {
363
  'page':i,
364
- 'action':'bp_media_bp_album_import',
365
  'count':$count,
366
  'values':$values
367
  }
@@ -390,7 +437,7 @@ jQuery(document).ready(function(){
390
  jQuery('#video-transcoding-main-container').on('click','.video-transcoding-survey',function(e){
391
  e.preventDefault();
392
  var data = {
393
- action: 'bp_media_convert_videos_form',
394
  email: jQuery('.email').val(),
395
  url: jQuery('.url').val(),
396
  choice: jQuery('input[name="choice"]:checked').val(),
@@ -401,33 +448,90 @@ jQuery(document).ready(function(){
401
  });
402
  return false;
403
  });
404
-
405
  jQuery('#bpmedia-bpalbumimporter').on('click','.deactivate-bp-album',function(e){
406
  e.preventDefault();
407
  $bpalbum = jQuery(this);
408
  var data = {
409
- action: 'bp_media_bp_album_deactivate'
410
  }
411
  jQuery.get(ajaxurl, data, function(response) {
412
  if(response)
413
  location.reload();
414
  else
415
- $bpalbum.parent().after('<p>'+bp_media_admin_strings.something_went_wrong+'</p>');
416
  });
417
  });
418
-
419
  jQuery('.updated').on('click','.bpm-hide-encoding-notice',function(){
420
- jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_admin_url+'images/wpspin_light.gif" />');
421
- var data ={
422
- action: 'bp_media_hide_encoding_notice'
423
- }
424
- jQuery.post(ajaxurl,data,function(response){
425
- if ( response ) {
426
- jQuery('.bpm-hide-encoding-notice').closest('.updated').remove();
427
- }
428
- });
429
  });
430
 
431
 
432
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
 
3
  /* Linkback */
4
  jQuery('#spread-the-word').on('click','#bp-media-add-linkback',function(){
5
  var data = {
6
+ action: 'rtmedia_linkback',
7
  linkback: jQuery('#bp-media-add-linkback:checked').length
8
  };
9
+ jQuery.post(rtmedia_admin_ajax,data,function(response){
10
  });
11
  })
12
 
13
  /* Fetch Feed */
14
+ var rtmedia_news_section = jQuery('#latest-news');
15
+ if(rtmedia_news_section.length>0){
16
  var data = {
17
+ action: 'rtmedia_fetch_feed'
18
  };
19
+ jQuery.post(rtmedia_admin_ajax,data,function(response){
20
+ rtmedia_news_section.find('.inside').html(response);
21
  });
22
  }
23
 
27
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html()
28
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html('<div class="support_form_loader"></div>');
29
  var data = {
30
+ action: 'rtmedia_select_request',
31
  form: jQuery(this).val()
32
  };
33
 
45
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html()
46
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html('<div class="support_form_loader"></div>');
47
  var data = {
48
+ action: 'rtmedia_cancel_request'
49
  };
50
 
51
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
60
  jQuery('.bp-media-support').on('submit', '#bp_media_settings_form', function(e){
61
  e.preventDefault();
62
  var data = {
63
+ action: 'rtmedia_submit_request',
64
  form_data: jQuery('form').serialize()
65
  };
66
 
70
  jQuery('#bp_media_settings_form .bp-media-metabox-holder').html(response).fadeIn('slow');
71
  });
72
  });
73
+
74
+ jQuery(document).on('click',"#bpm-services .encoding-try-now",function(e){
75
  e.preventDefault();
76
+ if(confirm(rtmedia_admin_strings.are_you_sure)){
77
+ jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+rtmedia_admin_url+'images/wpspin_light.gif" />')
78
+ var data = {
79
+ action: 'rtmedia_free_encoding_subscribe'
80
+ };
81
 
82
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
83
+ jQuery.getJSON(ajaxurl, data, function(response) {
84
+ if(response.error===undefined && response.apikey){
85
+ document.location.href = document.URL+'&apikey='+response.apikey;
86
+ }else{
87
+ jQuery('.encoding-try-now').next().remove();
88
+ jQuery('#settings-error-encoding-error').remove();
89
+ jQuery('h2:first').after('<div class="error" id="settings-error-encoding-error"><p>'+response.error+'</p></div>');
90
+ }
91
+ });
92
  }
93
  });
94
+
95
+ jQuery(document).on('click','#api-key-submit',function(e){
96
  e.preventDefault();
97
+ jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+rtmedia_admin_url+'images/wpspin_light.gif" />')
98
  var data = {
99
+ action: 'rtmedia_enter_api_key',
100
  apikey: jQuery('#new-api-key').val()
101
  };
102
 
103
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
104
  jQuery.getJSON(ajaxurl, data, function(response) {
105
  if(response.error===undefined && response.apikey){
106
+ var tempUrl = document.URL;
107
+ if(document.URL.toString().indexOf('&apikey='+response.apikey) == -1)
108
+ tempUrl += '&apikey='+response.apikey;
109
+ if(document.URL.toString().indexOf('&update=true') == -1)
110
+ tempUrl += '&update=true';
111
+ document.location.href = tempUrl;
112
+
113
  }else{
114
  jQuery('#settings-error-api-key-error').remove();
115
  jQuery('h2:first').after('<div class="error" id="settings-error-api-key-error"><p>'+response.error+'</p></div>');
116
  }
117
  });
118
  });
119
+
120
+ jQuery(document).on('click','#disable-encoding',function(e){
121
  e.preventDefault();
122
+ if ( confirm(rtmedia_admin_strings.disable_encoding )) {
123
+ jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+rtmedia_admin_url+'images/wpspin_light.gif" />')
124
  var data = {
125
+ action: 'rtmedia_disable_encoding'
126
  };
127
 
128
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
129
+ jQuery.post(ajaxurl, data, function(response) {
130
+ if(response){
131
+ jQuery('settings-error-encoding-disabled').remove();
132
+ jQuery('h2:first').after('<div class="updated" id="settings-encoding-successfully-disabled"><p>'+response+'</p></div>');
133
+ jQuery('#bp-media-encoding-usage').remove();
134
+ jQuery('#disable-encoding').next().remove();
135
+ jQuery('#disable-encoding').remove();
136
+ jQuery('#new-api-key').val('');
137
  }else{
138
+ jQuery('#settings-error-encoding-disabled').remove();
139
+ jQuery('h2:first').after('<div class="error" id="settings-error-encoding-disabled"><p>'+rtmedia_admin_strings.something_went_wrong+'</p></div>');
 
 
140
  }
141
  });
142
+ }
143
+ });
144
+
145
+ jQuery('.bp-media-encoding-table').on('click','.bpm-unsubscribe',function(e){
146
+ e.preventDefault();
147
+ // var note=prompt(bp_media_admin_strings.reason_for_unsubscribe);
148
+ jQuery( "#bpm-unsubscribe-dialog" ).dialog({
149
+ dialogClass: "wp-dialog",
150
+ modal: true,
151
+ buttons: {
152
+ Unsubscribe : function() {
153
+ jQuery( this ).dialog( "close" );
154
+ jQuery('.bpm-unsubscribe').after('<img style="margin: 0 0 0 10px" src="'+rtmedia_admin_url+'images/wpspin_light.gif" />')
155
+ var data = {
156
+ action: 'rtmedia_unsubscribe_encoding_service',
157
+ note: jQuery('#bpm-unsubscribe-note').val(),
158
+ plan: jQuery('.bpm-unsubscribe').attr('data-plan'),
159
+ price: jQuery('.bpm-unsubscribe').attr('data-price')
160
+ };
161
+
162
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
163
+ jQuery.getJSON(ajaxurl, data, function(response) {
164
+ if(response.error===undefined && response.updated){
165
+ jQuery('.bpm-unsubscribe').next().remove();
166
+ jQuery('.bpm-unsubscribe').after(response.form);
167
+ jQuery('.bpm-unsubscribe').remove();
168
+ jQuery('#settings-unsubscribed-successfully').remove();
169
+ jQuery('#settings-unsubscribe-error').remove();
170
+ jQuery('h2:first').after('<div class="updated" id="settings-unsubscribed-successfully"><p>'+response.updated+'</p></div>');
171
+ window.location.hash = '#settings-unsubscribed-successfully';
172
+ }else{
173
+ jQuery('.bpm-unsubscribe').next().remove();
174
+ jQuery('#settings-unsubscribed-successfully').remove();
175
+ jQuery('#settings-unsubscribe-error').remove();
176
+ jQuery('h2:first').after('<div class="error" id="settings-unsubscribe-error"><p>'+response.error+'</p></div>');
177
+ window.location.hash = '#settings-unsubscribe-error';
178
+ }
179
+ });
180
+ }
181
+ }
182
+ });
183
+
184
  });
185
+
186
  function fireRequest(data) {
187
  return jQuery.post(ajaxurl, data, function(response){
188
  if(response != 0){
197
  jQuery('#rtprivacyinstaller span.finished').html(parseInt(finished)+data.count);
198
  if ( redirect ) {
199
  jQuery.post(ajaxurl, {
200
+ action: 'rtmedia_privacy_redirect'
201
  }, function(response){
202
  window.location = settings_url;
203
  });
207
  }
208
  });
209
  }
210
+
211
  jQuery('#bpmedia-bpalbumimporter').on('change','#bp-album-import-accept',function(){
212
  jQuery('.bp-album-import-accept').toggleClass('i-accept');
213
  jQuery('.bp-album-importer-wizard').slideToggle();
236
  }
237
  newvals = {
238
  'page':i,
239
+ 'action':'rtmedia_privacy_install',
240
  'count':$count,
241
  'values':$values
242
  }
282
  jQuery('#bpmedia-bpalbumimporter .bp-album-users span.finished').html(parseInt(response.users));
283
  if ( favorites ) {
284
  favorite_data = {
285
+ 'action':'rtmedia_rt_album_import_favorites'
286
  }
287
  jQuery.post(ajaxurl,favorite_data,function(response){
288
  if(response.favorites!==0||response.favorites!=='0'){
301
  $count=1;
302
  }
303
  }
304
+
305
  newvals = {
306
+ 'action':'rtmedia_rt_album_import_step_favorites',
307
  'offset':(i-1)*1,
308
  'redirect':i==response.users
309
  }
316
  return fireimportfavoriteRequest(v);
317
  });
318
  });
319
+
320
  } else {
321
  window.setTimeout(reload_url, 2000);
322
  }
342
  jQuery('.bp-album-favorites #rtprogressbar>div').css('width',favorites_progw+'%');
343
  if(redirect){
344
  window.setTimeout(reload_url, 2000);
345
+ }
346
  });
347
  }
348
+
349
  function reload_url(){
350
  window.location = document.URL;
351
  }
353
  jQuery('#bpmedia-bpalbumimport-cleanup').click(function(e){
354
  e.preventDefault();
355
  jQuery.post(ajaxurl, {
356
+ action: 'rtmedia_rt_album_cleanup'
357
  }, function(response){
358
+ window.location = settings_rt_album_import_url;
359
  });
360
 
361
  });
372
  i = 3; //counter
373
 
374
  (function loop() { //recurisve IIFE
375
+ $el.css("background-color", "#EE0000");
376
  setTimeout(function () {
377
  $el.css("background-color", originalColor);
378
  if (--i) setTimeout(loop, x); //restart loop
384
  }
385
  wp_admin_url = ajaxurl.replace('admin-ajax.php','');
386
  if (!jQuery('.bpm-ajax-loader').length)
387
+ jQuery(this).after(' <img class="bpm-ajax-loader" src="'+wp_admin_url+'images/wpspin_light.gif" /> <strong>'+rtmedia_admin_strings.no_refresh+'</strong>');
388
+
389
+
390
  $progress_parent = jQuery('#bpmedia-bpalbumimport');
391
  $values=[];
392
  jQuery(this).parent().find('input').each(function(){
393
  $values [jQuery(this).attr('name')]=[jQuery(this).val()];
394
 
395
  });
396
+
397
  if ( $values['steps'][0] == 0 )
398
  $values['steps'][0]=1;
399
 
408
  }
409
  newvals = {
410
  'page':i,
411
+ 'action':'rtmedia_rt_album_import',
412
  'count':$count,
413
  'values':$values
414
  }
437
  jQuery('#video-transcoding-main-container').on('click','.video-transcoding-survey',function(e){
438
  e.preventDefault();
439
  var data = {
440
+ action: 'rtmedia_convert_videos_form',
441
  email: jQuery('.email').val(),
442
  url: jQuery('.url').val(),
443
  choice: jQuery('input[name="choice"]:checked').val(),
448
  });
449
  return false;
450
  });
451
+
452
  jQuery('#bpmedia-bpalbumimporter').on('click','.deactivate-bp-album',function(e){
453
  e.preventDefault();
454
  $bpalbum = jQuery(this);
455
  var data = {
456
+ action: 'rtmedia_rt_album_deactivate'
457
  }
458
  jQuery.get(ajaxurl, data, function(response) {
459
  if(response)
460
  location.reload();
461
  else
462
+ $bpalbum.parent().after('<p>'+rtmedia_admin_strings.something_went_wrong+'</p>');
463
  });
464
  });
465
+
466
  jQuery('.updated').on('click','.bpm-hide-encoding-notice',function(){
467
+ jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+rtmedia_admin_url+'images/wpspin_light.gif" />');
468
+ var data ={
469
+ action: 'rtmedia_hide_encoding_notice'
470
+ }
471
+ jQuery.post(ajaxurl,data,function(response){
472
+ if ( response ) {
473
+ jQuery('.bpm-hide-encoding-notice').closest('.updated').remove();
474
+ }
475
+ });
476
  });
477
 
478
 
479
+ jQuery("#bpm-settings-tabs,#bpm-addons").sliderTabs({
480
+ autoplay: false,
481
+ mousewheel: false,
482
+ defaultTab: manageHash()
483
+ });
484
+
485
+ if(jQuery('#rtmedia-privacy-enable').is(":checked")) {
486
+ jQuery(".privacy-driven-disable label input").prop("disabled",false);
487
+ jQuery(".privacy-driven-disable label .rt-switch").bootstrapSwitch("setActive",true);
488
+ } else {
489
+ jQuery(".privacy-driven-disable label input").prop("disabled",true);
490
+ jQuery(".privacy-driven-disable label .rt-switch").bootstrapSwitch("setActive",false);
491
+ }
492
+ jQuery('#rtmedia-privacy-enable').on("click", function(e) {
493
+ if(jQuery(this).is(":checked")) {
494
+ jQuery(".privacy-driven-disable label input").prop("disabled",false);
495
+ jQuery(".privacy-driven-disable label .rt-switch").bootstrapSwitch("setActive",true);
496
+ } else {
497
+ jQuery(".privacy-driven-disable label input").prop("disabled",true);
498
+ jQuery(".privacy-driven-disable label .rt-switch").bootstrapSwitch("setActive",false);
499
+ }
500
+ });
501
+
502
+ var onData = '';
503
+ var offData = '';
504
+ if(rtmedia_on_label!==undefined)
505
+ onData = 'data-on-label="'+rtmedia_on_label+'"';
506
+ if(rtmedia_off_label!==undefined)
507
+ offData = 'data-off-label="'+rtmedia_off_label+'"';
508
+ jQuery("[data-toggle='switch']").wrap('<div class="rt-switch" '+onData+' '+offData+' />').parent().bootstrapSwitch();
509
+
510
+ try {
511
+ jQuery('.rtm-show-tooltip').powerTip({
512
+ followMouse: true
513
+ });
514
+ } catch(e) {
515
+ // no tooltip is defined
516
+ }
517
+ $(".rtmedia-tab-title").click(function(){
518
+ hash = $(this).attr('href');
519
+ window.location.hash = hash.substring(1,hash.length);
520
+ });
521
+ function manageHash() {
522
+ if(window.location.hash===undefined || window.location.hash==='')
523
+ window.location.hash = 'rtmedia-general';
524
+
525
+
526
+ hash = window.location.hash;
527
+ $('#tab-'+hash.substr(1,hash.length)).click();
528
+ if($('#tab-'+hash.substr(1,hash.length)).length < 1)
529
+ return 1;
530
+ return $('#tab-'+hash.substr(1,hash.length)).parent().index()+1
531
+ }
532
 
533
+ $(window).hashchange(function(e,data) {
534
+ e.preventDefault();
535
+ manageHash();
536
+ });
537
+ });
app/assets/js/bootstrap-switch.js ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ============================================================
2
+ * bootstrapSwitch v1.3 by Larentis Mattia @spiritualGuru
3
+ * http://www.larentis.eu/switch/
4
+ * ============================================================
5
+ * Licensed under the Apache License, Version 2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * ============================================================ */
8
+
9
+ !function ($) {
10
+ "use strict";
11
+
12
+ $.fn['bootstrapSwitch'] = function (method) {
13
+ var methods = {
14
+ init: function () {
15
+ return this.each(function () {
16
+ var $element = $(this)
17
+ , $div
18
+ , $switchLeft
19
+ , $switchRight
20
+ , $label
21
+ , myClasses = ""
22
+ , classes = $element.attr('class')
23
+ , color
24
+ , moving
25
+ , onLabel = "ON"
26
+ , offLabel = "OFF"
27
+ , icon = false;
28
+
29
+ $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
30
+ if (classes.indexOf(el) >= 0)
31
+ myClasses = el;
32
+ });
33
+
34
+ $element.addClass('has-switch');
35
+
36
+ if ($element.data('on') !== undefined)
37
+ color = "switch-" + $element.data('on');
38
+
39
+ if ($element.data('on-label') !== undefined)
40
+ onLabel = $element.data('on-label');
41
+
42
+ if ($element.data('off-label') !== undefined)
43
+ offLabel = $element.data('off-label');
44
+
45
+ if ($element.data('icon') !== undefined)
46
+ icon = $element.data('icon');
47
+
48
+ $switchLeft = $('<span>')
49
+ .addClass("switch-left")
50
+ .addClass(myClasses)
51
+ .addClass(color)
52
+ .html(onLabel);
53
+
54
+ color = '';
55
+ if ($element.data('off') !== undefined)
56
+ color = "switch-" + $element.data('off');
57
+
58
+ $switchRight = $('<span>')
59
+ .addClass("switch-right")
60
+ .addClass(myClasses)
61
+ .addClass(color)
62
+ .html(offLabel);
63
+
64
+ $label = $('<label>')
65
+ .html("&nbsp;")
66
+ .addClass(myClasses)
67
+ .attr('for', $element.find('input').attr('id'));
68
+
69
+ if (icon) {
70
+ $label.html('<i class="' + icon + '"></i>');
71
+ }
72
+
73
+ $div = $element.find(':checkbox').wrap($('<div>')).parent().data('animated', false);
74
+
75
+ if ($element.data('animated') !== false)
76
+ $div.addClass('switch-animate').data('animated', true);
77
+
78
+ $div
79
+ .append($switchLeft)
80
+ .append($label)
81
+ .append($switchRight);
82
+
83
+ $element.find('>div').addClass(
84
+ $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
85
+ );
86
+
87
+ if ($element.find('input').is(':disabled'))
88
+ $(this).addClass('deactivate');
89
+
90
+ var changeStatus = function ($this) {
91
+ $($this).siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
92
+ };
93
+
94
+ $element.on('keydown', function (e) {
95
+ if (e.keyCode === 32) {
96
+ e.stopImmediatePropagation();
97
+ e.preventDefault();
98
+ changeStatus($(e.target).find('span:first'));
99
+ }
100
+ });
101
+
102
+ $switchLeft.on('click', function (e) {
103
+ changeStatus($(this));
104
+ });
105
+
106
+ $switchRight.on('click', function (e) {
107
+ changeStatus($(this));
108
+ });
109
+
110
+ $element.find('input').on('change', function (e) {
111
+ var $this = $(this)
112
+ , $element = $this.parent()
113
+ , thisState = $this.is(':checked')
114
+ , state = $element.is('.switch-off');
115
+
116
+ e.preventDefault();
117
+
118
+ $element.css('left', '');
119
+
120
+ if (state === thisState) {
121
+
122
+ if (thisState)
123
+ $element.removeClass('switch-off').addClass('switch-on');
124
+ else $element.removeClass('switch-on').addClass('switch-off');
125
+
126
+ if ($element.data('animated') !== false)
127
+ $element.addClass("switch-animate");
128
+
129
+ $element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
130
+ }
131
+ });
132
+
133
+ $element.find('label').on('mousedown touchstart', function (e) {
134
+ var $this = $(this);
135
+ moving = false;
136
+
137
+ e.preventDefault();
138
+ e.stopImmediatePropagation();
139
+
140
+ $this.closest('div').removeClass('switch-animate');
141
+
142
+ if ($this.closest('.has-switch').is('.deactivate'))
143
+ $this.unbind('click');
144
+ else {
145
+ $this.on('mousemove touchmove', function (e) {
146
+ var $element = $(this).closest('.rt-switch')
147
+ , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
148
+ , percent = (relativeX / $element.width()) * 100
149
+ , left = 25
150
+ , right = 75;
151
+
152
+ moving = true;
153
+
154
+ if (percent < left)
155
+ percent = left;
156
+ else if (percent > right)
157
+ percent = right;
158
+
159
+ $element.find('>div').css('left', (percent - right) + "%")
160
+ });
161
+
162
+ $this.on('click touchend', function (e) {
163
+ var $this = $(this)
164
+ , $target = $(e.target)
165
+ , $myCheckBox = $target.siblings('input');
166
+
167
+ e.stopImmediatePropagation();
168
+ e.preventDefault();
169
+
170
+ $this.unbind('mouseleave');
171
+
172
+ if (moving)
173
+ $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
174
+ else $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
175
+
176
+ moving = false;
177
+ $myCheckBox.trigger('change');
178
+ });
179
+
180
+ $this.on('mouseleave', function (e) {
181
+ var $this = $(this)
182
+ , $myCheckBox = $this.siblings('input');
183
+
184
+ e.preventDefault();
185
+ e.stopImmediatePropagation();
186
+
187
+ $this.unbind('mouseleave');
188
+ $this.trigger('mouseup');
189
+
190
+ $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
191
+ });
192
+
193
+ $this.on('mouseup', function (e) {
194
+ e.stopImmediatePropagation();
195
+ e.preventDefault();
196
+
197
+ $(this).unbind('mousemove');
198
+ });
199
+ }
200
+ });
201
+ }
202
+ );
203
+ },
204
+ toggleActivation: function () {
205
+ $(this).toggleClass('deactivate');
206
+ },
207
+ isActive: function () {
208
+ return !$(this).hasClass('deactivate');
209
+ },
210
+ setActive: function (active) {
211
+ if (active)
212
+ $(this).removeClass('deactivate');
213
+ else $(this).addClass('deactivate');
214
+ },
215
+ toggleState: function (skipOnChange) {
216
+ var $input = $(this).find('input:checkbox');
217
+ $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
218
+ },
219
+ setState: function (value, skipOnChange) {
220
+ $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
221
+ },
222
+ status: function () {
223
+ return $(this).find('input:checkbox').is(':checked');
224
+ },
225
+ destroy: function () {
226
+ var $div = $(this).find('div')
227
+ , $checkbox;
228
+
229
+ $div.find(':not(input:checkbox)').remove();
230
+
231
+ $checkbox = $div.children();
232
+ $checkbox.unwrap().unwrap();
233
+
234
+ $checkbox.unbind('change');
235
+
236
+ return $checkbox;
237
+ }
238
+ };
239
+
240
+ if (methods[method])
241
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
242
+ else if (typeof method === 'object' || !method)
243
+ return methods.init.apply(this, arguments);
244
+ else
245
+ $.error('Method ' + method + ' does not exist!');
246
+ };
247
+ }(jQuery);
248
+
249
+ jQuery(function () {
250
+ jQuery('.rt-switch')['bootstrapSwitch']();
251
+ jQuery(document).on('click' ,'.switch-left,.switch-right',function(e){
252
+ jQuery(this).siblings('label').trigger('click');
253
+ })
254
+
255
+ });
app/assets/js/bp-media-activity-uploader.js DELETED
@@ -1,222 +0,0 @@
1
- /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
4
- */
5
-
6
- jQuery(document).ready(function(){
7
- if ( jQuery('#bp-media-activity-upload-ui').length > 0 ) {
8
-
9
- jQuery('#whats-new').off('focus');
10
- jQuery('#whats-new').on('focus', function(){
11
- jQuery("#whats-new-options").css('height','auto');
12
- jQuery("form#whats-new-form textarea").animate({
13
- height:'50px'
14
- });
15
- jQuery("#aw-whats-new-submit").prop("disabled", false);
16
- });
17
-
18
- jQuery("input#aw-whats-new-submit").off('click');
19
- jQuery("input#aw-whats-new-submit").on('click',function() {
20
- var button = jQuery(this);
21
- var form = button.parent().parent().parent().parent();
22
-
23
- form.children().each( function() {
24
- if ( jQuery.nodeName(this, "textarea") || jQuery.nodeName(this, "input") )
25
- jQuery(this).prop( 'disabled', true );
26
- });
27
-
28
- /* Remove any errors */
29
- jQuery('div.error').remove();
30
- button.addClass('loading');
31
- button.prop('disabled', true);
32
-
33
- /* Default POST values */
34
- var object = '';
35
- var item_id = jQuery("#whats-new-post-in").val();
36
- var content = jQuery("#bp-media-dummy-update").val();
37
-
38
- /* Set object for non-profile posts */
39
- if ( item_id > 0 ) {
40
- object = jQuery("#whats-new-post-object").val();
41
- }
42
-
43
- jQuery.post( ajaxurl, {
44
- action: 'post_update',
45
- 'cookie': encodeURIComponent(document.cookie),
46
- '_wpnonce_post_update': jQuery("input#_wpnonce_post_update").val(),
47
- 'content': content,
48
- 'object': object,
49
- 'item_id': item_id,
50
- '_bp_as_nonce': jQuery('#_bp_as_nonce').val() || ''
51
- },
52
- function(response) {
53
-
54
- form.children().each( function() {
55
- if ( jQuery.nodeName(this, "textarea") || jQuery.nodeName(this, "input") ) {
56
- jQuery(this).prop( 'disabled', false );
57
- }
58
- });
59
-
60
- /* Check for errors and append if found. */
61
- if ( response[0] + response[1] == '-1' ) {
62
- form.prepend( response.substr( 2, response.length ) );
63
- jQuery( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
64
- } else {
65
- if ( 0 == jQuery("ul.activity-list").length ) {
66
- jQuery("div.error").slideUp(100).remove();
67
- jQuery("div#message").slideUp(100).remove();
68
- jQuery("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
69
- }
70
-
71
- jQuery("ul#activity-stream").prepend(response);
72
- jQuery("ul#activity-stream li:first").addClass('new-update');
73
-
74
- if ( 0 != jQuery("#latest-update").length ) {
75
- var l = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
76
- var v = jQuery("ul#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
77
-
78
- var ltext = jQuery("ul#activity-stream li.new-update .activity-content .activity-inner p").text();
79
-
80
- var u = '';
81
- if ( ltext != '' )
82
- u = l + ' ';
83
-
84
- u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>';
85
-
86
- jQuery("#latest-update").slideUp(300,function(){
87
- jQuery("#latest-update").html( u );
88
- jQuery("#latest-update").slideDown(300);
89
- });
90
- }
91
-
92
- jQuery("li.new-update").hide().slideDown( 300 );
93
- jQuery("li.new-update").removeClass( 'new-update' );
94
- jQuery("textarea#whats-new").val('');
95
- }
96
-
97
- jQuery("#whats-new-options").animate({
98
- height:'0px'
99
- });
100
- jQuery("form#whats-new-form textarea").animate({
101
- height:'20px'
102
- });
103
- jQuery("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
104
- });
105
-
106
- return false;
107
- });
108
-
109
- $dummy_update_box = jQuery('<input id="bp-media-dummy-update" type="hidden" name="whats-new" />');
110
- $update_container = jQuery('#whats-new-textarea');
111
- $update_container.append($dummy_update_box);
112
-
113
- jQuery('#whats-new').on('keyup',function(){
114
- $this = jQuery(this);
115
- $that = jQuery('#bp-media-update-text');
116
- $that.val($this.val()).change();
117
- });
118
- jQuery('#bp-media-update-text').on('change',function(){
119
- bp_media_overwrite();
120
- });
121
- jQuery('#bp-media-update-json').on('change',function(){
122
- bp_media_overwrite();
123
- });
124
-
125
- $bp_media_activity_is_multiple_upload = false;
126
- $bp_media_activity_uploader=new plupload.Uploader(bp_media_uploader_params);
127
- $bp_media_activity_album_selected = false;
128
- $bp_media_activity_uploader.init();
129
-
130
- $bp_media_activity_uploader.bind('FilesAdded', function(up, files) {
131
- //bp_media_is_multiple_upload = files.length==1&&jQuery('.bp-media-progressbar').length==0?false:true;
132
- $bp_media_activity_is_multiple_upload = files.length>1;
133
- jQuery.each(files, function(i, file) {
134
- $bp_media_activity_extension = file.name.substr( (file.name.lastIndexOf('.') +1) );
135
- jQuery('#bp-media-activity-uploaded-files').append('<div id="bp-media-activity-progress-'+file.id+'" class="bp-media-progressbar"><div class="bp-media-progress-text">' + file.name + ' (' + plupload.formatSize(file.size) + ')(<b>0%</b>)</div><div class="bp-media-progress-completed"></div></div>');
136
- });
137
- // bp_media_activity_album_selected = jQuery('#bp-media-activity-selected-album').val();
138
- $bp_media_activity_album_selected = default_album;
139
- $bp_media_activity_uploader.start();
140
- up.refresh(); // Reposition Flash/Silverlight
141
- });
142
- $bp_media_activity_uploader.bind('UploadProgress', function(up, file) {
143
- jQuery('input#aw-whats-new-submit').prop('disabled',true).addClass('loading');
144
- jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-completed').width(file.percent+'%');
145
- jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html(file.percent+'%');
146
- });
147
-
148
- $bp_media_activity_uploader.bind('Error', function(up, err) {
149
- jQuery('#bp-media-activity-uploaded-files').html('<div class="error"><p>Error: ' + err.code +
150
- ', Message: ' + err.message +
151
- (err.file ? ', File: ' + err.file.name : '') +
152
- '</p></div>'
153
- );
154
- up.refresh();
155
- });
156
- $bp_media_activity_uploader.bind('FileUploaded', function(up, file,response) {
157
- jQuery('#bp-media-activity-progress-'+file.id+' .bp-media-progress-text b').html("100%");
158
- $album_arr = [];
159
- $val = jQuery('#bp-media-update-json').val();
160
- if($val!=''){
161
- $album_arr= JSON.parse($val);
162
- }
163
- $album_arr.push(parseInt(response.response));
164
- $album_json =JSON.stringify($album_arr);
165
- jQuery('#bp-media-update-json').val($album_json).change();
166
- jQuery('#aw-whats-new-submit').prop('disabled',false).removeClass('loading');
167
-
168
- });
169
- $bp_media_activity_uploader.bind('BeforeUpload',function(up){
170
- up.settings.multipart_params.is_multiple_upload = $bp_media_activity_is_multiple_upload;
171
- up.settings.multipart_params.bp_media_album_id = $bp_media_activity_album_selected;
172
- up.settings.multipart_params.is_activity = true;
173
- });
174
- //jQuery("#aw-whats-new-submit").off( 'click');
175
-
176
- jQuery("#aw-whats-new-submit").on( 'click', function() {
177
- $latest = '';
178
- $val = bp_media_stringify();
179
- jQuery("#bp-media-dummy-update").val('');
180
- jQuery("#bp-media-update-json").val('');
181
- jQuery("#bp-media-update-txt").val('');
182
- jQuery("#bp-media-activity-uploaded-files").empty();
183
- setTimeout(function(){
184
- if($val!=''){
185
- $album_arr= JSON.parse($val);
186
- $lastid = parseInt($album_arr.length) - 1;
187
- $media_id = $album_arr[parseInt($lastid)];
188
- $activity = (jQuery('#activity-stream').find('li').first().attr('id')).split('-');
189
- $activity_id = $activity[1];
190
- var data = {
191
- action: 'bp_media_get_latest_activity',
192
- content : $val,
193
- id: $activity_id
194
- };
195
- jQuery.get(ajaxurl,data,function(response){
196
- $latest = response;
197
- jQuery('#latest-update').html($latest);
198
- });
199
- }
200
- },1000);
201
- });
202
-
203
- $bp_media_activity_uploader.bind('UploadComplete',function(response){
204
-
205
- });
206
- }
207
-
208
-
209
- function bp_media_stringify(){
210
- $album_json = jQuery('#bp-media-update-json').val();
211
- $update_txt = jQuery('#bp-media-update-text').val();
212
- $activity = {
213
- 'media':$album_json,
214
- 'update_txt':encodeURIComponent($update_txt)
215
- };
216
- return JSON.stringify($activity);
217
- }
218
-
219
- function bp_media_overwrite(){
220
- jQuery('#bp-media-dummy-update').val(bp_media_stringify());
221
- }
222
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/assets/js/bp-media-uploader.js DELETED
@@ -1,119 +0,0 @@
1
- /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
4
- */
5
-
6
- jQuery(document).ready(function(){
7
-
8
- var selected = jQuery('#bp-media-album-prompt select').val();
9
- var in_list = 0;
10
- if(jQuery('#'+bp_media_uploader_params.container).length==0)
11
- return false;
12
- if ( jQuery('#bp-media-album-prompt p').css('display') == 'none' )
13
- in_list = 1;
14
- jQuery('#bp-media-album-prompt select').change(function() {
15
- if ( jQuery(this).val() == 'create_new' ) {
16
- jQuery('#bp-media-album-prompt select').hide();
17
- jQuery('#bp-media-album-prompt p').hide();
18
- jQuery('#bp-media-album-prompt div.hide').show();
19
- } else
20
- selected = jQuery(this).val();
21
- });
22
- var new_album_flag = 0;
23
- jQuery('#btn-create-new').click(function(){
24
- if ( new_album_flag == 1 ) {
25
- return false;
26
- }
27
- var new_album_name = jQuery('#bp_media_album_new').val();
28
- if(new_album_name.length==0){
29
- alert(bp_media_uploader_strings.no_name);
30
- return false;
31
- } else {
32
- new_album_flag = 1;
33
- jQuery(this).val('Wait');
34
- var data = {
35
- action: 'bp_media_add_album',
36
- bp_media_album_name : new_album_name,
37
- bp_media_group_id : bp_media_uploader_params.multipart_params.bp_media_group_id
38
- };
39
- jQuery.post(bp_media_vars.ajaxurl,data,function(response){
40
- var album = parseInt(response);
41
- if(album == 0){
42
- alert(bp_media_uploader_strings.cant_upload_group_album);
43
- } else {
44
- jQuery('#bp-media-album-prompt select option').removeAttr('selected');
45
- jQuery('#bp-media-selected-album').prepend('<option value='+album+' selected="selected">'+new_album_name+'</option>');
46
- jQuery('#bp-media-album-prompt div.hide').hide();
47
- jQuery('#bp-media-album-prompt select').show();
48
- if ( in_list == 0 )
49
- jQuery('#bp-media-album-prompt p').show();
50
- }
51
- });
52
- }
53
- });
54
- jQuery('#btn-create-cancel').click(function(){
55
- jQuery('#bp-media-album-prompt div.hide').hide();
56
- jQuery('#bp-media-album-prompt select option').removeAttr('selected');
57
- jQuery('#bp-media-album-prompt select option[value=' + selected + ']').attr('selected', 'selected');
58
- jQuery('#bp-media-album-prompt select').show();
59
- if ( in_list == 0 )
60
- jQuery('#bp-media-album-prompt p').show();
61
- });
62
-
63
- //Normal Uplaoder
64
- var bp_media_is_multiple_upload = false;
65
- var bp_media_uploader=new plupload.Uploader(bp_media_uploader_params);
66
- var bp_media_album_selected = false;
67
- bp_media_uploader.init();
68
-
69
- bp_media_uploader.bind('FilesAdded', function(up, files) {
70
- if ( jQuery('#bp-media-selected-album').val() == 'create_new' ) {
71
- alert(bp_media_uploader_strings.select_album);
72
- return false;
73
- }
74
- //bp_media_is_multiple_upload = files.length==1&&jQuery('.bp-media-progressbar').length==0?false:true;
75
- bp_media_is_multiple_upload = files.length>1;
76
- jQuery.each(files, function(i, file) {
77
- var extension = file.name.substr( (file.name.lastIndexOf('.') +1) );
78
- jQuery('#bp-media-uploaded-files').append('<div id="bp-media-progress-'+file.id+'" class="bp-media-progressbar"><div class="bp-media-progress-text">' + file.name + ' (' + plupload.formatSize(file.size) + ')(<b>0%</b>)</div><div class="bp-media-progress-completed"></div></div>');
79
- });
80
- bp_media_album_selected = jQuery('#bp-media-selected-album').val();
81
- bp_media_uploader.start();
82
- up.refresh(); // Reposition Flash/Silverlight
83
- });
84
- bp_media_uploader.bind('UploadProgress', function(up, file) {
85
- jQuery('#bp-media-progress-'+file.id+' .bp-media-progress-completed').width(file.percent+'%');
86
- jQuery('#bp-media-progress-'+file.id+' .bp-media-progress-text b').html(file.percent+'%');
87
- });
88
-
89
- bp_media_uploader.bind('Error', function(up, err) {
90
- jQuery('#bp-media-uploaded-files').html('<div class="error"><p>Error: ' + err.code +
91
- ', Message: ' + err.message +
92
- (err.file ? ', File: ' + err.file.name : '') +
93
- '</p></div>'
94
- );
95
- up.refresh();
96
- });
97
-
98
- bp_media_uploader.bind('FileUploaded', function(up, file) {
99
- jQuery('#bp-media-progress-'+file.id+' .bp-media-progress-text b').html("100%");
100
- });
101
- bp_media_uploader.bind('BeforeUpload',function(up){
102
- up.settings.multipart_params.is_multiple_upload = bp_media_is_multiple_upload;
103
- up.settings.multipart_params.bp_media_album_id = bp_media_album_selected;
104
- });
105
- bp_media_uploader.bind('UploadComplete',function(){
106
- var new_location = window.location.href;
107
- if(new_location.search('/upload/')>0){
108
- new_location = new_location.replace('/upload/','/albums/');
109
- if(bp_media_album_selected>0)
110
- new_location = new_location.concat(bp_media_album_selected);
111
- else
112
- new_location = new_location.concat('0/');
113
- window.location.replace(new_location);
114
- } else
115
- location.reload(true);
116
- });
117
-
118
-
119
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/assets/js/jquery.observehashchange.pack.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jQuery.observeHashChange (Version: 1.0)
3
+ *
4
+ * http://finnlabs.github.com/jquery.observehashchange/
5
+ *
6
+ * Copyright (c) 2009, Gregor Schmidt, Finn GmbH
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a
9
+ * copy of this software and associated documentation files (the "Software"),
10
+ * to deal in the Software without restriction, including without limitation
11
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the
13
+ * Software is furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ **/
19
+ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2($){$.i.h=2(i){$(a).w("d.h",i);s x};$.f=2(j){4 5=$.y({},$.f.r,j);9(m()){l()}v{t(5)}};4 1=c;4 b=c;4 3=0;$.f.r={3:D};2 m(){s E a.k!==\'C\'}2 l(){1=7.6.8;a.k=n}2 n(e,B){4 g=1;1=7.6.8;$(a).q("d.h",{u:g,o:1})}2 t(5){9(1==c){1=7.6.8}9(b!=c){z(b)}9(3!=5.3){b=A(p,5.3);3=5.3}}2 p(){9(1!=7.6.8){4 g=1;1=7.6.8;$(a).q("d.h",{u:g,o:1})}}$.f()})(d);',41,41,'|locationHash|function|interval|var|opts|location|document|hash|if|window|functionStore|null|jQuery||observeHashChange|oldHash|hashchange|fn|options|onhashchange|nativeVersion|isHashChangeEventSupported|onhashchangeHandler|after|checkLocationHash|trigger|defaults|return|setIntervalVersion|before|else|bind|this|extend|clearInterval|setInterval|data|undefined|500|typeof'.split('|'),0,{}))
20
+
app/assets/js/jquery.powertip.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*!
2
+ PowerTip - v1.2.0 - 2013-04-03
3
+ http://stevenbenner.github.com/jquery-powertip/
4
+ Copyright (c) 2013 Steven Benner (http://stevenbenner.com/).
5
+ Released under MIT license.
6
+ https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt
7
+ */
8
+ (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(){var t=this;t.top="auto",t.left="auto",t.right="auto",t.bottom="auto",t.set=function(o,n){e.isNumeric(n)&&(t[o]=Math.round(n))}}function o(e,t,o){function n(n,i){r(),e.data(v)||(n?(i&&e.data(m,!0),o.showTip(e)):(P.tipOpenImminent=!0,l=setTimeout(function(){l=null,s()},t.intentPollInterval)))}function i(n){r(),P.tipOpenImminent=!1,e.data(v)&&(e.data(m,!1),n?o.hideTip(e):(P.delayInProgress=!0,l=setTimeout(function(){l=null,o.hideTip(e),P.delayInProgress=!1},t.closeDelay)))}function s(){var i=Math.abs(P.previousX-P.currentX),s=Math.abs(P.previousY-P.currentY),r=i+s;t.intentSensitivity>r?o.showTip(e):(P.previousX=P.currentX,P.previousY=P.currentY,n())}function r(){l=clearTimeout(l),P.delayInProgress=!1}function a(){o.resetPosition(e)}var l=null;this.show=n,this.hide=i,this.cancel=r,this.resetPosition=a}function n(){function e(e,i,r,a,l){var p,c=i.split("-")[0],u=new t;switch(p=s(e)?n(e,c):o(e,c),i){case"n":u.set("left",p.left-r/2),u.set("bottom",P.windowHeight-p.top+l);break;case"e":u.set("left",p.left+l),u.set("top",p.top-a/2);break;case"s":u.set("left",p.left-r/2),u.set("top",p.top+l);break;case"w":u.set("top",p.top-a/2),u.set("right",P.windowWidth-p.left+l);break;case"nw":u.set("bottom",P.windowHeight-p.top+l),u.set("right",P.windowWidth-p.left-20);break;case"nw-alt":u.set("left",p.left),u.set("bottom",P.windowHeight-p.top+l);break;case"ne":u.set("left",p.left-20),u.set("bottom",P.windowHeight-p.top+l);break;case"ne-alt":u.set("bottom",P.windowHeight-p.top+l),u.set("right",P.windowWidth-p.left);break;case"sw":u.set("top",p.top+l),u.set("right",P.windowWidth-p.left-20);break;case"sw-alt":u.set("left",p.left),u.set("top",p.top+l);break;case"se":u.set("left",p.left-20),u.set("top",p.top+l);break;case"se-alt":u.set("top",p.top+l),u.set("right",P.windowWidth-p.left)}return u}function o(e,t){var o,n,i=e.offset(),s=e.outerWidth(),r=e.outerHeight();switch(t){case"n":o=i.left+s/2,n=i.top;break;case"e":o=i.left+s,n=i.top+r/2;break;case"s":o=i.left+s/2,n=i.top+r;break;case"w":o=i.left,n=i.top+r/2;break;case"nw":o=i.left,n=i.top;break;case"ne":o=i.left+s,n=i.top;break;case"sw":o=i.left,n=i.top+r;break;case"se":o=i.left+s,n=i.top+r}return{top:n,left:o}}function n(e,t){function o(){d.push(p.matrixTransform(u))}var n,i,s,r,a=e.closest("svg")[0],l=e[0],p=a.createSVGPoint(),c=l.getBBox(),u=l.getScreenCTM(),f=c.width/2,w=c.height/2,d=[],h=["nw","n","ne","e","se","s","sw","w"];if(p.x=c.x,p.y=c.y,o(),p.x+=f,o(),p.x+=f,o(),p.y+=w,o(),p.y+=w,o(),p.x-=f,o(),p.x-=f,o(),p.y-=w,o(),d[0].y!==d[1].y||d[0].x!==d[7].x)for(i=Math.atan2(u.b,u.a)*O,s=Math.ceil((i%360-22.5)/45),1>s&&(s+=8);s--;)h.push(h.shift());for(r=0;d.length>r;r++)if(h[r]===t){n=d[r];break}return{top:n.y+P.scrollTop,left:n.x+P.scrollLeft}}this.compute=e}function i(o){function i(e){e.data(v,!0),O.queue(function(t){s(e),t()})}function s(e){var t;if(e.data(v)){if(P.isTipOpen)return P.isClosing||r(P.activeHover),O.delay(100).queue(function(t){s(e),t()}),void 0;e.trigger("powerTipPreRender"),t=p(e),t&&(O.empty().append(t),e.trigger("powerTipRender"),P.activeHover=e,P.isTipOpen=!0,O.data(g,o.mouseOnToPopup),o.followMouse?a():(b(e),P.isFixedTipOpen=!0),O.fadeIn(o.fadeInTime,function(){P.desyncTimeout||(P.desyncTimeout=setInterval(H,500)),e.trigger("powerTipOpen")}))}}function r(e){P.isClosing=!0,P.activeHover=null,P.isTipOpen=!1,P.desyncTimeout=clearInterval(P.desyncTimeout),e.data(v,!1),e.data(m,!1),O.fadeOut(o.fadeOutTime,function(){var n=new t;P.isClosing=!1,P.isFixedTipOpen=!1,O.removeClass(),n.set("top",P.currentY+o.offset),n.set("left",P.currentX+o.offset),O.css(n),e.trigger("powerTipClose")})}function a(){if(!P.isFixedTipOpen&&(P.isTipOpen||P.tipOpenImminent&&O.data(T))){var e,n,i=O.outerWidth(),s=O.outerHeight(),r=new t;r.set("top",P.currentY+o.offset),r.set("left",P.currentX+o.offset),e=c(r,i,s),e!==I.none&&(n=u(e),1===n?e===I.right?r.set("left",P.windowWidth-i):e===I.bottom&&r.set("top",P.scrollTop+P.windowHeight-s):(r.set("left",P.currentX-i-o.offset),r.set("top",P.currentY-s-o.offset))),O.css(r)}}function b(t){var n,i;o.smartPlacement?(n=e.fn.powerTip.smartPlacementLists[o.placement],e.each(n,function(e,o){var n=c(y(t,o),O.outerWidth(),O.outerHeight());return i=o,n===I.none?!1:void 0})):(y(t,o.placement),i=o.placement),O.addClass(i)}function y(e,n){var i,s,r=0,a=new t;a.set("top",0),a.set("left",0),O.css(a);do i=O.outerWidth(),s=O.outerHeight(),a=k.compute(e,n,i,s,o.offset),O.css(a);while(5>=++r&&(i!==O.outerWidth()||s!==O.outerHeight()));return a}function H(){var e=!1;!P.isTipOpen||P.isClosing||P.delayInProgress||(P.activeHover.data(v)===!1||P.activeHover.is(":disabled")?e=!0:l(P.activeHover)||P.activeHover.is(":focus")||P.activeHover.data(m)||(O.data(g)?l(O)||(e=!0):e=!0),e&&r(P.activeHover))}var k=new n,O=e("#"+o.popupId);0===O.length&&(O=e("<div/>",{id:o.popupId}),0===d.length&&(d=e("body")),d.append(O)),o.followMouse&&(O.data(T)||(f.on("mousemove",a),w.on("scroll",a),O.data(T,!0))),o.mouseOnToPopup&&O.on({mouseenter:function(){O.data(g)&&P.activeHover&&P.activeHover.data(h).cancel()},mouseleave:function(){P.activeHover&&P.activeHover.data(h).hide()}}),this.showTip=i,this.hideTip=r,this.resetPosition=b}function s(e){return window.SVGElement&&e[0]instanceof SVGElement}function r(){P.mouseTrackingActive||(P.mouseTrackingActive=!0,e(function(){P.scrollLeft=w.scrollLeft(),P.scrollTop=w.scrollTop(),P.windowWidth=w.width(),P.windowHeight=w.height()}),f.on("mousemove",a),w.on({resize:function(){P.windowWidth=w.width(),P.windowHeight=w.height()},scroll:function(){var e=w.scrollLeft(),t=w.scrollTop();e!==P.scrollLeft&&(P.currentX+=e-P.scrollLeft,P.scrollLeft=e),t!==P.scrollTop&&(P.currentY+=t-P.scrollTop,P.scrollTop=t)}}))}function a(e){P.currentX=e.pageX,P.currentY=e.pageY}function l(e){var t=e.offset(),o=e[0].getBoundingClientRect(),n=o.right-o.left,i=o.bottom-o.top;return P.currentX>=t.left&&P.currentX<=t.left+n&&P.currentY>=t.top&&P.currentY<=t.top+i}function p(t){var o,n,i=t.data(y),s=t.data(H),r=t.data(k);return i?(e.isFunction(i)&&(i=i.call(t[0])),n=i):s?(e.isFunction(s)&&(s=s.call(t[0])),s.length>0&&(n=s.clone(!0,!0))):r&&(o=e("#"+r),o.length>0&&(n=o.html())),n}function c(e,t,o){var n=P.scrollTop,i=P.scrollLeft,s=n+P.windowHeight,r=i+P.windowWidth,a=I.none;return(n>e.top||n>Math.abs(e.bottom-P.windowHeight)-o)&&(a|=I.top),(e.top+o>s||Math.abs(e.bottom-P.windowHeight)>s)&&(a|=I.bottom),(i>e.left||e.right+t>r)&&(a|=I.left),(e.left+t>r||i>e.right)&&(a|=I.right),a}function u(e){for(var t=0;e;)e&=e-1,t++;return t}var f=e(document),w=e(window),d=e("body"),h="displayController",v="hasActiveHover",m="forcedOpen",T="hasMouseMove",g="mouseOnToPopup",b="originalTitle",y="powertip",H="powertipjq",k="powertiptarget",O=180/Math.PI,P={isTipOpen:!1,isFixedTipOpen:!1,isClosing:!1,tipOpenImminent:!1,activeHover:null,currentX:0,currentY:0,previousX:0,previousY:0,desyncTimeout:null,mouseTrackingActive:!1,delayInProgress:!1,windowWidth:0,windowHeight:0,scrollTop:0,scrollLeft:0},I={none:0,top:1,bottom:2,left:4,right:8};e.fn.powerTip=function(t,n){if(!this.length)return this;if("string"===e.type(t)&&e.powerTip[t])return e.powerTip[t].call(this,this,n);var s=e.extend({},e.fn.powerTip.defaults,t),a=new i(s);return r(),this.each(function(){var t,n=e(this),i=n.data(y),r=n.data(H),l=n.data(k);n.data(h)&&e.powerTip.destroy(n),t=n.attr("title"),i||l||r||!t||(n.data(y,t),n.data(b,t),n.removeAttr("title")),n.data(h,new o(n,s,a))}),s.manual||this.on({"mouseenter.powertip":function(t){e.powerTip.show(this,t)},"mouseleave.powertip":function(){e.powerTip.hide(this)},"focus.powertip":function(){e.powerTip.show(this)},"blur.powertip":function(){e.powerTip.hide(this,!0)},"keydown.powertip":function(t){27===t.keyCode&&e.powerTip.hide(this,!0)}}),this},e.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:!1,popupId:"powerTip",intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:!1,offset:10,mouseOnToPopup:!1,manual:!1},e.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]},e.powerTip={show:function(t,o){return o?(a(o),P.previousX=o.pageX,P.previousY=o.pageY,e(t).data(h).show()):e(t).first().data(h).show(!0,!0),t},reposition:function(t){return e(t).first().data(h).resetPosition(),t},hide:function(t,o){return t?e(t).first().data(h).hide(o):P.activeHover&&P.activeHover.data(h).hide(!0),t},destroy:function(t){return e(t).off(".powertip").each(function(){var t=e(this),o=[b,h,v,m];t.data(b)&&(t.attr("title",t.data(b)),o.push(y)),t.removeData(o)}),t}},e.powerTip.showTip=e.powerTip.show,e.powerTip.closeTip=e.powerTip.hide});
app/assets/js/jquery.sliderTabs.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(e){e.sliderTabs=function(t,n){var r=this;var i={autoplay:false,tabArrowWidth:35,classes:{leftTabArrow:"",panel:"",panelActive:"",panelsContainer:"",rightTabArrow:"",tab:"",tabActive:"",tabsList:""},defaultTab:1,height:null,indicators:false,mousewheel:true,position:"top",panelArrows:false,panelArrowsShowOnHover:false,tabs:true,tabHeight:30,tabArrows:true,tabSlideLength:100,tabSlideSpeed:200,transition:"slide",transitionEasing:"easeOutCubic",transitionSpeed:500,width:null};var s=e(t),o,u,a,f,l,c,h,p,d,v;var m=false,g=true;var y,b;r.selectedTab=i.defaultTab;r.init=function(){y=r.settings=e.extend({},i,n);s.addClass("ui-slider-tabs");a=s.children("div").addClass("ui-slider-tab-content").remove();u=s.children("ul").addClass("ui-slider-tabs-list").remove();u.children("li").remove().appendTo(u);r.count=u.children("li").length;l=e("<div class='ui-slider-tabs-list-wrapper'>");f=e("<div class='ui-slider-tabs-list-container'>").append(u).appendTo(l);f.find("li").css("height",y.tabHeight+2);f.find("li a").css("height",y.tabHeight+2);h=e("<a href='#' class='ui-slider-left-arrow'><div></div></a>").css({width:y.tabArrowWidth,height:y.tabHeight+2}).appendTo(f).click(function(e){r.slideTabs("right",y.tabSlideLength);return false});p=e("<a href='#' class='ui-slider-right-arrow'><div></div></a>").css({width:y.tabArrowWidth,height:y.tabHeight+2}).appendTo(f).click(function(e){r.slideTabs("left",y.tabSlideLength);return false});c=e("<div class='ui-slider-tabs-content-container'>").append(a);if(y.position=="bottom")s.append(c).append(l.addClass("bottom"));else s.append(l).append(c);if(y.width)s.width(parseInt(y.width));if(y.height)c.height(parseInt(y.height)-y.tabHeight);if(y.indicators)r.showIndicators();r.selectTab(y.defaultTab);r.slideTabs("left",0);S();A();s.delegate(".ui-slider-tabs-list li a","click",function(){if(!e(this).parent().hasClass("selected")&&!m){r.selectTab(e(this).parent())}return false});if(o)o.delegate(".ui-slider-tabs-indicator","click",function(){if(!e(this).hasClass("selected")&&!m)r.selectTab(e(this).index()+1)});e.each(y.classes,function(e,t){switch(e){case"leftTabArrow":h.addClass(t);break;case"rightTabArrow":p.addClass(t);break;case"panel":a.addClass(t);break;case"panelsContainer":c.addClass(t);break;case"tab":u.find("li").addClass(t);break;case"tabsList":u.addClass(t);break;default:break}});if(y.panelArrows)k();if(y.panelArrowsShowOnHover){if(d)d.addClass("showOnHover");if(v)v.addClass("showOnHover")}c.resize(k);l.resize(function(){L();A()});setInterval(function(){var e=c.children(".selected");if(e.outerHeight()>c.outerHeight()&&g)C(e)},100);L();if(!y.tabs)l.hide();if(y.autoplay)setInterval(r.next,y.autoplay);if(y.mousewheel)s.bind("mousewheel",function(e,t,n,i){if(t>0)r.next();else if(t<0)r.prev();return false})};r.selectTab=function(e){g=false;var t=typeof e==="number"?u.children("li:nth-child("+e+")"):e;var n=t.find("a").attr("href").substr(1);var i=c.children("#"+n);r.selectedTab=typeof e==="number"?e:e.index()+1;C(i);m=true;var s=u.find(".selected").index()<t.index()?"left":"right";t.siblings().removeClass("selected");if(y.classes.tabActive!="")t.siblings().removeClass(y.classes.tabActive);t.addClass("selected").addClass(y.classes.tabActive);T(c.children(".ui-slider-tab-content:visible"),s);N(i);E(t);w()};r.next=function(){if(!m){if(r.count===r.selectedTab)r.selectTab(1);else r.selectTab(r.selectedTab+1)}};r.prev=function(){if(!m){if(r.selectedTab===1)r.selectTab(r.count);else r.selectTab(r.selectedTab-1)}};r.slideTabs=function(e,t){var n=parseInt(u.css("margin-left"));var r=n;h.removeClass("edge");p.removeClass("edge");if(e=="right")r+=t;else if(e=="left")r-=t;if(r>=0){r=0;h.addClass("edge")}else if(r<=b){r=b;p.addClass("edge")}u.animate({"margin-left":r},y.tabSlideSpeed)};r.showIndicators=function(){if(!o){o=e("<div class='ui-slider-tabs-indicator-container'>");for(var t=0;t<a.length;t++){o.append("<div class='ui-slider-tabs-indicator'></div>")}c.append(o)}else o.show()};r.hideIndicators=function(){if(o)o.hide()};r.showTabArrows=function(){if(!y.tabArrows)return;h.show();p.show();f.css("margin","0 "+y.tabArrowWidth+"px")};r.hideTabArrows=function(){h.hide();p.hide();f.css("margin","0")};r.showPanelArrows=function(){if(d)d.show();if(v)v.show()};r.hidePanelArrows=function(){if(d)d.hide();if(v)v.hide()};var w=function(){if(y.indicators&&o){var e=o.children("div:nth-child("+r.selectedTab+")");e.siblings().removeClass("selected");e.addClass("selected")}};var E=function(e){var t=e.offset(),n=f.offset(),i=t.left-n.left,s=n.left+f.outerWidth()-(t.left+e.outerWidth());if(i<0)r.slideTabs("right",-i);else if(s<0)r.slideTabs("left",-s)};var S=function(){if(y.transition=="slide")u.children("li").each(function(t,n){var r=u.children(".selected").index(),i=e(n).index();var s=c.children("#"+e(n).find("a").attr("href").substr(1));if(r<i)s.css({left:c.width()+"px"});else if(r>i)s.css({left:"-"+c.width()+"px"});else s.addClass(y.classes.panelActive)});if(y.transition=="fade")u.children("li").each(function(t,n){var r=u.children(".selected").index(),i=e(n).index();var s=c.children("#"+e(n).find("a").attr("href").substr(1));if(r!=i)s.css({opacity:0});else s.addClass(y.classes.panelActive)})};var x=function(e){return{hide:{slideleft:{left:"-"+e+"px"},slideright:{left:e+"px"},fade:{opacity:0}},show:{slide:{left:0},fade:{opacity:1}}}};var T=function(e,t){if(y.transition=="slide")var n="slide"+t;else var n=y.transition;e.animate(x(c.width())["hide"][n],y.transitionSpeed,y.transitionEasing,function(){e.hide();e.removeClass("selected");m=false;S()})};var N=function(e){e.show();e.addClass(y.classes.panelActive).addClass("selected");e.animate(x(c.width())["show"][y.transition],y.transitionSpeed,y.transitionEasing,function(){m=false;g=true;S()})};var C=function(e){if(!y.height)c.animate({height:O(e)},200)};var k=function(){if(y.panelArrows){if(!d&&!v){d=e("<div class='ui-slider-tabs-leftPanelArrow'>").click(function(){r.prev()});v=e("<div class='ui-slider-tabs-rightPanelArrow'>").click(function(){r.next()});d.appendTo(c);v.appendTo(c)}v.css({top:c.height()/2-v.outerHeight()/2});d.css({top:c.height()/2-d.outerHeight()/2})}};var L=function(){var t=0;u.children().each(function(n,r){t+=e(r).outerWidth(true)});u.width(t+50);if(f.width()<t&&y.tabArrows){r.showTabArrows();b=f.width()-t}else r.hideTabArrows()};var A=function(){a.width(c.width()-(a.outerWidth()-a.width()))};var O=function(e){var t={display:e.css("display"),left:e.css("left"),position:e.css("position")};e.css({display:"normal",left:-5e3,position:"absolute"});var n=e.outerHeight();e.css(t);return n};r.init()};e.fn.sliderTabs=function(t){return this.each(function(){var n=e(this),r=n.data("sliderTabs");if(!r){r=new e.sliderTabs(this,t);n.data("sliderTabs",r);return r}if(r.methods[t]){return r.methods[t].apply(this,Array.prototype.slice.call(arguments,1))}})}})(jQuery);(function(e){function r(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=true,o=0,u=0;t=e.event.fix(n);t.type="mousewheel";if(n.wheelDelta){i=n.wheelDelta/120}if(n.detail){i=-n.detail/3}u=i;if(n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS){u=0;o=-1*i}if(n.wheelDeltaY!==undefined){u=n.wheelDeltaY/120}if(n.wheelDeltaX!==undefined){o=-1*n.wheelDeltaX/120}r.unshift(t,i,o,u);return(e.event.dispatch||e.event.handle).apply(this,r)}var t=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks){for(var n=t.length;n;){e.event.fixHooks[t[--n]]=e.event.mouseHooks}}e.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var e=t.length;e;){this.addEventListener(t[--e],r,false)}}else{this.onmousewheel=r}},teardown:function(){if(this.removeEventListener){for(var e=t.length;e;){this.removeEventListener(t[--e],r,false)}}else{this.onmousewheel=null}}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})(jQuery);(function(e,t,n){function c(){s=t[o](function(){r.each(function(){var t=e(this),n=t.width(),r=t.height(),i=e.data(this,a);if(n!==i.w||r!==i.h){t.trigger(u,[i.w=n,i.h=r])}});c()},i[f])}var r=e([]),i=e.resize=e.extend(e.resize,{}),s,o="setTimeout",u="resize",a=u+"-special-event",f="delay",l="throttleWindow";i[f]=250;i[l]=true;e.event.special[u]={setup:function(){if(!i[l]&&this[o]){return false}var t=e(this);r=r.add(t);e.data(this,a,{w:t.width(),h:t.height()});if(r.length===1){c()}},teardown:function(){if(!i[l]&&this[o]){return false}var t=e(this);r=r.not(t);t.removeData(a);if(!r.length){clearTimeout(s)}},add:function(t){function s(t,i,s){var o=e(this),u=e.data(this,a);u.w=i!==n?i:o.width();u.h=s!==n?s:o.height();r.apply(this,arguments)}if(!i[l]&&this[o]){return false}var r;if(e.isFunction(t)){r=t;return s}else{r=t.handler;t.handler=s}}}})(jQuery,this)
app/assets/js/main.js CHANGED
@@ -117,16 +117,16 @@ jQuery(document).ready(function(){
117
  });
118
  });
119
 
120
- jQuery('#bp-media-move-merge-ui,#bp-media-delete-ui').on('click','.select-all', function(e){
121
  e.preventDefault();
122
- jQuery('#bp-media-list input').each(function(){
123
  jQuery(this).prop('checked',true);
124
  });
125
  });
126
 
127
- jQuery('#bp-media-move-merge-ui,#bp-media-delete-ui').on('click','.unselect-all', function(e){
128
  e.preventDefault();
129
- jQuery('#bp-media-list input').each(function(){
130
  jQuery(this).prop('checked',false);
131
  });
132
  });
@@ -304,7 +304,8 @@ jQuery(document).ready(function(){
304
  action: 'bp_media_load_more_sc',
305
  page: parseInt($this.attr('data-page'))+1,
306
  media:$this.attr('data-media'),
307
- count:$this.attr('data-count')
 
308
  };
309
  jQuery.get(bp_media_vars.ajaxurl, data, function(response) {
310
  if(response.length==0) {
@@ -822,4 +823,7 @@ jQuery(document).ready(function(){
822
 
823
  }
824
 
825
- });
 
 
 
117
  });
118
  });
119
 
120
+ jQuery('.rtmedia-container').on('click','.select-all', function(e){
121
  e.preventDefault();
122
+ jQuery('.rtmedia-list input').each(function(){
123
  jQuery(this).prop('checked',true);
124
  });
125
  });
126
 
127
+ jQuery('.rtmedia-container').on('click','.unselect-all', function(e){
128
  e.preventDefault();
129
+ jQuery('.rtmedia-list input').each(function(){
130
  jQuery(this).prop('checked',false);
131
  });
132
  });
304
  action: 'bp_media_load_more_sc',
305
  page: parseInt($this.attr('data-page'))+1,
306
  media:$this.attr('data-media'),
307
+ count:$this.attr('data-count'),
308
+ title:$this.attr('data-title')
309
  };
310
  jQuery.get(bp_media_vars.ajaxurl, data, function(response) {
311
  if(response.length==0) {
823
 
824
  }
825
 
826
+ jQuery('.rtmedia-item-thumbnail a').magnificPopup({type:'ajax'});
827
+
828
+ });
829
+
app/assets/js/rtMedia.backbone.js ADDED
@@ -0,0 +1,552 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var galleryObj;
2
+ var nextpage = 2;
3
+ var upload_sync = false;
4
+ var activity_id = -1;
5
+
6
+ jQuery(function($) {
7
+
8
+
9
+ rtMedia = window.rtMedia || {};
10
+
11
+ rtMedia = window.rtMedia || {};
12
+
13
+ rtMedia.Context = Backbone.Model.extend({
14
+ url: function() {
15
+ var url = "media/";
16
+ if (!upload_sync && nextpage > 0)
17
+ url += 'pg/' + nextpage + '/'
18
+ return url;
19
+ },
20
+ defaults: {
21
+ "context": "post",
22
+ "context_id": false
23
+ }
24
+ });
25
+
26
+ rtMedia.Media = Backbone.Model.extend({
27
+ defaults: {
28
+ "id": 0,
29
+ "blog_id": false,
30
+ "media_id": false,
31
+ "media_author": false,
32
+ "media_title": false,
33
+ "album_id": false,
34
+ "media_type": "photo",
35
+ "activity_id": false,
36
+ "privacy": 0,
37
+ "views": 0,
38
+ "downloads": 0,
39
+ "ratings_average": 0,
40
+ "ratings_total": 0,
41
+ "ratings_count": 0,
42
+ "likes": 0,
43
+ "dislikes": 0,
44
+ "guid": false,
45
+ "width": 0,
46
+ "height": 0,
47
+ "rt_permalink": false
48
+ // "next" : -1,
49
+ // "prev" : -1
50
+ }
51
+
52
+ });
53
+
54
+ rtMedia.Gallery = Backbone.Collection.extend({
55
+ model: rtMedia.Media,
56
+ url: function() {
57
+ var temp = window.location.pathname;
58
+ var url = '';
59
+ if (temp.indexOf('media') == -1) {
60
+ url = 'media/';
61
+ } else {
62
+ if (temp.indexOf('pg/') == -1)
63
+ url = temp;
64
+ else
65
+ url = window.location.pathname.substr(0, window.location.pathname.lastIndexOf("pg/"));
66
+ }
67
+ if (!upload_sync && nextpage > 1) {
68
+ if (url.substr(url.length - 1) != "/")
69
+ url += "/"
70
+ url += 'pg/' + nextpage + '/';
71
+ }
72
+ return url;
73
+ },
74
+ getNext: function(page) {
75
+ this.fetch({
76
+ data: {
77
+ json: true,
78
+ rtmedia_page: nextpage
79
+ },
80
+ success: function(model, response) {
81
+ nextpage = response.next;
82
+ var galleryViewObj = new rtMedia.GalleryView({
83
+ collection: new rtMedia.Gallery(response.data),
84
+ el: $(".rtmedia-list")[0]
85
+ });
86
+ }
87
+ });
88
+ },
89
+ reloadView: function() {
90
+ upload_sync = true;
91
+ this.getNext();
92
+ }
93
+
94
+
95
+ });
96
+
97
+ rtMedia.MediaView = Backbone.View.extend({
98
+ tagName: 'li',
99
+ className: 'rtmedia-list-item',
100
+ initialize: function() {
101
+ this.template = _.template($("#rtmedia-gallery-item-template").html());
102
+ this.model.bind('change', this.render);
103
+ this.model.bind('remove', this.unrender);
104
+ this.render();
105
+ },
106
+ render: function() {
107
+ $(this.el).html(this.template(this.model.toJSON()));
108
+ return this.el;
109
+ },
110
+ unrender: function() {
111
+ $(this.el).remove();
112
+ },
113
+ remove: function() {
114
+ this.model.destroy();
115
+ }
116
+ });
117
+
118
+ rtMedia.GalleryView = Backbone.View.extend({
119
+ tagName: 'ul',
120
+ className: 'rtmedia-list',
121
+ initialize: function() {
122
+ this.template = _.template($("#rtmedia-gallery-item-template").html());
123
+ this.render();
124
+ },
125
+ render: function() {
126
+
127
+ that = this;
128
+
129
+ if (upload_sync) {
130
+ $(that.el).html('');
131
+ }
132
+
133
+ $.each(this.collection.toJSON(), function(key, media) {
134
+ $(that.el).append(that.template(media));
135
+ });
136
+ if (upload_sync) {
137
+ upload_sync = false;
138
+ }
139
+ if (nextpage > 1) {
140
+ $("#rtMedia-galary-next").show();
141
+ }
142
+
143
+
144
+ },
145
+ appendTo: function(media) {
146
+ console.log("append");
147
+ var mediaView = new rtMedia.MediaView({
148
+ model: media
149
+ });
150
+ $(this.el).append(mediaView.render().el);
151
+ }
152
+ });
153
+
154
+
155
+ galleryObj = new rtMedia.Gallery();
156
+
157
+ $("body").append('<script id="rtmedia-gallery-item-template" type="text/template"></script>');
158
+ var o_is_album,o_is_edit_allowed;
159
+ if (typeof(is_album) == "undefined"){
160
+ o_is_album=new Array("");
161
+ } else {
162
+ o_is_album = is_album
163
+ }
164
+ if(typeof(is_edit_allowed) == "undefined") {
165
+ o_is_edit_allowed=new Array("")
166
+ } else{
167
+ o_is_edit_allowed = is_edit_allowed;
168
+ }
169
+ $("#rtmedia-gallery-item-template").load(template_url + "/media-gallery-item.php", {
170
+ backbone: true,
171
+ is_album: o_is_album,
172
+ is_edit_allowed: o_is_edit_allowed
173
+ }, function(response, status, xhr) {
174
+
175
+ $(document).on("click", "#rtMedia-galary-next", function(e) {
176
+ $(this).hide();
177
+ e.preventDefault();
178
+
179
+ galleryObj.getNext(nextpage);
180
+ });
181
+ });
182
+
183
+
184
+
185
+
186
+ if (window.location.pathname.indexOf('media') != -1) {
187
+ var tempNext = window.location.pathname.substring(window.location.pathname.lastIndexOf("page/") + 5, window.location.pathname.lastIndexOf("/"));
188
+ if (isNaN(tempNext) === false) {
189
+ nextpage = parseInt(tempNext) + 1;
190
+ }
191
+ }
192
+
193
+
194
+
195
+ window.UploadView = Backbone.View.extend({
196
+ events: {
197
+ "click #rtMedia-start-upload": "uploadFiles"
198
+ },
199
+ initialize: function(config) {
200
+ this.uploader = new plupload.Uploader(config);
201
+ },
202
+ render: function() {
203
+
204
+ },
205
+ initUploader: function() {
206
+ this.uploader.init();
207
+ //The plupload HTML5 code gives a negative z-index making add files button unclickable
208
+ $(".plupload.html5").css({
209
+ zIndex: 0
210
+ });
211
+ $("#rtMedia-upload-button").css({
212
+ zIndex: 2
213
+ });
214
+ $("#rtMedia-upload-button").after("<span>(Max file size is " + plupload.formatSize (this.uploader.settings.max_file_size) + ")</span>" )
215
+
216
+ return this;
217
+ },
218
+ uploadFiles: function(e) {
219
+ if (e != undefined)
220
+ e.preventDefault();
221
+ this.uploader.start();
222
+ return false;
223
+ }
224
+
225
+ });
226
+
227
+
228
+
229
+ if ($("#rtMedia-upload-button").length > 0) {
230
+ var uploaderObj = new UploadView(rtMedia_plupload_config);
231
+
232
+ uploaderObj.initUploader();
233
+
234
+ uploaderObj.uploader.bind('UploadComplete', function(up, files) {
235
+ activity_id = -1;
236
+ galleryObj.reloadView();
237
+ });
238
+
239
+ uploaderObj.uploader.bind('FilesAdded', function(up, files) {
240
+ var upload_size_error =false;
241
+ var upload_error = "";
242
+ var upload_error_sep = "";
243
+ $.each(files, function(i, file) {
244
+ if(uploaderObj.uploader.settings.max_file_size<file.size){
245
+ upload_size_error=true
246
+ upload_error += upload_error_sep + file.name;
247
+ upload_error_sep = ",";
248
+ var tr = "<tr style='background-color:lightpink;color:black' id='" + file.id + "'><td>" + file.name+ "(" + plupload.formatSize(file.size) + ")" + "</td><td colspan='3'> Max file size is " + plupload.formatSize (uploaderObj.uploader.settings.max_file_size)+ "</td></tr>"
249
+ $("#rtMedia-queue-list tbody").append(tr)
250
+ return true;
251
+ }
252
+ tdName = document.createElement("td");
253
+ tdName.innerHTML = file.name;
254
+ tdStatus = document.createElement("td");
255
+ tdStatus.className = "plupload_file_status";
256
+ tdStatus.innerHTML = "0%";
257
+ tdSize = document.createElement("td");
258
+ tdSize.className = "plupload_file_size";
259
+ tdSize.innerHTML = plupload.formatSize(file.size);
260
+ tdDelete = document.createElement("td");
261
+ tdDelete.innerHTML = "X";
262
+ tdDelete.className = "plupload_delete"
263
+ tr = document.createElement("tr");
264
+ tr.id = file.id;
265
+ tr.appendChild(tdName);
266
+ tr.appendChild(tdStatus);
267
+ tr.appendChild(tdSize);
268
+ tr.appendChild(tdDelete);
269
+ $("#rtMedia-queue-list").append(tr);
270
+ //Delete Function
271
+ $("#" + file.id + " td.plupload_delete").click(function(e) {
272
+ e.preventDefault();
273
+ uploaderObj.uploader.removeFile(uploader.getFile(file.id));
274
+ $("#" + file.id).remove();
275
+ return false;
276
+ });
277
+
278
+ });
279
+ if(upload_size_error){
280
+ // alert(upload_error + " because max file size is " + plupload.formatSize(uploaderObj.uploader.settings.max_file_size) );
281
+ }
282
+ });
283
+
284
+ uploaderObj.uploader.bind('QueueChanged', function(up) {
285
+ uploaderObj.uploadFiles()
286
+
287
+ });
288
+
289
+ uploaderObj.uploader.bind('UploadProgress', function(up, file) {
290
+ $("#" + file.id + " .plupload_file_status").html(file.percent + "%");
291
+ if(file.percent == 100){
292
+ $("#" + file.id ).css("background-color","lightgreen");
293
+ $("#" + file.id ).css("color","#000");
294
+ }
295
+ });
296
+ uploaderObj.uploader.bind('BeforeUpload', function(up, file) {
297
+ up.settings.multipart_params.privacy = $("#rtm-file_upload-ui select#privacy").val();
298
+ up.settings.multipart_params.activity_id = activity_id;
299
+ if ($('.rtmedia-user-album-list').length > 0)
300
+ up.settings.multipart_params.album_id = $('.rtmedia-user-album-list').find(":selected").val();
301
+ else if ( $('.rtmedia-current-album').length > 0 )
302
+ up.settings.multipart_params.album_id = $('.rtmedia-current-album').val();
303
+ });
304
+
305
+ uploaderObj.uploader.bind('FileUploaded', function(up, file, res) {
306
+
307
+ files = up.files;
308
+ lastfile = files[files.length - 1];
309
+ try {
310
+ var rtnObj;
311
+ rtnObj = JSON.parse(res.response);
312
+ activity_id = rtnObj.activity_id;
313
+ } catch (e) {
314
+ console.log('Invalid Activity ID');
315
+ }
316
+ });
317
+
318
+ $("#rtMedia-start-upload").click(function(e) {
319
+ uploaderObj.uploadFiles(e);
320
+ });
321
+ $("#rtMedia-start-upload").hide();
322
+ }
323
+
324
+
325
+ });
326
+ /** History Code for route
327
+
328
+ var rtMediaRouter = Backbone.Router.extend({
329
+ routes: {
330
+ "media/*": "getMedia"
331
+ }
332
+ });
333
+ var app_router = new rtMediaRouter;
334
+ app_router.on('route:getMedia', function() {
335
+ // Note the variable in the route definition being passed in here
336
+ });
337
+ Backbone.history.start({pushState: true});
338
+
339
+ **/
340
+
341
+
342
+ /** Activity Update Js **/
343
+
344
+ jQuery(document).ready(function($) {
345
+ if (typeof rtMedia_update_plupload_config == 'undefined'){
346
+ return false;
347
+ }
348
+ var activity_attachemnt_ids = [];
349
+ if ($("#rtmedia-add-media-button-post-update").length > 0) {
350
+ $("#whats-new-options").prepend($("#rtmedia-action-update"));
351
+ if($("#privacy").length > 0 ){
352
+ $("#rtmedia-action-update").append($("#privacy"));
353
+ }
354
+ }
355
+ $("#whats-new-form").on('click', '#rtmedia-add-media-button-post-update', function(e) {
356
+ $("#div-attache-rtmedia").toggle();
357
+ })
358
+ //whats-new-post-in
359
+ var objUploadView = new UploadView(rtMedia_update_plupload_config);
360
+
361
+ objUploadView.uploader.bind('FilesAdded', function(up, files) {
362
+ //$("#aw-whats-new-submit").attr('disabled', 'disabled');
363
+ $.each(files, function(i, file) {
364
+ tdName = document.createElement("span");
365
+ tdName.innerHTML = file.name;
366
+ tdStatus = document.createElement("span");
367
+ tdStatus.className = "plupload_file_status";
368
+ tdStatus.innerHTML = "0%";
369
+ tr = document.createElement("p");
370
+ tr.id = file.id;
371
+ tr.appendChild(tdName);
372
+ tr.appendChild(tdStatus);
373
+ $("#rtMedia-update-queue-list").append(tr);
374
+ });
375
+ });
376
+
377
+ objUploadView.uploader.bind('FileUploaded', function(up, file, res) {
378
+ if (res.status == 200) {
379
+ try {
380
+ var objIds = JSON.parse(res.response);
381
+ $.each(objIds, function(key, val) {
382
+ activity_attachemnt_ids.push(val);
383
+ if ($("#whats-new-form").find("#rtmedia_attached_id_" + val).length < 1) {
384
+ $("#whats-new-form").append("<input type='hidden' name='rtMedia_attached_files[]' data-mode='rtMedia-update' id='rtmedia_attached_id_" + val + "' value='"
385
+ + val + "' />");
386
+ }
387
+ });
388
+ } catch (e) {
389
+
390
+ }
391
+ }
392
+ });
393
+ objUploadView.uploader.bind('BeforeUpload', function(up, files) {
394
+
395
+ var object = '';
396
+ var item_id = jq("#whats-new-post-in").val();
397
+ if(item_id==undefined)
398
+ item_id = 0;
399
+ if ( item_id > 0 ) {
400
+ object="group";
401
+ }else{
402
+ object="profile";
403
+ }
404
+
405
+ up.settings.multipart_params.context = object;
406
+ up.settings.multipart_params.context_id = item_id;
407
+ up.settings.multipart_params.privacy = $("#rtm-file_upload-ui select#privacy").val();
408
+ });
409
+ objUploadView.uploader.bind('UploadComplete', function(up, files) {
410
+ media_uploading=true;
411
+ $("#aw-whats-new-submit").click();
412
+ //$("#aw-whats-new-submit").removeAttr('disabled');
413
+ });
414
+ objUploadView.uploader.bind('UploadProgress', function(up, file) {
415
+ $("#" + file.id + " .plupload_file_status").html(file.percent + "%");
416
+
417
+ });
418
+
419
+ $("#rtMedia-start-upload").hide();
420
+
421
+ objUploadView.initUploader();
422
+ var change_flag = false
423
+ var media_uploading = false ;
424
+ $.ajaxPrefilter(function(options, originalOptions, jqXHR) {
425
+ // Modify options, control originalOptions, store jqXHR, etc
426
+ if(typeof(originalOptions.data) == "undefined" || typeof(originalOptions.data.action) =="undefined"){
427
+ return true;
428
+ }
429
+ if (originalOptions.data.action == 'post_update') {
430
+ var temp = activity_attachemnt_ids;
431
+ while (activity_attachemnt_ids.length > 0) {
432
+ options.data += "&rtMedia_attached_files[]=" + activity_attachemnt_ids.pop();
433
+ }
434
+ options.data += "&rtmedia-privacy="+$("#rtm-file_upload-ui select#privacy").val();
435
+ activity_attachemnt_ids = temp;
436
+ var orignalSuccess = originalOptions.success ;
437
+ options.beforeSend= function(){
438
+ if($.trim($("#whats-new").val())==""){
439
+ alert("Please enter some content to post.");
440
+ $("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
441
+ return false;
442
+ }
443
+ if(! media_uploading && objUploadView.uploader.files.length > 0){
444
+ $("#whats-new-post-in").attr('disabled', 'disabled');
445
+ $("#rtmedia-add-media-button-post-update").attr('disabled', 'disabled');
446
+ objUploadView.uploadFiles()
447
+ media_uploading=true;
448
+ return false;
449
+ }else{
450
+ media_uploading=false;
451
+ return true;
452
+ }
453
+
454
+
455
+ }
456
+ options.success= function(response){
457
+ orignalSuccess(response);
458
+ if ( response[0] + response[1] == '-1' ) {
459
+ //Error
460
+
461
+ }else{
462
+ jQuery("input[data-mode=rtMedia-update]").remove();
463
+ while(objUploadView.uploader.files.pop()!= undefined){}
464
+ objUploadView.uploader.refresh()
465
+ $('#rtMedia-update-queue-list').html('');
466
+ $("#div-attache-rtmedia").hide();
467
+ }
468
+ $("#whats-new-post-in").removeAttr('disabled');
469
+ $("#rtmedia-add-media-button-post-update").removeAttr('disabled');
470
+
471
+ }
472
+ }
473
+ });
474
+ });
475
+ /**
476
+ * rtMedia Comment Js
477
+ */
478
+ jQuery(document).ready(function($) {
479
+ jQuery(document).on("click",".mfp-content #rt_media_comment_form #rt_media_comment_submit",function(e){
480
+ e.preventDefault();
481
+ if($.trim($("#comment_content").val())==""){
482
+ alert("Empty Comment is not allowed");
483
+ return false;
484
+ }
485
+
486
+ $(this).attr('disabled', 'disabled');
487
+
488
+ $.ajax({
489
+ url: jQuery("#rt_media_comment_form").attr("action"),
490
+ type: 'post',
491
+ data: jQuery("#rt_media_comment_form").serialize() + "&rtajax=true",
492
+ success: function (data) {
493
+ $(".mfp-content #rtmedia_comment_ul").append(data);
494
+ $("#comment_content").val("");
495
+ $(".mfp-content #rt_media_comment_form #rt_media_comment_submit").removeAttr('disabled');
496
+ }
497
+ });
498
+
499
+
500
+
501
+ return false;
502
+ });
503
+
504
+
505
+
506
+ $(document).on("click",'.rtmedia-like',function(e){
507
+ e.preventDefault();
508
+ var that = this;
509
+ $(this).attr('disabled', 'disabled');
510
+ var url = $(this).parent().attr("action");
511
+ $(that).prepend("<img src='" + rMedia_loading_file + "' />");
512
+ $.ajax({
513
+ url: url,
514
+ type: 'post',
515
+ data:"json=true",
516
+ success: function (data) {
517
+ try{
518
+ data = JSON.parse(data);
519
+ }catch(e){
520
+
521
+ }
522
+ $(that).html(data.next);
523
+ $(that).removeAttr('disabled');
524
+ }
525
+ });
526
+
527
+
528
+ });
529
+ $(document).on("click",'.rtmedia-featured',function(e){
530
+ e.preventDefault();
531
+ var that = this;
532
+ $(this).attr('disabled', 'disabled');
533
+ var url = $(this).parent().attr("action");
534
+ $(that).prepend("<img src='" + rMedia_loading_file + "' />");
535
+ $.ajax({
536
+ url: url,
537
+ type: 'post',
538
+ data:"json=true",
539
+ success: function (data) {
540
+ try{
541
+ data = JSON.parse(data);
542
+ }catch(e){
543
+
544
+ }
545
+ $(that).html(data.next);
546
+ $(that).removeAttr('disabled');
547
+ }
548
+ });
549
+
550
+
551
+ });
552
+ });
app/assets/js/rtMedia.js ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery('document').ready(function($){
2
+
3
+ $("#rt_media_comment_form").submit(function(e){
4
+ if($.trim($("#comment_content").val()) == ""){
5
+ alert("Empty Comment is not allowed");
6
+ return false;
7
+ }else{
8
+ return true;
9
+ }
10
+
11
+ })
12
+
13
+ if(jQuery('.wp-audio-shortcode, .wp-video-shortcode').length > 0)
14
+ jQuery('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
15
+
16
+ jQuery('.rtmedia-list-media, .rtmedia-activity-container ul.rtmedia-list, #bp-media-list,.widget-item-listing,.bp-media-sc-list, li.media.album_updated ul,ul.bp-media-list-media, li.activity-item div.activity-content div.activity-inner div.bp_media_content').magnificPopup({
17
+ delegate: 'a',
18
+ type: 'ajax',
19
+ tLoading: 'Loading image #%curr%...',
20
+ mainClass: 'mfp-img-mobile',
21
+ preload: [1,3] ,
22
+ gallery: {
23
+ enabled: true,
24
+ navigateByImgClick: true,
25
+ preload: [0,1] // Will preload 0 - before current, and 1 after the current image
26
+ },
27
+ image: {
28
+ tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
29
+ titleSrc: function(item) {
30
+ return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';
31
+ }
32
+ },
33
+
34
+ disableOn: function() {
35
+ if( jQuery(window).width() < 600 ) {
36
+ return false;
37
+ }
38
+ return true;
39
+ },
40
+ callbacks: {
41
+ ajaxContentAdded: function(){
42
+
43
+ $container = this.content.find('.tagcontainer');
44
+ if($container.length>0){
45
+ $context = $container.find('img');
46
+ $container.find('.tagcontainer').css(
47
+ {
48
+ 'height': $context.css('height'),
49
+ 'width': $context.css('width')
50
+ });
51
+
52
+ }
53
+ }
54
+ }
55
+ });
56
+
57
+ jQuery('.rtmedia-container').on('click','.select-all', function(e){
58
+ e.preventDefault();
59
+ jQuery('.rtmedia-list input').each(function(){
60
+ jQuery(this).prop('checked',true);
61
+ });
62
+ });
63
+
64
+ jQuery('.rtmedia-container').on('click','.unselect-all', function(e){
65
+ e.preventDefault();
66
+ jQuery('.rtmedia-list input').each(function(){
67
+ jQuery(this).prop('checked',false);
68
+ });
69
+ });
70
+
71
+ jQuery('.rtmedia-container').on('click','.rtmedia-move',function(e){
72
+ jQuery('.rtmedia-delete-container').slideUp();
73
+ jQuery('.rtmedia-move-container').slideToggle();
74
+ });
75
+
76
+ jQuery('.rtmedia-container').on('click','.rtmedia-merge',function(e){
77
+ jQuery('.rtmedia-merge-container').slideToggle();
78
+ });
79
+
80
+ jQuery('.rtmedia-container').on('click','.rtmedia-create-new-album-button',function(e){
81
+ jQuery('.rtmedia-create-new-album-container').slideToggle();
82
+ });
83
+
84
+ jQuery('.rtmedia-container').on('click','#rtmedia_create_new_album',function(e){
85
+ $albumname = jQuery.trim(jQuery('#rtmedia_album_name').val());
86
+ $context = jQuery.trim(jQuery('#rtmedia_album_context').val());
87
+ $context_id = jQuery.trim(jQuery('#rtmedia_album_context_id').val());
88
+ if ($albumname != '') {
89
+ var data = {
90
+ action: 'rtmedia_create_album',
91
+ name: $albumname,
92
+ context:$context,
93
+ context_id: $context_id
94
+ };
95
+
96
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
97
+ $("#rtmedia_create_new_album").attr('disabled','disabled');
98
+ var old_val = $("#rtmedia_create_new_album").html();
99
+ $("#rtmedia_create_new_album").prepend("<img src='" + rMedia_loading_file + "'/>");
100
+ jQuery.post(rtmedia_ajax_url, data, function(response) {
101
+ if(response){
102
+ jQuery('.rtmedia-user-album-list').append('<option value="'+response+'">'+$albumname+'</option>');
103
+ jQuery('select.rtmedia-user-album-list option[value="'+response+'"]').prop('selected', true);
104
+ jQuery('.rtmedia-create-new-album-container').slideToggle();
105
+ jQuery('#rtmedia_album_name').val("");
106
+ jQuery(".rtmedia-create-new-album-button").after("<span class='rtmedia-success rtmedia-create-album-alert'><b>" + $albumname + "</b> album created.</span>" );
107
+ setTimeout(function(){jQuery(".rtmedia-create-album-alert").remove()},4000);
108
+
109
+ } else {
110
+ alert('Something went wrong. Please try again.');
111
+ }
112
+ $("#rtmedia_create_new_album").removeAttr('disabled');
113
+ $("#rtmedia_create_new_album").html(old_val);
114
+ });
115
+ } else {
116
+ alert('Enter an album name');
117
+ }
118
+ });
119
+
120
+ jQuery('.rtmedia-container').on('click','.rtmedia-delete-selected',function(e){
121
+ jQuery('.rtmedia-bulk-actions').attr('action','../../../media/delete');
122
+ });
123
+
124
+ jQuery('.rtmedia-container').on('click','.rtmedia-move-selected',function(e){
125
+ jQuery('.rtmedia-bulk-actions').attr('action','');
126
+ });
127
+
128
+ });
129
+
app/assets/sass/config.rb ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ require 'zurb-foundation'
2
+ # Require any additional compass plugins here.
3
+
4
+ # Set this to the root of your project when deployed:
5
+ http_path = "/"
6
+ css_dir = "../css"
7
+ sass_dir = "./"
8
+ images_dir = "../img"
9
+ javascripts_dir = "javascripts"
10
+
11
+ # You can select your preferred output style here (can be overridden via the command line):
12
+ output_style = :compressed
13
+
14
+ # To enable relative paths to assets via compass helper functions. Uncomment:
15
+ # relative_assets = true
16
+
17
+ # To disable debugging comments that display the original location of your selectors. Uncomment:
18
+ line_comments = false
19
+
20
+
21
+ # If you prefer the indented syntax, you might want to regenerate this
22
+ # project again passing --syntax sass, or you can uncomment this:
23
+ # preferred_syntax = :sass
24
+ # and then run:
25
+ # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
app/assets/sass/main.scss ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rtmedia-container{
2
+ @import "compass/reset";
3
+ @import "compass/css3";
4
+ @import "foundation/components/global"; // *always required
5
+ @import "foundation/components/grid";
6
+ @import "foundation/components/visibility";
7
+ @import "foundation/components/block-grid",
8
+ "foundation/components/flex-video";
9
+ .row{
10
+ max-width:1000px
11
+ }
12
+ .rtmedia-item-title{
13
+ h4{
14
+ text-overflow: ellipsis;
15
+ white-space: nowrap;
16
+ width: 100%;
17
+ overflow: hidden;
18
+ font-size:1.1em;
19
+ text-align:center;
20
+ }
21
+ }
22
+ .rtmedia-success{
23
+ display: block;
24
+ padding: 10px;
25
+ border: 1px solid #008000;
26
+ background-color: #90EE90;
27
+ @include border-radius(4px);
28
+ }
29
+ padding:5px;
30
+ margin: 0;
31
+ clear: left;
32
+
33
+ h2 {
34
+ font-size:1.4em;
35
+ font-weight:bold;
36
+ line-height: 2.4em;
37
+ }
38
+
39
+ .drag-drop{
40
+ border: 4px dashed #DDD;
41
+ text-align: center;
42
+ background: #fafafa;
43
+ overflow: hidden;
44
+ padding: 15px 0;
45
+ &.dragover{
46
+ border-color: #83b4d8;
47
+ }
48
+ }
49
+
50
+ .rtmedia-action-update{
51
+ float: left;
52
+ margin-top: 12px;
53
+ margin-right: 10px;
54
+ }
55
+
56
+
57
+ .rtmedia-list {
58
+ list-style: none;
59
+
60
+ .rtmedia-list-item {
61
+ word-wrap: break-word;
62
+ padding-top:20px;
63
+ padding-bottom:20px;
64
+
65
+ a {
66
+ text-decoration:none;
67
+ h4 {
68
+ line-height:1.4em;
69
+ font-size:1.2em;
70
+ padding-top:10px;
71
+ }
72
+ }
73
+ }
74
+ }
75
+
76
+ .rtmedia-media img {
77
+ max-width: 100%;
78
+ }
79
+
80
+ .rtmedia-item-thumbnail {
81
+ text-align: center;
82
+ height: 110px;
83
+ line-height: 110px;
84
+ img {
85
+ max-width: 100%;
86
+ max-height: 110px;
87
+ vertical-align: middle;
88
+ }
89
+ }
90
+ .rtmedia-item-comments-container {
91
+ margin: 3% 3%;
92
+ }
93
+
94
+ .rtmedia-comment {
95
+ list-style: none;
96
+ background: #f6f6f6;
97
+ border: 1px solid #ddd;
98
+ -moz-border-radius: 3px;
99
+ border-radius: 3px;
100
+ margin: 5px 0;
101
+ padding: 1px 5px 25px;
102
+ width: 391px;
103
+
104
+ .rtmedia-comment-author {
105
+ display: block;
106
+ }
107
+
108
+ .rtmedia-comment-content {
109
+ display: block;
110
+ }
111
+
112
+ .rtmedia-comment-date {
113
+ display: block;
114
+ float: right;
115
+ }
116
+ }
117
+
118
+ .rtmedia-bp-header {
119
+ width: 460px;
120
+ margin: auto;
121
+ }
122
+
123
+ #div-attache-rtmedia{
124
+ display:none;
125
+ }
126
+ #rtMedia-update-queue-list{
127
+ p{
128
+ span{
129
+ margin-right:20px;
130
+ }
131
+ }
132
+ }
133
+ .rtmedia-move-container {
134
+ display: none;
135
+ }
136
+ #rtmedia-add-media-button-post-update{
137
+ float: left;
138
+ margin-top: 10px;
139
+ margin-right: 20px;
140
+ }
141
+ #whats-new-post-in-box{
142
+ float:left;
143
+ }
144
+ .rtmedia-activity-text{
145
+ display:block;
146
+ padding-bottom:10px;
147
+ }
148
+ .rtmedia-merge-container{
149
+ display: none;
150
+ }
151
+ .rtmedia-create-new-album-container{
152
+ display: none;
153
+ }
154
+ select{
155
+ width: auto;
156
+ }
157
+ &.rtmedia-single-container{
158
+ .row{
159
+ background-color: #FFF;
160
+ #rtmedia-single-media-container{
161
+ .rtmedia-media{
162
+ .mejs-overlay-button{
163
+ margin: -50px 0 0 -50px;
164
+ }
165
+ .mejs-controls .mejs-button button {
166
+ cursor: pointer;
167
+ display: block;
168
+ font-size: 0;
169
+ line-height: 0;
170
+ text-decoration: none;
171
+ margin: 7px 5px;
172
+ padding: 0;
173
+ position: absolute;
174
+ height: 16px;
175
+ width: 16px;
176
+ border: 0;
177
+ background: rgba(0, 0, 0, 0) url('../../../lib/media-element/controls.png') no-repeat;
178
+ }
179
+ .mejs-controls .mejs-mute button {
180
+ background-position: -16px -16px;
181
+ }
182
+ .mejs-controls .mejs-fullscreen-button button {
183
+ background-position: -32px 0;
184
+ }
185
+ }
186
+ }
187
+ .rtmedia-single-meta{
188
+ padding: 10px;
189
+ button{
190
+ color: #5E5E5E;
191
+ background-color: #EBEBEB;
192
+ background-repeat: repeat-x;
193
+ background-image: -moz-linear-gradient(top, #F9F9F9, #EBEBEB);
194
+ background-image: -ms-linear-gradient(top, #F9F9F9, #EBEBEB);
195
+ background-image: -webkit-linear-gradient(top, #F9F9F9, #EBEBEB);
196
+ background-image: -o-linear-gradient(top, #F9F9F9, #EBEBEB);
197
+ background-image: linear-gradient(top, #F9F9F9, #EBEBEB);
198
+ }
199
+ &>a{
200
+ float: left;
201
+ margin:10px;
202
+ }
203
+ .rtmedia-item-actions{
204
+ &>a{
205
+ display: inline-block;
206
+ float:left;
207
+ }
208
+ &>form{
209
+ float:left;
210
+ margin-right: 5px;
211
+ }
212
+ }
213
+ }
214
+ .rtmedia-item-comments{
215
+ background-color:transparent;
216
+ div{
217
+ background-color:transparent;
218
+ }
219
+ }
220
+ }
221
+ }
222
+ }
223
+
224
+ .rtmedia-activity-container {
225
+ @extend .rtmedia-container;
226
+ }
227
+
228
+ #rtmedia-action-update{
229
+ float: left;
230
+ padding-right: 10px;
231
+ }
232
+ #header{
233
+ z-index:1 !important;
234
+ }
235
+
236
+ .bp_media_content{
237
+ video{
238
+ background-color:black;
239
+ }
240
+ }
app/helper/BPMediaLog.php CHANGED
@@ -26,7 +26,7 @@ if (!class_exists('BPMediaLog')) {
26
  public function __construct($msg, $context = '', $log_file = '') {
27
  $log_msg = $this->log_msg($msg, $context = '');
28
  if ($log_file == '') {
29
- $log_file = BP_MEDIA_PATH . 'log/bpmedia.log';
30
  }
31
  return $this->log($log_msg, $log_file);
32
  }
@@ -72,7 +72,7 @@ if (!class_exists('BPMediaLog')) {
72
  * @return boolean
73
  */
74
  public function log($logmsg, $file) {
75
- $fp = fopen(BP_MEDIA_PATH . 'plugin.log', "a+");
76
  if ($fp) {
77
  fwrite($fp, "\n" . $logmsg);
78
  fclose($fp);
26
  public function __construct($msg, $context = '', $log_file = '') {
27
  $log_msg = $this->log_msg($msg, $context = '');
28
  if ($log_file == '') {
29
+ $log_file = RTMEDIA_PATH . 'log/rtmedia.log';
30
  }
31
  return $this->log($log_msg, $log_file);
32
  }
72
  * @return boolean
73
  */
74
  public function log($logmsg, $file) {
75
+ $fp = fopen(RTMEDIA_PATH . 'plugin.log', "a+");
76
  if ($fp) {
77
  fwrite($fp, "\n" . $logmsg);
78
  fclose($fp);
app/helper/BPMediaSettings.php DELETED
@@ -1,613 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaSettings
4
- *
5
- * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
- * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
- */
8
- if (!class_exists('BPMediaSettings')) {
9
-
10
- class BPMediaSettings {
11
-
12
- public function __construct() {
13
- add_action('admin_init', array($this, 'settings'));
14
- if (is_multisite()) {
15
- add_action('network_admin_notices', array($this, 'privacy_notice'));
16
- } else {
17
- add_action('admin_notices', array($this, 'privacy_notice'));
18
- }
19
- }
20
-
21
- /**
22
- * Register Settings
23
- *
24
- * @global string 'buddypress-media'
25
- */
26
-
27
- /**
28
- *
29
- * @global BPMediaAddon $bp_media_addon
30
- */
31
- public function settings() {
32
- global $bp_media, $bp_media_addon, $wpdb;
33
- add_settings_section('bpm-settings', __('Enabled Media Types', 'buddypress-media'), is_multisite() ? array($this, 'allowed_types') : '', 'bp-media-settings');
34
- add_settings_field('bpm-image', __('Photos', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-settings', array(
35
- 'setting' => 'bp_media_options',
36
- 'option' => 'images_enabled',
37
- 'desc' => __('Enable Photos', 'buddypress-media')
38
- ));
39
- add_settings_field('bpm-video', __('Video', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-settings', array(
40
- 'setting' => 'bp_media_options',
41
- 'option' => 'videos_enabled',
42
- 'desc' => __('Enable Video (mp4)', 'buddypress-media')
43
- ));
44
- add_settings_field('bpm-audio', __('Audio', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-settings', array(
45
- 'setting' => 'bp_media_options',
46
- 'option' => 'audio_enabled',
47
- 'desc' => __('Enable Audio (mp3)', 'buddypress-media')
48
- ));
49
-
50
- add_settings_section('bpm-featured', __('Enable Featured Media', 'buddypress-media'), '', 'bp-media-settings');
51
- add_settings_field('bpm-featured-image', __('Photos', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-featured', array(
52
- 'setting' => 'bp_media_options',
53
- 'option' => 'featured_image',
54
- 'desc' => __('Enable Featured Photos', 'buddypress-media')
55
- ));
56
- add_settings_field('bpm-featured-video', __('Video', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-featured', array(
57
- 'setting' => 'bp_media_options',
58
- 'option' => 'featured_video',
59
- 'desc' => __('Enable Featured Video', 'buddypress-media')
60
- ));
61
- add_settings_field('bpm-featured-audio', __('Audio', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-featured', array(
62
- 'setting' => 'bp_media_options',
63
- 'option' => 'featured_audio',
64
- 'desc' => __('Enable Featured Audio', 'buddypress-media')
65
- ));
66
- add_settings_field('bpm-featured-media-dimensions', __('Featured Media Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-featured', array(
67
- 'setting' => 'bp_media_options',
68
- 'type' => 'media',
69
- 'size' => 'featured',
70
- 'crop' => true
71
- // 'desc' => __('Used in albums, sidebar media widget acitvity stream', 'buddypress-media')
72
- ));
73
-
74
-
75
- add_settings_section('bpm-image-settings', __('Image Settings', 'buddypress-media'), array($this, 'image_settings_intro'), 'bp-media-settings');
76
- add_settings_field('bpm-image-thumbnail', __('Thumbnail Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-image-settings', array(
77
- 'type' => 'image',
78
- 'size' => 'thumbnail',
79
- 'crop' => true,
80
- 'desc' => __('Used in albums, sidebar media widget acitvity stream', 'buddypress-media')
81
- ));
82
- add_settings_field('bpm-image-medium', __('Medium Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-image-settings', array(
83
- 'type' => 'image',
84
- 'size' => 'medium',
85
- 'crop' => true,
86
- 'desc' => __('Used in activity stream for single media uploads', 'buddypress-media')
87
- ));
88
- add_settings_field('bpm-image-large', __('Large Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-image-settings', array(
89
- 'type' => 'image',
90
- 'size' => 'large',
91
- 'crop' => true,
92
- 'desc' => __('Used in single media and thickbox', 'buddypress-media')
93
- ));
94
-
95
- add_settings_section('bpm-video-settings', __('Video Payer Settings', 'buddypress-media'), is_multisite() ? array($this, 'network_notices') : '', 'bp-media-settings');
96
- add_settings_field('bpm-video-medium', __('Activity Player Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-video-settings', array(
97
- 'type' => 'video',
98
- 'size' => 'medium'
99
- ));
100
- add_settings_field('bpm-video-large', __('Single Player Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-video-settings', array(
101
- 'type' => 'video',
102
- 'size' => 'large'
103
- ));
104
-
105
- add_settings_section('bpm-audio-settings', __('Audio Player Settings', 'buddypress-media'), is_multisite() ? array($this, 'network_notices') : '', 'bp-media-settings');
106
- add_settings_field('bpm-audio-medium', __('Activity Player Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-audio-settings', array(
107
- 'type' => 'audio',
108
- 'size' => 'medium',
109
- 'height' => false
110
- ));
111
- add_settings_field('bpm-audio-large', __('Single Player Size', 'buddypress-media'), array($this, 'dimensions'), 'bp-media-settings', 'bpm-audio-settings', array(
112
- 'type' => 'audio',
113
- 'size' => 'large',
114
- 'height' => false
115
- ));
116
-
117
- if (bp_is_active('activity')) {
118
- add_settings_section('bpm-activity-upload', __('Activity Upload', 'buddypress-media'), '', 'bp-media-settings');
119
- add_settings_field('bpm-activity', __('Activity Uploads', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-activity-upload', array(
120
- 'setting' => 'bp_media_options',
121
- 'option' => 'activity_upload',
122
- 'desc' => __('Enable Activity Uploading', 'buddypress-media')
123
- )
124
- );
125
- }
126
-
127
- add_settings_section('bpm-media-lightbox', __('Lightbox Integration', 'buddypress-media'), '', 'bp-media-settings');
128
- add_settings_field('bpm-media-lightbox-option', __('Lightbox', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-media-lightbox', array(
129
- 'setting' => 'bp_media_options',
130
- 'option' => 'enable_lightbox',
131
- 'desc' => __('Enable Lighbox on Media', 'buddypress-media')
132
- )
133
- );
134
-
135
- if (bp_is_active('groups')) {
136
- add_settings_section('bpm-media-type', __('Groups Integration', 'buddypress-media'), '', 'bp-media-settings');
137
- // add_settings_field('bpm-admin-profile', __('User profiles', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-media-type', array(
138
- // 'setting' => 'bp_media_options',
139
- // 'option' => 'enable_on_profile',
140
- // 'desc' => __('Check to enable BuddyPress Media on User profiles', 'buddypress-media')
141
- // )
142
- // );
143
- add_settings_field('bpm-admin-group', __('Groups', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-media-type', array(
144
- 'setting' => 'bp_media_options',
145
- 'option' => 'enable_on_group',
146
- 'desc' => __('Allow Media in Groups', 'buddypress-media')
147
- )
148
- );
149
- }
150
-
151
- add_settings_section('bpm-media-fine', __('Display Settings', 'buddypress-media'), '', 'bp-media-settings');
152
- add_settings_field('bpm-media-count', __('Number of media', 'buddypress-media'), array($this, 'textbox'), 'bp-media-settings', 'bpm-media-fine', array(
153
- 'setting' => 'bp_media_options',
154
- 'option' => 'default_count',
155
- 'number' => true
156
- ));
157
- add_settings_field('bpm-download', __('Download Button', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-media-fine', array(
158
- 'setting' => 'bp_media_options',
159
- 'option' => 'download_enabled',
160
- 'desc' => __('Display download button under media', 'buddypress-media')
161
- ));
162
-
163
- if (BPMediaPrivacy::is_installed()) {
164
- add_settings_section('bpm-privacy', __('Privacy Settings', 'buddypress-media'), '', 'bp-media-settings');
165
- add_settings_field('bpm-privacy-enabled', __('Enable Privacy', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-privacy', array(
166
- 'setting' => 'bp_media_options',
167
- 'option' => 'privacy_enabled',
168
- 'desc' => __('Enable privacy', 'buddypress-media')
169
- ));
170
-
171
- $settings = array(
172
- 6 => __('<strong>Private</strong> - Visible only to the user', 'buddypress-media'),
173
- 4 => __('<strong>Friends</strong> - Visible to user\'s friends', 'buddypress-media'),
174
- 2 => __('<strong>Users</strong> - Visible to registered users', 'buddypress-media'),
175
- 0 => __('<strong>Public</strong> - Visible to the world', 'buddypress-media')
176
- );
177
- if (!bp_is_active('friends')) {
178
- unset($settings[4]);
179
- }
180
- add_settings_field('bpm-privacy-private-enabled', __('Default Privacy', 'buddypress-media'), array($this, 'radio'), 'bp-media-settings', 'bpm-privacy', array(
181
- 'setting' => 'bp_media_options',
182
- 'option' => 'default_privacy_level',
183
- 'radios' => $settings,
184
- 'default' => 0,
185
- ));
186
- add_settings_field('bpm-privacy-override-enabled', __('User Override', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-privacy', array(
187
- 'setting' => 'bp_media_options',
188
- 'option' => 'privacy_override_enabled',
189
- 'desc' => __('Allow users to override admin defaults (<em>Recommended</em>)', 'buddypress-media')
190
- ));
191
- }
192
- add_settings_section('bpm-miscellaneous', __('Other Settings', 'buddypress-media'), '', 'bp-media-settings');
193
-
194
- add_settings_field('bpm-admin-bar-menu', __('Admin bar menu', 'buddypress-media'), array($this, 'checkbox'), 'bp-media-settings', 'bpm-miscellaneous', array(
195
- 'setting' => 'bp_media_options',
196
- 'option' => 'show_admin_menu',
197
- 'desc' => __('Enable menu in WordPress admin bar', 'buddypress-media')
198
- )
199
- );
200
- add_settings_field('bpm-other-settings', __('Recount', 'buddypress-media'), array($this, 'button'), 'bp-media-settings', 'bpm-miscellaneous', array(
201
- 'option' => 'refresh-count',
202
- 'name' => __('Recount', 'buddypress-media'),
203
- 'desc' => '<br />' . __('Repair media counts', 'buddypress-media')
204
- ));
205
-
206
- $bp_media_addon = new BPMediaAddon();
207
- add_settings_section('bpm-addons', __('BuddyPress Media Addons for Photos', 'buddypress-media'), array($bp_media_addon, 'get_addons'), 'bp-media-addons');
208
-
209
- add_settings_section('bpm-support', __('Support', 'buddypress-media'), array($this, 'bp_media_support_intro'), 'bp-media-support');
210
-
211
- if (!BPMediaPrivacy::is_installed()) {
212
- $bp_media_privacy = new BPMediaPrivacySettings();
213
- add_filter('bp_media_add_sub_tabs', array($bp_media_privacy, 'ui'), 99, 2);
214
- add_settings_section('bpm-privacy', __('Update Database', 'buddypress-media'), array($bp_media_privacy, 'init'), 'bp-media-privacy');
215
- }
216
-
217
- $bp_media_album_importer = new BPMediaAlbumimporter();
218
- add_settings_section('bpm-bp-album-importer', __('BP-Album Importer', 'buddypress-media'), array($bp_media_album_importer, 'ui'), 'bp-media-importer');
219
- register_setting('bp_media', 'bp_media_options', array($this, 'sanitize'));
220
- }
221
-
222
- public function network_notices() {
223
- $flag = 1;
224
- if (get_site_option('bpm-media-enable', false)) {
225
- echo '<div id="setting-error-bpm-media-enable" class="error"><p><strong>' . get_site_option('bpm-media-enable') . '</strong></p></div>';
226
- delete_site_option('bpm-media-enable');
227
- $flag = 0;
228
- }
229
- if (get_site_option('bpm-media-type', false)) {
230
- echo '<div id="setting-error-bpm-media-type" class="error"><p><strong>' . get_site_option('bpm-media-type') . '</strong></p></div>';
231
- delete_site_option('bpm-media-type');
232
- $flag = 0;
233
- }
234
- if (get_site_option('bpm-media-default-count', false)) {
235
- echo '<div id="setting-error-bpm-media-default-count" class="error"><p><strong>' . get_site_option('bpm-media-default-count') . '</strong></p></div>';
236
- delete_site_option('bpm-media-default-count');
237
- $flag = 0;
238
- }
239
-
240
- if (get_site_option('bpm-recount-success', false)) {
241
- echo '<div id="setting-error-bpm-recount-success" class="updated"><p><strong>' . get_site_option('bpm-recount-success') . '</strong></p></div>';
242
- delete_site_option('bpm-recount-success');
243
- $flag = 0;
244
- } elseif (get_site_option('bpm-recount-fail', false)) {
245
- echo '<div id="setting-error-bpm-recount-fail" class="error"><p><strong>' . get_site_option('bpm-recount-fail') . '</strong></p></div>';
246
- delete_site_option('bpm-recount-fail');
247
- $flag = 0;
248
- }
249
-
250
- if (get_site_option('bpm-settings-saved') && $flag) {
251
- echo '<div id="setting-error-bpm-settings-saved" class="updated"><p><strong>' . get_site_option('bpm-settings-saved') . '</strong></p></div>';
252
- }
253
- delete_site_option('bpm-settings-saved');
254
- }
255
-
256
- public function allowed_types() {
257
- $allowed_types = get_site_option('upload_filetypes', 'jpg jpeg png gif');
258
- $allowed_types = explode(' ', $allowed_types);
259
- $allowed_types = implode(', ', $allowed_types);
260
- echo '<span class="description">' . sprintf(__('Currently your network allows uploading of the following file types. You can change the settings <a href="%s">here</a>.<br /><code>%s</code></span>', 'buddypress-media'), network_admin_url('settings.php#upload_filetypes'), $allowed_types);
261
- }
262
-
263
- /**
264
- * Sanitizes the settings
265
- */
266
-
267
- /**
268
- *
269
- * @global type $bp_media_admin
270
- * @param type $input
271
- * @return type
272
- */
273
- public function sanitize($input) {
274
- global $bp_media_admin;
275
- if (isset($_POST['refresh-count'])) {
276
- if ($bp_media_admin->update_count()) {
277
- if (is_multisite())
278
- update_site_option('bpm-recount-success', __('Recounting of media files done successfully', 'buddypress-media'));
279
- else
280
- add_settings_error(__('Recount Success', 'buddypress-media'), 'bpm-recount-success', __('Recounting of media files done successfully', 'buddypress-media'), 'updated');
281
- } else {
282
- if (is_multisite())
283
- update_site_option('bpm-recount-fail', __('Recounting Failed', 'buddypress-media'));
284
- else
285
- add_settings_error(__('Recount Fail', 'buddypress-media'), 'bpm-recount-fail', __('Recounting Failed', 'buddypress-media'));
286
- }
287
- }
288
- // if (!isset($_POST['bp_media_options']['enable_on_profile']) && !isset($_POST['bp_media_options']['enable_on_group'])) {
289
- // if (is_multisite())
290
- // update_site_option('bpm-media-enable', __('Enable BuddyPress Media on either User Profiles or Groups or both. Atleast one should be selected.', 'buddypress-media'));
291
- // else
292
- // add_settings_error(__('Enable BuddyPress Media', 'buddypress-media'), 'bpm-media-enable', __('Enable BuddyPress Media on either User Profiles or Groups or both. Atleast one should be selected.', 'buddypress-media'));
293
- // $input['enable_on_profile'] = 1;
294
- // }
295
- if (!isset($_POST['bp_media_options']['videos_enabled']) && !isset($_POST['bp_media_options']['audio_enabled']) && !isset($_POST['bp_media_options']['images_enabled'])) {
296
- if (is_multisite())
297
- update_site_option('bpm-media-type', __('Atleast one Media Type Must be selected', 'buddypress-media'));
298
- else
299
- add_settings_error(__('Media Type', 'buddypress-media'), 'bpm-media-type', __('Atleast one Media Type Must be selected', 'buddypress-media'));
300
- $input['images_enabled'] = 1;
301
- }
302
-
303
- $input['default_count'] = intval($_POST['bp_media_options']['default_count']);
304
- if (!is_int($input['default_count']) || ($input['default_count'] < 0 ) || empty($input['default_count'])) {
305
- if (is_multisite())
306
- update_site_option('bpm-media-default-count', __('"Number of media" count value should be numeric and greater than 0.', 'buddypress-media'));
307
- else
308
- add_settings_error(__('Default Count', 'buddypress-media'), 'bpm-media-default-count', __('"Number of media" count value should be numeric and greater than 0.', 'buddypress-media'));
309
- $input['default_count'] = 10;
310
- }
311
- if (is_multisite())
312
- update_site_option('bpm-settings-saved', __('Settings saved.', 'buddypress-media'));
313
- do_action('bp_media_sanitize_settings', $_POST, $input);
314
- return $input;
315
- }
316
-
317
- public function image_settings_intro() {
318
- if (is_plugin_active('regenerate-thumbnails/regenerate-thumbnails.php')) {
319
- $regenerate_link = admin_url('/tools.php?page=regenerate-thumbnails');
320
- } elseif (array_key_exists('regenerate-thumbnails/regenerate-thumbnails.php', get_plugins())) {
321
- $regenerate_link = admin_url('/plugins.php#regenerate-thumbnails');
322
- } else {
323
- $regenerate_link = wp_nonce_url(admin_url('update.php?action=install-plugin&plugin=regenerate-thumbnails'), 'install-plugin_regenerate-thumbnails');
324
- }
325
- echo '<span class="description">' . sprintf(__('If you make changes to width, height or crop settings, you must use "<a href="%s">Regenerate Thumbnail Plugin</a>" to regenerate old images."', 'buddypress-media'), $regenerate_link) . '</span>';
326
- }
327
-
328
- /**
329
- * Output a checkbox
330
- *
331
- * @global array $bp_media
332
- * @param array $args
333
- */
334
-
335
- /**
336
- *
337
- * @global array $bp_media
338
- * @param type $args
339
- * @return type
340
- */
341
- public function checkbox($args) {
342
- global $bp_media;
343
- $options = $bp_media->options;
344
- $defaults = array(
345
- 'setting' => '',
346
- 'option' => '',
347
- 'desc' => '',
348
- );
349
- $args = wp_parse_args($args, $defaults);
350
- extract($args);
351
- if (empty($option)) {
352
- trigger_error(__('Please provide "option" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( \'option\' => \'option_name\' ) ', 'buddypress-media'));
353
- return;
354
- }
355
-
356
- if (!empty($setting)) {
357
- $name = $setting . '[' . $option . ']';
358
- $options = bp_get_option($setting);
359
- } else
360
- $name = $option;
361
-
362
- if (!isset($options[$option]))
363
- $options[$option] = '';
364
- ?>
365
- <label for="<?php echo $option; ?>">
366
- <input<?php checked($options[$option]); ?> name="<?php echo $name; ?>" id="<?php echo $option; ?>" value="1" type="checkbox" />
367
- <?php echo $desc; ?>
368
- </label><?php
369
- }
370
-
371
- /**
372
- * Outputs Radio Buttons
373
- *
374
- * @global array $bp_media
375
- * @param array $args
376
- */
377
-
378
- /**
379
- *
380
- * @global array $bp_media
381
- * @param type $args
382
- * @return type
383
- */
384
- public function radio($args) {
385
- global $bp_media;
386
- $options = $bp_media->options;
387
- $defaults = array(
388
- 'setting' => '',
389
- 'option' => '',
390
- 'radios' => array(),
391
- 'default' => '',
392
- );
393
- $args = wp_parse_args($args, $defaults);
394
- extract($args);
395
- if (empty($option) || ( 2 > count($radios) )) {
396
- if (empty($option))
397
- trigger_error(__('Please provide "option" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( \'option\' => \'option_name\' )', 'buddypress-media'));
398
- if (2 > count($radios))
399
- trigger_error(__('Need to specify atleast to radios else use a checkbox instead', 'buddypress-media'));
400
- return;
401
- }
402
-
403
- if (!empty($setting)) {
404
- $name = $setting . '[' . $option . ']';
405
- $options = bp_get_option($setting);
406
- } else
407
- $name = $option;
408
-
409
- if ((isset($options[$option]) && empty($options[$option])) || !isset($options[$option])) {
410
- $options[$option] = $default;
411
- }
412
-
413
- foreach ($radios as $value => $desc) {
414
- ?>
415
- <label for="<?php echo sanitize_title($desc); ?>"><input<?php checked($options[$option], $value); ?> value="<?php echo $value; ?>" name="<?php echo $name; ?>" id="<?php echo sanitize_title($desc); ?>" type="radio" />&nbsp;<?php echo $desc; ?></label><br /><?php
416
- }
417
- }
418
-
419
- /**
420
- * Outputs Textbox
421
- *
422
- * @global array $bp_media
423
- * @param array $args
424
- */
425
-
426
- /**
427
- *
428
- * @global array $bp_media
429
- * @param type $args
430
- * @return type
431
- */
432
- public function textbox($args) {
433
- global $bp_media;
434
- $options = $bp_media->options;
435
- $defaults = array(
436
- 'setting' => '',
437
- 'option' => '',
438
- 'desc' => '',
439
- 'password' => false,
440
- 'hidden' => false,
441
- 'number' => false,
442
- );
443
- $args = wp_parse_args($args, $defaults);
444
- extract($args);
445
- if (empty($option)) {
446
- trigger_error(__('Please provide "option" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( \'option\' => \'option_name\' )', 'buddypress-media'));
447
- return;
448
- }
449
-
450
- if (!empty($setting)) {
451
- $name = $setting . '[' . $option . ']';
452
- $options = bp_get_option($setting);
453
- } else
454
- $name = $option;
455
-
456
- if ((isset($options[$option]) && empty($options[$option])) || !isset($options[$option])) {
457
- $options[$option] = '';
458
- }
459
- ?>
460
- <label for="<?php echo sanitize_title($option); ?>"><input value="<?php echo $options[$option]; ?>" name="<?php echo $name; ?>" id="<?php echo sanitize_title($option); ?>" type="<?php echo $password ? 'password' : ($hidden ? 'hidden' : ($number ? 'number' : 'text')); ?>" /><?php
461
- if (!empty($desc)) {
462
- echo '<br /><span class="description">' . $desc . '</span>';
463
- }
464
- ?></label><br /><?php
465
- }
466
-
467
- /**
468
- *
469
- * @global array $bp_media
470
- * @param type $args
471
- * @return type
472
- */
473
- public function dimensions($args) {
474
- global $bp_media;
475
- $defaults = array(
476
- 'type' => 'image',
477
- 'size' => 'thumbnail',
478
- 'height' => true,
479
- 'crop' => false,
480
- 'desc' => ''
481
- );
482
- $args = wp_parse_args($args, $defaults);
483
- extract($args);
484
-
485
- $options = bp_get_option('bp_media_options');
486
-
487
- $w = $options['sizes'][$type][$size]['width'];
488
- if ($height) {
489
- $h = $options['sizes'][$type][$size]['height'];
490
- }
491
- if ($crop) {
492
- $c = $options['sizes'][$type][$size]['crop'];
493
- }
494
- ?>
495
- <label for="<?php echo sanitize_title("{$type}_{$size}_w"); ?>"><?php _e('Width', 'buddypress-media'); ?> <input value="<?php echo $w; ?>" name="<?php echo "bp_media_options[sizes][$type][$size][width]"; ?>" id="<?php echo sanitize_title("{$type}_{$size}_w"); ?>" type="number" class="small-text" /></label>
496
- <?php if ($height) { ?><label for="<?php echo sanitize_title("{$type}_{$size}_h"); ?>"><?php _e('Height', 'buddypress-media'); ?> <input value="<?php echo $h; ?>" name="<?php echo "bp_media_options[sizes][$type][$size][height]"; ?>" id="<?php echo sanitize_title("{$type}_{$size}_h"); ?>" type="number" class="small-text" /></label> <?php } ?>
497
- <?php if ($crop) { ?><label for="<?php echo sanitize_title("{$type}_{$size}_c"); ?>"> <input value="1"<?php checked($c ? $c : 0, 1); ?> name="<?php echo "bp_media_options[sizes][$type][$size][crop]"; ?>" id="<?php echo sanitize_title("{$type}_{$size}_c"); ?>" type="checkbox" /> <?php _e('Crop', 'buddypress-media'); ?></label><?php } ?>
498
- <?php if ($desc) { ?><br /><span class="description"><?php echo $desc; ?></span><?php
499
- }
500
- }
501
-
502
- /**
503
- * Outputs Dropdown
504
- *
505
- * @global array $bp_media
506
- * @param array $args
507
- */
508
-
509
- /**
510
- *
511
- * @param type $args
512
- * @return type
513
- */
514
- public function dropdown($args) {
515
- $defaults = array(
516
- 'setting' => '',
517
- 'option' => '',
518
- 'none' => true,
519
- 'values' => ''
520
- );
521
- $args = wp_parse_args($args, $defaults);
522
- extract($args);
523
- if (empty($option) || empty($values)) {
524
- if (empty($option))
525
- trigger_error(__('Please provide "option" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( \'option\' => \'option_name\' )', 'buddypress-media'));
526
- if (empty($values))
527
- trigger_error(__('Please provide some values to populate the dropdown. Format : array( \'value\' => \'option\' )', 'buddypress-media'));
528
- return;
529
- }
530
-
531
- if (!empty($setting)) {
532
- $name = $setting . '[' . $option . ']';
533
- $options = bp_get_option($setting);
534
- } else
535
- $name = $option;
536
-
537
- if ((isset($options[$option]) && empty($options[$option])) || !isset($options[$option])) {
538
- $options[$option] = '';
539
- }
540
- ?>
541
- <select name="<?php echo $name; ?>" id="<?php echo $option; ?>"><?php if ($none) { ?>
542
- <option><?php _e('None', 'buddypress-media'); ?></option><?php
543
- }
544
- foreach ($values as $value => $text) {
545
- ?>
546
- <option<?php selected($options[$option], $value); ?> value="<?php echo $value; ?>"><?php echo $text; ?></option><?php }
547
- ?>
548
- </select><?php
549
- }
550
-
551
- /**
552
- * Outputs a Button
553
- *
554
- * @global array $bp_media
555
- * @param array $args
556
- */
557
-
558
- /**
559
- *
560
- * @param type $args
561
- * @return type
562
- */
563
- public function button($args) {
564
- $defaults = array(
565
- 'setting' => '',
566
- 'option' => '',
567
- 'name' => 'Save Changes',
568
- 'desc' => '',
569
- );
570
- $args = wp_parse_args($args, $defaults);
571
- extract($args);
572
- if (empty($option)) {
573
- trigger_error('Please provide "option" value ( Required ) in the argument. Pass argument to add_settings_field in the following format array( \'option\' => \'option_name\', \'link\' => \'linkurl\' )');
574
- return;
575
- }
576
- if (!empty($setting)) {
577
- $button = $setting . '[' . $option . ']';
578
- } else
579
- $button = $option;
580
- submit_button($name, '', $button, false);
581
- if (!empty($desc)) {
582
- ?>
583
- <span class="description"><?php echo $desc; ?></a><?php
584
- }
585
- }
586
-
587
- public function privacy_notice() {
588
- if (current_user_can('create_users')) {
589
- if (BPMediaPrivacy::is_installed())
590
- return;
591
- $url = add_query_arg(
592
- array('page' => 'bp-media-privacy'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
593
- );
594
-
595
- $notice = '
596
- <div class="error">
597
- <p>' . __('BuddyPress Media 2.6 requires a database upgrade. ', 'buddypress-media')
598
- . '<a href="' . $url . '">' . __('Update Database', 'buddypress-media') . '.</a></p>
599
- </div>
600
- ';
601
- echo $notice;
602
- }
603
- }
604
-
605
- public function bp_media_support_intro() {
606
- echo '<p>' . __('If your site has some issues due to BuddyPress Media and you want one on one support then you can create a support topic on the <a target="_blank" href="http://rtcamp.com/groups/buddypress-media/forum/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media">rtCamp Support Forum</a>.', 'buddypress-media') . '</p>';
607
- echo '<p>' . __('If you have any suggestions, enhancements or bug reports, then you can open a new issue on <a target="_blank" href="https://github.com/rtCamp/buddypress-media/issues/new">GitHub</a>.', 'buddypress-media') . '</p>';
608
- }
609
-
610
- }
611
-
612
- }
613
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/helper/BPMediaUpgrade.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaUpgrade
4
- *
5
- * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
- * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
- */
8
- if (!class_exists('BPMediaUpgrade')) {
9
-
10
- class BPMediaUpgrade {
11
-
12
- public function __construct() {
13
- if (is_admin()) {
14
- if (version_compare(BP_MEDIA_DB_VERSION, get_site_option('bp_media_db_version', '1.0'), '>')) {
15
- add_action('admin_notices', array($this, 'upgrade_db'));
16
- }
17
- add_action('wp_loaded', array($this, 'upgrade'));
18
- }
19
- }
20
-
21
- /**
22
- * Displays admin notice to upgrade BuddyPress Media Database
23
- *
24
- * @global string BP_MEDIA_TXT_DOMAIN
25
- */
26
-
27
- /**
28
- *
29
- * @global type $bp_media
30
- */
31
- public function upgrade_db() {
32
- global $bp_media;
33
- ?>
34
- <div class="error"><p><?php
35
- printf(__('Please click upgrade to upgrade the database of BuddyPress Media <a class="button" id="refresh_media_count" href ="%s" class="button" title="It will migrate your BuddyPress Media\'s earlier database to new database.">Upgrade</a>', BP_MEDIA_TXT_DOMAIN), bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings', 'bp_media_upgrade_db' => 1, 'wp_nonce' => wp_create_nonce('bp_media_upgrade_db')), 'admin.php')))
36
- ?>
37
- </p></div>
38
- <?php
39
- }
40
-
41
- /**
42
- * Upgrade Script
43
- */
44
- public function upgrade() {
45
- if (isset($_GET['bp_media_upgrade_db']) && empty($_REQUEST['settings-updated'])) {
46
- check_admin_referer('bp_media_upgrade_db', 'wp_nonce');
47
- $current_version = get_site_option('bp_media_db_version', '1.0');
48
- if ($current_version == '2.0')
49
- $this->upgrade_2_0_to_2_1();
50
- else
51
- $this->upgrade_1_0_to_2_1();
52
- remove_action('admin_notices', 'upgrade_db');
53
- }
54
- }
55
-
56
- /**
57
- * Upgrade from BuddyPress Media 1.0 to 2.1
58
- * @global wpdb $wpdb
59
- * @global string BP_MEDIA_TXT_DOMAIN
60
- */
61
-
62
- /**
63
- *
64
- * @global wpdb $wpdb
65
- * @global type $bp_media
66
- */
67
- public function upgrade_1_0_to_2_1() {
68
- global $wpdb, $bp_media;
69
- $post_wall = __('Wall Posts', BP_MEDIA_TXT_DOMAIN);
70
- remove_filter('bp_activity_get_user_join_filter', 'BPMediaFilters::activity_query_filter', 10);
71
- /* @var $wpdb wpdb */
72
- $wall_posts_album_ids = array();
73
- do {
74
- $media_files = new WP_Query(array(
75
- 'post_type' => 'bp_media',
76
- 'posts_per_page' => 10
77
- ));
78
- $media_files = isset($media_files->posts) ? $media_files->posts : null;
79
- if (is_array($media_files) && count($media_files)) {
80
- foreach ($media_files as $media_file) {
81
- $attachment_id = get_post_meta($media_file->ID, 'bp_media_child_attachment', true);
82
- $child_activity = get_post_meta($media_file->ID, 'bp_media_child_activity', true);
83
- update_post_meta($attachment_id, 'bp_media_child_activity', $child_activity);
84
- $attachment = get_post($attachment_id, ARRAY_A);
85
- if (isset($wall_posts_album_ids[$media_file->post_author])) {
86
- $wall_posts_id = $wall_posts_album_ids[$media_file->post_author];
87
- } else {
88
- $wall_posts_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = $post_wall AND post_author = '" . $media_file->post_author . "' AND post_type='bp_media_album'");
89
- if ($wall_posts_id == null) {
90
- $album = new BPMediaAlbum();
91
- $album->add_album($post_wall, $media_file->post_author);
92
- $wall_posts_id = $album->get_id();
93
- }
94
- if (!$wall_posts_id) {
95
- continue; //This condition should never be encountered
96
- }
97
- $wall_posts_album_ids[$media_file->post_author] = $wall_posts_id;
98
- }
99
- $attachment['post_parent'] = $wall_posts_id;
100
- wp_update_post($attachment);
101
- update_post_meta($attachment_id, 'bp-media-key', $media_file->post_author);
102
- $activity = bp_activity_get(array('in' => intval($child_activity)));
103
- if (isset($activity['activities'][0]->id))
104
- $activity = $activity['activities'][0];
105
- try {
106
- $bp_media = new BPMediaHostWordpress($attachment_id);
107
- } catch (exception $e) {
108
- continue;
109
- }
110
- $args = array(
111
- 'content' => $bp_media->get_media_activity_content(),
112
- 'id' => $child_activity,
113
- 'type' => 'media_upload',
114
- 'action' => apply_filters('bp_media_added_media', sprintf(__('%1$s added a %2$s', BP_MEDIA_TXT_DOMAIN), bp_core_get_userlink($media_file->post_author), '<a href="' . $bp_media->get_url() . '">' . $bp_media->get_media_activity_type() . '</a>')),
115
- 'primary_link' => $bp_media->get_url(),
116
- 'item_id' => $attachment_id,
117
- 'recorded_time' => $activity->date_recorded,
118
- 'user_id' => $bp_media->get_author()
119
- );
120
- $act_id = BPMediaFunction::record_activity($args);
121
- bp_activity_delete_meta($child_activity, 'bp_media_parent_post');
122
- wp_delete_post($media_file->ID);
123
- }
124
- } else {
125
- break;
126
- }
127
- } while (1);
128
- update_site_option('bp_media_db_version', BP_MEDIA_DB_VERSION);
129
- add_action('admin_notices', 'BPMediaUpgradeScript::database_updated_notice');
130
- wp_cache_flush();
131
- }
132
-
133
- /**
134
- * Upgrade from BuddyPress Media 2.0 to 2.1
135
- *
136
- * @global string BP_MEDIA_TXT_DOMAIN
137
- */
138
-
139
- /**
140
- *
141
- * @global type $bp_media
142
- */
143
- public function upgrade_2_0_to_2_1() {
144
- global $bp_media;
145
- $page = 0;
146
- while ($media_entries = BPMediaUpgradeScript::return_query_posts(array(
147
- 'post_type' => 'attachment',
148
- 'post_status' => 'any',
149
- 'meta_key' => 'bp-media-key',
150
- 'meta_value' => 0,
151
- 'meta_compare' => '>',
152
- 'paged' => ++$page,
153
- 'postsperpage' => 10
154
- ))) {
155
- foreach ($media_entries as $media) {
156
- try {
157
- $bp_media = new BPMediaHostWordpress($media->ID);
158
- } catch (exception $e) {
159
- continue;
160
- }
161
- $child_activity = get_post_meta($media->ID, 'bp_media_child_activity', true);
162
- if ($child_activity) {
163
- $activity = bp_activity_get(array('in' => intval($child_activity)));
164
- if (isset($activity['activities'][0]->id))
165
- $activity = $activity['activities'][0];
166
- else
167
- continue;
168
- $args = array(
169
- 'content' => $bp_media->get_media_activity_content(),
170
- 'id' => $child_activity,
171
- 'type' => 'media_upload',
172
- 'action' => apply_filters('bp_media_added_media', sprintf(__('%1$s added a %2$s', BP_MEDIA_TXT_DOMAIN), bp_core_get_userlink($bp_media->get_author()), '<a href="' . $bp_media->get_url() . '">' . $bp_media->get_media_activity_type() . '</a>')),
173
- 'primary_link' => $bp_media->get_url(),
174
- 'item_id' => $activity->item_id,
175
- 'recorded_time' => $activity->date_recorded,
176
- 'user_id' => $bp_media->get_author()
177
- );
178
- BPMediaFunction::record_activity($args);
179
- }
180
- }
181
- }
182
- update_site_option('bp_media_db_version', BP_MEDIA_DB_VERSION);
183
- add_action('admin_notices', 'BPMediaUpgradeScript::database_updated_notice');
184
- wp_cache_flush();
185
- }
186
-
187
- }
188
-
189
- }
190
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/helper/{BPMediaAddon.php → RTMediaAddon.php} RENAMED
@@ -1,17 +1,17 @@
1
  <?php
2
 
3
  /**
4
- * Description of BPMediaAddon
5
  *
6
- * @package BuddyPressMedia
7
  * @subpackage Admin
8
  *
9
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
10
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
11
  */
12
- if (!class_exists('BPMediaAddon')) {
13
 
14
- class BPMediaAddon {
15
 
16
  public $enquiry_link = 'http://rtcamp.com/contact/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media';
17
 
@@ -23,67 +23,152 @@ if (!class_exists('BPMediaAddon')) {
23
  . '</a>';
24
  }
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  public function get_addons() {
27
- $addons = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  array(
29
- 'title' => __('BuddyPress-Media Photo Tagging', 'buddypress-media'),
30
  'img_src' => 'http://rtcamp.com/wp-content/uploads/2013/04/bpm-photo-tagging.png',
31
  'product_link' => 'http://rtcamp.com/store/buddypress-media-photo-tagging/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
32
- 'desc' => '<p>' . __('BuddyPress Media Instagram adds Instagram like filters to images uploaded with BuddyPress Media.', 'buddypress-media') . '</p>
33
- <p><strong>' . __('Important', 'buddypress-media') . ':</strong> ' . __('You need to have ImageMagick installed on your server for this addon to work.', 'buddypress-media') . '</p>',
34
  'price' => '$19',
35
  'demo_link' => 'http://demo.rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
36
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=37506'
37
  ),
38
  array(
39
- 'title' => __('BuddyPress-Media Instagram', 'buddypress-media'),
40
  'img_src' => 'http://cdn.rtcamp.com/wp-content/uploads/2013/03/BuddyPressMedia-Instagram.png',
41
  'product_link' => 'http://rtcamp.com/store/buddypress-media-instagram/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
42
- 'desc' => '<p>' . __('BuddyPress Media Instagram adds Instagram like filters to images uploaded with BuddyPress Media.', 'buddypress-media') . '</p>
43
- <p><strong>' . __('Important', 'buddypress-media') . ':</strong> ' . __('You need to have ImageMagick installed on your server for this addon to work.', 'buddypress-media') . '</p>',
44
  'price' => '$19',
45
  'demo_link' => 'http://demo.rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
46
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=34379'
47
  ),
48
  array(
49
- 'title' => __('BuddyPress-Media Kaltura Add-on', 'buddypress-media'),
50
  'img_src' => 'http://cdn.rtcamp.com/files/2012/10/new-buddypress-media-kaltura-logo-240x184.png',
51
  'product_link' => 'http://rtcamp.com/store/buddypress-media-kaltura/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
52
- 'desc' => '<p>' . __('Add support for more video formats using Kaltura video solution.', 'buddypress-media') . '</p>
53
- <p>' . __('Works with Kaltura.com, self-hosted Kaltura-CE and Kaltura-on-premise.', 'buddypress-media') . '</p>',
54
  'price' => '$99',
55
  'demo_link' => 'http://demo.rtcamp.com/bpm-kaltura/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
56
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=15446'
57
  ),
58
  array(
59
- 'title' => __('BuddyPress-Media FFMPEG Add-on', 'buddypress-media'),
60
  'img_src' => 'http://cdn.rtcamp.com/files/2012/09/ffmpeg-logo-240x184.png',
61
  'product_link' => 'http://rtcamp.com/store/buddypress-media-ffmpeg-converter/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
62
- 'desc' => '<p>' . __('Add supports for more audio & video formats using open-source media-node.', 'buddypress-media') . '</p>
63
- <p>' . __('Media node comes with automated setup script for Ubuntu/Debian.', 'buddypress-media') . '</p>',
64
  'price' => '$49',
65
  'demo_link' => 'http://demo.rtcamp.com/bpm-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
66
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=13677'
67
  )
68
  );
69
- $addons = apply_filters('bp_media_addons', $addons);
70
- foreach ($addons as $key => $addon) {
71
- $this->addon($addon);
72
- if ( $key == 1 ) {
73
- echo '<h3>';
74
- _e('BuddyPress Media Addons for Audio/Video');
75
- echo '</h3>';
76
- }
77
- }
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
  /**
81
  *
82
- * @global type $bp_media
83
  * @param type $args
84
  */
85
  public function addon($args) {
86
- global $bp_media;
87
 
88
  $defaults = array(
89
  'title' => '',
@@ -111,8 +196,8 @@ if (!class_exists('BPMediaAddon')) {
111
  </div>
112
  <div class="product_footer">
113
  <span class="price alignleft"><span class="amount">' . $price . '</span></span>
114
- <a class="add_to_cart_button alignright product_type_simple" href="' . $buy_now . '" target="_blank">' . __('Buy Now', 'buddypress-media') . '</a>
115
- <a class="alignleft product_demo_link" href="' . $demo_link . '" title="' . $title . '" target="_blank">' . __('Live Demo', 'buddypress-media') . '</a>
116
  </div>'
117
  . $coming_soon_div .
118
  '</div>';
1
  <?php
2
 
3
  /**
4
+ * Description of RTMediaAddon
5
  *
6
+ * @package rtMedia
7
  * @subpackage Admin
8
  *
9
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
10
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
11
  */
12
+ if (!class_exists('RTMediaAddon')) {
13
 
14
+ class RTMediaAddon {
15
 
16
  public $enquiry_link = 'http://rtcamp.com/contact/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media';
17
 
23
  . '</a>';
24
  }
25
 
26
+ public static function render_addons($page = '') {
27
+ global $wp_settings_sections, $wp_settings_fields;
28
+
29
+ if ( ! isset( $wp_settings_sections ) || !isset( $wp_settings_sections[$page] ) )
30
+ return;
31
+
32
+ foreach ( (array) $wp_settings_sections[$page] as $section ) {
33
+
34
+ if ( $section['callback'] )
35
+ call_user_func( $section['callback'], $section );
36
+
37
+ if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) )
38
+ continue;
39
+
40
+ echo '<table class="form-table">';
41
+ do_settings_fields( $page, $section['id'] );
42
+ echo '</table>';
43
+ }
44
+ }
45
+
46
  public function get_addons() {
47
+
48
+ $tabs = array();
49
+ global $rtmedia_admin;
50
+ $tabs[] = array(
51
+ 'title' => 'Audio/Video Encoding',
52
+ 'name' => __('Audio/Video Encoding', 'rtmedia'),
53
+ 'href' => '#bpm-services',
54
+ 'callback' => array($rtmedia_admin->rtmedia_encoding, 'encoding_service_intro')
55
+ );
56
+ $tabs[] = array(
57
+ 'title' => 'Plugins',
58
+ 'name' => __('Plugins', 'rtmedia'),
59
+ 'href' => '#bpm-plugins',
60
+ 'callback' => array($this, 'plugins_content')
61
+ );
62
+
63
+ /* $tabs[] = array(
64
+ 'title' => 'Themes',
65
+ 'name' => __('Themes', 'rtmedia'),
66
+ 'href' => '#bpm-themes',
67
+ 'callback' => array($this, 'themes_content')
68
+ );*/
69
+
70
+ ?>
71
+ <div id="bpm-addons">
72
+ <ul>
73
+ <?php
74
+ foreach ($tabs as $tab) {?>
75
+ <li><a title="<?php echo $tab['title'] ?>" href="<?php echo $tab['href']; ?>"><?php echo $tab['name']; ?></a></li>
76
+ <?php }
77
+ ?>
78
+ </ul>
79
+
80
+ <?php
81
+ foreach ($tabs as $tab) {
82
+ echo '<div id="' . substr($tab['href'],1) . '">';
83
+ call_user_func($tab['callback']);
84
+ echo '</div>';
85
+ }
86
+ ?>
87
+ </div>
88
+ <?php
89
+ }
90
+
91
+
92
+ public function plugins_content($args = '') {
93
+
94
+ $addons = array(
95
  array(
96
+ 'title' => __('rtMedia Photo Tagging', 'rtmedia'),
97
  'img_src' => 'http://rtcamp.com/wp-content/uploads/2013/04/bpm-photo-tagging.png',
98
  'product_link' => 'http://rtcamp.com/store/buddypress-media-photo-tagging/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
99
+ 'desc' => '<p>' . __('rtMedia Instagram adds Instagram like filters to images uploaded with rtMedia.', 'rtmedia') . '</p>
100
+ <p><strong>' . __('Important', 'rtmedia') . ':</strong> ' . __('You need to have ImageMagick installed on your server for this addon to work.', 'rtmedia') . '</p>',
101
  'price' => '$19',
102
  'demo_link' => 'http://demo.rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
103
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=37506'
104
  ),
105
  array(
106
+ 'title' => __('rtMedia Instagram', 'rtmedia'),
107
  'img_src' => 'http://cdn.rtcamp.com/wp-content/uploads/2013/03/BuddyPressMedia-Instagram.png',
108
  'product_link' => 'http://rtcamp.com/store/buddypress-media-instagram/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
109
+ 'desc' => '<p>' . __('rtMedia Instagram adds Instagram like filters to images uploaded with rtMedia.', 'rtmedia') . '</p>
110
+ <p><strong>' . __('Important', 'rtmedia') . ':</strong> ' . __('You need to have ImageMagick installed on your server for this addon to work.', 'rtmedia') . '</p>',
111
  'price' => '$19',
112
  'demo_link' => 'http://demo.rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
113
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=34379'
114
  ),
115
  array(
116
+ 'title' => __('rtMedia Kaltura Add-on', 'rtmedia'),
117
  'img_src' => 'http://cdn.rtcamp.com/files/2012/10/new-buddypress-media-kaltura-logo-240x184.png',
118
  'product_link' => 'http://rtcamp.com/store/buddypress-media-kaltura/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
119
+ 'desc' => '<p>' . __('Add support for more video formats using Kaltura video solution.', 'rtmedia') . '</p>
120
+ <p>' . __('Works with Kaltura.com, self-hosted Kaltura-CE and Kaltura-on-premise.', 'rtmedia') . '</p>',
121
  'price' => '$99',
122
  'demo_link' => 'http://demo.rtcamp.com/bpm-kaltura/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
123
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=15446'
124
  ),
125
  array(
126
+ 'title' => __('rtMedia FFMPEG Add-on', 'rtmedia'),
127
  'img_src' => 'http://cdn.rtcamp.com/files/2012/09/ffmpeg-logo-240x184.png',
128
  'product_link' => 'http://rtcamp.com/store/buddypress-media-ffmpeg-converter/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
129
+ 'desc' => '<p>' . __('Add supports for more audio & video formats using open-source media-node.', 'rtmedia') . '</p>
130
+ <p>' . __('Media node comes with automated setup script for Ubuntu/Debian.', 'rtmedia') . '</p>',
131
  'price' => '$49',
132
  'demo_link' => 'http://demo.rtcamp.com/bpm-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media',
133
  'buy_now' => 'http://rtcamp.com/store/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media&add-to-cart=13677'
134
  )
135
  );
136
+ $addons = apply_filters('rtmedia_addons', $addons);
137
+
138
+ foreach ($addons as $key => $value) {
139
+
140
+ if($key == 0) {
141
+ echo '<h3>';
142
+ _e('rtMedia Addons for Photos');
143
+ echo '</h3>';
144
+ } else if($key == 2) {
145
+ echo '<h3>';
146
+ _e('rtMedia Addons for Audio/Video');
147
+ echo '</h3>';
148
+ }
149
+ $this->addon($value);
150
+ }
151
+ }
152
+
153
+ public function services_content($args = '') {
154
+
155
+
156
+ $objEncoding->encoding_service_intro();
157
+ }
158
+
159
+ public function themes_content($args = '') {
160
+ echo '<h3>Coming Soon !!</h3>';
161
+ }
162
+
163
+
164
 
165
  /**
166
  *
167
+ * @global type $rtmedia
168
  * @param type $args
169
  */
170
  public function addon($args) {
171
+ global $rtmedia;
172
 
173
  $defaults = array(
174
  'title' => '',
196
  </div>
197
  <div class="product_footer">
198
  <span class="price alignleft"><span class="amount">' . $price . '</span></span>
199
+ <a class="add_to_cart_button alignright product_type_simple" href="' . $buy_now . '" target="_blank">' . __('Buy Now', 'rtmedia') . '</a>
200
+ <a class="alignleft product_demo_link" href="' . $demo_link . '" title="' . $title . '" target="_blank">' . __('Live Demo', 'rtmedia') . '</a>
201
  </div>'
202
  . $coming_soon_div .
203
  '</div>';
app/helper/{BPMediaAdminWidget.php → RTMediaAdminWidget.php} RENAMED
@@ -1,23 +1,23 @@
1
  <?php
2
  /**
3
- * Description of BPMediaWidget
4
  *
5
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
  */
8
- if (!class_exists('BPMediaAdminWidget')) {
9
 
10
- class BPMediaAdminWidget {
11
 
12
  /**
13
- *
14
- * @global type $bp_media
15
  * @param type $id
16
  * @param type $title
17
  * @param type $content
18
  */
19
  public function __construct($id = NULL, $title = NULL, $content = NULL) {
20
- global $bp_media;
21
  if ($id) {
22
  ?>
23
  <div class="postbox" id="<?php echo $id; ?>"><?php if ($title) { ?>
@@ -26,7 +26,7 @@ if (!class_exists('BPMediaAdminWidget')) {
26
  <div class="inside"><?php echo $content; ?></div>
27
  </div><?php
28
  } else {
29
- trigger_error(__('Argument missing. id is required.', 'buddypress-media'));
30
  }
31
  }
32
 
1
  <?php
2
  /**
3
+ * Description of RTMediaWidget
4
  *
5
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
  */
8
+ if (!class_exists('RTMediaAdminWidget')) {
9
 
10
+ class RTMediaAdminWidget {
11
 
12
  /**
13
+ *
14
+ * @global type $rtmedia
15
  * @param type $id
16
  * @param type $title
17
  * @param type $content
18
  */
19
  public function __construct($id = NULL, $title = NULL, $content = NULL) {
20
+ global $rtmedia;
21
  if ($id) {
22
  ?>
23
  <div class="postbox" id="<?php echo $id; ?>"><?php if ($title) { ?>
26
  <div class="inside"><?php echo $content; ?></div>
27
  </div><?php
28
  } else {
29
+ trigger_error(__('Argument missing. id is required.', 'rtmedia'));
30
  }
31
  }
32
 
app/helper/RTMediaCommentModel.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaCommentModel
10
+ *
11
+ * @author Udit Desai <udit.desai@rtcamp.com>
12
+ */
13
+ class RTMediaCommentModel {
14
+
15
+ public function __construct() {
16
+ //initialization
17
+ }
18
+
19
+ function insert($attr) {
20
+
21
+ return wp_insert_comment($attr);
22
+ }
23
+
24
+ function update() {
25
+
26
+ return wp_update_comment($attr, ARRAY_A);
27
+ }
28
+
29
+ function get($where) {
30
+
31
+ return get_comments($where);
32
+ }
33
+
34
+ function get_by_id($id) {
35
+
36
+ return get_comment($id);
37
+ }
38
+
39
+ function delete($id) {
40
+
41
+ return wp_delete_comment($id);
42
+ }
43
+ }
44
+
45
+ ?>
app/helper/{BPMediaFeed.php → RTMediaFeed.php} RENAMED
@@ -1,12 +1,12 @@
1
  <?php
2
 
3
  /**
4
- * Description of BPMediaFeed
5
  *
6
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
7
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
8
  */
9
- class BPMediaFeed {
10
 
11
  public $feed_url = 'http://rtcamp.com/tag/buddypress/feed/';
12
 
@@ -21,10 +21,10 @@ class BPMediaFeed {
21
 
22
  /**
23
  *
24
- * @global type $bp_media
25
  */
26
  public function fetch_feed() {
27
- global $bp_media;
28
  // Get RSS Feed(s)
29
  require_once( ABSPATH . WPINC . '/feed.php' );
30
  $maxitems = 0;
@@ -32,7 +32,8 @@ class BPMediaFeed {
32
  $rss = fetch_feed($this->feed_url);
33
  if (!is_wp_error($rss)) { // Checks that the object is created correctly
34
  // Figure out how many total items there are, but limit it to 5.
35
- $maxitems = $rss->get_item_quantity(5);
 
36
 
37
  // Build an array of all the items, starting with element 0 (first element).
38
  $rss_items = $rss->get_items(0, $maxitems);
@@ -40,13 +41,13 @@ class BPMediaFeed {
40
  ?>
41
  <ul><?php
42
  if ($maxitems == 0) {
43
- echo '<li>' . __('No items', 'buddypress-media') . '.</li>';
44
  } else {
45
  // Loop through each feed item and display each item as a hyperlink.
46
  foreach ($rss_items as $item) {
47
  ?>
48
  <li>
49
- <a href='<?php echo $item->get_permalink(); ?>?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media' title='<?php echo __('Posted ', 'buddypress-media') . $item->get_date('j F Y | g:i a'); ?>'><?php echo $item->get_title(); ?></a>
50
  </li><?php
51
  }
52
  }
1
  <?php
2
 
3
  /**
4
+ * Description of RTMediaFeed
5
  *
6
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
7
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
8
  */
9
+ class RTMediaFeed {
10
 
11
  public $feed_url = 'http://rtcamp.com/tag/buddypress/feed/';
12
 
21
 
22
  /**
23
  *
24
+ * @global type $rtmedia
25
  */
26
  public function fetch_feed() {
27
+ global $rtmedia;
28
  // Get RSS Feed(s)
29
  require_once( ABSPATH . WPINC . '/feed.php' );
30
  $maxitems = 0;
32
  $rss = fetch_feed($this->feed_url);
33
  if (!is_wp_error($rss)) { // Checks that the object is created correctly
34
  // Figure out how many total items there are, but limit it to 5.
35
+ // $maxitems = $rss->get_item_quantity(5);
36
+ $maxitems = $rss->get_item_quantity(3);
37
 
38
  // Build an array of all the items, starting with element 0 (first element).
39
  $rss_items = $rss->get_items(0, $maxitems);
41
  ?>
42
  <ul><?php
43
  if ($maxitems == 0) {
44
+ echo '<li>' . __('No items', 'rtmedia') . '.</li>';
45
  } else {
46
  // Loop through each feed item and display each item as a hyperlink.
47
  foreach ($rss_items as $item) {
48
  ?>
49
  <li>
50
+ <a href='<?php echo $item->get_permalink(); ?>?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media' title='<?php echo __('Posted ', 'rtmedia') . $item->get_date('j F Y | g:i a'); ?>'><?php echo $item->get_title(); ?></a>
51
  </li><?php
52
  }
53
  }
app/helper/RTMediaModel.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of BPMediaModel
5
+ *
6
+ * @author joshua
7
+ */
8
+ class RTMediaModel extends RTDBModel {
9
+
10
+ function __construct() {
11
+ parent::__construct( 'rtm_media' );
12
+ $this->meta_table_name = "rt_rtm_media_meta";
13
+ }
14
+
15
+ /**
16
+ *
17
+ * @param type $name
18
+ * @param type $arguments
19
+ * @return type
20
+ */
21
+ function __call( $name, $arguments ) {
22
+ $result = parent::__call( $name, $arguments );
23
+ if ( ! $result[ 'result' ] ) {
24
+ $result[ 'result' ] = $this->populate_results_fallback( $name, $arguments );
25
+ }
26
+ return $result;
27
+ }
28
+
29
+ /**
30
+ *
31
+ * @global type $wpdb
32
+ * @param type $columns
33
+ * @param type $offset
34
+ * @param type $per_page
35
+ * @param type $order_by
36
+ * @return type
37
+ */
38
+ function get( $columns, $offset = false, $per_page = false, $order_by = 'media_id desc' ) {
39
+ global $wpdb;
40
+ $select = "SELECT * FROM {$this->table_name}";
41
+ $join = "";
42
+ $where = " where 2=2 ";
43
+ $temp = 65;
44
+ foreach ( $columns as $colname => $colvalue ) {
45
+ if ( strtolower( $colname ) == "meta_query" ) {
46
+ foreach ( $colvalue as $meta_query ) {
47
+ if ( ! isset( $meta_query[ "compare" ] ) ) {
48
+ $meta_query[ "compare" ] = "=";
49
+ }
50
+ $tbl_alias = chr( $temp ++ );
51
+ $join .= " LEFT JOIN {$wpdb->prefix}{$this->meta_table_name} {$tbl_alias} ON {$this->table_name}.id = {$tbl_alias}.media_id ";
52
+ if ( isset($meta_query[ "value" ]) )
53
+ $where .= " AND ({$tbl_alias}.meta_key = '{$meta_query[ "key" ]}' and {$tbl_alias}.meta_value {$meta_query[ "compare" ]} '{$meta_query[ "value" ]}' ) ";
54
+ else
55
+ $where .= " AND {$tbl_alias}.meta_key = '{$meta_query[ "key" ]}' ";
56
+ }
57
+ } else {
58
+ if ( is_array( $colvalue ) ) {
59
+ if ( ! isset( $colvalue[ 'compare' ] ) )
60
+ $compare = 'IN';
61
+ else
62
+ $compare = $colvalue[ 'compare' ];
63
+ if ( ! isset( $colvalue[ 'value' ] ) ) {
64
+ $colvalue[ 'value' ] = $colvalue;
65
+ }
66
+ $col_val_comapare = ($colvalue[ 'value' ]) ? '(\''. implode( "','", $colvalue[ 'value' ] ) .'\')' : '';
67
+ $where .= " AND {$this->table_name}.{$colname} {$compare} {$col_val_comapare}";
68
+ } else
69
+ $where .= " AND {$this->table_name}.{$colname} = '{$colvalue}'";
70
+ }
71
+ }
72
+
73
+ $where = apply_filters( 'rtmedia-model-where-query', $where, $this->table_name );
74
+ $sql = $select . $join . $where;
75
+
76
+ $sql .= " ORDER BY {$this->table_name}.$order_by";
77
+
78
+ if ( is_integer( $offset ) && is_integer( $per_page ) ) {
79
+ $sql .= ' LIMIT ' . $offset . ',' . $per_page;
80
+ }
81
+
82
+ return $wpdb->get_results( $sql );
83
+ }
84
+
85
+ /**
86
+ *
87
+ * @param type $name
88
+ * @param type $arguments
89
+ * @return type
90
+ */
91
+ function populate_results_fallback( $name, $arguments ) {
92
+ $result[ 'result' ] = false;
93
+ if ( 'get_by_media_id' == $name && isset( $arguments[ 0 ] ) && $arguments[ 0 ] ) {
94
+
95
+ $result[ 'result' ][ 0 ]->media_id = $arguments[ 0 ];
96
+
97
+ $post_type = get_post_field( 'post_type', $arguments[ 0 ] );
98
+ if ( 'attachment' == $post_type ) {
99
+ $post_mime_type = explode( '/', get_post_field( 'post_mime_type', $arguments[ 0 ] ) );
100
+ $result[ 'result' ][ 0 ]->media_type = $post_mime_type[ 0 ];
101
+ } elseif ( 'bp_media_album' == $post_type ) {
102
+ $result[ 'result' ][ 0 ]->media_type = 'bp_media_album';
103
+ } else {
104
+ $result[ 'result' ][ 0 ]->media_type = false;
105
+ }
106
+
107
+ $result[ 'result' ][ 0 ]->context_id = intval( get_post_meta( $arguments[ 0 ], 'bp-media-key', true ) );
108
+ if ( $result[ 'result' ][ 0 ]->context_id > 0 )
109
+ $result[ 'result' ][ 0 ]->context = 'profile';
110
+ else
111
+ $result[ 'result' ][ 0 ]->context = 'group';
112
+
113
+ $result[ 'result' ][ 0 ]->activity_id = get_post_meta( $arguments[ 0 ], 'bp_media_child_activity', true );
114
+
115
+ $result[ 'result' ][ 0 ]->privacy = get_post_meta( $arguments[ 0 ], 'bp_media_privacy', true );
116
+ }
117
+ return $result[ 'result' ];
118
+ }
119
+
120
+ /**
121
+ *
122
+ * @param type $columns
123
+ * @param type $offset
124
+ * @param type $per_page
125
+ * @param type $order_by
126
+ * @return type
127
+ */
128
+ function get_media( $columns, $offset = false, $per_page = false, $order_by = 'media_id desc' ) {
129
+ if ( is_multisite() ) {
130
+ $results = $this->get( $columns, $offset, $per_page, "blog_id ," . $order_by );
131
+ } else {
132
+ $results = $this->get( $columns, $offset, $per_page, $order_by );
133
+ }
134
+ return $results;
135
+ }
136
+
137
+ function get_user_albums( $author_id, $offset, $per_page, $order_by = 'media_id desc' ) {
138
+ global $wpdb;
139
+ if ( is_multisite() )
140
+ $order_by = "blog_id ," . $order_by;
141
+ $sql = "SELECT * FROM {$this->table_name} WHERE id IN(SELECT DISTINCT (album_id) FROM {$this->table_name} WHERE media_author = $author_id AND album_id IS NOT NULL AND media_type != 'album' AND context != 'group') OR (media_type = 'album' AND media_author = $author_id AND context != 'group')";
142
+ $sql .= " ORDER BY {$this->table_name}.$order_by";
143
+
144
+ if ( is_integer( $offset ) && is_integer( $per_page ) ) {
145
+ $sql .= ' LIMIT ' . $offset . ',' . $per_page;
146
+ }
147
+
148
+ $results = $wpdb->get_results( $sql );
149
+ return $results;
150
+ }
151
+
152
+ function get_group_albums( $group_id, $offset, $per_page, $order_by = 'media_id desc' ) {
153
+ global $wpdb;
154
+ if ( is_multisite() )
155
+ $order_by = "blog_id ," . $order_by;
156
+ $sql = "SELECT * FROM {$this->table_name} WHERE id IN(SELECT DISTINCT (album_id) FROM {$this->table_name} WHERE context_id = $group_id AND album_id IS NOT NULL AND media_type != 'album' AND context = 'group') OR (media_type = 'album' AND context_id = $group_id AND context = 'group')";
157
+ $sql .= " ORDER BY {$this->table_name}.$order_by";
158
+
159
+ if ( is_integer( $offset ) && is_integer( $per_page ) ) {
160
+ $sql .= ' LIMIT ' . $offset . ',' . $per_page;
161
+ }
162
+
163
+ $results = $wpdb->get_results( $sql );
164
+ return $results;
165
+ }
166
+
167
+ function get_counts( $user_id = false, $where_query = false ) {
168
+
169
+ if ( ! $user_id && ! $where_query )
170
+ return false;
171
+ global $wpdb, $rtmedia;
172
+
173
+ $query =
174
+ "SELECT {$this->table_name}.privacy, ";
175
+ foreach ( $rtmedia->allowed_types as $type ) {
176
+ $query .= "SUM(CASE WHEN {$this->table_name}.media_type LIKE '{$type[ 'name' ]}' THEN 1 ELSE 0 END) as {$type[ 'name' ]}, ";
177
+ }
178
+ $query .= "SUM(CASE WHEN {$this->table_name}.media_type LIKE 'album' THEN 1 ELSE 0 END) as album
179
+ FROM
180
+ {$this->table_name} WHERE 2=2 ";
181
+ if ( $user_id ) {
182
+ $query .= "AND {$this->table_name}.media_author = $user_id ";
183
+ }
184
+ if ( $where_query ) {
185
+ foreach ( $where_query as $colname => $colvalue ) {
186
+ if ( strtolower( $colname ) != "meta_query" ) {
187
+ if ( is_array( $colvalue ) ) {
188
+ if ( ! isset( $colvalue[ 'compare' ] ) )
189
+ $compare = 'IN';
190
+ else
191
+ $compare = $colvalue[ 'compare' ];
192
+ if ( ! isset( $colvalue[ 'value' ] ) ) {
193
+ $colvalue[ 'value' ] = $colvalue;
194
+ }
195
+
196
+ $where .= " AND {$this->table_name}.{$colname} {$compare} ('" . implode( "','", $colvalue[ 'value' ] ) . "')";
197
+ } else
198
+ $where .= " AND {$this->table_name}.{$colname} = '{$colvalue}'";
199
+ }
200
+ }
201
+ }
202
+ $query .= "GROUP BY privacy";
203
+ $result = $wpdb->get_results( $query );
204
+ if ( ! is_array( $result ) )
205
+ return false;
206
+ return $result;
207
+ }
208
+
209
+ }
210
+
211
+ ?>
app/helper/RTMediaSettings.php ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Description of RTMediaSettings
4
+ *
5
+ * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
+ * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
+ */
8
+ if (!class_exists('RTMediaSettings')) {
9
+
10
+ class RTMediaSettings {
11
+
12
+ public function __construct() {
13
+ if ( !(defined('DOING_AJAX') && DOING_AJAX) )
14
+ add_action('admin_init', array($this, 'settings'));
15
+ // if (is_multisite()) {
16
+ // add_action('network_admin_notices', array($this, 'privacy_notice'));
17
+ // } else {
18
+ // add_action('admin_notices', array($this, 'privacy_notice'));
19
+ // }
20
+ }
21
+
22
+ /**
23
+ * Register Settings
24
+ *
25
+ * @global string 'rtmedia'
26
+ */
27
+
28
+ function sanitize_options($options) {
29
+
30
+ global $rtmedia;
31
+
32
+ $defaults = array(
33
+ 'general_enableAlbums' => 0,
34
+ 'general_enableComments' => 0,
35
+ 'general_downloadButton' => 0,
36
+ 'general_enableLightbox' => 0,
37
+ 'general_perPageMedia' => 10,
38
+ 'general_enableMediaEndPoint' => 0,
39
+ 'general_showAdminMenu' => 0,
40
+ );
41
+
42
+ foreach($rtmedia->allowed_types as $type){
43
+ // invalid keys handled in sanitize method
44
+ $defaults['allowedTypes_'.$type['name'].'_enabled'] = 0;
45
+ $defaults['allowedTypes_'.$type['name'].'_featured'] = 0;
46
+ }
47
+
48
+ /* Previous Sizes values from buddypress is migrated */
49
+ foreach ($rtmedia->default_sizes as $type => $typeValue) {
50
+ foreach ($typeValue as $size => $sizeValue) {
51
+ foreach ($sizeValue as $dimension => $value) {
52
+ $defaults['defaultSizes_'.$type.'_'.$size.'_'.$dimension] = 0;
53
+ }
54
+ }
55
+ }
56
+
57
+ /* Privacy */
58
+ $defaults['privacy_enabled'] = 0;
59
+ $defaults['privacy_default'] = 0;
60
+ $defaults['privacy_userOverride'] = 0;
61
+
62
+ $defaults['buddypress_enableOnGroup'] = 0;
63
+ $defaults['buddypress_enableOnActivity'] = 0;
64
+ $defaults['buddypress_enableOnProfile'] = 0;
65
+
66
+ $options = wp_parse_args($options, $defaults);
67
+
68
+ return $options;
69
+ }
70
+
71
+ /**
72
+ *
73
+ * @global BPMediaAddon $rtmedia_addon
74
+ */
75
+ public function settings() {
76
+ global $rtmedia, $rtmedia_addon;
77
+
78
+ // Save Settings first then proceed.
79
+ if(isset($_POST['rtmedia-options-save'])) {
80
+
81
+ $options = $_POST['rtmedia-options'];
82
+ $options = $this->sanitize_options($options);
83
+
84
+ rtmedia_update_site_option('rtmedia-options', $options);
85
+ global $rtmedia;
86
+ $rtmedia->options = $options;
87
+ }
88
+
89
+ $rtmedia_addon = new RTMediaAddon();
90
+ add_settings_section('rtm-addons', __('BuddyPress Media Addons for Photos', 'rtmedia'), array($rtmedia_addon, 'get_addons'), 'rtmedia-addons');
91
+
92
+ add_settings_section('rtm-support', __('Support', 'rtmedia'), array($this, 'rtmedia_support_intro'), 'rtmedia-support');
93
+
94
+ // if (!BPMediaPrivacy::is_installed()) {
95
+ // $rtmedia_privacy = new BPMediaPrivacySettings();
96
+ // add_filter('rtmedia_add_sub_tabs', array($rtmedia_privacy, 'ui'), 99, 2);
97
+ // add_settings_section('rtm-privacy', __('Update Database', 'rtmedia'), array($rtmedia_privacy, 'init'), 'rtmedia-privacy');
98
+ // }
99
+
100
+ //$rtmedia_album_importer = new BPMediaAlbumimporter();
101
+ //add_settings_section('rtm-rt-album-importer', __('BP-Album Importer', 'rtmedia'), array($rtmedia_album_importer, 'ui'), 'rtmedia-importer');
102
+ //register_setting('rtmedia', 'rtmedia_options', array($this, 'sanitize'));
103
+ }
104
+
105
+ public function network_notices() {
106
+ $flag = 1;
107
+ if (rtmedia_get_site_option('rtm-media-enable', false)) {
108
+ echo '<div id="setting-error-bpm-media-enable" class="error"><p><strong>' . rtmedia_get_site_option('rtm-media-enable') . '</strong></p></div>';
109
+ delete_site_option('rtm-media-enable');
110
+ $flag = 0;
111
+ }
112
+ if (rtmedia_get_site_option('rtm-media-type', false)) {
113
+ echo '<div id="setting-error-bpm-media-type" class="error"><p><strong>' . rtmedia_get_site_option('rtm-media-type') . '</strong></p></div>';
114
+ delete_site_option('rtm-media-type');
115
+ $flag = 0;
116
+ }
117
+ if (rtmedia_get_site_option('rtm-media-default-count', false)) {
118
+ echo '<div id="setting-error-bpm-media-default-count" class="error"><p><strong>' . rtmedia_get_site_option('rtm-media-default-count') . '</strong></p></div>';
119
+ delete_site_option('rtm-media-default-count');
120
+ $flag = 0;
121
+ }
122
+
123
+ if (rtmedia_get_site_option('rtm-recount-success', false)) {
124
+ echo '<div id="setting-error-bpm-recount-success" class="updated"><p><strong>' . rtmedia_get_site_option('rtm-recount-success') . '</strong></p></div>';
125
+ delete_site_option('rtm-recount-success');
126
+ $flag = 0;
127
+ } elseif (rtmedia_get_site_option('rtm-recount-fail', false)) {
128
+ echo '<div id="setting-error-bpm-recount-fail" class="error"><p><strong>' . rtmedia_get_site_option('rtm-recount-fail') . '</strong></p></div>';
129
+ delete_site_option('rtm-recount-fail');
130
+ $flag = 0;
131
+ }
132
+
133
+ if (get_site_option('rtm-settings-saved') && $flag) {
134
+ echo '<div id="setting-error-bpm-settings-saved" class="updated"><p><strong>' . get_site_option('rtm-settings-saved') . '</strong></p></div>';
135
+ }
136
+ delete_site_option('rtm-settings-saved');
137
+ }
138
+
139
+ public function allowed_types() {
140
+ $allowed_types = get_site_option('upload_filetypes', 'jpg jpeg png gif');
141
+ $allowed_types = explode(' ', $allowed_types);
142
+ $allowed_types = implode(', ', $allowed_types);
143
+ echo '<span class="description">' . sprintf(__('Currently your network allows uploading of the following file types. You can change the settings <a href="%s">here</a>.<br /><code>%s</code></span>', 'rtmedia'), network_admin_url('settings.php#upload_filetypes'), $allowed_types);
144
+ }
145
+
146
+ /**
147
+ * Sanitizes the settings
148
+ */
149
+
150
+ /**
151
+ *
152
+ * @global type $rtmedia_admin
153
+ * @param type $input
154
+ * @return type
155
+ */
156
+ public function sanitize($input) {
157
+ global $rtmedia_admin;
158
+ if (isset($_POST['refresh-count'])) {
159
+ if ($rtmedia_admin->update_count()) {
160
+ if (is_multisite())
161
+ update_site_option('rtm-recount-success', __('Recounting of media files done successfully', 'rtmedia'));
162
+ else
163
+ add_settings_error(__('Recount Success', 'rtmedia'), 'rtm-recount-success', __('Recounting of media files done successfully', 'rtmedia'), 'updated');
164
+ } else {
165
+ if (is_multisite())
166
+ update_site_option('rtm-recount-fail', __('Recounting Failed', 'rtmedia'));
167
+ else
168
+ add_settings_error(__('Recount Fail', 'rtmedia'), 'rtm-recount-fail', __('Recounting Failed', 'rtmedia'));
169
+ }
170
+ }
171
+ // if (!isset($_POST['rtmedia_options']['enable_on_profile']) && !isset($_POST['rtmedia_options']['enable_on_group'])) {
172
+ // if (is_multisite())
173
+ // update_site_option('rtm-media-enable', __('Enable BuddyPress Media on either User Profiles or Groups or both. Atleast one should be selected.', 'rtmedia'));
174
+ // else
175
+ // add_settings_error(__('Enable BuddyPress Media', 'rtmedia'), 'rtm-media-enable', __('Enable BuddyPress Media on either User Profiles or Groups or both. Atleast one should be selected.', 'rtmedia'));
176
+ // $input['enable_on_profile'] = 1;
177
+ // }
178
+ if (!isset($_POST['rtmedia_options']['videos_enabled']) && !isset($_POST['rtmedia_options']['audio_enabled']) && !isset($_POST['rtmedia_options']['images_enabled'])) {
179
+ if (is_multisite())
180
+ update_site_option('rtm-media-type', __('Atleast one Media Type Must be selected', 'rtmedia'));
181
+ else
182
+ add_settings_error(__('Media Type', 'rtmedia'), 'rtm-media-type', __('Atleast one Media Type Must be selected', 'rtmedia'));
183
+ $input['images_enabled'] = 1;
184
+ }
185
+
186
+ $input['default_count'] = intval($_POST['rtmedia_options']['default_count']);
187
+ if (!is_int($input['default_count']) || ($input['default_count'] < 0 ) || empty($input['default_count'])) {
188
+ if (is_multisite())
189
+ update_site_option('rtm-media-default-count', __('"Number of media" count value should be numeric and greater than 0.', 'rtmedia'));
190
+ else
191
+ add_settings_error(__('Default Count', 'rtmedia'), 'rtm-media-default-count', __('"Number of media" count value should be numeric and greater than 0.', 'rtmedia'));
192
+ $input['default_count'] = 10;
193
+ }
194
+ if (is_multisite())
195
+ update_site_option('rtm-settings-saved', __('Settings saved.', 'rtmedia'));
196
+ do_action('rtmedia_sanitize_settings', $_POST, $input);
197
+ return $input;
198
+ }
199
+
200
+ public function image_settings_intro() {
201
+ if (is_plugin_active('regenerate-thumbnails/regenerate-thumbnails.php')) {
202
+ $regenerate_link = admin_url('/tools.php?page=regenerate-thumbnails');
203
+ } elseif (array_key_exists('regenerate-thumbnails/regenerate-thumbnails.php', get_plugins())) {
204
+ $regenerate_link = admin_url('/plugins.php#regenerate-thumbnails');
205
+ } else {
206
+ $regenerate_link = wp_nonce_url(admin_url('update.php?action=install-plugin&plugin=regenerate-thumbnails'), 'install-plugin_regenerate-thumbnails');
207
+ }
208
+ echo '<span class="description">' . sprintf(__('If you make changes to width, height or crop settings, you must use "<a href="%s">Regenerate Thumbnail Plugin</a>" to regenerate old images."', 'rtmedia'), $regenerate_link) . '</span>';
209
+ echo '<div class="clearfix">&nbsp;</div>';
210
+ }
211
+
212
+ /**
213
+ * Output a checkbox
214
+ *
215
+ * @global array $rtmedia
216
+ * @param array $args
217
+ */
218
+
219
+ public function privacy_notice() {
220
+ if (current_user_can('create_users')) {
221
+ // if (BPMediaPrivacy::is_installed())
222
+ // return;
223
+ $url = add_query_arg(
224
+ array('page' => 'rtmedia-privacy'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
225
+ );
226
+
227
+ $notice = '
228
+ <div class="error">
229
+ <p>' . __('BuddyPress Media 2.6 requires a database upgrade. ', 'rtmedia')
230
+ . '<a href="' . $url . '">' . __('Update Database', 'rtmedia') . '.</a></p>
231
+ </div>
232
+ ';
233
+ echo $notice;
234
+ }
235
+ }
236
+
237
+ public function rtmedia_support_intro() {
238
+ echo '<p>' . __('If your site has some issues due to BuddyPress Media and you want one on one support then you can create a support topic on the <a target="_blank" href="http://rtcamp.com/groups/buddypress-media/forum/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media">rtCamp Support Forum</a>.', 'rtmedia') . '</p>';
239
+ echo '<p>' . __('If you have any suggestions, enhancements or bug reports, then you can open a new issue on <a target="_blank" href="https://github.com/rtCamp/buddypress-media/issues/new">GitHub</a>.', 'rtmedia') . '</p>';
240
+ }
241
+
242
+ }
243
+
244
+ }
245
+ ?>
app/helper/{BPMediaSupport.php → RTMediaSupport.php} RENAMED
@@ -1,19 +1,19 @@
1
  <?php
2
  /**
3
- * Description of BPMediaSupport
4
  *
5
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
  */
8
- if (!class_exists('BPMediaSupport')) {
9
 
10
- class BPMediaSupport {
11
 
12
  var $debug_info;
13
 
14
  public function __construct() {
15
  $this->debug_info();
16
- add_action('bp_media_admin_page_append', array($this, 'debug_info_html'));
17
  }
18
 
19
  public function debug_info() {
@@ -22,11 +22,12 @@ if (!class_exists('BPMediaSupport')) {
22
  $debug_info['PHP'] = PHP_VERSION;
23
  $debug_info['MYSQL'] = $wpdb->db_version();
24
  $debug_info['WordPress'] = $wp_version;
25
- $debug_info['BuddyPress'] = $bp->version;
26
- $debug_info['BuddyPress Media'] = BP_MEDIA_VERSION;
27
  $debug_info['OS'] = PHP_OS;
28
  if (extension_loaded('imagick')) {
29
- $imagick = $message = preg_replace(" #((http|https|ftp)://(\S*?\.\S*?))(\s|\;|\)|\]|\[|\{|\}|,|\"|'|:|\<|$|\.\s)#ie", "'<a href=\"$1\" target=\"_blank\">$3</a>$4'", Imagick::getVersion() );
 
30
  } else {
31
  $imagick['versionString'] = 'Not Installed';
32
  }
@@ -44,10 +45,10 @@ if (!class_exists('BPMediaSupport')) {
44
  }
45
 
46
  public function debug_info_html($page) {
47
- if ('bp-media-support' == $page) {
48
  ?>
49
  <div id="debug-info">
50
- <h3><?php _e('Debug info', 'buddypress-media'); ?></h3>
51
  <table class="form-table">
52
  <tbody><?php
53
  if ($this->debug_info) {
@@ -78,13 +79,13 @@ if (!class_exists('BPMediaSupport')) {
78
  global $current_user;
79
  switch ($form) {
80
  case "bug_report":
81
- $meta_title = __('Submit a Bug Report', 'buddypress-media');
82
  break;
83
  case "new_feature":
84
- $meta_title = __('Submit a New Feature Request', 'buddypress-media');
85
  break;
86
  case "premium_support":
87
- $meta_title = __('Submit a Premium Support Request', 'buddypress-media');
88
  break;
89
  }
90
  ?>
@@ -92,22 +93,22 @@ if (!class_exists('BPMediaSupport')) {
92
  <div id="support-form" class="bp-media-form">
93
  <ul>
94
  <li>
95
- <label class="bp-media-label" for="name"><?php _e('Name', 'buddypress-media'); ?>:</label><input class="bp-media-input" id="name" type="text" name="name" value="<?php echo (isset($_REQUEST['name'])) ? esc_attr(stripslashes(trim($_REQUEST['name']))) : $current_user->display_name; ?>" required />
96
  </li>
97
  <li>
98
- <label class="bp-media-label" for="email"><?php _e('Email', 'buddypress-media'); ?>:</label><input id="email" class="bp-media-input" type="text" name="email" value="<?php echo (isset($_REQUEST['email'])) ? esc_attr(stripslashes(trim($_REQUEST['email']))) : get_option('admin_email'); ?>" required />
99
  </li>
100
  <li>
101
- <label class="bp-media-label" for="website"><?php _e('Website', 'buddypress-media'); ?>:</label><input id="website" class="bp-media-input" type="text" name="website" value="<?php echo (isset($_REQUEST['website'])) ? esc_attr(stripslashes(trim($_REQUEST['website']))) : get_bloginfo('url'); ?>" required />
102
  </li>
103
  <li>
104
- <label class="bp-media-label" for="phone"><?php _e('Phone', 'buddypress-media'); ?>:</label><input class="bp-media-input" id="phone" type="text" name="phone" value="<?php echo (isset($_REQUEST['phone'])) ? esc_attr(stripslashes(trim($_REQUEST['phone']))) : ''; ?>"/>
105
  </li>
106
  <li>
107
- <label class="bp-media-label" for="subject"><?php _e('Subject', 'buddypress-media'); ?>:</label><input id="subject" class="bp-media-input" type="text" name="subject" value="<?php echo (isset($_REQUEST['subject'])) ? esc_attr(stripslashes(trim($_REQUEST['subject']))) : ''; ?>" required />
108
  </li>
109
  <li>
110
- <label class="bp-media-label" for="details"><?php _e('Details', 'buddypress-media'); ?>:</label><textarea id="details" class="bp-media-textarea" type="text" name="details" required/><?php echo (isset($_REQUEST['details'])) ? esc_textarea(stripslashes(trim($_REQUEST['details']))) : ''; ?></textarea>
111
  </li>
112
  <input type="hidden" name="request_type" value="<?php echo $form; ?>"/>
113
  <input type="hidden" name="request_id" value="<?php echo wp_create_nonce(date('YmdHis')); ?>"/>
@@ -118,24 +119,24 @@ if (!class_exists('BPMediaSupport')) {
118
 
119
  </ul>
120
  </div><!-- .submit-bug-box --><?php if ($form == 'bug_report') { ?>
121
- <h3><?php _e('Additional Information', 'buddypress-media'); ?></h3>
122
  <div id="support-form" class="bp-media-form">
123
  <ul>
124
 
125
  <li>
126
- <label class="bp-media-label" for="wp_admin_username"><?php _e('Your WP Admin Login:', 'buddypress-media'); ?></label><input class="bp-media-input" id="wp_admin_username" type="text" name="wp_admin_username" value="<?php echo (isset($_REQUEST['wp_admin_username'])) ? esc_attr(stripslashes(trim($_REQUEST['wp_admin_username']))) : $current_user->user_login; ?>"/>
127
  </li>
128
  <li>
129
- <label class="bp-media-label" for="wp_admin_pwd"><?php _e('Your WP Admin password:', 'buddypress-media'); ?></label><input class="bp-media-input" id="wp_admin_pwd" type="password" name="wp_admin_pwd" value="<?php echo (isset($_REQUEST['wp_admin_pwd'])) ? esc_attr(stripslashes(trim($_REQUEST['wp_admin_pwd']))) : ''; ?>"/>
130
  </li>
131
  <li>
132
- <label class="bp-media-label" for="ssh_ftp_host"><?php _e('Your SSH / FTP host:', 'buddypress-media'); ?></label><input class="bp-media-input" id="ssh_ftp_host" type="text" name="ssh_ftp_host" value="<?php echo (isset($_REQUEST['ssh_ftp_host'])) ? esc_attr(stripslashes(trim($_REQUEST['ssh_ftp_host']))) : ''; ?>"/>
133
  </li>
134
  <li>
135
- <label class="bp-media-label" for="ssh_ftp_username"><?php _e('Your SSH / FTP login:', 'buddypress-media'); ?></label><input class="bp-media-input" id="ssh_ftp_username" type="text" name="ssh_ftp_username" value="<?php echo (isset($_REQUEST['ssh_ftp_username'])) ? esc_attr(stripslashes(trim($_REQUEST['ssh_ftp_username']))) : ''; ?>"/>
136
  </li>
137
  <li>
138
- <label class="bp-media-label" for="ssh_ftp_pwd"><?php _e('Your SSH / FTP password:', 'buddypress-media'); ?></label><input class="bp-media-input" id="ssh_ftp_pwd" type="password" name="ssh_ftp_pwd" value="<?php echo (isset($_REQUEST['ssh_ftp_pwd'])) ? esc_attr(stripslashes(trim($_REQUEST['ssh_ftp_pwd']))) : ''; ?>"/>
139
  </li>
140
  </ul>
141
  </div><!-- .submit-bug-box --><?php } ?>
@@ -151,23 +152,23 @@ if (!class_exists('BPMediaSupport')) {
151
 
152
  /**
153
  *
154
- * @global type $bp_media
155
  */
156
  public function submit_request() {
157
- global $bp_media;
158
  $form_data = wp_parse_args($_POST['form_data']);
159
  if ($form_data['request_type'] == 'premium_support') {
160
  $mail_type = 'Premium Support';
161
- $title = __('BuddyPress Media Premium Support Request from', 'buddypress-media');
162
  } elseif ($form_data['request_type'] == 'new_feature') {
163
  $mail_type = 'New Feature Request';
164
- $title = __('BuddyPress Media New Feature Request from', 'buddypress-media');
165
  } elseif ($form_data['request_type'] == 'bug_report') {
166
  $mail_type = 'Bug Report';
167
- $title = __('BuddyPress Media Bug Report from', 'buddypress-media');
168
  } else {
169
  $mail_type = 'Bug Report';
170
- $title = __('BuddyPress Media Contact from', 'buddypress-media');
171
  }
172
  $message = '<html>
173
  <head>
@@ -228,7 +229,7 @@ if (!class_exists('BPMediaSupport')) {
228
  }
229
  $message .= '</table>';
230
  if ( $this->debug_info ) {
231
- $message .= '<h3>'.__('Debug Info', 'buddypress-media').'</h3>';
232
  $message .= '<table>';
233
  foreach ($this->debug_info as $configuration => $value) {
234
  $message .= '<tr>
@@ -241,17 +242,17 @@ if (!class_exists('BPMediaSupport')) {
241
  </html>';
242
  add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
243
  $headers = 'From: ' . $form_data['name'] . ' <' . $form_data['email'] . '>' . "\r\n";
244
- if (wp_mail($bp_media->support_email, '[buddypress-media] ' . $mail_type . ' from ' . str_replace(array('http://', 'https://'), '', $form_data['website']), $message, $headers)) {
245
  if ($form_data['request_type'] == 'new_feature') {
246
- echo '<p>' . __('Thank you for your Feedback/Suggestion.', 'buddypress-media') . '</p>';
247
  } else {
248
- echo '<p>' . __('Thank you for posting your support request.', 'buddypress-media') . '</p>';
249
- echo '<p>' . __('We will get back to you shortly.', 'buddypress-media') . '</p>';
250
  }
251
  } else {
252
- echo '<p>' . __('Your server failed to send an email.', 'buddypress-media') . '</p>';
253
- echo '<p>' . __('Kindly contact your server support to fix this.', 'buddypress-media') . '</p>';
254
- echo '<p>' . sprintf(__('You can alternatively create a support request <a href="%s">here</a>', 'buddypress-media'), $bp_media->support_url) . '</p>';
255
  }
256
  die();
257
  }
1
  <?php
2
  /**
3
+ * Description of RTMediaSupport
4
  *
5
  * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
6
  * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
  */
8
+ if (!class_exists('RTMediaSupport')) {
9
 
10
+ class RTMediaSupport {
11
 
12
  var $debug_info;
13
 
14
  public function __construct() {
15
  $this->debug_info();
16
+ add_action('rtmedia_admin_page_insert', array($this, 'debug_info_html'));
17
  }
18
 
19
  public function debug_info() {
22
  $debug_info['PHP'] = PHP_VERSION;
23
  $debug_info['MYSQL'] = $wpdb->db_version();
24
  $debug_info['WordPress'] = $wp_version;
25
+ $debug_info['BuddyPress'] = (isset($bp->version))?$bp->version:'-NA-';
26
+ $debug_info['rtMedia'] = RTMEDIA_VERSION;
27
  $debug_info['OS'] = PHP_OS;
28
  if (extension_loaded('imagick')) {
29
+ $imagickobj = new Imagick();
30
+ $imagick = $message = preg_replace(" #((http|https|ftp)://(\S*?\.\S*?))(\s|\;|\)|\]|\[|\{|\}|,|\"|'|:|\<|$|\.\s)#ie", "'<a href=\"$1\" target=\"_blank\">$3</a>$4'", $imagickobj->getversion() );
31
  } else {
32
  $imagick['versionString'] = 'Not Installed';
33
  }
45
  }
46
 
47
  public function debug_info_html($page) {
48
+ if ('rtmedia-support' == $page) {
49
  ?>
50
  <div id="debug-info">
51
+ <h3><?php _e('Debug info', 'rtmedia'); ?></h3>
52
  <table class="form-table">
53
  <tbody><?php
54
  if ($this->debug_info) {
79
  global $current_user;
80
  switch ($form) {
81
  case "bug_report":
82
+ $meta_title = __('Submit a Bug Report', 'rtmedia');
83
  break;
84
  case "new_feature":
85
+ $meta_title = __('Submit a New Feature Request', 'rtmedia');
86
  break;
87
  case "premium_support":
88
+ $meta_title = __('Submit a Premium Support Request', 'rtmedia');
89
  break;
90
  }
91
  ?>
93
  <div id="support-form" class="bp-media-form">
94
  <ul>
95
  <li>
96
+ <label class="bp-media-label" for="name"><?php _e('Name', 'rtmedia'); ?>:</label><input class="bp-media-input" id="name" type="text" name="name" value="<?php echo (isset($_REQUEST['name'])) ? esc_attr(stripslashes(trim($_REQUEST['name']))) : $current_user->display_name; ?>" required />
97
  </li>
98
  <li>
99
+ <label class="bp-media-label" for="email"><?php _e('Email', 'rtmedia'); ?>:</label><input id="email" class="bp-media-input" type="text" name="email" value="<?php echo (isset($_REQUEST['email'])) ? esc_attr(stripslashes(trim($_REQUEST['email']))) : get_option('admin_email'); ?>" required />
100
  </li>
101
  <li>
102
+ <label class="bp-media-label" for="website"><?php _e('Website', 'rtmedia'); ?>:</label><input id="website" class="bp-media-input" type="text" name="website" value="<?php echo (isset($_REQUEST['website'])) ? esc_attr(stripslashes(trim($_REQUEST['website']))) : get_bloginfo('url'); ?>" required />
103
  </li>
104
  <li>
105
+ <label class="bp-media-label" for="phone"><?php _e('Phone', 'rtmedia'); ?>:</label><input class="bp-media-input" id="phone" type="text" name="phone" value="<?php echo (isset($_REQUEST['phone'])) ? esc_attr(stripslashes(trim($_REQUEST['phone']))) : ''; ?>"/>
106
  </li>
107
  <li>
108
+ <label class="bp-media-label" for="subject"><?php _e('Subject', 'rtmedia'); ?>:</label><input id="subject" class="bp-media-input" type="text" name="subject" value="<?php echo (isset($_REQUEST['subject'])) ? esc_attr(stripslashes(trim($_REQUEST['subject']))) : ''; ?>" required />
109
  </li>
110
  <li>
111
+ <label class="bp-media-label" for="details"><?php _e('Details', 'rtmedia'); ?>:</label><textarea id="details" class="bp-media-textarea" type="text" name="details" required/><?php echo (isset($_REQUEST['details'])) ? esc_textarea(stripslashes(trim($_REQUEST['details']))) : ''; ?></textarea>
112
  </li>
113
  <input type="hidden" name="request_type" value="<?php echo $form; ?>"/>
114
  <input type="hidden" name="request_id" value="<?php echo wp_create_nonce(date('YmdHis')); ?>"/>
119
 
120
  </ul>
121
  </div><!-- .submit-bug-box --><?php if ($form == 'bug_report') { ?>
122
+ <h3><?php _e('Additional Information', 'rtmedia'); ?></h3>
123
  <div id="support-form" class="bp-media-form">
124
  <ul>
125
 
126
  <li>
127
+ <label class="bp-media-label" for="wp_admin_username"><?php _e('Your WP Admin Login:', 'rtmedia'); ?></label><input class="bp-media-input" id="wp_admin_username" type="text" name="wp_admin_username" value="<?php echo (isset($_REQUEST['wp_admin_username'])) ? esc_attr(stripslashes(trim($_REQUEST['wp_admin_username']))) : $current_user->user_login; ?>"/>
128
  </li>
129
  <li>
130
+ <label class="bp-media-label" for="wp_admin_pwd"><?php _e('Your WP Admin password:', 'rtmedia'); ?></label><input class="bp-media-input" id="wp_admin_pwd" type="password" name="wp_admin_pwd" value="<?php echo (isset($_REQUEST['wp_admin_pwd'])) ? esc_attr(stripslashes(trim($_REQUEST['wp_admin_pwd']))) : ''; ?>"/>
131
  </li>
132
  <li>
133
+ <label class="bp-media-label" for="ssh_ftp_host"><?php _e('Your SSH / FTP host:', 'rtmedia'); ?></label><input class="bp-media-input" id="ssh_ftp_host" type="text" name="ssh_ftp_host" value="<?php echo (isset($_REQUEST['ssh_ftp_host'])) ? esc_attr(stripslashes(trim($_REQUEST['ssh_ftp_host']))) : ''; ?>"/>
134
  </li>
135
  <li>
136
+ <label class="bp-media-label" for="ssh_ftp_username"><?php _e('Your SSH / FTP login:', 'rtmedia'); ?></label><input class="bp-media-input" id="ssh_ftp_username" type="text" name="ssh_ftp_username" value="<?php echo (isset($_REQUEST['ssh_ftp_username'])) ? esc_attr(stripslashes(trim($_REQUEST['ssh_ftp_username']))) : ''; ?>"/>
137
  </li>
138
  <li>
139
+ <label class="bp-media-label" for="ssh_ftp_pwd"><?php _e('Your SSH / FTP password:', 'rtmedia'); ?></label><input class="bp-media-input" id="ssh_ftp_pwd" type="password" name="ssh_ftp_pwd" value="<?php echo (isset($_REQUEST['ssh_ftp_pwd'])) ? esc_attr(stripslashes(trim($_REQUEST['ssh_ftp_pwd']))) : ''; ?>"/>
140
  </li>
141
  </ul>
142
  </div><!-- .submit-bug-box --><?php } ?>
152
 
153
  /**
154
  *
155
+ * @global type $rtmedia
156
  */
157
  public function submit_request() {
158
+ global $rtmedia;
159
  $form_data = wp_parse_args($_POST['form_data']);
160
  if ($form_data['request_type'] == 'premium_support') {
161
  $mail_type = 'Premium Support';
162
+ $title = __('rtMedia Premium Support Request from', 'rtmedia');
163
  } elseif ($form_data['request_type'] == 'new_feature') {
164
  $mail_type = 'New Feature Request';
165
+ $title = __('rtMedia New Feature Request from', 'rtmedia');
166
  } elseif ($form_data['request_type'] == 'bug_report') {
167
  $mail_type = 'Bug Report';
168
+ $title = __('rtMedia Bug Report from', 'rtmedia');
169
  } else {
170
  $mail_type = 'Bug Report';
171
+ $title = __('rtMedia Contact from', 'rtmedia');
172
  }
173
  $message = '<html>
174
  <head>
229
  }
230
  $message .= '</table>';
231
  if ( $this->debug_info ) {
232
+ $message .= '<h3>'.__('Debug Info', 'rtmedia').'</h3>';
233
  $message .= '<table>';
234
  foreach ($this->debug_info as $configuration => $value) {
235
  $message .= '<tr>
242
  </html>';
243
  add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
244
  $headers = 'From: ' . $form_data['name'] . ' <' . $form_data['email'] . '>' . "\r\n";
245
+ if (wp_mail($rtmedia->support_email, '[rtmedia] ' . $mail_type . ' from ' . str_replace(array('http://', 'https://'), '', $form_data['website']), $message, $headers)) {
246
  if ($form_data['request_type'] == 'new_feature') {
247
+ echo '<p>' . __('Thank you for your Feedback/Suggestion.', 'rtmedia') . '</p>';
248
  } else {
249
+ echo '<p>' . __('Thank you for posting your support request.', 'rtmedia') . '</p>';
250
+ echo '<p>' . __('We will get back to you shortly.', 'rtmedia') . '</p>';
251
  }
252
  } else {
253
+ echo '<p>' . __('Your server failed to send an email.', 'rtmedia') . '</p>';
254
+ echo '<p>' . __('Kindly contact your server support to fix this.', 'rtmedia') . '</p>';
255
+ echo '<p>' . sprintf(__('You can alternatively create a support request <a href="%s">here</a>', 'rtmedia'), $rtmedia->support_url) . '</p>';
256
  }
257
  die();
258
  }
app/helper/RTMediaUploadException.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUploadException
5
+ *
6
+ * @author joshua
7
+ */
8
+ class RTMediaUploadException extends Exception
9
+ {
10
+ /**
11
+ *
12
+ * @var type
13
+ *
14
+ * Exception for Invalid context while uploading any media
15
+ */
16
+ var $upload_err_invalid_context = 9;
17
+
18
+ /**
19
+ *
20
+ * @param type $code
21
+ * @param type $msg
22
+ */
23
+ public function __construct($code,$msg=false) {
24
+ $message = $this->codeToMessage($code,$msg);
25
+ parent::__construct($message, $code);
26
+ }
27
+
28
+ /**
29
+ * Error specific Message generated for the exception depending upon the code passed.
30
+ * Native Error Codes defined in PHP core module are used for uploading a standard file
31
+ *
32
+ * @param type $code
33
+ * @param type $msg
34
+ * @return type
35
+ */
36
+ private function codeToMessage($code,$msg)
37
+ {
38
+ switch ($code) {
39
+ case UPLOAD_ERR_INI_SIZE:
40
+ case UPLOAD_ERR_FORM_SIZE:
41
+ $message = apply_filters('bp_media_file_size_error', __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','rtmedia'));
42
+ break;
43
+ case UPLOAD_ERR_NO_FILE:
44
+ $message = apply_filters('bp_media_file_null_error', __('No file was uploaded','rtmedia'));
45
+ break;
46
+ case UPLOAD_ERR_PARTIAL:
47
+ case UPLOAD_ERR_NO_TMP_DIR:
48
+ case UPLOAD_ERR_CANT_WRITE: $message = apply_filters('bp_media_file_internal_error', __('Uploade failed due to internal server error.','rtmedia'));
49
+ break;
50
+ case UPLOAD_ERR_EXTENSION:
51
+ $message = apply_filters('bp_media_file_extension_error', __('File type not allowed.','rtmedia'));
52
+ break;
53
+
54
+ case $this->upload_err_invalid_context:
55
+ $message = apply_filters('rtmedia_invalid_context_error', __('Invalid Context for upload.','rtmedia'));
56
+ break;
57
+ default:
58
+ $msg = $msg ? $msg : __('Unknown file upload error.','rtmedia');
59
+ $message = apply_filters('bp_media_file_unknown_error', $msg);
60
+ break;
61
+ }
62
+ return $message;
63
+ }
64
+ }
65
+
66
+ ?>
app/helper/db/RTDBModel.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTDBModel
5
+ * Base class for any Database Model like Media, Album etc.
6
+ *
7
+ * @author faishal
8
+ */
9
+ class RTDBModel {
10
+
11
+ /**
12
+ *
13
+ * @var type
14
+ *
15
+ * $table_name - database table linked to the model.
16
+ * All the queries will be fired on that table or with the join in this table.
17
+ * $per_page - number of rows per page to be displayed
18
+ */
19
+ public $table_name;
20
+ public $per_page;
21
+
22
+ /**
23
+ *
24
+ * @param string $table_name Table name for model
25
+ * @param boolean $withprefix Set true if $tablename is with prefix otherwise it will prepend wordpress prefix with "rt_"
26
+ */
27
+ function __construct($table_name, $withprefix = false, $per_page = 10) {
28
+ $this->set_table_name($table_name, $withprefix);
29
+ $this->set_per_page($per_page);
30
+ }
31
+
32
+ /**
33
+ *
34
+ * @global type $wpdb
35
+ * @param string $table_name
36
+ * @param type $withprefix
37
+ */
38
+ public function set_table_name($table_name, $withprefix = false) {
39
+ global $wpdb;
40
+ if (!$withprefix) {
41
+ $table_name = $wpdb->prefix . "rt_" . $table_name;
42
+ }
43
+ $this->table_name = $table_name;
44
+ }
45
+
46
+ /**
47
+ * set number of rows per page for pagination
48
+ * @param type $per_page
49
+ */
50
+ public function set_per_page($per_page) {
51
+ $this->per_page = $per_page;
52
+ }
53
+
54
+ /**
55
+ * Magic Method for getting DB rows by particular column.
56
+ * E.g., get_by_<columnName>(params)
57
+ * @global type $wpdb
58
+ * @param type $name - Added get_by_<coulmname>(value,pagging=true,page_no=1)
59
+ * @param type $arguments
60
+ * @return type result array
61
+ */
62
+ function __call($name, $arguments) {
63
+ $column_name = str_replace("get_by_", "", strtolower($name));
64
+ $paging = false;
65
+ $page = 1;
66
+ if ($arguments && !empty($arguments)) {
67
+ if (!isset($arguments[1])) {
68
+ $paging = true;
69
+ } else {
70
+ $paging = $arguments[1];
71
+ }
72
+
73
+ if (!isset($arguments[2])) {
74
+ $page = 1;
75
+ } else {
76
+ $page = $arguments[2];
77
+ }
78
+
79
+ $this->per_page = apply_filters("rt_db_model_per_page", $this->per_page, $this->table_name);
80
+ $return_array = Array();
81
+ $return_array["result"] = false;
82
+ global $wpdb;
83
+ $return_array["total"] = intval($wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM " . $this->table_name . " WHERE {$column_name} = %s", $arguments[0])));
84
+ if ($return_array["total"] > 0) {
85
+ $other = "";
86
+ if ($paging) {
87
+ $offset = ($page - 1) * $this->per_page;
88
+ if ($offset <= $return_array["total"]) {
89
+ $other = " LIMIT " . $offset . "," . $this->per_page;
90
+ }else{
91
+ return false;
92
+ }
93
+ }
94
+ //echo $wpdb->prepare("SELECT * FROM " . $this->table_name . " WHERE {$column_name} = %s {$other}", $arguments[0]);
95
+ $return_array["result"] = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $this->table_name . " WHERE {$column_name} = %s {$other}", $arguments[0]), ARRAY_A);
96
+ }
97
+ return $return_array;
98
+ } else {
99
+ return false;
100
+ }
101
+ }
102
+
103
+ /**
104
+ *
105
+ * @global type $wpdb
106
+ * @param type $row
107
+ * @return type
108
+ */
109
+ function insert($row) {
110
+ global $wpdb;
111
+ $insertdata =array();
112
+ foreach($row as $key=>$val){
113
+ if($val != NULL)
114
+ $insertdata[$key]=$val;
115
+ }
116
+
117
+ $wpdb->insert($this->table_name, $insertdata);
118
+ return $wpdb->insert_id;
119
+ }
120
+
121
+ /**
122
+ *
123
+ * @global type $wpdb
124
+ * @param type $data
125
+ * @param type $where
126
+ */
127
+ function update($data, $where) {
128
+ global $wpdb;
129
+ return $wpdb->update($this->table_name, $data, $where);
130
+ }
131
+
132
+ /**
133
+ * Get all the rows according to the columns set in $columns parameter.
134
+ * offset and rows per page can also be passed for pagination.
135
+ * @global type $wpdb
136
+ * @param type $columns
137
+ * @return type
138
+ */
139
+ function get($columns, $offset=false, $per_page=false, $order_by= 'id desc') {
140
+ $select = "SELECT * FROM {$this->table_name}";
141
+ $where = " where 2=2 " ;
142
+ foreach ($columns as $colname => $colvalue) {
143
+ $where .= " AND {$this->table_name}.{$colname} = '{$colvalue}'";
144
+ }
145
+ $sql = $select . $where ;
146
+
147
+ $sql .= " ORDER BY {$this->table_name}.$order_by";
148
+
149
+ if(is_integer($offset) && is_integer($per_page)) {
150
+ $sql .= ' LIMIT ' . $offset . ',' . $per_page;
151
+ }
152
+ global $wpdb;
153
+ return $wpdb->get_results($sql);
154
+ }
155
+
156
+ /**
157
+ *
158
+ * @global type $wpdb
159
+ * @param type $where
160
+ * @return type
161
+ */
162
+ function delete($where) {
163
+ global $wpdb;
164
+ return $wpdb->delete($this->table_name, $where);
165
+ }
166
+
167
+
168
+ }
app/helper/db/RTDBUpdate.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTDBUpdate
5
+ * Required : rt_plugin_info.php
6
+ * @author faishal
7
+ */
8
+ class RTDBUpdate {
9
+ /**
10
+ *
11
+ * @var type String
12
+ */
13
+ public $db_version;
14
+ public $install_db_version;
15
+ public $schema_path = '/../../schema/';
16
+ public $db_version_option_name;
17
+ public $rt_plugin_info;
18
+
19
+ /**
20
+ * Set db current and installed version and also plugin info in rt_plugin_info variable.
21
+ *
22
+ * @param type string $current_version Optional if not defined then will use plugin version
23
+ */
24
+ public function __construct($current_version = false) {
25
+ $this->rt_plugin_info = new rt_plugin_info(RTMEDIA_PATH.'index.php');
26
+ if ($current_version == false) {
27
+ $current_version = $this->rt_plugin_info->version;
28
+ }
29
+ $this->db_version = $current_version;
30
+ $this->db_version_option_name = $this->get_db_version_option_name();
31
+ $this->install_db_version = $this->get_install_db_version();
32
+ }
33
+
34
+ public function create_table($sql) {
35
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
36
+ dbDelta($sql);
37
+ }
38
+
39
+ public function get_db_version_option_name() {
40
+ return strtoupper("RT_" . str_replace("-", "_", sanitize_title($this->rt_plugin_info->name)) . "_DB_VERSIONS");
41
+ }
42
+
43
+ public function get_install_db_version() {
44
+ return get_site_option($this->db_version_option_name, "0.0");
45
+ }
46
+
47
+ public function check_upgrade() {
48
+ return version_compare($this->db_version, $this->install_db_version, '>');
49
+ }
50
+
51
+ public function do_upgrade() {
52
+ if (version_compare($this->db_version, $this->install_db_version, '>')) {
53
+ $path = realpath(__DIR__ . $this->schema_path);
54
+ if ($handle = opendir($path)) {
55
+ while (false !== ($entry = readdir($handle))) {
56
+ if ($entry != "." && $entry != "..") {
57
+ if (strpos($entry, ".schema") !== false && file_exists($path . "/" . $entry)) {
58
+ $this->create_table($this->genrate_sql($entry, file_get_contents($path . "/" . $entry)));
59
+ }
60
+ }
61
+ }
62
+ closedir($handle);
63
+ }
64
+ update_site_option($this->db_version_option_name, $this->db_version);
65
+ }
66
+ }
67
+
68
+ public function genrate_sql($file_name, $file_content) {
69
+ return sprintf($file_content, $this->genrate_table_name($file_name));
70
+ }
71
+
72
+ public function genrate_table_name($file_name) {
73
+ global $wpdb;
74
+ return $wpdb->prefix . "rt_" . str_replace(".schema", "", strtolower($file_name));
75
+ }
76
+
77
+ }
app/helper/db/rt_plugin_info.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of rt_plugin_info
5
+ *
6
+ * @author faishal
7
+ */
8
+ class rt_plugin_info {
9
+
10
+ //put your code here
11
+ public $plugin_path;
12
+ public $name; //'Name' - Name of the plugin, must be unique.
13
+ public $title; //'Title' - Title of the plugin and the link to the plugin's web site.
14
+ public $desctipriton; //'Description' - Description of what the plugin does and/or notes from the author.
15
+ public $authro; //'Author' - The author's name
16
+ public $authoruri; //'AuthorURI' - The authors web site address.
17
+ public $version; //'Version' - The plugin version number.
18
+ public $pluginuri; //'PluginURI' - Plugin web site address.
19
+ public $textdomain; //'TextDomain' - Plugin's text domain for localization.
20
+ public $domain_path; //'DomainPath' - Plugin's relative directory path to .mo files.
21
+ public $network; //'Network' - Boolean. Whether the plugin can only be activated network wide.
22
+ public $plugin_data;
23
+
24
+ public function __construct($path = NULL) {
25
+ $this->set_current_plugin_path($path);
26
+ $this->set_plugin_data();
27
+ }
28
+
29
+ function get_plugin_data() {
30
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
31
+ return @get_plugin_data($this->plugin_path);
32
+ }
33
+
34
+ function set_plugin_data() {
35
+ $this->plugin_data = $this->get_plugin_data();
36
+ $this->name = $this->plugin_data["Name"];
37
+ $this->title = $this->plugin_data["Title"];
38
+ $this->desctipriton = $this->plugin_data["Description"];
39
+ $this->author = $this->plugin_data["Author"];
40
+ $this->authoruri = $this->plugin_data["AuthorURI"];
41
+ $this->version = $this->plugin_data["Version"];
42
+ $this->pluginuri = $this->plugin_data["PluginURI"];
43
+ $this->textdomain = $this->plugin_data["TextDomain"];
44
+ $this->domain_path = $this->plugin_data["DomainPath"];
45
+ $this->network = $this->plugin_data["Network"];
46
+ }
47
+
48
+ function set_current_plugin_path($path) {
49
+ if ($path != NULL)
50
+ $this->plugin_path = $path;
51
+ else
52
+ $this->plugin_path = realpath(plugin_dir_path(__FILE__) . "../../index.php");
53
+ }
54
+
55
+ }
56
+
57
+ ?>
app/helper/rtDimensions.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 rtfDimension
10
+ *
11
+ * @author udit
12
+ */
13
+ class rtDimensions extends rtForm {
14
+
15
+ private $element_id;
16
+
17
+ private static $id_count = 0;
18
+
19
+ private static $default_class = "rt-form-dimension";
20
+
21
+ private function get_default_id() {
22
+ return self::$id_count;
23
+ }
24
+
25
+ private function update_default_id() {
26
+ self::$id_count ++;
27
+ }
28
+
29
+ private function get_default_class() {
30
+ return self::$default_class;
31
+ }
32
+
33
+ private function embedd_class( $element, $class = null ) {
34
+
35
+ $html = 'class = "' . $this->get_default_class();
36
+
37
+ if( isset( $class ) ) {
38
+
39
+ if( is_array( $class ) )
40
+ $html .= ' ' . implode(" ", $class);
41
+ else
42
+ throw new rtFormsInvalidArgumentsException( "class [". $element ."]" );
43
+ }
44
+ $html .= '"';
45
+
46
+ return $html;
47
+ }
48
+
49
+
50
+ protected function generate_dimensions( $attributes ) {
51
+
52
+ $element = "rtDimension";
53
+ global $rtmedia;
54
+ $defaults = array(
55
+ 'desc' => '',
56
+ 'show_desc' => false
57
+ );
58
+
59
+ $attributes = wp_parse_args($attributes, $defaults);
60
+ extract($attributes);
61
+
62
+ $html = '<div ';
63
+
64
+ if( isset($attributes['id']) )
65
+ $html .= 'id="' . $attributes['id'] . '" ';
66
+ else {
67
+ $html .= 'id="' . $this->get_default_class () . '-' . $this->get_default_id () . '" ';
68
+ $this->update_default_id();
69
+ }
70
+
71
+ if( isset($attributes['class']) )
72
+ $html .= self::embedd_class($element, $attributes['class']);
73
+ else
74
+ $html .= self::embedd_class($element);
75
+ $html .= '>';
76
+
77
+ $html .= parent::get_number(array(
78
+ 'name' => "rtmedia-options[{$key}_width]",
79
+ 'value' => $width,
80
+ 'class' => array("small-text large-offset-1"),
81
+ 'show_desc' => $show_desc
82
+ ));
83
+
84
+ if (isset($height)) {
85
+ $html .= parent::get_number(array(
86
+ 'name' => "rtmedia-options[{$key}_height]",
87
+ 'value' => $height,
88
+ 'class' => array("small-text large-offset-1"),
89
+ 'show_desc' => $show_desc
90
+ ));
91
+ }
92
+
93
+ if(isset($crop)) {
94
+ $html .= parent::get_checkbox(array(
95
+ 'name' => "rtmedia-options[{$key}_crop]",
96
+ 'rtForm_options' => array(array(
97
+ '' => 1, //label would be blank
98
+ 'checked' => $crop
99
+ )),
100
+ 'class' => array("large-offset-1"),
101
+ 'show_desc' => $show_desc
102
+ ));
103
+ }
104
+
105
+ if ($desc && $show_desc)
106
+ $html .= '<span class="clearfix large-offset-3 description">' . $desc . '</span>';
107
+
108
+ $html .= '</div>';
109
+
110
+ if( isset($attributes['label']) )
111
+ $html = parent::enclose_label('container', $html, $attributes['label']);
112
+
113
+ return $html;
114
+ }
115
+
116
+ public function get_dimensions( $attributes = '' ) {
117
+
118
+ return $this->generate_dimensions($attributes);
119
+ }
120
+ }
121
+
122
+ ?>
app/helper/rtForm.php ADDED
@@ -0,0 +1,648 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 rtForms
10
+ *
11
+ * @author udit
12
+ */
13
+
14
+ if(!class_exists("rtForm")) {
15
+
16
+ class rtForm {
17
+
18
+
19
+ private $element_id;
20
+ /**
21
+ * default id counts
22
+ * if id for any element is not given then these count will be used in id generation
23
+ */
24
+ private static $id_counts = array(
25
+ "rtText" => 0,
26
+ "rtNumber" => 0,
27
+ "rtRadio" => 0,
28
+ "rtCheckbox" => 0,
29
+ "rtSelect" => 0,
30
+ "rtTextarea" => 0,
31
+ "rtHidden" => 0,
32
+ "rtWysiwyg" => 0
33
+ );
34
+
35
+ private static $default_classes = array(
36
+ "rtText" => "rt-form-text",
37
+ "rtNumber" => "rt-form-number",
38
+ "rtRadio" => "rt-form-radio",
39
+ "rtCheckbox" => "rt-form-checkbox",
40
+ "rtSelect" => "rt-form-select",
41
+ "rtTextarea" => "rt-form-textarea",
42
+ "rtHidden" => "rt-form-hidden",
43
+ "rtWysiwyg" => "rt-form-wysiwyg"
44
+ );
45
+
46
+
47
+ private function get_default_id($element) {
48
+ return self::$id_counts[$element];
49
+ }
50
+
51
+ private function update_default_id($element) {
52
+ self::$id_counts[$element] ++;
53
+ }
54
+
55
+ private function get_default_class($element) {
56
+ return self::$default_classes[$element];
57
+ }
58
+
59
+
60
+ private function embedd_class($element, $class = NULL) {
61
+
62
+ $html = 'class="' . $this->get_default_class($element);
63
+
64
+ if( isset( $class ) ) {
65
+
66
+ if( is_array( $class ) )
67
+ $html .= ' ' . implode(" ", $class);
68
+ else
69
+ throw new rtFormInvalidArgumentsException( "class [". $element ."]" );
70
+ }
71
+ $html .= '" ';
72
+
73
+ return $html;
74
+ }
75
+
76
+ private function generate_element_id($element, $id = NULL) {
77
+
78
+ $html = 'id="';
79
+ if( isset( $id ) ) {
80
+ $html .= $id . '"';
81
+ $this->element_id = $id;
82
+ } else {
83
+ $html .= $this->get_default_class($element) . "-" . $this->get_default_id($element) . '"';
84
+ $this->element_id = $this->get_default_class($element) . "-" . $this->get_default_id($element);
85
+ $this->update_default_id($element);
86
+ }
87
+
88
+ return $html;
89
+ }
90
+
91
+ private function generate_element_name($element, $multiple, $name) {
92
+
93
+ $html = 'name="';
94
+ if( $multiple ) {
95
+
96
+ $html .= isset( $name ) ? $name . '[]' : $element . '[]';
97
+
98
+ // for select - add multiple = multiple
99
+ if( $element == "rtSelect" ) {
100
+ $html .= 'multiple = "multiple"';
101
+ }
102
+ }
103
+ else
104
+ $html .= isset( $name ) ? $name : $element;
105
+ $html .= '"';
106
+
107
+ return $html;
108
+ }
109
+
110
+ private function generate_element_value($element, $attributes) {
111
+
112
+ $html = '';
113
+ switch( $element ) {
114
+ case "rtHidden"://hidden
115
+ case "rtNumber"://number
116
+ case "rtText" : //text
117
+ $html .= 'value="';
118
+ $html .= ( isset($attributes['value']) ) ? $attributes['value'] : '';
119
+ $html .= '" ';
120
+ break;
121
+
122
+ case "rtTextarea" : /**textarea
123
+ * no process --- handled in between the start tab and end tag.
124
+ * <textarea> value </textarea>
125
+ */
126
+ break;
127
+
128
+ case "rtCheckbox" : //checkbox
129
+ case "rtRadio" ://radio
130
+ $html .= 'value = "' . $attributes['value'] . '">';
131
+ break;
132
+ }
133
+ return $html;
134
+ }
135
+
136
+ private function generate_element_desc($attributes) {
137
+
138
+ if( isset($attributes['desc']) ) {
139
+
140
+ $html = '<span class="clearfix large-offset-3 description">' . $attributes['desc'] . '</span>';
141
+
142
+ return $html;
143
+ }
144
+
145
+ return "";
146
+ }
147
+
148
+ private function embedd_misc_attributes($misc) {
149
+ $html = '';
150
+
151
+ return $html;
152
+ }
153
+
154
+ private function processAttributes($element, $attributes, $container = false) {
155
+
156
+ /* generating the id on its own if not provided otherwise taken from the parameter provided */
157
+ if( isset($attributes['id']) )
158
+ $html = $this->generate_element_id($element, $attributes['id']) . ' ';
159
+ else
160
+ $html = $this->generate_element_id($element) . ' ';
161
+
162
+ /* name attrbute according to multiple flag */
163
+ $multiple = ( isset($attributes['multiple']) && $attributes['multiple'] ) ? true : false;
164
+ $name = ( isset($attributes['name']) ) ? $attributes['name'] : $element;
165
+ $html .= $this->generate_element_name($element, $multiple, $name) . ' ';
166
+
167
+ /*
168
+ * list down all the classes provided along with the default class of rtForms.
169
+ * default class of rtForms will always be attached irrespective of the attributes provided.
170
+ */
171
+ if(!$container) {
172
+
173
+ if(isset($attributes['class']))
174
+ $html .= $this->embedd_class($element, $attributes['class']);
175
+ else
176
+ $html .= $this->embedd_class($element);
177
+ }
178
+
179
+ if(isset($attributes['misc']) && is_array($attributes['misc']))
180
+ $html.= $this->embedd_misc_attributes($attributes['misc']);
181
+
182
+ $html .= $this->generate_element_value($element, $attributes);
183
+
184
+ return $html;
185
+ }
186
+
187
+ private function container_enclosed_elements($element, $attrib, $rtForm_options) {
188
+
189
+ $html = '';
190
+ $size = count($rtForm_options);
191
+ if( isset($attrib['id']) )
192
+ $id = $attrib['id'];
193
+
194
+ foreach ($rtForm_options as $opt) {
195
+
196
+ if( isset($attrib['id']) && $size>1 ) {
197
+ $attrib['id'] = $id . "-" . $this->get_default_id($element);
198
+ $this->update_default_id($element);
199
+ }
200
+
201
+ foreach ((array)$opt as $key => $val) {
202
+
203
+ if($key == "checked")
204
+ $attrib['checked'] = $val;
205
+ else if($key == "selected")
206
+ $attrib['selected'] = $val;
207
+ else if($key == "desc")
208
+ $attrib['desc'] = $val;
209
+ else if($key == "id")
210
+ $attrib['id'] = $val;
211
+ else {
212
+ $attrib['key'] = $key;
213
+ $attrib['value'] = $val;
214
+ }
215
+ }
216
+
217
+ $checked = (isset($attrib['checked']) && $attrib['checked']) ? "checked=checked" : "";
218
+ if( isset($attrib['switch']) && $attrib['switch'])
219
+ $switch = 'data-toggle="switch"';
220
+ else
221
+ $switch = '';
222
+
223
+ switch($element) {
224
+ case "rtRadio" :
225
+ $data = '<input type="radio" ' . $checked . " ";
226
+ break;
227
+ case "rtCheckbox" :
228
+ $data = '<input type="checkbox" ' . $checked . " " . $switch . " ";
229
+ break;
230
+ case "rtSelect" :
231
+ $selected = ($attrib['selected']) ? "selected=selected" : "";
232
+ $data = '<option value="' . $attrib['value'] . '"' . $selected . '>' . $attrib['key'] . '</option><br />';
233
+ break;
234
+ }
235
+
236
+ if($element != "rtSelect") {
237
+ $data .= $this->processAttributes($element, $attrib, true);
238
+
239
+ if( isset($attrib['switch_square']) && $attrib['switch_square'] ) {
240
+
241
+ $data = '<div class="rt-switch switch-square" data-on-label="<i class=\'fui-check\'></i>" data-off-label="<i class=\'fui-cross\'></i>">' . $data . '</div>';
242
+
243
+ } else if( (isset($attrib['switch']) && $attrib['switch']) ||
244
+ (isset($attrib['switch_square']) && $attrib['switch_square']) ) {
245
+
246
+ if( $size > 1 )
247
+ $data = '<div>' . $this->enclose_label($element, $data, $attrib['key']) . '</div>';
248
+ else
249
+ $data = $this->enclose_label($element, $data, $attrib['key']);
250
+
251
+ } else
252
+ $data = $this->enclose_label($element, $data, $attrib['key']);
253
+
254
+ $data .= '<br>';
255
+ }
256
+
257
+ $html .= $data;
258
+
259
+ unset($attrib['id']);
260
+ unset($attrib['key']);
261
+ unset($attrib['value']);
262
+ }
263
+ return $html;
264
+ }
265
+
266
+ private function parse_multiple_options($element, $attributes) {
267
+
268
+ if( is_array($attributes) ) {
269
+
270
+ if( isset($attributes['rtForm_options']) && is_array($attributes['rtForm_options']) ) {
271
+
272
+ $attribKeys = array_keys($attributes);
273
+ $attrib = array();
274
+
275
+ foreach ($attribKeys as $key) {
276
+ if( $key != "rtForm_options" )
277
+ $attrib[$key] = $attributes[$key];
278
+ }
279
+
280
+ $rtForm_options = (array) $attributes['rtForm_options'];
281
+
282
+ return array( 'attrib' => $attrib, 'rtForm_options' => $rtForm_options );
283
+ } else
284
+ throw new rtFormInvalidArgumentsException( "rtForm_options [" . $element . "]" );
285
+ } else
286
+ throw new rtFormInvalidArgumentsException( "attributes" );
287
+ }
288
+
289
+ protected function enclose_label($element, $html, $label) {
290
+
291
+ $data = '<label for="' . $this->element_id . '">';
292
+
293
+ if( $element == "rtRadio" || $element == "rtCheckbox" )
294
+ $data .= $html . ' ' . $label;
295
+ else
296
+ $data .= $label . ' ' . $html;
297
+
298
+ $data .= '</label>';
299
+
300
+ return $data;
301
+ }
302
+
303
+
304
+ protected function generate_textbox($attributes) {
305
+
306
+ $element = 'rtText';
307
+ if( is_array( $attributes ) ) {
308
+
309
+ /* Starting the input tag */
310
+ $html = '<input type="text" ';
311
+
312
+ /* generating attributes */
313
+ $html .= $this->processAttributes($element, $attributes);
314
+
315
+ /* ending the tag */
316
+ $html .= ' />';
317
+
318
+ if( isset($attributes['label']) )
319
+ $html = $this->enclose_label($element, $html, $attributes['label']);
320
+
321
+ if( isset($attributes['show_desc']) && $attributes['show_desc'] )
322
+ $html .= $this->generate_element_desc($attributes);
323
+
324
+ return $html;
325
+ } else
326
+ throw new rtFormInvalidArgumentsException( "attributes" );
327
+ }
328
+
329
+ public function get_textbox( $attributes = '' ) {
330
+
331
+ return $this->generate_textbox($attributes);
332
+ }
333
+
334
+
335
+ protected function generate_number($attributes) {
336
+
337
+ $element = 'rtNumber';
338
+ if( is_array( $attributes ) ) {
339
+
340
+ /* Starting the input tag */
341
+ $html = '<input type="number" ';
342
+
343
+ /* generating attributes */
344
+ $html .= $this->processAttributes($element, $attributes);
345
+
346
+ /* ending the tag */
347
+ $html .= ' />';
348
+
349
+ if( isset($attributes['label']) )
350
+ $html = $this->enclose_label($element, $html, $attributes['label']);
351
+
352
+ if( isset($attributes['show_desc']) && $attributes['show_desc'] )
353
+ $html .= $this->generate_element_desc($attributes);
354
+
355
+ return $html;
356
+ } else
357
+ throw new rtFormInvalidArgumentsException( "attributes" );
358
+ }
359
+
360
+ public function get_number( $attributes = '' ) {
361
+
362
+ return $this->generate_number($attributes);
363
+ }
364
+
365
+
366
+ protected function generate_hidden($attributes) {
367
+
368
+ $element = 'rtHidden';
369
+ if( is_array( $attributes ) ) {
370
+
371
+ /* Starting the input tag */
372
+ $html = '<input type="hidden" ';
373
+
374
+ /* generating attributes */
375
+ $html .= $this->processAttributes($element, $attributes);
376
+
377
+ /* ending the tag */
378
+ $html .= ' />';
379
+
380
+ if( isset($attributes['label']) )
381
+ $html = $this->enclose_label($element, $html, $attributes['label']);
382
+
383
+ if( isset($attributes['show_desc']) && $attributes['show_desc'] )
384
+ $html .= $this->generate_element_desc($attributes);
385
+
386
+ return $html;
387
+ } else
388
+ throw new rtFormInvalidArgumentsException( "attributes" );
389
+ }
390
+
391
+ public function get_hidden( $attributes = '' ) {
392
+
393
+ return $this->generate_hidden($attributes);
394
+ }
395
+
396
+
397
+ protected function generate_textarea($attributes) {
398
+
399
+ $element = 'rtTextarea';
400
+ if( is_array( $attributes ) ) {
401
+
402
+ $html = '<textarea ';
403
+ $html .= $this->processAttributes($element, $attributes);
404
+ $html .= '>';
405
+
406
+ $html .= (isset($attributes['value'])) ? $attributes['value'] : "" ;
407
+
408
+ $html .= '</textarea>';
409
+
410
+ if( isset($attributes['label']) )
411
+ $html = $this->enclose_label($element, $html, $attributes['label']);
412
+
413
+ if( isset($attributes['show_desc']) && $attributes['show_desc'] )
414
+ $html .= $this->generate_element_desc($attributes);
415
+
416
+ return $html;
417
+ } else
418
+ throw new rtFormInvalidArgumentsException( "attributes" );
419
+ }
420
+
421
+ public function get_textarea( $attributes = '' ) {
422
+
423
+ return $this->generate_textarea($attributes);
424
+ }
425
+
426
+
427
+
428
+ /* wysiwyg
429
+ *
430
+ * pending as of now.
431
+ *
432
+ * functionality and flow needs to be decided
433
+ *
434
+ * */
435
+ // protected function generate_wysiwyg($attributes) {
436
+ //
437
+ // $element = 'rtWysiwyg';
438
+ // if( is_array($attributes) ) {
439
+ //
440
+ // $id = isset( $attributes['id'] ) ? $attributes['id'] : $this->get_default_class($element) . "-" . $this->get_default_id($element);
441
+ // $name = isset( $attributes['name'] ) ? $attributes['name'] : $element;
442
+ // if(isset($attributes['class']))
443
+ // $class = $this->embedd_class($element, $attributes['class']);
444
+ // else
445
+ // $class = $this->embedd_class($element);
446
+ // $value = isset( $attributes['value'] ) ? $attributes['value'] : "";
447
+ //
448
+ // echo '<label for="' . $id . '">';
449
+ // wp_editor( $value, $id, array('textarea_name' => $name, 'editor_class' => $class) );
450
+ // echo '</label>';
451
+ // } else
452
+ // throw new rtFormInvalidArgumentsException( "attributes" );
453
+ // }
454
+ //
455
+ // public function get_wysiwyg( $attributes = '' ) {
456
+ //
457
+ // ob_start();
458
+ // $this->generate_wysiwyg($attributes);
459
+ // return ob_get_clean();
460
+ // }
461
+
462
+
463
+ protected function generate_radio($attributes) {
464
+
465
+ $element = 'rtRadio';
466
+ $html = '';
467
+
468
+ $meta = $this->parse_multiple_options($element, $attributes);
469
+ $html .= $this->container_enclosed_elements($element, $meta['attrib'], $meta['rtForm_options']);
470
+
471
+ if( isset($attributes['show_desc']) && $attributes['show_desc'] )
472
+ $html .= $this->generate_element_desc($attributes);
473
+
474
+ $container = '<span ';
475
+ if(isset($attributes['class']))
476
+ $container .= $this->embedd_class($element, $attributes['class']);
477
+ else
478
+ $container .= $this->embedd_class($element);
479
+ $container .= '>';
480
+
481
+ $container .= $html;
482
+
483
+ $container .= '</span>';
484
+
485
+ // if( isset($attributes['label']) )
486
+ // $container = $this->enclose_label('container', $container, $attributes['label']);
487
+
488
+ return $container;
489
+ }
490
+
491
+ public function get_radio( $attributes = '' ) {
492
+
493
+ return $this->generate_radio($attributes);
494
+ }
495
+
496
+
497
+ protected function generate_checkbox($attributes) {
498
+
499
+ $element = 'rtCheckbox';
500
+ $html = '';
501
+
502
+ $meta = $this->parse_multiple_options($element, $attributes);
503
+ $html .= $this->container_enclosed_elements($element, $meta['attrib'], $meta['rtForm_options']);
504
+
505
+ if( isset($attributes['show_desc']) && $attributes['show_desc'] )
506
+ $html .= $this->generate_element_desc($attributes);
507
+
508
+ $container = '<span ';
509
+ if(isset($attributes['class']))
510
+ $container .= $this->embedd_class($element, $attributes['class']);
511
+ else
512
+ $container .= $this->embedd_class($element);
513
+ $container .= '>';
514
+
515
+ $container .= $html;
516
+
517
+ $container .= '</span>';
518
+
519
+ // if( isset($attributes['label']) )
520
+ // $container = $this->enclose_label('container', $container, $attributes['label']);
521
+
522
+ return $container;
523
+ }
524
+
525
+ public function get_checkbox( $attributes = '' ) {
526
+
527
+ return $this->generate_checkbox($attributes);
528
+ }
529
+
530
+ public function get_switch($attributes = '') {
531
+
532
+ $attributes['switch'] = true;
533
+ return $this->generate_checkbox($attributes);
534
+ }
535
+
536
+ public function get_switch_square($attributes = '') {
537
+
538
+ $attributes['switch_square'] = true;
539
+ return $this->generate_checkbox($attributes);
540
+ }
541
+
542
+ protected function generate_select($attributes) {
543
+
544
+ if( is_array($attributes) ) {
545
+ $element = 'rtSelect';
546
+ $html = '<select ';
547
+
548
+ if(isset($attributes['id']))
549
+ $id = $attributes['id'];
550
+ else {
551
+ $id = $element.$this->get_default_id ($element);
552
+ $this->update_default_id($element);
553
+ }
554
+ $html .= $this->generate_element_id($element, $id) . ' ';
555
+ $multiple = ( isset($attributes['multiple']) && $attributes['multiple'] ) ? true : false;
556
+ $name = ( isset($attributes['name']) ) ? $attributes['name'] : $element;
557
+ $html .= $this->generate_element_name($element, $multiple, $name) . ' ';
558
+ if(isset($attributes['class']))
559
+ $html .= $this->embedd_class($element, $attributes['class']);
560
+ else
561
+ $html .= $this->embedd_class($element);
562
+
563
+ $html .= '>';
564
+
565
+ $meta = $this->parse_multiple_options($element, $attributes);
566
+ $html .= $this->container_enclosed_elements($element, $meta['attrib'], $meta['rtForm_options']);
567
+
568
+ $html .= '</select>';
569
+
570
+ if( isset($attributes['label']) )
571
+ $html = $this->enclose_label($element, $html, $attributes['label']);
572
+
573
+ if( isset($attributes['show_desc']) && $attributes['show_desc'] )
574
+ $html .= $this->generate_element_desc($attributes);
575
+
576
+ return $html;
577
+ } else
578
+ throw new rtFormInvalidArgumentsException( "attributes" );
579
+
580
+ }
581
+
582
+ public function get_select( $attributes = '' ) {
583
+
584
+ return $this->generate_select($attributes);
585
+ }
586
+ }
587
+ }
588
+
589
+ //if(!isset($obj))
590
+ // $obj = new rtForm();
591
+
592
+ //textbox test
593
+ /*echo $obj->get_textbox(array(
594
+ "id"=>"myid",
595
+ "label" => "mylabel",
596
+ "name"=>"myname",
597
+ "value"=>"myval",
598
+ "class"=> array("myclass")
599
+ ))."\n";*/
600
+
601
+
602
+ //textarea test
603
+ /*echo $obj->get_textarea(array(
604
+ "id"=>"myid",
605
+ "name"=>"myname",
606
+ "value"=>"myval",
607
+ "class"=> array("myclass")
608
+ ))."\n";*/
609
+
610
+
611
+ //radio test
612
+ /*echo $obj->get_radio(array(
613
+ "id"=>"myid",
614
+ "name"=>"myname",
615
+ "class"=>array("myclass"),
616
+ "rtForm_options"=>array(
617
+ "op1"=>1,
618
+ "op2"=>2,
619
+ "op3"=>3
620
+ )
621
+ ))."\n";
622
+ */
623
+
624
+ //checkbox test
625
+ /*echo $obj->get_checkbox(array(
626
+ "id"=>"myid",
627
+ "name"=>"myname",
628
+ "class"=>array("myclass"),
629
+ "rtForm_options"=>array(
630
+ "op1"=>1,
631
+ "op2"=>2,
632
+ "op3"=>3
633
+ )
634
+ ))."\n";*/
635
+
636
+ // select test
637
+ /*echo $obj->get_select(array(
638
+ "id"=>"myid",
639
+ "name"=>"myname",
640
+ "class"=>array("myclass"),
641
+ "rtForm_options"=>array(
642
+ "op1"=>1,
643
+ "op2"=>2,
644
+ "op3"=>3
645
+ )
646
+ ))."\n";*/
647
+
648
+ ?>
app/helper/rtFormInvalidArgumentsException.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 rtException
10
+ *
11
+ * @author udit
12
+ */
13
+
14
+ if(!class_exists("rtFormsInvalidArgumentsException")) {
15
+
16
+ class rtFormInvalidArgumentsException extends Exception {
17
+
18
+ public function __construct($msg) {
19
+
20
+ //Error Message
21
+ $errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile() .
22
+ ' : <b>The method expects an array in arguments for ' . $msg . ' provided.</b>';
23
+
24
+ echo $errorMsg;
25
+ }
26
+ }
27
+ }
28
+
29
+ ?>
app/helper/rtProgress.php CHANGED
@@ -32,6 +32,8 @@ class rtProgress {
32
  }
33
 
34
  function progress($progress,$total){
 
 
35
  return ($progress/$total)*100;
36
  }
37
 
32
  }
33
 
34
  function progress($progress,$total){
35
+ if($total<1)
36
+ return 100;
37
  return ($progress/$total)*100;
38
  }
39
 
app/importers/BPMediaBPAlbumImporter.php DELETED
@@ -1,87 +0,0 @@
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 BPMediaBPAlbumImporter
10
- *
11
- * @author saurabh
12
- */
13
- class BPMediaBPAlbumImporter extends BPMediaImporter {
14
-
15
-
16
- function __construct() {
17
- parent::__construct();
18
- $this->active = $this->_active( 'bp-album/loader.php' );
19
-
20
- if($this->active!=-1){
21
- $this->update_table();
22
- $this->set_total_count();
23
- }
24
- }
25
-
26
- function update_table() {
27
- global $wpdb;
28
- $wpdb->query(
29
- "ALTER TABLE {$wpdb->base_prefix}bp_album ADD COLUMN
30
- import_status TINYINT (1) NOT NULL DEFAULT 0"
31
- );
32
- }
33
-
34
- function create_album($album_name = 'BP Album'){
35
- parent::create_album($album_name);
36
- }
37
-
38
- function get_total_count() {
39
- global $wpdb;
40
- $table = $wpdb->base_prefix . 'bp_album';
41
- if ( $this->table_exists( $table ) && $this->active != -1 ) {
42
- return $wpdb->query( "SELECT * FROM {$table}" );
43
- }
44
- }
45
-
46
- function set_total_count(){
47
- $total_count = $this->get_total_count();
48
- update_site_option('bp_album_import_total_count',$total_count);
49
- $this->import_steps = ceil( floatval( $total_count ) / 10 );
50
- update_site_option('bp_album_import_total_count',$total_count);
51
-
52
- }
53
-
54
- static function batch_import($offset=0){
55
- global $wpdb;
56
- $table = $wpdb->base_prefix . 'bp_album';
57
- $bp_album_data = $wpdb->get_results(
58
- "SELECT * FROM {$table} WHERE import_status='0'
59
- LIMIT 10 OFFSET {$offset}"
60
- );
61
-
62
- return $bp_album_data;
63
-
64
- }
65
-
66
- static function bpmedia_ajax_import_callback(){
67
-
68
- $offset = 0;//$_GET['offset'];
69
-
70
- $bp_album_data = BPMediaBPAlbumImporter::batch_import($offset);
71
-
72
- foreach ($bp_album_data as &$bp_album_item){
73
- $album_id=BPMediaBPAlbumImporter::create_album('',$bp_album_item->owner_id);
74
- BPMediaImporter::add_media(
75
- $album_id,
76
- $bp_album_item->title,
77
- $bp_album_item->description,
78
- $bp_album_item->pic_org_path,
79
- $bp_album_item->privacy,
80
- $bp_album_item->owner_id
81
- );
82
- }
83
- }
84
-
85
- }
86
-
87
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/importers/BPMediaImporter.php CHANGED
@@ -104,7 +104,7 @@ class BPMediaImporter {
104
  global $wpdb;
105
  $bp_imported_media = new BPMediaHostWordpress();
106
  // add_filter('bp_media_force_hide_activity', create_function('', 'return true;'));
107
- $imported_media_id = $bp_imported_media->insert_media($title, $description, $album_id, 0, false, false, $files, $author_id, $album_name);
108
 
109
  wp_update_post($args = array('ID' => $imported_media_id, 'post_author' => $author_id));
110
 
104
  global $wpdb;
105
  $bp_imported_media = new BPMediaHostWordpress();
106
  // add_filter('bp_media_force_hide_activity', create_function('', 'return true;'));
107
+ $imported_media_id = $bp_imported_media->insertmedia($title, $description, $album_id, 0, false, false, $files, $author_id, $album_name);
108
 
109
  wp_update_post($args = array('ID' => $imported_media_id, 'post_author' => $author_id));
110
 
app/importers/RTMediaMigration.php ADDED
@@ -0,0 +1,1021 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of BuddyPress_Migration
5
+ *
6
+ * @author faishal
7
+ */
8
+ class RTMediaMigration {
9
+
10
+ public $bmp_table = "";
11
+
12
+ function __construct() {
13
+ global $wpdb;
14
+ $this->bmp_table = $wpdb->prefix . "rt_rtm_media";
15
+
16
+ add_action('admin_menu', array($this, 'menu'));
17
+ add_action('wp_ajax_bp_media_rt_db_migration', array($this, "migrate_to_new_db"));
18
+ if (isset($_REQUEST["force"]) && $_REQUEST["force"] === "true")
19
+ $pending = false;
20
+ else
21
+ $pending = get_site_option("rtMigration-pending-count");
22
+
23
+ if ($pending === false) {
24
+ $total = $this->get_total_count();
25
+ $done = $this->get_done_count();
26
+ $pending = $total - $done;
27
+ if ($pending < 0)
28
+ $pending = 0;
29
+ update_site_option("rtMigration-pending-count", $pending);
30
+ }
31
+ if ($pending > 0) {
32
+ if(!(isset($_REQUEST["page"]) && $_REQUEST["page"] == "rtmedia-migration"))
33
+ add_action('admin_notices', array(&$this, 'add_migration_notice'));
34
+ }
35
+ }
36
+
37
+ function add_migration_notice() {
38
+ $this->create_notice("<p><strong>rtMedia</strong> : Please Migrate your Database <a href='" . admin_url("admin.php?page=rtmedia-migration&force=true") . "'>Click Here</a>. </p>");
39
+ }
40
+
41
+ function create_notice($message, $type = "error") {
42
+ echo '<div class="' . $type . '">' . $message . '</div>';
43
+ }
44
+
45
+ static function table_exists($table) {
46
+ global $wpdb;
47
+
48
+ if ($wpdb->query("SHOW TABLES LIKE '" . $table . "'") == 1) {
49
+ return true;
50
+ }
51
+
52
+ return false;
53
+ }
54
+
55
+ function menu() {
56
+ add_submenu_page('rtmedia-settings', __('Migration', 'buddypress-media'), __('Migration', 'buddypress-media'), 'manage_options', 'rtmedia-migration', array($this, 'test'));
57
+ }
58
+
59
+ function get_total_count() {
60
+ global $wpdb;
61
+ if (function_exists("bp_core_get_table_prefix"))
62
+ $bp_prefix = bp_core_get_table_prefix();
63
+ else
64
+ $bp_prefix = "";
65
+ $sql_album_usercount = "select count(*) FROM $wpdb->usermeta where meta_key ='bp-media-default-album' ";
66
+
67
+ $_SESSION["migration_user_album"] = $wpdb->get_var($sql_album_usercount);
68
+ $count = intval($_SESSION["migration_user_album"]);
69
+
70
+ if ($this->table_exists($bp_prefix . "bp_groups_groupmeta")) {
71
+ $sql_album_groupcount = "select count(*) FROM {$bp_prefix}bp_groups_groupmeta where meta_key ='bp_media_default_album'";
72
+ $_SESSION["migration_group_album"] = $wpdb->get_var($sql_album_groupcount);
73
+ $count += intval($_SESSION["migration_group_album"]);
74
+ }
75
+ if ($this->table_exists($bp_prefix . "bp_activity")) {
76
+ //$sql_bpm_comment_count = "select count(*) from {$bp_prefix}bp_activity where component='activity' and type='activity_comment' and is_spam <> 1 and ;";
77
+ $sql_bpm_comment_count = "SELECT
78
+ count(id)
79
+ FROM
80
+ {$bp_prefix}bp_activity
81
+ where
82
+ type = 'activity_comment'
83
+ and is_spam <>1
84
+ and item_id in (select distinct
85
+ a.meta_value
86
+ from
87
+ $wpdb->postmeta a
88
+ left join
89
+ $wpdb->posts p ON (a.post_id = p.ID)
90
+ where
91
+ (NOT p.ID IS NULL)
92
+ and a.meta_key = 'bp_media_child_activity')";
93
+
94
+
95
+ //echo $sql_bpm_comment_count;
96
+
97
+ $_SESSION["migration_activity"] = $wpdb->get_var($sql_bpm_comment_count);
98
+ $count +=intval($_SESSION["migration_activity"]);
99
+ }
100
+
101
+ $sql = "select count(*)
102
+ from
103
+ {$wpdb->postmeta} a
104
+ left join
105
+ {$wpdb->postmeta} b ON ((a.post_id = b.post_id)
106
+ and (b.meta_key = 'bp_media_privacy'))
107
+ left join
108
+ {$wpdb->postmeta} c ON (a.post_id = c.post_id)
109
+ and (c.meta_key = 'bp_media_child_activity')
110
+ left join
111
+ {$wpdb->posts} p ON (a.post_id = p.ID)
112
+ where
113
+ a.post_id > 0 and (NOT p.ID IS NULL)
114
+ and a.meta_key = 'bp-media-key'";
115
+
116
+
117
+ $_SESSION["migration_media"] = $wpdb->get_var($sql);
118
+ $count += intval($_SESSION["migration_media"]);
119
+ // var_dump($_SESSION);
120
+ return $count;
121
+ }
122
+
123
+ function get_last_imported() {
124
+ $album = get_site_option("rtmedia-global-albums");
125
+ $album_id = $album[0];
126
+
127
+ global $wpdb;
128
+ $sql = "select a.post_ID
129
+ from
130
+ {$wpdb->postmeta} a left join
131
+ {$wpdb->posts} p ON (a.post_id = p.ID)
132
+ where
133
+ a.meta_key = 'bp-media-key' and (NOT p.ID IS NULL) and a.post_id not in (select media_id
134
+ from {$this->bmp_table} where blog_id = %d and media_id <> %d ) order by a.post_ID";
135
+ $sql = $wpdb->prepare($sql, get_current_blog_id(), $album_id);
136
+ $row = $wpdb->get_row($sql);
137
+ if ($row) {
138
+ return $row->post_ID;
139
+ } else {
140
+ return false;
141
+ }
142
+ }
143
+
144
+ function get_done_count($flag = false) {
145
+ global $wpdb;
146
+ $sql = "select count(*)
147
+ from {$this->bmp_table} where blog_id = %d and media_id in (select a.post_id
148
+ from
149
+ {$wpdb->postmeta} a
150
+ left join
151
+ {$wpdb->postmeta} b ON ((a.post_id = b.post_id)
152
+ and (b.meta_key = 'bp_media_privacy'))
153
+ left join
154
+ {$wpdb->postmeta} c ON (a.post_id = c.post_id)
155
+ and (c.meta_key = 'bp_media_child_activity')
156
+ left join
157
+ {$wpdb->posts} p ON (a.post_id = p.ID)
158
+ where
159
+ a.post_id > 0 and (NOT p.ID IS NULL)
160
+ and a.meta_key = 'bp-media-key')";
161
+
162
+ $media_count = $wpdb->get_var($wpdb->prepare($sql, get_current_blog_id()));
163
+ if ($flag)
164
+ return $media_count - 1;
165
+ $state = intval(get_site_option("rtmedia-migration", "0"));
166
+ if ($state == 5) {
167
+ $album_count = intval($_SESSION["migration_user_album"]);
168
+ $album_count += (isset($_SESSION["migration_group_album"])) ? intval($_SESSION["migration_group_album"]) : 0;
169
+ } else {
170
+ if ($state >0){
171
+ if (function_exists("bp_core_get_table_prefix"))
172
+ $bp_prefix = bp_core_get_table_prefix();
173
+ else
174
+ $bp_prefix = "";
175
+ $pending_count = "select count(*) from $wpdb->posts where post_type='bp_media_album' and ( ID in (select meta_value FROM $wpdb->usermeta where meta_key ='bp-media-default-album') ";
176
+ if ($this->table_exists($bp_prefix . "bp_groups_groupmeta")) {
177
+ $pending_count .= " or ID in (select meta_value FROM {$bp_prefix}bp_groups_groupmeta where meta_key ='bp_media_default_album')";
178
+ }
179
+ $pending_count .= ")";
180
+ $pending_count = $wpdb->get_var($pending_count);
181
+
182
+ $album_count = intval($_SESSION["migration_user_album"]);
183
+ $album_count += (isset($_SESSION["migration_group_album"])) ? intval($_SESSION["migration_group_album"]) : 0;
184
+ $album_count = $album_count - intval($pending_count);
185
+ }
186
+ else{
187
+ $album_count = 0;
188
+ }
189
+ }
190
+
191
+ $comment_sql = $wpdb->get_var("select count(*) from $wpdb->comments a where a.comment_post_ID in (select b.media_id from $this->bmp_table b left join
192
+ {$wpdb->posts} p ON (b.media_id = p.ID) where (NOT p.ID IS NULL) ) and a.comment_agent=''");
193
+ // echo $media_count . "--" . $album_count . "--" . $comment_sql;
194
+ return $media_count + $album_count + $comment_sql;
195
+ }
196
+
197
+ function return_migration() {
198
+ $total = $this->get_total_count();
199
+ $done = $this->get_done_count();
200
+ $pending = $total - $done;
201
+ if ($pending < 0) {
202
+ $pending = 0;
203
+ $done = $total;
204
+ }
205
+ if($done > $total){
206
+ $done = $total;
207
+ }
208
+ if($done == $total){
209
+ global $wp_rewrite;
210
+ //Call flush_rules() as a method of the $wp_rewrite object
211
+ $wp_rewrite->flush_rules(true);
212
+
213
+ }
214
+ update_site_option("rtMigration-pending-count", $pending);
215
+ $pending_time = $this->formatSeconds($pending);
216
+
217
+ echo json_encode(array("status" => true, "done" => $done, "total" => $total,"pending"=>$pending_time));
218
+ die();
219
+ }
220
+
221
+ function manage_album() {
222
+ $album = get_site_option("rtmedia-global-albums");
223
+ $stage = intval(get_site_option("rtmedia-migration", "0"));
224
+
225
+ $album_rt_id = $album[0];
226
+
227
+ $album_post_type = "rtmedia_album";
228
+
229
+ global $wpdb;
230
+
231
+ $album_id = $wpdb->get_var($wpdb->prepare("select media_id from $this->bmp_table where id = %d",$album_rt_id));
232
+
233
+ if (function_exists("bp_core_get_table_prefix"))
234
+ $bp_prefix = bp_core_get_table_prefix();
235
+ else
236
+ $bp_prefix = "";
237
+
238
+ if($stage < 1){
239
+ global $wpdb;
240
+ if (function_exists("bp_core_get_table_prefix"))
241
+ $bp_prefix = bp_core_get_table_prefix();
242
+ else
243
+ $bp_prefix = "";
244
+ $sql = $wpdb->prepare("update {$bp_prefix}bp_activity set content=replace(content,%s,%s) where id > 0;",'<ul class="bp-media-list-media">','<div class="rtmedia-activity-container"><ul class="rtmedia-list large-block-grid-3">');
245
+ $wpdb->get_row($sql);
246
+ $sql = $wpdb->prepare("update {$bp_prefix}bp_activity set content=replace(content,%s,%s) where id > 0;",'</ul>','</ul></div>');
247
+ $wpdb->get_row($sql);
248
+
249
+
250
+ $sql_group = "update $wpdb->posts set post_parent='{$album_id}' where post_parent in (select meta_value FROM $wpdb->usermeta where meta_key ='bp-media-default-album') ";
251
+ if ($this->table_exists($bp_prefix . "bp_groups_groupmeta")) {
252
+ $sql_group .= " or post_parent in (select meta_value FROM {$bp_prefix}bp_groups_groupmeta where meta_key ='bp_media_default_album')";
253
+ }
254
+ $wpdb->query($sql_group);
255
+ $stage = 1;
256
+ update_site_option("rtmedia-migration", $stage);
257
+ $this->return_migration();
258
+ }
259
+ if($stage < 2){
260
+ $sql_delete = "select * from $wpdb->posts where post_type='bp_media_album' and ID in (select meta_value FROM $wpdb->usermeta where meta_key ='bp-media-default-album') limit 10";
261
+ $results = $wpdb->get_results($sql_delete);
262
+ $delete_ids = "";
263
+ $sep = "";
264
+ foreach($results as $result){
265
+ $this->search_and_replace($result->guid, trailingslashit(get_rtmedia_user_link($result->post_author)). "media/" . $album_rt_id);
266
+ $delete_ids .= $sep . $result->ID;
267
+ $sep = ",";
268
+ }
269
+ if($delete_ids != "")
270
+ $wpdb->query("delete from $wpdb->posts where ID in ({$delete_ids})");
271
+ if(count($results) < 10){
272
+ $stage =2;
273
+ }
274
+ update_site_option("rtmedia-migration", $stage);
275
+ $this->return_migration();
276
+ }
277
+ if($stage < 3){
278
+ if ($this->table_exists($bp_prefix . "bp_groups_groupmeta")) {
279
+ $sql_delete = "select * from $wpdb->posts where post_type='bp_media_album' and ID in (select meta_value FROM {$bp_prefix}bp_groups_groupmeta where meta_key ='bp_media_default_album') limit 10";
280
+ $results = $wpdb->get_results($sql_delete);
281
+ $delete_ids = "";
282
+ $sep = "";
283
+ if($results){
284
+ foreach($results as $result){
285
+ $group_id = abs(intval(get_post_meta($result->ID, "bp-media-key",true)));
286
+ $this->search_and_replace(trailingslashit(get_rtmedia_group_link($group_id)). "albums/" . $result->ID, trailingslashit(get_rtmedia_group_link($group_id)). "media/" . $album_rt_id);
287
+ $delete_ids .= $sep . $result->ID;
288
+ $sep = ",";
289
+ }
290
+ if($delete_ids != "")
291
+ $wpdb->query("delete from $wpdb->posts where ID in ({$delete_ids})");
292
+ if(count($results) < 10){
293
+ $stage =3;
294
+ }
295
+ }else{
296
+ $stage =3;
297
+ }
298
+ update_site_option("rtmedia-migration", $stage);
299
+ $this->return_migration();
300
+ }else{
301
+ $stage =3;
302
+ update_site_option("rtmedia-migration", $stage);
303
+ $this->return_migration();
304
+ }
305
+ }
306
+
307
+
308
+ $sql = "update $wpdb->posts set post_type='{$album_post_type}' where post_type='bp_media_album'";
309
+ if ($wpdb->query($sql) !== false) {
310
+ update_site_option("rtmedia-migration", "5");
311
+ return true;
312
+ }
313
+ return false;
314
+ }
315
+
316
+ function test() {
317
+ if( !$this->table_exists($this->bmp_table) ){
318
+ $obj = new RTDBUpdate();
319
+ $obj->install_db_version = "0";
320
+ $obj->do_upgrade();
321
+ }
322
+ $prog = new rtProgress();
323
+ $total = $this->get_total_count();
324
+ $done = $this->get_done_count();
325
+ if($done >= $total){
326
+ $done = $total;
327
+ ?>
328
+ <!--<div class="error"><p> Please Update your <a href='<?php //admin_url("options-permalink.php") ?>'>Permalink</a> after migration.</p></div>-->
329
+ <?php }else{ ?>
330
+ <div class="error"><p> Please Backup your <strong>DATABASE</strong> and <strong>UPLOAD</strong> folder before Migration.</p></div>
331
+ <?php }
332
+
333
+ ?>
334
+
335
+ <div class="wrap">
336
+
337
+ <h2>rtMedia Migration</h2>
338
+ <h3><?php _e("It will migrate following things"); ?> </h3>
339
+ User Albums : <?php echo $_SESSION["migration_user_album"]; ?><br />
340
+ <?php if (isset($_SESSION["migration_group_album"])) { ?>
341
+ Groups Albums : <?php echo $_SESSION["migration_group_album"]; ?><br />
342
+ <?php } ?>
343
+ Media : <?php echo $_SESSION["migration_media"]; ?><br />
344
+ <?php if (isset($_SESSION["migration_activity"])) { ?>
345
+ Comments : <?php echo $_SESSION["migration_activity"]; ?><br />
346
+ <?php } ?>
347
+ <hr />
348
+
349
+ <?php
350
+ echo '<span class="pending">' . $this->formatSeconds($total - $done) . '</span><br />';
351
+ echo '<span class="finished">' . $done . '</span>/<span class="total">' . $total . '</span>';
352
+ echo '<img src="images/loading.gif" alt="syncing" id="rtMediaSyncing" style="display:none" />';
353
+
354
+ $temp = $prog->progress($done, $total);
355
+ $prog->progress_ui($temp, true);
356
+ ?>
357
+ <script type="text/javascript">
358
+ jQuery(document).ready(function(e){
359
+ if(db_total<1)
360
+ jQuery("#submit").attr('disabled',"disabled");
361
+ })
362
+ function db_start_migration(db_done, db_total) {
363
+
364
+
365
+ if (db_done < db_total) {
366
+ jQuery("#rtMediaSyncing").show();
367
+ jQuery.ajax({
368
+ url: rtmedia_admin_ajax,
369
+ type: 'post',
370
+ data: {
371
+ "action": "bp_media_rt_db_migration",
372
+ "done": db_done
373
+ },
374
+ success: function(sdata) {
375
+
376
+ try{
377
+ data = JSON.parse(sdata);
378
+ }catch(e){
379
+ jQuery("#submit").attr('disabled',"");
380
+ }
381
+ if (data.status) {
382
+ done = parseInt(data.done);
383
+ total = parseInt(data.total);
384
+ var progw = Math.ceil((done / total) * 100);
385
+ if (progw > 100) {
386
+ progw = 100;
387
+ }
388
+ ;
389
+ jQuery('#rtprogressbar>div').css('width', progw + '%');
390
+ jQuery('span.finished').html(done);
391
+ jQuery('span.total').html(total);
392
+ jQuery('span.pending').html(data.pending);
393
+ db_start_migration(done, total);
394
+ } else {
395
+ alert("Migration completed.");
396
+ jQuery("#rtMediaSyncing").hide();
397
+ }
398
+ },
399
+ error: function(){
400
+ alert("Error During Migration, Please Refresh Page then try again");
401
+ jQuery("#submit").removeAttr('disabled');
402
+ }
403
+ });
404
+ } else {
405
+ alert("Migration completed.");
406
+ jQuery("#rtMediaSyncing").hide();
407
+ }
408
+ }
409
+ var db_done = <?php echo $done; ?>;
410
+ var db_total = <?php echo $total; ?>;
411
+ jQuery(document).on('click', '#submit', function(e) {
412
+ e.preventDefault();
413
+
414
+ db_start_migration(db_done, db_total);
415
+ jQuery(this).attr('disabled', 'disabled');
416
+ });
417
+ </script>
418
+ <hr />
419
+ <input type="button" id="submit" value="start" class="button button-primary" />
420
+
421
+ </div>
422
+ <?php
423
+ }
424
+
425
+ function migrate_to_new_db($lastid = 0, $limit = 1) {
426
+
427
+ if (!isset($_SESSION["migration_media"]))
428
+ $this->get_total_count();
429
+
430
+ $state = intval(get_site_option("rtmedia-migration"));
431
+ if ($state < 5) {
432
+ if ($this->manage_album()) {
433
+ $this->migrate_encoding_options();
434
+ $this->return_migration();
435
+ }
436
+ }
437
+
438
+ if (intval($_SESSION["migration_media"]) >= $this->get_done_count(true)) {
439
+
440
+ if (!$lastid) {
441
+ $lastid = $this->get_last_imported();
442
+ if (!$lastid) {
443
+ $this->return_migration();
444
+ }
445
+ }
446
+ global $wpdb;
447
+ $sql = "select
448
+ a.post_id as 'post_id',
449
+ a.meta_value as 'privacy',
450
+ b.meta_value as 'context_id',
451
+ c.meta_value as 'activity_id',
452
+ p.post_type,
453
+ p.post_mime_type,
454
+ p.post_author as 'media_author',
455
+ p.post_title as 'media_title',
456
+ p.post_parent as 'parent'
457
+ from
458
+ {$wpdb->postmeta} a
459
+ left join
460
+ {$wpdb->postmeta} b ON ((a.post_id = b.post_id)
461
+ and (b.meta_key = 'bp-media-key'))
462
+ left join
463
+ {$wpdb->postmeta} c ON (a.post_id = c.post_id)
464
+ and (c.meta_key = 'bp_media_child_activity')
465
+ left join
466
+ {$wpdb->posts} p ON (a.post_id = p.ID)
467
+ where
468
+ a.post_id >= %d and (NOT p.ID is NULL)
469
+ and a.meta_key = 'bp_media_privacy'
470
+ order by a.post_id
471
+ limit %d";
472
+
473
+
474
+ $results = $wpdb->get_results($wpdb->prepare($sql, $lastid, $limit));
475
+
476
+ if (function_exists("bp_core_get_table_prefix"))
477
+ $bp_prefix = bp_core_get_table_prefix();
478
+ else
479
+ $bp_prefix = "";
480
+ if ($results) {
481
+
482
+ foreach ($results as $result) {
483
+ $this->migrate_single_media($result);
484
+ }
485
+ }
486
+ } else {
487
+ global $wp_rewrite;
488
+ //Call flush_rules() as a method of the $wp_rewrite object
489
+ $wp_rewrite->flush_rules(true);
490
+ // echo json_encode(array("status" => false, "done" => $done, "total" => $this->get_total_count()));
491
+ // die();
492
+ }
493
+ $this->return_migration();
494
+ }
495
+
496
+ function migrate_encoding_options() {
497
+ $encoding_mnigration_array = array(
498
+ 'bp-media-encoding-api-key' => 'rtmedia-encoding-api-key',
499
+ 'bp-media-encoding-usage-limit-mail' => 'rtmedia-encoding-usage-limit-mail',
500
+ 'bp-media-encoding-usage' => 'rtmedia-encoding-usage',
501
+ 'bpmedia_encoding_service_notice' => 'rtmedia-encoding-service-notice',
502
+ 'bpmedia_encoding_expansion_notice' => 'rtmedia-encoding-expansion-notice',
503
+ 'bp_media_ffmpeg_options' => 'rtmedia-ffmpeg-options',
504
+ 'bp_media_kaltura_options' => 'rtmedia-kaltura-options',
505
+ );
506
+ foreach ($encoding_mnigration_array as $key => $ma) {
507
+ if (($value = get_site_option($key)) !== false) {
508
+ update_site_option($ma, $value);
509
+ }
510
+ }
511
+ }
512
+
513
+ function migrate_single_media($result, $album = false) {
514
+ $blog_id = get_current_blog_id();
515
+ $old= $result;
516
+ if (function_exists("bp_core_get_table_prefix"))
517
+ $bp_prefix = bp_core_get_table_prefix();
518
+ else
519
+ $bp_prefix = "";
520
+ global $wpdb;
521
+
522
+ if ($album !== false && ! (is_object($result))) {
523
+ $id = $wpdb->get_var($wpdb->prepare("select ID from $this->bmp_table where media_id = %d", $result));
524
+ if ($id == NULL) {
525
+ $sql = "select
526
+ a.post_id as 'post_id',
527
+ a.meta_value as 'privacy',
528
+ b.meta_value as 'context_id',
529
+ c.meta_value as 'activity_id',
530
+ p.post_type,
531
+ p.post_mime_type,
532
+ p.post_author as 'media_author',
533
+ p.post_title as 'media_title',
534
+ p.post_parent as 'parent'
535
+ from
536
+ {$wpdb->postmeta} a
537
+ left join
538
+ {$wpdb->postmeta} b ON ((a.post_id = b.post_id)
539
+ and (b.meta_key = 'bp-media-key'))
540
+ left join
541
+ {$wpdb->postmeta} c ON (a.post_id = c.post_id)
542
+ and (c.meta_key = 'bp_media_child_activity')
543
+ left join
544
+ {$wpdb->posts} p ON (a.post_id = p.ID)
545
+ where
546
+ a.post_id = %d and (NOT p.ID IS NULL)
547
+ and a.meta_key = 'bp_media_privacy'";
548
+ $result = $wpdb->get_row($wpdb->prepare($sql, $result));
549
+ } else {
550
+ return $id;
551
+ }
552
+ }
553
+ if(!isset($result) || !isset($result->post_id)){
554
+ return $old;
555
+ }
556
+ $media_id = $result->post_id;
557
+
558
+ if (intval($result->context_id) > 0) {
559
+ $media_context = "profile";
560
+ $prefix = "users/" . abs(intval($result->context_id));
561
+ } else {
562
+ $media_context = "group";
563
+ $prefix = "groups/" . abs(intval($result->context_id));
564
+ }
565
+
566
+
567
+ $old_type ="";
568
+ if ($result->post_type != "attachment") {
569
+ $media_type = "album";
570
+ } else {
571
+ $mime_type = strtolower($result->post_mime_type);
572
+ $old_type = "";
573
+ if (strpos($mime_type, "image") === 0) {
574
+ $media_type = "photo";
575
+ $old_type = "photos";
576
+ } else if (strpos($mime_type, "audio") === 0) {
577
+ $media_type = "music";
578
+ $old_type = "music";
579
+ } else if (strpos($mime_type, "video") === 0) {
580
+ $media_type = "video";
581
+ $old_type = "videos";
582
+ } else {
583
+ $media_type = "other";
584
+ }
585
+ }
586
+
587
+ $activity_data = $wpdb->get_row($wpdb->prepare("select * from {$bp_prefix}bp_activity where id= %d", $result->activity_id));
588
+ if ($media_type != 'album') {
589
+ $this->importmedia($media_id, $prefix);
590
+ }
591
+
592
+ if ($this->table_exists($bp_prefix . "bp_activity") && class_exists("BP_Activity_Activity")) {
593
+ $bp_activity = new BP_Activity_Activity();
594
+ $activity_sql = $wpdb->prepare("SELECT
595
+ *
596
+ FROM
597
+ {$bp_prefix}bp_activity
598
+ where
599
+ id in (select distinct
600
+ a.meta_value
601
+ from
602
+ $wpdb->postmeta a
603
+ left join
604
+ $wpdb->posts p ON (a.post_id = p.ID)
605
+ where
606
+ (NOT p.ID IS NULL) and p.ID = %d
607
+ and a.meta_key = 'bp_media_child_activity')", $media_id);
608
+ $all_activity = $wpdb->get_results($activity_sql);
609
+ remove_all_actions("wp_insert_comment");
610
+ foreach ($all_activity as $activity) {
611
+ $comments = $bp_activity->get_activity_comments($activity->id, $activity->mptt_left, $activity->mptt_right);
612
+ $exclude = get_post_meta($media_id, "rtmedia_imported_activity", true);
613
+ if (!is_array($exclude)) {
614
+ $exclude = array();
615
+ }
616
+ if ($comments)
617
+ $this->insert_comment($media_id, $comments, $exclude);
618
+ }
619
+ }
620
+ if (intval($result->parent) !== 0 ) {
621
+ $album_id = $this->migrate_single_media($result->parent, true);
622
+ } else {
623
+ $album_id = 0;
624
+ }
625
+ if (function_exists("bp_activity_get_meta"))
626
+ $likes = bp_activity_get_meta($result->activity_id, 'favorite_count');
627
+ else
628
+ $likes = 0;
629
+
630
+ $wpdb->insert(
631
+ $this->bmp_table, array(
632
+ 'blog_id' => $blog_id,
633
+ 'media_id' => $media_id,
634
+ 'media_type' => $media_type,
635
+ "context" => $media_context,
636
+ "context_id" => abs(intval($result->context_id)),
637
+ "activity_id" => $result->activity_id,
638
+ "privacy" => intval($result->privacy) * 10,
639
+ "media_author" => $result->media_author,
640
+ "media_title" => $result->media_title,
641
+ "album_id" => $album_id,
642
+ "likes" => $likes
643
+ ), array('%d', '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%s', '%d', '%d')
644
+ );
645
+ $last_id = $wpdb->insert_id;
646
+
647
+ // Photo tag meta migration
648
+ //$photo_tag_meta = get_post_meta($media_id, "bp-media-user-tags", true);
649
+
650
+ // if($photo_tag_meta && !empty($photo_tag_meta)){
651
+ // $wpdb->insert(
652
+ // $wpdb->prefix . "rt_rtm_media_meta", array(
653
+ // 'media_id' => $media_id,
654
+ // 'meta_key' => "user-tags",
655
+ // "meta_value" => maybe_serialize($photo_tag_meta)), array('%d', '%s', '%s'));
656
+ // }
657
+ if ($media_type != 'album' && function_exists('bp_core_get_user_domain') && $activity_data) {
658
+ if (function_exists("bp_core_get_table_prefix"))
659
+ $bp_prefix = bp_core_get_table_prefix();
660
+ else
661
+ $bp_prefix = "";
662
+
663
+ $activity_data->old_primary_link = $activity_data->primary_link;
664
+ $parent_link = get_rtmedia_user_link($activity_data->user_id);
665
+ $activity_data->primary_link = $parent_link . "media/" . $last_id;
666
+ $this->search_and_replace($activity_data->old_primary_link, $activity_data->primary_link);
667
+ $activity_data->action = str_replace($activity_data->old_primary_link, $activity_data->primary_link, $activity_data->action);
668
+ $activity_data->content = str_replace($activity_data->old_primary_link, $activity_data->primary_link, $activity_data->content);
669
+ global $last_baseurl, $last_newurl;
670
+
671
+ $replace_img = $last_newurl; //$last_baseurl . "rtMedia/$prefix/";
672
+ if (strpos($activity_data->content, $replace_img) === false)
673
+ $activity_data->content = str_replace($last_baseurl, $replace_img, $activity_data->content);
674
+ global $wpdb;
675
+ $wpdb->update($bp_prefix . "bp_activity", array("primary_link" => $activity_data->primary_link,
676
+ "action" => $activity_data->action,
677
+ "content" => $activity_data->content), array("id" => $activity_data->id));
678
+ }else{
679
+ if($media_context == "group"){
680
+ $activity_data->old_primary_link = $activity_data->primary_link;
681
+ $parent_link = get_rtmedia_group_link( abs(intval($result->context_id)) );
682
+ $parent_link = trailingslashit($parent_link);
683
+ $activity_data->primary_link = trailingslashit( $parent_link . 'media/' . $last_id );
684
+ $this->search_and_replace($activity_data->old_primary_link, $activity_data->primary_link);
685
+ }else{
686
+ $activity_data->old_primary_link = $activity_data->primary_link;
687
+ $parent_link = get_rtmedia_user_link($activity_data->user_id);
688
+ $parent_link = trailingslashit($parent_link);
689
+ $activity_data->primary_link = trailingslashit( $parent_link . 'media/' . $last_id );
690
+ $this->search_and_replace($activity_data->old_primary_link, $activity_data->primary_link);
691
+ }
692
+ }
693
+ if($old_type !=""){
694
+ if($media_context == "group"){
695
+ $parent_link = get_rtmedia_group_link( abs(intval($result->context_id)) );
696
+ $parent_link = trailingslashit($parent_link);
697
+ $this->search_and_replace(trailingslashit( $parent_link . $old_type . '/' . $media_id ), trailingslashit( $parent_link . 'media/' . $last_id ));
698
+
699
+ }else{
700
+ $parent_link = get_rtmedia_user_link($activity_data->user_id);
701
+ $parent_link = trailingslashit($parent_link);
702
+ $this->search_and_replace(trailingslashit( $parent_link . $old_type . '/' . $media_id ), trailingslashit( $parent_link . 'media/' . $last_id ));
703
+
704
+ }
705
+
706
+ }
707
+ return $last_id;
708
+ }
709
+
710
+ function importmedia($id, $prefix) {
711
+
712
+
713
+ $delete = false;
714
+ $attached_file = get_attached_file($id);
715
+ $attached_file_option = get_post_meta($id, '_wp_attached_file', true);
716
+ $basename = wp_basename($attached_file);
717
+ $file_folder_path = trailingslashit(str_replace($basename, '', $attached_file));
718
+
719
+
720
+ $siteurl = get_option('siteurl');
721
+ $upload_path = trim(get_option('upload_path'));
722
+
723
+ if (empty($upload_path) || 'wp-content/uploads' == $upload_path) {
724
+ $dir = WP_CONTENT_DIR . '/uploads';
725
+ } elseif (0 !== strpos($upload_path, ABSPATH)) {
726
+ // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
727
+ $dir = path_join(ABSPATH, $upload_path);
728
+ } else {
729
+ $dir = $upload_path;
730
+ }
731
+
732
+ if (!$url = get_option('upload_url_path')) {
733
+ if (empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ))
734
+ $url = WP_CONTENT_URL . '/uploads';
735
+ else
736
+ $url = trailingslashit($siteurl) . $upload_path;
737
+ }
738
+
739
+ // Obey the value of UPLOADS. This happens as long as ms-files rewriting is disabled.
740
+ // We also sometimes obey UPLOADS when rewriting is enabled -- see the next block.
741
+ if (defined('UPLOADS') && !( is_multisite() && get_site_option('ms_files_rewriting') )) {
742
+ $dir = ABSPATH . UPLOADS;
743
+ $url = trailingslashit($siteurl) . UPLOADS;
744
+ }
745
+
746
+ // If multisite (and if not the main site in a post-MU network)
747
+ if (is_multisite() && !( is_main_site() && defined('MULTISITE') )) {
748
+
749
+ if (!get_site_option('ms_files_rewriting')) {
750
+ // If ms-files rewriting is disabled (networks created post-3.5), it is fairly straightforward:
751
+ // Append sites/%d if we're not on the main site (for post-MU networks). (The extra directory
752
+ // prevents a four-digit ID from conflicting with a year-based directory for the main site.
753
+ // But if a MU-era network has disabled ms-files rewriting manually, they don't need the extra
754
+ // directory, as they never had wp-content/uploads for the main site.)
755
+
756
+ if (defined('MULTISITE'))
757
+ $ms_dir = '/sites/' . get_current_blog_id();
758
+ else
759
+ $ms_dir = '/' . get_current_blog_id();
760
+
761
+ $dir .= $ms_dir;
762
+ $url .= $ms_dir;
763
+ } elseif (defined('UPLOADS') && !ms_is_switched()) {
764
+ // Handle the old-form ms-files.php rewriting if the network still has that enabled.
765
+ // When ms-files rewriting is enabled, then we only listen to UPLOADS when:
766
+ // 1) we are not on the main site in a post-MU network,
767
+ // as wp-content/uploads is used there, and
768
+ // 2) we are not switched, as ms_upload_constants() hardcodes
769
+ // these constants to reflect the original blog ID.
770
+ //
771
+ // Rather than UPLOADS, we actually use BLOGUPLOADDIR if it is set, as it is absolute.
772
+ // (And it will be set, see ms_upload_constants().) Otherwise, UPLOADS can be used, as
773
+ // as it is relative to ABSPATH. For the final piece: when UPLOADS is used with ms-files
774
+ // rewriting in multisite, the resulting URL is /files. (#WP22702 for background.)
775
+
776
+ if (defined('BLOGUPLOADDIR'))
777
+ $dir = untrailingslashit(BLOGUPLOADDIR);
778
+ else
779
+ $dir = ABSPATH . UPLOADS;
780
+ $url = trailingslashit($siteurl) . 'files';
781
+ }
782
+ }
783
+
784
+ $basedir = trailingslashit($dir);
785
+ $baseurl = trailingslashit($url);
786
+
787
+ $new_file_folder_path = trailingslashit(str_replace($basedir, $basedir . "rtMedia/$prefix/", $file_folder_path));
788
+
789
+ $year_month = untrailingslashit(str_replace($basedir, '', $file_folder_path));
790
+
791
+
792
+ $metadata = wp_get_attachment_metadata($id);
793
+ $backup_metadata = get_post_meta($id, '_wp_attachment_backup_sizes', true);
794
+ $instagram_thumbs = get_post_meta($id, '_instagram_thumbs', true);
795
+ $instagram_full_images = get_post_meta($id, '_instagram_full_images', true);
796
+ $instagram_metadata = get_post_meta($id, '_instagram_metadata', true);
797
+ $encoding_job_id = get_post_meta($id, 'bp-media-encoding-job-id', true);
798
+ $ffmpeg_thumbnail_ids = get_post_meta($id, 'bp_media_thumbnail_ids', true);
799
+ $ffmpeg_thumbnail = get_post_meta($id, 'bp_media_thumbnail', true);
800
+ $ffmpeg_remote_id = get_post_meta($id, 'bp_media_ffmpeg_remote_id', true);
801
+ $kaltura_remote_id = get_post_meta($id, 'bp_media_kaltura_remote_id', true);
802
+
803
+ if (wp_mkdir_p($basedir . "rtMedia/$prefix/" . $year_month)) {
804
+ if (copy($attached_file, str_replace($basedir, $basedir . "rtMedia/$prefix/", $attached_file))) {
805
+ $delete = true;
806
+
807
+ if (isset($metadata['sizes'])) {
808
+ foreach ($metadata['sizes'] as $size) {
809
+ if (!copy($file_folder_path . $size['file'], $new_file_folder_path . $size['file'])) {
810
+ $delete = false;
811
+
812
+ } else {
813
+ $delete_sizes[] = $file_folder_path . $size['file'];
814
+ $this->search_and_replace(trailingslashit($baseurl . $year_month). $size['file'],trailingslashit($baseurl . "rtMedia/$prefix/" . $year_month). $size['file']);
815
+ }
816
+
817
+ }
818
+ }
819
+ if ($backup_metadata) {
820
+ foreach ($backup_metadata as $backup_images) {
821
+ if (!copy($file_folder_path . $backup_images['file'], $new_file_folder_path . $backup_images['file'])) {
822
+ $delete = false;
823
+ } else {
824
+ $delete_sizes[] = $file_folder_path . $backup_images['file'];
825
+ $this->search_and_replace(trailingslashit($baseurl . $year_month). $backup_images['file'],trailingslashit($baseurl . "rtMedia/$prefix/" . $year_month). $backup_images['file']);
826
+ }
827
+ }
828
+ }
829
+
830
+ if ($instagram_thumbs) {
831
+ foreach ($instagram_thumbs as $key => $insta_thumb) {
832
+ try{
833
+ if (!copy(str_replace($baseurl, $basedir, $insta_thumb), str_replace($baseurl, $basedir . "rtMedia/$prefix/", $insta_thumb))) {
834
+ $delete = false;
835
+ } else {
836
+ $delete_sizes[] = str_replace($baseurl, $basedir, $insta_thumb);
837
+ $instagram_thumbs_new[$key] = str_replace($baseurl, $baseurl . "rtMedia/$prefix/", $insta_thumb);
838
+ $this->search_and_replace(trailingslashit($baseurl . $year_month).$insta_thumb,trailingslashit($baseurl . "rtMedia/$prefix/" . $year_month). $insta_thumb);
839
+ }
840
+ } catch (Exceptio $e){
841
+ $delete = false;
842
+ }
843
+ }
844
+ }
845
+
846
+ if ($instagram_full_images) {
847
+ foreach ($instagram_full_images as $key => $insta_full_image) {
848
+ if (!copy($insta_full_image, str_replace($basedir, $basedir . "rtMedia/$prefix/", $insta_full_image))) {
849
+ $delete = false;
850
+ } else {
851
+ $delete_sizes[] = $insta_full_image;
852
+ $instagram_full_images_new[$key] = str_replace($basedir, $basedir . "rtMedia/$prefix", $insta_full_image);
853
+ $this->search_and_replace(trailingslashit($baseurl . $year_month).$insta_full_image,trailingslashit($baseurl . "rtMedia/$prefix/" . $year_month). $insta_full_image);
854
+ }
855
+ }
856
+ }
857
+
858
+ if ($instagram_metadata) {
859
+ $instagram_metadata_new = $instagram_metadata;
860
+ foreach ($instagram_metadata as $wp_size => $insta_metadata) {
861
+ if (isset($insta_metadata['file'])) {
862
+ if (!copy($basedir . $insta_metadata['file'], $basedir . "rtMedia/$prefix/" . $insta_metadata['file'])) {
863
+ $delete = false;
864
+ } else {
865
+ $delete_sizes[] = $basedir . $insta_metadata['file'];
866
+ $instagram_metadata_new[$wp_size]['file'] = "rtMedia/$prefix/" . $insta_metadata['file'];
867
+ if (isset($insta_metadata['sizes'])) {
868
+ foreach ($insta_metadata['sizes'] as $key => $insta_size) {
869
+ if (!copy($file_folder_path . $insta_size['file'], $new_file_folder_path . $insta_size['file'])) {
870
+ $delete = false;
871
+ } else {
872
+ $delete_sizes[] = $file_folder_path . $insta_size['file'];
873
+ $this->search_and_replace(trailingslashit($baseurl . $year_month).$insta_size['file'],trailingslashit($baseurl . "rtMedia/$prefix/" . $year_month). $insta_size['file']);
874
+ }
875
+ }
876
+ }
877
+ }
878
+ }
879
+ }
880
+ }
881
+
882
+ if ($delete) {
883
+ if (file_exists($attached_file))
884
+ unlink($attached_file);
885
+
886
+ if (isset($delete_sizes)) {
887
+ foreach ($delete_sizes as $delete_size) {
888
+ if (file_exists($delete_size))
889
+ unlink($delete_size);
890
+ }
891
+ }
892
+ update_post_meta($id, '_wp_attached_file', "rtMedia/$prefix/" . $attached_file_option);
893
+ if (isset($metadata['file'])) {
894
+ $metadata['file'] = "rtMedia/$prefix/" . $metadata['file'];
895
+ wp_update_attachment_metadata($id, $metadata);
896
+ }
897
+ if ($instagram_thumbs) {
898
+ update_rtmedia_meta($id, '_instagram_thumbs', $instagram_thumbs_new);
899
+ }
900
+ if ($instagram_full_images) {
901
+ update_rtmedia_meta($id, '_instagram_full_images', $instagram_full_images_new);
902
+ }
903
+ if ($instagram_metadata) {
904
+ update_rtmedia_meta($id, '_instagram_metadata', $instagram_metadata_new);
905
+ }
906
+ if ($encoding_job_id) {
907
+ update_rtmedia_meta($id, 'rtmedia-encoding-job-id', $encoding_job_id);
908
+ }
909
+ if ($ffmpeg_thumbnail_ids) {
910
+ update_rtmedia_meta($id, 'rtmedia-thumbnail-ids', $ffmpeg_thumbnail_ids);
911
+ }
912
+ if ($ffmpeg_thumbnail) {
913
+ $model = new RTMediaModel();
914
+ $model->update(array('cover_art' => $ffmpeg_thumbnail), array('id' => $id));
915
+ }
916
+ if ($ffmpeg_remote_id) {
917
+ update_rtmedia_meta($id, 'rtmedia-ffmpeg-remote-id', $ffmpeg_remote_id);
918
+ }
919
+ if ($kaltura_remote_id) {
920
+ update_rtmedia_meta($id, 'rtmedia-kaltura-remote-id', $kaltura_remote_id);
921
+ }
922
+
923
+ $attachment = array();
924
+ $attachment['ID'] = $id;
925
+ $old_guid = get_post_field('guid', $id);
926
+ $attachment['guid'] = str_replace($baseurl, $baseurl . "rtMedia/$prefix/", $old_guid);
927
+ /**
928
+ * For Activity
929
+ */
930
+ global $last_baseurl, $last_newurl;
931
+ $last_baseurl = $baseurl;
932
+ $last_newurl = $baseurl . "rtMedia/$prefix/";
933
+ $this->search_and_replace($old_guid, $attachment['guid']);
934
+ wp_update_post($attachment);
935
+ }
936
+ }
937
+ }
938
+ }
939
+
940
+ function search_and_replace($old,$new){
941
+ global $wpdb;
942
+ if (function_exists("bp_core_get_table_prefix"))
943
+ $bp_prefix = bp_core_get_table_prefix();
944
+ else
945
+ $bp_prefix = "";
946
+ $sql = $wpdb->prepare("update {$bp_prefix}bp_activity set action=replace(action,%s,%s) ,content=replace(content,%s,%s), primary_link=replace(primary_link,%s,%s) where id > 0;",$old,$new,$old,$new,$old,$new);
947
+ $wpdb->get_row($sql);
948
+ }
949
+ function formatSeconds($secondsLeft) {
950
+
951
+ $minuteInSeconds = 60;
952
+ $hourInSeconds = $minuteInSeconds * 60;
953
+ $dayInSeconds = $hourInSeconds * 24;
954
+
955
+ $days = floor($secondsLeft / $dayInSeconds);
956
+ $secondsLeft = $secondsLeft % $dayInSeconds;
957
+
958
+ $hours = floor($secondsLeft / $hourInSeconds);
959
+ $secondsLeft = $secondsLeft % $hourInSeconds;
960
+
961
+ $minutes = floor($secondsLeft / $minuteInSeconds);
962
+
963
+ $seconds = $secondsLeft % $minuteInSeconds;
964
+
965
+ $timeComponents = array();
966
+
967
+ if ($days > 0) {
968
+ $timeComponents[] = $days . " day" . ($days > 1 ? "s" : "");
969
+ }
970
+
971
+ if ($hours > 0) {
972
+ $timeComponents[] = $hours . " hour" . ($hours > 1 ? "s" : "");
973
+ }
974
+
975
+ if ($minutes > 0) {
976
+ $timeComponents[] = $minutes . " minute" . ($minutes > 1 ? "s" : "");
977
+ }
978
+
979
+ if ($seconds > 0) {
980
+ $timeComponents[] = $seconds . " second" . ($seconds > 1 ? "s" : "");
981
+ }
982
+ if (count($timeComponents) > 0) {
983
+ $formattedTimeRemaining = implode(", ", $timeComponents);
984
+ $formattedTimeRemaining = trim($formattedTimeRemaining);
985
+ } else {
986
+ $formattedTimeRemaining = "No time remaining.";
987
+ }
988
+
989
+ return $formattedTimeRemaining;
990
+ }
991
+
992
+ function insert_comment($media_id, $data, $exclude, $parent_commnet_id = 0) {
993
+ foreach ($data as $cmnt) {
994
+ $comment_id = 0;
995
+ if (!key_exists(strval($cmnt->id), $exclude)) {
996
+ $commentdata = array(
997
+ "comment_date" => $cmnt->date_recorded,
998
+ "comment_parent" => $parent_commnet_id,
999
+ "user_id" => $cmnt->user_id,
1000
+ "comment_content" => $cmnt->content,
1001
+ "comment_author_email" => $cmnt->user_email,
1002
+ 'comment_post_ID' => $media_id,
1003
+ 'comment_author' => $cmnt->display_name,
1004
+ 'comment_author_url' => '',
1005
+ 'comment_author_IP' => '');
1006
+ $comment_id = wp_insert_comment($commentdata);
1007
+ $exclude[strval($cmnt->id)] = $comment_id;
1008
+ } else {
1009
+ $comment_id = $exclude[strval($cmnt->id)];
1010
+ }
1011
+
1012
+ update_post_meta($media_id, "rtmedia_imported_activity", $exclude);
1013
+
1014
+ if (is_array($cmnt->children)) {
1015
+ $this->insert_comment($media_id, $cmnt->children, $exclude, $comment_id);
1016
+ }
1017
+ }
1018
+ }
1019
+
1020
+ }
1021
+ ?>
app/main/BPMediaComponent.php DELETED
@@ -1,343 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Don't load this file directly!
5
- */
6
- if ( ! defined( 'ABSPATH' ) )
7
- exit;
8
-
9
- /**
10
- * Add BuddyPress Media as a component of BuddyPress
11
- *
12
- * @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
13
- * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
14
- */
15
- class BPMediaComponent extends BP_Component {
16
-
17
- /**
18
- * Hold the messages that are generated during initialization process
19
- * and will be shown on the screen functions
20
- *
21
- * @var array
22
- */
23
- var $messages = array(
24
- 'error' => array( ),
25
- 'info' => array( ),
26
- 'updated' => array( )
27
- );
28
-
29
- /**
30
- * Initialise the component with appropriate parameters.
31
- * Add hook for plugins, themes, extensions to hook on to
32
- * Activates the component
33
- * Registers necessary post types
34
- *
35
- * @global object $bp The global BuddyPress object
36
- */
37
- function __construct() {
38
- global $bp;
39
- parent::start( BP_MEDIA_SLUG, BP_MEDIA_LABEL, BP_MEDIA_PATH );
40
- do_action( 'bp_media_init' );
41
- $bp->active_components[ $this->id ] = '1';
42
- add_action( 'init', array( &$this, 'register_post_types' ), 10 );
43
- }
44
-
45
- /**
46
- * Initialise the global variables of the BuddyPress Media
47
- * and its parent class.
48
- * Add necessary slugs and search functionality
49
- *
50
- * @global object $bp The global BuddyPress object
51
- */
52
- function setup_globals() {
53
- global $bp;
54
- $globals = array(
55
- 'slug' => BP_MEDIA_SLUG,
56
- 'root_slug' => isset(
57
- $bp->pages->{$this->id}->slug ) ?
58
- $bp->pages->{$this->id}->slug : BP_MEDIA_SLUG,
59
- // 'has_directory' => true, // Set to false if not required
60
- 'search_string' => __( 'Search Media...', 'buddypress-media' ),
61
- 'notification_callback' => 'bp_media_notifications_callback'
62
- );
63
- parent::setup_globals( $globals );
64
- }
65
-
66
- /**
67
- * Sets up BuddyPress Media navigation and tabs on profile
68
- *
69
- * @global object $bp The global BuddyPress object
70
- */
71
- function setup_nav() {
72
- global $bp, $bp_media;
73
-
74
- $enabled = $bp_media->enabled();
75
- $default_tab = $bp_media->default_tab();
76
- $defaults_tab = $bp_media->defaults_tab();
77
-
78
- /* Upload Screen */
79
-
80
-
81
- /* Media Screens */
82
-
83
- foreach ( $enabled as $tab => $active ) {
84
- if ( $active == true ) {
85
- $tabs = $tab;
86
- if ( $tabs != 'audio' && $tabs != 'upload' ) {
87
- $tabs .= 's';
88
- }
89
- if ( $tab == 'upload' ) {
90
- ${'bp_media_' . $tab} = new BPMediaUploadScreen(
91
- $tab,
92
- constant( 'BP_MEDIA_' . strtoupper( $tabs ) . '_SLUG' )
93
- );
94
- } elseif ( $tab == 'album' ) {
95
- $bp_media_album = new BPMediaAlbumScreen(
96
- $tab,
97
- constant( 'BP_MEDIA_' . strtoupper( $tabs ) . '_SLUG' )
98
- );
99
- } else {
100
- ${'bp_media_' . $tab} = new BPMediaScreen(
101
- $tab,
102
- constant( 'BP_MEDIA_' . strtoupper( $tabs ) . '_SLUG' )
103
- );
104
- }
105
- }
106
- }
107
-
108
- if(array_key_exists('privacy_override_enabled',$bp_media->options))
109
- if(checked($bp_media->options['privacy_override_enabled'],true,false))
110
- $bp_media_privacy_screen = new BPMediaPrivacyScreen();
111
-
112
- /* Switch between different screens depending on context */
113
- switch ( $bp->current_component ) {
114
- case BP_MEDIA_IMAGES_SLUG:
115
- if ( $enabled[ 'image' ] && is_numeric( $bp->current_action ) ) {
116
- $bp->action_variables[ 0 ] = $bp->current_action;
117
- $bp->current_action = BP_MEDIA_IMAGES_VIEW_SLUG;
118
- }
119
- break;
120
- case BP_MEDIA_AUDIO_SLUG:
121
- if ( $enabled[ 'audio' ] && is_numeric( $bp->current_action ) ) {
122
- $bp->action_variables[ 0 ] = $bp->current_action;
123
- $bp->current_action = BP_MEDIA_AUDIO_VIEW_SLUG;
124
- }
125
- break;
126
- case BP_MEDIA_VIDEOS_SLUG:
127
- if ( $enabled[ 'video' ] && is_numeric( $bp->current_action ) ) {
128
- $bp->action_variables[ 0 ] = $bp->current_action;
129
- $bp->current_action = BP_MEDIA_VIDEOS_VIEW_SLUG;
130
- }
131
- break;
132
- case BP_MEDIA_ALBUMS_SLUG:
133
- if ( is_numeric( $bp->current_action ) ) {
134
- $bp->action_variables[ 0 ] = $bp->current_action;
135
- $bp->current_action = BP_MEDIA_ALBUMS_VIEW_SLUG;
136
- }
137
- break;
138
- }
139
-
140
- /* Create the main navigation on profile */
141
- $main_nav = array(
142
- 'name' => __( BP_MEDIA_LABEL, 'buddypress-media' ),
143
- 'slug' => BP_MEDIA_SLUG,
144
- 'position' => 80,
145
- 'screen_function' => array( ${'bp_media_' . $default_tab}, 'screen' ),
146
- 'default_subnav_slug' => constant( 'BP_MEDIA_' . strtoupper( $defaults_tab ) . '_SLUG' )
147
- );
148
-
149
- /* Create an empty sub navigation */
150
- $sub_nav[ ] = array( );
151
-
152
- /* Set up navigation */
153
- parent::setup_nav( $main_nav, $sub_nav );
154
- /* Set up individual screens for each nav/sub nav */
155
- foreach ( $enabled as $type => $status ) {
156
- if($status){
157
- $screen_array[ ] = array(
158
- 'type' => $type,
159
- 'status' => $status,
160
- 'subscreens' => true
161
- );
162
- }
163
- }
164
- $screen_array = apply_filters( 'bpmedia_media_screens', $screen_array );
165
- foreach ( $screen_array as $screen ) {
166
- $type = $screen[ 'type' ];
167
- $status = $screen[ 'status' ];
168
- $subscreens = $screen[ 'subscreens' ];
169
- if ( $type != 'upload' ) {
170
- $types = $type;
171
- if ( $type != 'audio' ) {
172
- $types .='s';
173
- }
174
- bp_core_new_nav_item( array(
175
- 'name' => __( constant( 'BP_MEDIA_' . strtoupper( $types ) . '_LABEL' ), 'buddypress-media' ),
176
- 'slug' => constant( 'BP_MEDIA_' . strtoupper( $types ) . '_SLUG' ),
177
- 'screen_function' => array( ${'bp_media_' . $type}, 'screen' ),
178
- ) );
179
- if ( $subscreens == true ) {
180
- $subscreens_array = array(
181
- 'view',
182
- 'edit',
183
- 'delete',
184
- 'page'
185
- );
186
- $subscreens_array = apply_filters( 'bpmedia_media_type_subscreens', $subscreens_array );
187
-
188
- foreach ( $subscreens_array as $subscreen ) {
189
- $screen_to_load = 'screen';
190
- if ( $subscreen == 'edit' ) {
191
- $screen_to_load = $subscreen . '_' . $screen_to_load;
192
- }
193
- $slug = 'BP_MEDIA_';
194
- if ( $subscreen != 'delete' ) {
195
- $slug .= strtoupper( $types ) . '_';
196
- }
197
- if ( $subscreen != 'page' ) {
198
- $slug .= strtoupper( $subscreen ) . '_';
199
- }
200
- $slug .= 'SLUG';
201
-
202
- bp_core_new_subnav_item( array(
203
- 'name' => ucfirst( $subscreen ),
204
- /* Display name for the nav item(It won't be shown anywhere) */
205
- 'slug' => constant( $slug ),
206
- /* URL slug for the nav item */
207
- 'parent_slug' => constant( 'BP_MEDIA_' . strtoupper( $types ) . '_SLUG' ),
208
- /* URL slug of the parent nav item */
209
- 'parent_url' => trailingslashit( bp_loggedin_user_domain()
210
- . constant( 'BP_MEDIA_' . strtoupper( $types ) . '_SLUG' ) ),
211
- /* URL of the parent item */
212
- 'position' => 90,
213
- /* Index of where this nav item should be positioned */
214
- 'screen_function' => array( ${'bp_media_' . $type}, $screen_to_load ),
215
- /* The name of the function to run when clicked */
216
- ) );
217
- }
218
- }
219
- }
220
- }
221
-
222
-
223
- bp_core_new_nav_item( array(
224
- 'name' => __( BP_MEDIA_UPLOAD_LABEL, 'buddypress-media' ),
225
- 'slug' => BP_MEDIA_UPLOAD_SLUG,
226
- 'screen_function' => array( $bp_media_upload, 'upload_screen' ),
227
- 'user_has_access' => bp_is_my_profile()
228
- ) );
229
- if(array_key_exists('privacy_override_enabled',$bp_media->options))
230
- if(checked($bp_media->options['privacy_override_enabled'],true,false))
231
- bp_core_new_subnav_item( array(
232
- 'name' => __( BP_MEDIA_USER_SETTINGS_LABEL, 'buddypress-media' ),
233
- /* Display name for the nav item(It won't be shown anywhere) */
234
- 'slug' => BP_MEDIA_USER_SETTINGS_SLUG,
235
- /* URL slug for the nav item */
236
- 'parent_slug' => BP_MEDIA_SLUG,
237
- /* URL slug of the parent nav item */
238
- 'parent_url' => trailingslashit( bp_loggedin_user_domain()
239
- . BP_MEDIA_SLUG),
240
- /* URL of the parent item */
241
- 'position' => 900,
242
- /* Index of where this nav item should be positioned */
243
- 'screen_function' => array( $bp_media_privacy_screen, 'ui' ),
244
- /* The name of the function to run when clicked */
245
- 'user_has_access' => bp_is_my_profile()
246
- ) );
247
- }
248
-
249
- /**
250
- * Register Custom Post Types required by BuddyPress Media
251
- */
252
- function register_post_types() {
253
-
254
- /* Set up Album labels */
255
- $album_labels = array(
256
- 'name' => __( 'Albums', 'buddypress-media' ),
257
- 'singular_name' => __( 'Album', 'buddypress-media' ),
258
- 'add_new' => __( 'Create', 'buddypress-media' ),
259
- 'add_new_item' => __( 'Create Album', 'buddypress-media' ),
260
- 'edit_item' => __( 'Edit Album', 'buddypress-media' ),
261
- 'new_item' => __( 'New Album', 'buddypress-media' ),
262
- 'all_items' => __( 'All Albums', 'buddypress-media' ),
263
- 'view_item' => __( 'View Album', 'buddypress-media' ),
264
- 'search_items' => __( 'Search Albums', 'buddypress-media' ),
265
- 'not_found' => __( 'No album found', 'buddypress-media' ),
266
- 'not_found_in_trash' => __( 'No album found in Trash', 'buddypress-media' ),
267
- 'parent_item_colon' => '',
268
- 'menu_name' => __( 'Albums', 'buddypress-media' )
269
- );
270
-
271
- /* Set up Album post type arguments */
272
- $album_args = array(
273
- 'labels' => $album_labels,
274
- 'public' => true,
275
- 'publicly_queryable' => true,
276
- 'show_ui' => false,
277
- 'show_in_menu' => false,
278
- 'query_var' => true,
279
- 'capability_type' => 'post',
280
- 'has_archive' => true,
281
- 'hierarchical' => false,
282
- 'menu_position' => null,
283
- 'supports' => array(
284
- 'title',
285
- 'author',
286
- 'thumbnail',
287
- 'excerpt',
288
- 'comments'
289
- )
290
- );
291
-
292
- /* register Album post type */
293
- register_post_type( 'bp_media_album', $album_args );
294
-
295
-
296
- /* Set up labels for Media post type */
297
- $labels = array(
298
- 'name' => __( 'Media', 'buddypress-media' ),
299
- 'singular' => __( 'Media', 'buddypress-media' ),
300
- 'add_new' => __( 'Add New Media', 'buddypress-media' )
301
- );
302
-
303
- /* Set up the arguments for Media post type */
304
- $args = array(
305
- 'label' => __( 'Media', 'buddypress-media' ),
306
- 'labels' => $labels,
307
- 'description' => __(
308
- 'BuddyPress Media\'s Media Files', 'buddypress-media'
309
- ),
310
- 'public' => true,
311
- 'show_ui' => false,
312
- 'supports' => array(
313
- 'title',
314
- 'editor',
315
- 'excerpt',
316
- 'author',
317
- 'thumbnail',
318
- 'custom-fields'
319
- )
320
- );
321
-
322
- /* Register Media post type */
323
- register_post_type( 'bp_media', $args );
324
-
325
- /* Register parent's post types */
326
- parent::register_post_types();
327
- }
328
-
329
- }
330
-
331
- //needs to be a bloody singleton because BuddyPress does a function_exists!
332
- function bp_media_notifications_callback($action, $media_id, $initiator_id, $total_items){
333
- $params = array(
334
- 'action' => $action,
335
- 'media_id' => $media_id,
336
- 'initiator_id' => $initiator_id,
337
- 'total_items' => $total_items
338
- );
339
-
340
- return apply_filters('bp_media_notifications',$params);
341
- }
342
-
343
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/BPMediaGroupLoader.php DELETED
@@ -1,313 +0,0 @@
1
- <?php
2
- /**
3
- * Don't load this file directly!
4
- */
5
- if (!defined('ABSPATH'))
6
- exit;
7
-
8
- /**
9
- * Loads Group Media functionality
10
- *
11
- * @author Faishal Saiyed <faishal.saiyed@rtcamp.com>
12
- * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
13
- */
14
- class BPMediaGroupLoader {
15
-
16
- /**
17
- * Constructs all the group functionality
18
- * Loads dummy classes
19
- * Adds necessary navigation and tabs
20
- *
21
- */
22
- function __construct() {
23
- global $bp_media;
24
- $enabled = $bp_media->enabled();
25
-
26
-
27
- if (class_exists('BPMediaGroupsExtension')) :
28
- bp_register_group_extension('BPMediaGroupsExtension');
29
- foreach (array('image','video', 'audio', 'album', 'upload') as $type){
30
- if($enabled[$type]){
31
- $types = $type;
32
- if($types!='audio'&&$types!='upload'){
33
- $types .= 's';
34
- }
35
- $grp_class = 'BPMediaGroup'.ucfirst($types);
36
- new $grp_class();
37
- }
38
- }
39
- endif;
40
- add_action('bp_actions', array($this, 'custom_nav'), 999);
41
- add_filter('bp_media_multipart_params_filter',
42
- array($this, 'multipart_params_handler')
43
- );
44
- }
45
-
46
- /**
47
- * Handles the custom navigation structure of the BuddyPress Group Extension Media
48
- *
49
- * @uses global $bp
50
- *
51
- * @since BuddyPress Media 2.3
52
- */
53
-
54
- /**
55
- *
56
- * @global type $bp
57
- * @return type
58
- */
59
- function custom_nav() {
60
- global $bp;
61
- $current_group = isset($bp->groups->current_group->slug) ?
62
- $bp->groups->current_group->slug : null;
63
- if (!$current_group)
64
- return;
65
- if (!(isset($bp->bp_options_nav[$current_group])
66
- && is_array($bp->bp_options_nav[$current_group])))
67
- return;
68
-
69
- /** This line might break a thing or two in custom themes and widgets */
70
- if ( isset($bp->action_variables[0]) )
71
- remove_filter('bp_activity_get_user_join_filter', 'BPMediaFilters::activity_query_filter', 10);
72
- // add_filter('bp_activity_get_user_join_filter', 'BPMediaFilters::group_activity_query_filter', 10);
73
-
74
- foreach ($bp->bp_options_nav[$current_group] as $key => $nav_item) {
75
- switch ($nav_item['slug']) {
76
- case BP_MEDIA_IMAGES_SLUG:
77
- case BP_MEDIA_VIDEOS_SLUG:
78
- case BP_MEDIA_AUDIO_SLUG:
79
- case BP_MEDIA_ALBUMS_SLUG:
80
- case BP_MEDIA_UPLOAD_SLUG:
81
- unset($bp->bp_options_nav[$current_group][$key]);
82
- }
83
- switch ($bp->current_action) {
84
- case BP_MEDIA_IMAGES_SLUG:
85
-
86
- case BP_MEDIA_VIDEOS_SLUG:
87
- case BP_MEDIA_AUDIO_SLUG:
88
- case BP_MEDIA_ALBUMS_SLUG:
89
- case BP_MEDIA_UPLOAD_SLUG:
90
- $count = count($bp->action_variables);
91
- for ($i = $count; $i > 0; $i--) {
92
- $bp->action_variables[$i] = $bp->action_variables[$i - 1];
93
- }
94
- $bp->action_variables[0] = $bp->current_action;
95
- $bp->current_action = BP_MEDIA_SLUG;
96
- }
97
- }
98
- }
99
-
100
- /**
101
- * Adds the current group id as parameter for plupload
102
- *
103
- * @param Array $multipart_params Array of Multipart Parameters to be passed on to plupload script
104
- *
105
- * @since BuddyPress Media 2.3
106
- */
107
-
108
- /**
109
- *
110
- * @global type $bp
111
- * @param type $multipart_params
112
- * @return type
113
- */
114
- function multipart_params_handler($multipart_params) {
115
- if (is_array($multipart_params)) {
116
- global $bp;
117
- if (isset($bp->current_action) && ( ($bp->current_action == BP_MEDIA_SLUG) || bp_is_group_home() )
118
- && isset($bp->action_variables)
119
- && isset($bp->current_component)
120
- && $bp->current_component == 'groups'
121
- && isset($bp->groups->current_group->id)) {
122
- $multipart_params['bp_media_group_id'] = $bp->groups->current_group->id;
123
- }
124
- }
125
- return $multipart_params;
126
- }
127
-
128
- /**
129
- * Displays the navigation available to the group media tab for the
130
- * logged in user.
131
- *
132
- * @uses $bp Global Variable set by BuddyPress
133
- *
134
- * @since BuddyPress Media 2.3
135
- */
136
-
137
- /**
138
- *
139
- * @global type $bp
140
- * @return boolean
141
- */
142
- static function navigation_menu() {
143
- global $bp,$bp_media;
144
- $enabled = $bp_media->enabled();
145
- $default_tab = $bp_media->default_tab();
146
- $defaults_tab = $bp_media->defaults_tab();
147
- $default_const = 'BP_MEDIA_'.strtoupper($defaults_tab).'_SLUG';
148
-
149
- if (!isset($bp->current_action) || $bp->current_action != BP_MEDIA_SLUG)
150
- return false;
151
- ${'bp_media_'.$default_tab} = new BPMediaScreen($defaults_tab, constant($default_const));
152
-
153
-
154
- if (isset($bp->action_variables[0])) {
155
- $current_tab = $bp->action_variables[0];
156
- }else{
157
- $current_tab = constant($default_const);
158
- }
159
-
160
- // if (BPMediaGroup::can_upload()) {
161
- $bp_media_nav[constant($default_const)] = array(
162
- 'url' => trailingslashit(bp_get_group_permalink($bp->groups->current_group)) . BP_MEDIA_SLUG,
163
- 'label' => constant('BP_MEDIA_'.strtoupper($defaults_tab).'_LABEL'),
164
- 'screen_function' => array(${'bp_media_'.$default_tab}, 'screen')
165
- );
166
- // } else {
167
- // $bp_media_nav = array();
168
- // }
169
-
170
- foreach (array('IMAGES','VIDEOS', 'AUDIO', 'ALBUMS', 'UPLOAD') as $types) {
171
- if ($types == 'UPLOAD') {
172
-
173
- if (BPMediaGroupLoader::can_upload()) {
174
- $bp_media_nav[constant('BP_MEDIA_' . $types . '_SLUG')] = array(
175
- 'url' => trailingslashit(bp_get_group_permalink($bp->groups->current_group)) . constant('BP_MEDIA_' . $types . '_SLUG'),
176
- 'label' => constant('BP_MEDIA_' . $types . '_LABEL'),
177
- // 'screen_function' => array( $bp_media_upload, 'upload_screen' ),
178
- 'user_has_access' => BPMediaGroupLoader::can_upload()
179
- );
180
- }
181
- } else {
182
- $type = $types;
183
- if($types!='AUDIO'){
184
- $type = substr($types, 0, -1);
185
- }
186
- if($enabled[strtolower($type)] && $default_tab!=strtolower($type)){
187
- $bp_media_nav[constant('BP_MEDIA_' . $types . '_SLUG')] = array(
188
- 'url' => trailingslashit(bp_get_group_permalink($bp->groups->current_group)) . constant('BP_MEDIA_' . $types . '_SLUG'),
189
- 'label' => constant('BP_MEDIA_' . $types . '_LABEL'),
190
- );
191
- }
192
- }
193
- }
194
-
195
- /** This variable will be used to display the tabs in group component */
196
- $bp_media_group_tabs = apply_filters('bp_media_group_tabs', $bp_media_nav, $current_tab);
197
- ?>
198
- <div class="item-list-tabs no-ajax bp-media-group-navigation" id="subnav">
199
- <ul>
200
- <?php
201
- foreach ($bp_media_group_tabs as $tab_slug => $tab_info) {
202
- echo '<li id="' . $tab_slug . '-group-li" ' . ($current_tab == $tab_slug ? 'class="current selected"' : '') . '><a id="' . $tab_slug . '" href="' . $tab_info['url'] . '" title="' . __($tab_info['label'], 'buddypress-media') . '">' . __($tab_info['label'], 'buddypress-media') . '</a></li>';
203
- }
204
- ?>
205
- </ul>
206
- </div>
207
- <?php
208
- }
209
-
210
- /**
211
- * Checks whether the current logged in user has the ability to upload on
212
- * the given group or not
213
- *
214
- * @since BuddyPress Media 2.3
215
- */
216
-
217
- /**
218
- *
219
- * @global type $bp
220
- * @return boolean
221
- */
222
- static function can_upload() {
223
- /** @todo Implementation Pending */
224
- global $bp;
225
- if (isset($bp->loggedin_user->id) && is_numeric($bp->loggedin_user->id) && class_exists('BP_Group_Extension')) {
226
- return groups_is_user_member($bp->loggedin_user->id, bp_get_current_group_id());
227
- } else {
228
- return false;
229
- }
230
-
231
- return true;
232
- }
233
-
234
- /**
235
- * Adds the Media Settings menu for groups in the admin bar
236
- *
237
- * @uses global $bp,$wp_admin_bar
238
- *
239
- * @since BuddyPress Media 2.3
240
- */
241
-
242
- /**
243
- *
244
- * @global type $wp_admin_bar
245
- * @global type $bp
246
- */
247
- function admin_bar() {
248
- global $wp_admin_bar, $bp;
249
- $wp_admin_bar->add_menu(array(
250
- 'parent' => $bp->group_admin_menu_id,
251
- 'id' => 'bp-media-group',
252
- 'title' => __('Media Settings', 'buddypress-media'),
253
- 'href' => bp_get_groups_action_link('admin/media')
254
- ));
255
- }
256
-
257
- //add_action('admin_bar_menu','admin_bar',99);
258
- /* This will need some handling for checking if its a single group page or not, also whether the person can
259
- * edit media settings or not
260
- */
261
-
262
- /**
263
- * Checks whether a user can create an album in the given group or not
264
- *
265
- * @param string $group_id The group id to check against
266
- * @param string $user_id The user to be checked for permission
267
- *
268
- * @return boolean True if the user can create an album in the group, false if not
269
- */
270
-
271
- /**
272
- *
273
- * @param type $group_id
274
- * @param type $user_id
275
- * @return boolean
276
- */
277
- static function user_can_create_album($group_id, $user_id = 0) {
278
- if ($user_id == 0)
279
- $user_id = get_current_user_id();
280
- $current_level = groups_get_groupmeta($group_id, 'bp_media_group_control_level');
281
- switch ($current_level) {
282
- case 'all':
283
- return groups_is_user_member($user_id, $group_id) || groups_is_user_mod($user_id, $group_id) || groups_is_user_admin($user_id, $group_id);
284
- break;
285
- case 'moderators':
286
- return groups_is_user_mod($user_id, $group_id) || groups_is_user_admin($user_id, $group_id);
287
- break;
288
- case 'admin':
289
- return groups_is_user_admin($user_id, $group_id);
290
- break;
291
- default :
292
- return groups_is_user_admin($user_id, $group_id);
293
- }
294
- return false;
295
- }
296
-
297
- /**
298
- *
299
- * @param type $errorMessage
300
- */
301
- static function bp_media_display_error($errorMessage) {
302
- ?>
303
- <div id="message" class="error">
304
- <p>
305
- <?php _e($errorMessage, 'buddypress-media'); ?>
306
- </p>
307
- </div>
308
- <?php
309
- }
310
-
311
- }
312
-
313
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/BPMediaLoader.php DELETED
@@ -1,172 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Don't load this file directly!
5
- */
6
- if (!defined('ABSPATH'))
7
- exit;
8
-
9
- /**
10
- * BuddyPress Media Loader
11
- *
12
- * Hook into BuddyPress, so we can load BuddyPress Media.
13
- * Called by BuddyPressMedia on intialisation.
14
- *
15
- * @package BuddyPressMedia
16
- * @subpackage Main
17
- *
18
- * @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
19
- * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
20
- */
21
- class BPMediaLoader {
22
-
23
- /**
24
- * Initialises BuddyPress Media's functionality. Hooks into BuddyPress
25
- *
26
- * Hooks into bp_loaded to load itself
27
- * Hooks into bp_setup_nav to add tabs to the profile and group navigation
28
- * Hooks into after_setup_theme to add its thumbnail sizes
29
- *
30
- * @uses bp_loaded
31
- * @uses bp_setup_nav
32
- * @uses after_setup_theme
33
- * @global object $bp_media
34
- */
35
- public function __construct() {
36
- global $bp_media;
37
- //$options = $bp_media->options;
38
-
39
- add_action('bp_loaded', array($this, 'load_component'));
40
- add_action('bp_setup_nav', array($this, 'custom_nav'), 999);
41
- //if ( array_key_exists( 'enable_on_profile', $options ) ) {
42
- // if ( $options[ 'enable_on_profile' ] ) {
43
- // This is where the add actions should move
44
- // after some refactoring,
45
- // so it is loaded on profiles, only when the admin specifies
46
- // }
47
- //}
48
-
49
- add_action('after_setup_theme', array($this, 'add_image_sizes'));
50
- }
51
-
52
- /**
53
- * Load the BPMedia Component as an component of BuddyPress
54
- * Add it to the BuddyPress global object
55
- *
56
- * @global object $bp BuddyPress object
57
- */
58
-
59
- /**
60
- *
61
- * @global object $bp
62
- */
63
- public function load_component() {
64
- global $bp;
65
- $bp->{BP_MEDIA_SLUG} = new BPMediaComponent();
66
- }
67
-
68
- /**
69
- * Navigation Loader
70
- *
71
- * Loads BuddyPress Media's navigation
72
- *
73
- * @global object $bp BuddyPress object
74
- */
75
- public function custom_nav() {
76
- global $bp;
77
- foreach ($bp->bp_nav as $key => $nav_item) {
78
- switch ($nav_item['slug']) {
79
- case BP_MEDIA_IMAGES_SLUG:
80
- case BP_MEDIA_VIDEOS_SLUG:
81
- case BP_MEDIA_AUDIO_SLUG:
82
- case BP_MEDIA_ALBUMS_SLUG:
83
- $bp->bp_options_nav[BP_MEDIA_SLUG][] = array(
84
- 'name' => $nav_item['name'],
85
- 'link' => (
86
- isset($bp->displayed_user->domain) ?
87
- $bp->displayed_user->domain : (
88
- isset($bp->loggedin_user->domain) ?
89
- $bp->loggedin_user->domain : ''
90
- )
91
- )
92
- . $nav_item['slug']
93
- . '/',
94
- 'slug' => $nav_item['slug'],
95
- 'css_id' => $nav_item['css_id'],
96
- 'position' => $nav_item['position'],
97
- 'screen_function' => $nav_item['screen_function'],
98
- 'user_has_access' => true,
99
- 'parent_url' => trailingslashit(
100
- bp_displayed_user_domain()
101
- )
102
- );
103
- unset($bp->bp_nav[$key]);
104
- break;
105
- case BP_MEDIA_UPLOAD_SLUG:
106
- $bp->bp_options_nav[BP_MEDIA_SLUG][] = array(
107
- 'name' => $nav_item['name'],
108
- 'link' => (
109
- isset($bp->displayed_user->domain) ?
110
- $bp->displayed_user->domain : (
111
- isset($bp->loggedin_user->domain) ?
112
- $bp->loggedin_user->domain : ''
113
- )
114
- )
115
- . $nav_item['slug']
116
- . '/',
117
- 'slug' => $nav_item['slug'],
118
- 'css_id' => $nav_item['css_id'],
119
- 'position' => $nav_item['position'],
120
- 'screen_function' => $nav_item['screen_function'],
121
- 'user_has_access' => bp_is_my_profile(),
122
- 'parent_url' => trailingslashit(
123
- bp_displayed_user_domain()
124
- )
125
- );
126
- unset($bp->bp_nav[$key]);
127
- }
128
- switch ($bp->current_component) {
129
- case BP_MEDIA_IMAGES_SLUG:
130
- case BP_MEDIA_VIDEOS_SLUG:
131
- case BP_MEDIA_AUDIO_SLUG:
132
- case BP_MEDIA_ALBUMS_SLUG:
133
- case BP_MEDIA_UPLOAD_SLUG:
134
- $count = count($bp->action_variables);
135
- for ($i = $count; $i > 0; $i--) {
136
- $bp->action_variables[$i]
137
- = $bp->action_variables[$i - 1];
138
- }
139
- $bp->action_variables[0] = $bp->current_action;
140
- $bp->current_action = $bp->current_component;
141
- $bp->current_component = BP_MEDIA_SLUG;
142
- }
143
- }
144
- }
145
-
146
-
147
-
148
- /**
149
- * Add image sizes required by the plugin to existing WordPress sizes.
150
- * This can be filtered
151
- *
152
- * @global object $bp_media
153
- */
154
- public function add_image_sizes() {
155
- global $bp_media;
156
-
157
- $default_sizes = $bp_media->media_sizes();
158
- $image_sizes = $default_sizes['image'];
159
- add_image_size(
160
- 'bp_media_thumbnail', $image_sizes['thumbnail']['width'], $image_sizes['thumbnail']['height'], $image_sizes['thumbnail']['crop']
161
- );
162
- add_image_size(
163
- 'bp_media_activity_image', $image_sizes['medium']['width'], $image_sizes['medium']['height'], $image_sizes['medium']['crop']
164
- );
165
- add_image_size(
166
- 'bp_media_single_image', $image_sizes['large']['width'], $image_sizes['large']['height'], $image_sizes['large']['crop']
167
- );
168
- }
169
-
170
- }
171
-
172
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/BuddyPressMedia.php DELETED
@@ -1,776 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Don't load this file directly!
5
- */
6
- if (!defined('ABSPATH'))
7
- exit;
8
-
9
- /**
10
- * BuddyPress Media
11
- *
12
- * The main BuddyPress Media Class. This is where everything starts.
13
- *
14
- * @package BuddyPressMedia
15
- * @subpackage Main
16
- *
17
- * @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
18
- * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
19
- * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
20
- */
21
- class BuddyPressMedia {
22
-
23
- /**
24
- *
25
- * @var string The text domain for loading translations
26
- */
27
- public $text_domain = 'buddypress-media';
28
-
29
- /**
30
- *
31
- * @var array BuddyPress Media settings
32
- */
33
- public $options = array();
34
-
35
- /**
36
- *
37
- * @var string Email address the admin support form should send to
38
- */
39
- public $support_email = 'support@rtcamp.com';
40
-
41
- /**
42
- *
43
- * @var string Support forum url
44
- */
45
- public $support_url = 'http://rtcamp.com/support/forum/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media';
46
-
47
- /**
48
- *
49
- * @var object/array The query that fetches media (photos, video and audio)
50
- */
51
- public $query;
52
-
53
- /**
54
- *
55
- * @var object/array The query that fetches albums
56
- */
57
- public $albums_query;
58
-
59
- /**
60
- *
61
- * @var int Count
62
- */
63
- public $count = null;
64
-
65
- /**
66
- *
67
- * @var int Number of media items to show in one view.
68
- */
69
- public $posts_per_page = 10;
70
-
71
- /**
72
- *
73
- * @var array The types of activity BuddyPress Media creates
74
- */
75
- public $activity_types = array(
76
- 'media_upload',
77
- 'album_updated',
78
- 'album_created'
79
- );
80
-
81
- /**
82
- *
83
- * @var array A cache for activities that are hidden by BuddyPress Media
84
- */
85
- public $hidden_activity_cache = array();
86
-
87
- /**
88
- *
89
- * @var type
90
- */
91
- public $loader;
92
-
93
- /**
94
- *
95
- * @var type
96
- */
97
- public $group_loader;
98
-
99
- /**
100
- * Constructs the class
101
- * Defines constants and excerpt lengths, initiates admin notices,
102
- * loads and initiates the plugin, loads translations.
103
- * Initialises media counter
104
- *
105
- * @global int $bp_media_counter Media counter
106
- */
107
- public function __construct() {
108
- /**
109
- * Define constants
110
- */
111
- $this->constants();
112
- /**
113
- * Define excerpt lengths
114
- */
115
- $this->excerpt_lengths();
116
- /**
117
- * Add admin notice for BuddyPress dependance
118
- */
119
- add_action('admin_notices', array($this, 'bp_exists'));
120
- /**
121
- * Activate the plugin!
122
- */
123
- register_activation_hook(__FILE__, array($this, 'activate'));
124
-
125
- /**
126
- * Hook it to BuddyPress
127
- */
128
- add_action('bp_include', array($this, 'init'));
129
-
130
- /**
131
- * Hook admin to wp init
132
- */
133
- add_action('bp_init', array($this, 'admin_init'));
134
- /**
135
- * Add the widget
136
- */
137
- add_action('widgets_init', array($this, 'widgets_init'), 1);
138
- /**
139
- * Load translations
140
- */
141
- add_action('plugins_loaded', array($this, 'load_translation'));
142
- /**
143
- * Initialise media counter
144
- */
145
- global $bp_media_counter;
146
- $bp_media_counter = 0;
147
- }
148
-
149
- /**
150
- * Checks if BuddyPress is installed!
151
- */
152
- public function bp_exists() {
153
- if (!class_exists('BuddyPress')) {
154
- $plugins = get_plugins();
155
- if (array_key_exists('buddypress/bp-loader.php', $plugins)) {
156
- $install_link = wp_nonce_url(admin_url('plugins.php?action=activate&amp;plugin=buddypress%2Fbp-loader.php'), 'activate-plugin_buddypress/bp-loader.php');
157
- } else {
158
- include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
159
- $info = plugins_api('plugin_information', array('slug' => 'buddypress'));
160
- $install_link = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=buddypress'), 'install-plugin_buddypress');
161
- }
162
- echo '<div class="error">
163
- <p><strong>' . __('BuddyPress is not installed.', $this->text_domain) . '</strong></p>
164
- <p>'
165
- . __('To use BuddyPress Media, BuddyPress must be installed first.', $this->text_domain) .
166
- ' ' . sprintf(__('<a href="%s">Install BuddyPress now</a>', $this->text_domain), $install_link)
167
- . '</p>
168
- </div>';
169
- }
170
- }
171
-
172
- /**
173
- * Populates $options with saved settings
174
- */
175
- public function get_option() {
176
- $options = bp_get_option('bp_media_options', false);
177
- if (!$options) {
178
- $options = array(
179
- 'enable_on_group' => 1,
180
- 'enable_lightbox' => 1,
181
- 'sizes' => array(
182
- 'image' => array(
183
- 'thumbnail' => array('width' => 150, 'height' => 150, 'crop' => 1),
184
- 'medium' => array('width' => 320, 'height' => 240, 'crop' => 1),
185
- 'large' => array('width' => 800, 'height' => 0, 'crop' => 1)
186
- ),
187
- 'video' => array(
188
- 'medium' => array('width' => 320, 'height' => 240),
189
- 'large' => array('width' => 640, 'height' => 480)
190
- ),
191
- 'audio' => array(
192
- 'medium' => array('width' => 320),
193
- 'large' => array('width' => 640)
194
- ),
195
- 'media' => array(
196
- 'featured' => array('width' => 100,'height'=>100,'crop'=>1)
197
- )
198
- ),
199
- 'featured_image' => 0,
200
- 'featured_video' => 0,
201
- 'featured_audio' => 0,
202
- 'videos_enabled' => 1,
203
- 'audio_enabled' => 1,
204
- 'images_enabled' => 1,
205
- 'download_enabled' => 1,
206
- 'show_admin_menu' => 1
207
- );
208
- bp_update_option('bp_media_options', $options);
209
- } elseif (!isset($options['sizes'])) {
210
- $options['sizes'] = array(
211
- 'image' => array(
212
- 'thumbnail' => array('width' => 150, 'height' => 150, 'crop' => 1),
213
- 'medium' => array('width' => 320, 'height' => 240, 'crop' => 1),
214
- 'large' => array('width' => 800, 'height' => 0, 'crop' => 1)
215
- ),
216
- 'video' => array(
217
- 'medium' => array('width' => 320, 'height' => 240),
218
- 'large' => array('width' => 640, 'height' => 480)
219
- ),
220
- 'audio' => array(
221
- 'medium' => array('width' => 320),
222
- 'large' => array('width' => 640)
223
- ),
224
- 'media' => array(
225
- 'featured' => array('width' => 100,'height'=>100,'crop'=>1)
226
- ));
227
- bp_update_option('bp_media_options', $options);
228
- } elseif (!isset($options['sizes']['media'])) {
229
- $options['sizes']['media'] = array(
230
- 'featured' => array('width' => 100,'height'=>100,'crop'=>1)
231
- );
232
- bp_update_option('bp_media_options', $options);
233
- }
234
-
235
- $this->options = $options;
236
- }
237
-
238
- /**
239
- * Defines all the constants if undefined. Can be overridden by
240
- * defining them elsewhere, say wp-config.php
241
- */
242
- public function constants() {
243
-
244
- /* If the plugin is installed. */
245
- if (!defined('BP_MEDIA_IS_INSTALLED'))
246
- define('BP_MEDIA_IS_INSTALLED', 1);
247
-
248
- /* Current Version. */
249
- if (!defined('BP_MEDIA_VERSION'))
250
- define('BP_MEDIA_VERSION', BuddyPressMedia::plugin_get_version());
251
-
252
- /* Required Version */
253
- if (!defined('BP_MEDIA_REQUIRED_BP'))
254
- define('BP_MEDIA_REQUIRED_BP', '1.6.2');
255
-
256
- /* Database Version */
257
- if (!defined('BP_MEDIA_DB_VERSION'))
258
- define('BP_MEDIA_DB_VERSION', '2.1');
259
-
260
- /* Slug Constants for building urls */
261
-
262
- /* Media slug */
263
- if (!defined('BP_MEDIA_SLUG'))
264
- define('BP_MEDIA_SLUG', 'media');
265
-
266
- /* Upload slug */
267
- if (!defined('BP_MEDIA_UPLOAD_SLUG'))
268
- define('BP_MEDIA_UPLOAD_SLUG', 'upload');
269
-
270
- /* Delete slug */
271
- if (!defined('BP_MEDIA_DELETE_SLUG'))
272
- define('BP_MEDIA_DELETE_SLUG', 'delete');
273
-
274
- /* Photos slug */
275
- if (!defined('BP_MEDIA_IMAGES_SLUG'))
276
- define('BP_MEDIA_IMAGES_SLUG', 'photos');
277
-
278
- if (!defined('BP_MEDIA_IMAGES_VIEW_SLUG'))
279
- define('BP_MEDIA_IMAGES_VIEW_SLUG', 'view');
280
-
281
- if (!defined('BP_MEDIA_IMAGES_EDIT_SLUG'))
282
- define('BP_MEDIA_IMAGES_EDIT_SLUG', 'edit');
283
-
284
- /* Videos slug */
285
- if (!defined('BP_MEDIA_VIDEOS_SLUG'))
286
- define('BP_MEDIA_VIDEOS_SLUG', 'videos');
287
-
288
- if (!defined('BP_MEDIA_VIDEOS_VIEW_SLUG'))
289
- define('BP_MEDIA_VIDEOS_VIEW_SLUG', 'watch');
290
-
291
- if (!defined('BP_MEDIA_VIDEOS_EDIT_SLUG'))
292
- define('BP_MEDIA_VIDEOS_EDIT_SLUG', 'edit');
293
-
294
- /* Audio slug */
295
- if (!defined('BP_MEDIA_AUDIO_SLUG'))
296
- define('BP_MEDIA_AUDIO_SLUG', 'music');
297
-
298
- if (!defined('BP_MEDIA_AUDIO_VIEW_SLUG'))
299
- define('BP_MEDIA_AUDIO_VIEW_SLUG', 'listen');
300
-
301
- if (!defined('BP_MEDIA_AUDIO_EDIT_SLUG'))
302
- define('BP_MEDIA_AUDIO_EDIT_SLUG', 'edit');
303
-
304
- /* Albums slug */
305
- if (!defined('BP_MEDIA_ALBUMS_SLUG'))
306
- define('BP_MEDIA_ALBUMS_SLUG', 'albums');
307
-
308
- if (!defined('BP_MEDIA_ALBUMS_VIEW_SLUG'))
309
- define('BP_MEDIA_ALBUMS_VIEW_SLUG', 'list');
310
-
311
- if (!defined('BP_MEDIA_ALBUMS_EDIT_SLUG'))
312
- define('BP_MEDIA_ALBUMS_EDIT_SLUG', 'edit');
313
-
314
- /* Settings slug */
315
- if (!defined('BP_MEDIA_USER_SETTINGS_SLUG'))
316
- define('BP_MEDIA_USER_SETTINGS_SLUG', 'privacy');
317
-
318
- /* UI Labels loaded via text domain, can be translated */
319
- if (!defined('BP_MEDIA_LABEL'))
320
- define('BP_MEDIA_LABEL', __('Media', $this->text_domain));
321
-
322
- if (!defined('BP_MEDIA_LABEL_SINGULAR'))
323
- define('BP_MEDIA_LABEL_SINGULAR', __('Media', $this->text_domain));
324
- if (!defined('BP_MEDIA_USER_SETTINGS_LABEL'))
325
- define('BP_MEDIA_USER_SETTINGS_LABEL', __('Privacy', $this->text_domain));
326
-
327
- if (!defined('BP_MEDIA_IMAGES_LABEL'))
328
- define('BP_MEDIA_IMAGES_LABEL', __('Photos', $this->text_domain));
329
-
330
- if (!defined('BP_MEDIA_IMAGES_LABEL_SINGULAR'))
331
- define('BP_MEDIA_IMAGES_LABEL_SINGULAR', __('Photo', $this->text_domain));
332
-
333
- if (!defined('BP_MEDIA_VIDEOS_LABEL'))
334
- define('BP_MEDIA_VIDEOS_LABEL', __('Videos', $this->text_domain));
335
-
336
- if (!defined('BP_MEDIA_VIDEOS_LABEL_SINGULAR'))
337
- define('BP_MEDIA_VIDEOS_LABEL_SINGULAR', __('Video', $this->text_domain));
338
-
339
- if (!defined('BP_MEDIA_AUDIO_LABEL'))
340
- define('BP_MEDIA_AUDIO_LABEL', __('Music', $this->text_domain));
341
-
342
- if (!defined('BP_MEDIA_AUDIO_LABEL_SINGULAR'))
343
- define('BP_MEDIA_AUDIO_LABEL_SINGULAR', __('Music', $this->text_domain));
344
-
345
- if (!defined('BP_MEDIA_ALBUMS_LABEL'))
346
- define('BP_MEDIA_ALBUMS_LABEL', __('Albums', $this->text_domain));
347
-
348
- if (!defined('BP_MEDIA_ALBUMS_LABEL_SINGULAR'))
349
- define('BP_MEDIA_ALBUMS_LABEL_SINGULAR', __('Album', $this->text_domain));
350
-
351
- if (!defined('BP_MEDIAUPLOAD_LABEL'))
352
- define('BP_MEDIA_UPLOAD_LABEL', __('Upload', $this->text_domain));
353
-
354
- /* Support Email constant */
355
- if (!defined('BP_MEDIA_SUPPORT_EMAIL'))
356
- define('BP_MEDIA_SUPPORT_EMAIL', $this->support_email);
357
- }
358
-
359
- /**
360
- * Hooks the plugin into BuddyPress via 'bp_include' action.
361
- * Initialises the plugin's functionalities, options,
362
- * loads media for Profiles and Groups.
363
- * Creates Admin panels
364
- * Loads accessory functions
365
- *
366
- * @global BPMediaAdmin $bp_media_admin
367
- */
368
- function init() {
369
-
370
- /**
371
- * Load options/settings
372
- */
373
- $this->get_option();
374
-
375
- if (defined('BP_VERSION') &&
376
- version_compare(BP_VERSION, BP_MEDIA_REQUIRED_BP, '>=')) {
377
- /**
378
- * Add a settings link to the Plugin list screen
379
- */
380
- add_filter('plugin_action_links', array($this, 'settings_link'), 10, 2);
381
- /**
382
- * Load BuddyPress Media for profiles
383
- */
384
- $this->loader = new BPMediaLoader();
385
- /**
386
- * Load BuddyPress Media for groups
387
- */
388
- if (array_key_exists('enable_on_group', $this->options)) {
389
- if ($this->options['enable_on_group']) {
390
- $this->group_loader = new BPMediaGroupLoader();
391
- }
392
- }
393
-
394
-
395
- /**
396
- * Load accessory functions
397
- */
398
- // new BPMediaActivity();
399
- $class_construct = array(
400
- 'activity' => false,
401
- 'filters' => false,
402
- 'actions' => false,
403
- 'function' => false,
404
- 'privacy' => false,
405
- 'download' => false,
406
- 'albumimporter' => false,
407
- 'image' => false,
408
- 'featured' => false
409
- );
410
- $class_construct = apply_filters('bpmedia_class_construct', $class_construct);
411
-
412
- foreach ($class_construct as $classname => $global_scope) {
413
- $class = 'BPMedia' . ucfirst($classname);
414
- if (class_exists($class)) {
415
- if ($global_scope == true) {
416
- global ${'bp_media_' . $classname};
417
- ${'bp_media_' . $classname} = new $class();
418
- } else {
419
- new $class();
420
- }
421
- }
422
- }
423
- }
424
-
425
- /**
426
- * Add admin notices
427
- */
428
- add_action('admin_notices', array($this, 'admin_notice'));
429
- }
430
-
431
- function admin_init(){
432
- /**
433
- * Initialise Admin Panels
434
- */
435
- global $bp_media_admin;
436
- $bp_media_admin = new BPMediaAdmin();
437
- }
438
-
439
- /**
440
- * Loads translations
441
- */
442
- static function load_translation() {
443
- load_plugin_textdomain('buddypress-media', false, basename(BP_MEDIA_PATH) . '/languages/');
444
- }
445
-
446
- /**
447
- * Add a settings link to the BuddyPress Media entry
448
- * in the list of active plugins screen
449
- *
450
- * @param array $links
451
- * @param string $file
452
- * @return array
453
- */
454
- function settings_link($links, $file) {
455
- /* create link */
456
- $plugin_name = plugin_basename(BP_MEDIA_PATH . 'index.php');
457
- $admin_link = $this->get_admin_url(
458
- add_query_arg(
459
- array(
460
- 'page' => 'bp-media-settings'), 'admin.php'
461
- )
462
- );
463
- if ($file == $plugin_name) {
464
- array_unshift(
465
- $links, sprintf(
466
- '<a href="%s">%s</a>', $admin_link, __('Settings', $this->text_domain)
467
- )
468
- );
469
- }
470
- return $links;
471
- }
472
-
473
- /**
474
- * Default media sizes
475
- *
476
- * @return array
477
- */
478
- function media_sizes() {
479
- $options = $this->options;
480
- $def_sizes = array(
481
-
482
- //legacy array
483
- 'single_video' => array(
484
- 'width' => 640,
485
- 'height' => 480
486
- ),
487
- 'single_audio' => array(
488
- 'width' => 640,
489
- ),
490
-
491
- 'image' => array(
492
- 'thumbnail' => array(
493
- 'width' => $options['sizes']['image']['thumbnail']['width'],
494
- 'height' => $options['sizes']['image']['thumbnail']['height'],
495
- 'crop' => $options['sizes']['image']['thumbnail']['crop']
496
- ),
497
- 'medium' => array(
498
- 'width' => $options['sizes']['image']['medium']['width'],
499
- 'height' => $options['sizes']['image']['medium']['height'],
500
- 'crop' => $options['sizes']['image']['medium']['crop'],
501
- ),
502
- 'large' => array(
503
- 'width' => $options['sizes']['image']['large']['width'],
504
- 'height' => $options['sizes']['image']['large']['height'],
505
- 'crop' => $options['sizes']['image']['large']['crop'],
506
- )
507
- ),
508
- 'video' => array(
509
- 'medium' => array(
510
- 'width' => $options['sizes']['video']['medium']['width'],
511
- 'height' => $options['sizes']['video']['medium']['height'],
512
- ),
513
- 'large' => array(
514
- 'width' => $options['sizes']['video']['large']['width'],
515
- 'height' => $options['sizes']['video']['large']['height'],
516
- )
517
- ),
518
- 'audio' => array(
519
- 'medium' => array(
520
- 'width' => $options['sizes']['audio']['medium']['width'],
521
- ),
522
- 'large' => array(
523
- 'width' => $options['sizes']['audio']['large']['width'],
524
- )
525
- )
526
- );
527
-
528
- return $def_sizes;
529
- }
530
-
531
- /**
532
- * Defines default length of strings and excerpts displayed in activities
533
- * and media tabs
534
- *
535
- * @global array $bp_media_default_excerpts
536
- */
537
- function excerpt_lengths() {
538
- global $bp_media_default_excerpts;
539
- $def_excerpt = array(
540
- 'single_entry_title' => 100,
541
- 'single_entry_description' => 500,
542
- 'activity_entry_title' => 50,
543
- 'activity_entry_description' => 500
544
- );
545
-
546
- $bp_media_default_excerpts = apply_filters(
547
- 'bpmedia_excerpt_lengths', $def_excerpt
548
- );
549
- }
550
-
551
- /**
552
- * Admin notices for dependencies and compatibility
553
- *
554
- * @global object/array $current_user
555
- */
556
- public function admin_notice() {
557
- global $current_user;
558
- $user_id = $current_user->ID;
559
- if (isset($_GET['bp_media_nag_ignore'])
560
- && '0' == $_GET['bp_media_nag_ignore']) {
561
- add_user_meta($user_id, 'bp_media_ignore_notice', 'true', true);
562
- }
563
- /* Check that the user hasn't already clicked to ignore the message */
564
- if (!get_user_meta($user_id, 'bp_media_ignore_notice')) {
565
- if (defined('BP_VERSION')) {
566
- if (version_compare(BP_VERSION, BP_MEDIA_REQUIRED_BP, '<')) {
567
- echo '<div class="error"><p>';
568
- printf(
569
- __(
570
- 'The BuddyPress version installed is an
571
- older version and is not supported,
572
- please update BuddyPress to use
573
- BuddyPress Media Plugin.
574
- <a class="alignright" href="%1$s">X</a>', $this->text_domain
575
- ), '?bp_media_nag_ignore=0'
576
- );
577
- echo "</p></div>";
578
- }
579
- } else {
580
- echo '<div class="error"><p>';
581
- printf(
582
- __(
583
- 'You have not installed BuddyPress.
584
- Please install latest version of BuddyPress
585
- to use BuddyPress Media plugin.
586
- <a class="alignright" href="%1$s">X</a>', $this->text_domain
587
- ), '?bp_media_nag_ignore=0'
588
- );
589
- echo "</p></div>";
590
- }
591
- }
592
- }
593
-
594
- /**
595
- * Plugin activation, checks for old database and updates it.
596
- *
597
- */
598
- public function activate() {
599
- $bpmquery = new WP_Query(
600
- array(
601
- 'post_type' => 'bp_media',
602
- 'posts_per_page' => 1
603
- )
604
- );
605
- if ($bpmquery->found_posts > 0) {
606
- update_site_option('bp_media_db_version', '1.0');
607
- } else {
608
- switch (get_site_option('bp_media_db_version', false, false)) {
609
- case '2.0':
610
- break;
611
- default:
612
- update_site_option(
613
- 'bp_media_db_version', BP_MEDIA_DB_VERSION
614
- );
615
- }
616
- }
617
-
618
- BPMediaPrivacy::install();
619
- }
620
-
621
- /**
622
- * Provides the right admin url to work with
623
- *
624
- * @param string $path
625
- * @param string $scheme
626
- * @return string The proper admin url for single/multisite installs
627
- */
628
- function get_admin_url($path = '', $scheme = 'admin') {
629
-
630
- // Links belong in network admin
631
- if (is_multisite())
632
- $url = network_admin_url($path, $scheme);
633
-
634
- // Links belong in site admin
635
- else
636
- $url = admin_url($path, $scheme);
637
-
638
- return $url;
639
- }
640
-
641
- /**
642
- * Registers and activates the BuddyPress Media Widgets
643
- */
644
- function widgets_init() {
645
- register_widget('BPMediaWidget');
646
- }
647
-
648
- /**
649
- *
650
- */
651
- function enabled() {
652
- $options = $this->options;
653
- $enabled = array(
654
- 'image' => false,
655
- 'video' => false,
656
- 'audio' => false,
657
- 'album' => true,
658
- 'upload' => true
659
- );
660
- if (array_key_exists('images_enabled', $options)) {
661
- if ($options['images_enabled'] == 1) {
662
- $enabled['image'] = true;
663
- }
664
- }
665
- if (array_key_exists('videos_enabled', $options)) {
666
- if ($options['videos_enabled'] == 1) {
667
- $enabled['video'] = true;
668
- }
669
- }
670
- if (array_key_exists('audio_enabled', $options)) {
671
- if ($options['audio_enabled'] == 1) {
672
- $enabled['audio'] = true;
673
- }
674
- }
675
-
676
- return $enabled;
677
- }
678
-
679
- function default_count() {
680
- $count = $this->posts_per_page;
681
- if (array_key_exists('default_count', $this->options)) {
682
- $count = $this->options['default_count'];
683
- }
684
- $count = (!is_int($count)) ? 0 : $count;
685
- return (!$count) ? 10 : $count;
686
- }
687
-
688
- function default_tab() {
689
- $enabled = $this->enabled();
690
- unset($enabled['upload']);
691
- unset($enabled['album']);
692
- foreach ($enabled as $tab => $value) {
693
- if ($value == true) {
694
- return $tab;
695
- }
696
- }
697
- }
698
-
699
- function defaults_tab() {
700
- $defaults_tab = $this->default_tab();
701
- if ($defaults_tab != 'audio') {
702
- $defaults_tab .= 's';
703
- }
704
- return $defaults_tab;
705
- }
706
-
707
- /*
708
- static function get_wall_album( $group_id = false ) {
709
- global $wpdb;
710
- $group_id = ( ! $group_id) ? '1' : $group_id;
711
- $album_name = __( 'Wall Posts', BP_MEDclaIA_TXT_DOMAIN );
712
- $query = "SELECT ID FROM {$wpdb->prefix}posts ps LEFT JOIN
713
- {$wpdb->prefix}postmeta pm ON ps.ID= pm.post_id WHERE ps.post_title
714
- LIKE '{$album_name}' AND ps.post_type='bp_media_album' AND
715
- pm.meta_key='bp-media-key' AND pm.meta_value ='{$group_id}'";
716
- $wall_albums = $wpdb->get_results( $query, ARRAY_A );
717
- if ( count( $wall_albums ) > 1 ) {
718
- return BuddyPressMedia::merge_duplicate_wall_albums( $wall_albums );
719
- } elseif($wall_albums) {
720
- return $wall_albums[ 0 ][ 'ID' ];
721
- }
722
- }
723
- *
724
- */
725
-
726
- static function merge_duplicate_wall_albums($wall_albums) {
727
- global $wpdb;
728
- $album_id = $wall_albums[0]['ID'];
729
- unset($wall_albums[0]);
730
- foreach ($wall_albums as $album) {
731
- $query = "SELECT ID FROM {$wpdb->prefix}posts WHERE
732
- post_parent={$album['ID']} AND post_type='attachment'";
733
- $media = $wpdb->get_results($query, ARRAY_A);
734
- foreach ($media as $file) {
735
- $wpdb->update(
736
- $wpdb->prefix . 'posts', array(
737
- ' post_parent' => $album_id
738
- ), array('ID' => $file['ID']), array('%d'), array('%d')
739
- );
740
- }
741
-
742
- wp_delete_post($album['ID'], true);
743
- }
744
- }
745
-
746
- static function plugin_get_version($path = NULL) {
747
- require_once(ABSPATH . 'wp-admin/includes/plugin.php');
748
- $path = ($path) ? $path : BP_MEDIA_PATH . 'index.php';
749
- $plugin_data = get_plugin_data($path);
750
- $plugin_version = $plugin_data['Version'];
751
- return $plugin_version;
752
- }
753
-
754
- static function get_current_user_default_album() {
755
- if (is_user_logged_in()) {
756
- $current_user_id = get_current_user_id();
757
- $album_id = get_user_meta($current_user_id, 'bp-media-default-album', true);
758
- return $album_id;
759
- }
760
- return false;
761
- }
762
-
763
- }
764
-
765
- /**
766
- * This wraps up the main BuddyPress Media class. Three important notes:
767
- *
768
- * 1. All the constants can be overridden.
769
- * So, you could use, 'portfolio' instead of 'media'
770
- * 2. The default thumbnail and display sizes can be filtered
771
- * using 'bpmedia_media_sizes' hook
772
- * 3. The excerpts and string sizes can be filtered
773
- * using 'bpmedia_excerpt_lengths' hook
774
- *
775
- */
776
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/RTMedia.php ADDED
@@ -0,0 +1,702 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Don't load this file directly!
5
+ */
6
+ if ( ! defined( 'ABSPATH' ) )
7
+ exit;
8
+
9
+ /**
10
+ * BuddyPress Media
11
+ *
12
+ * The main BuddyPress Media Class. This is where everything starts.
13
+ *
14
+ * @package BuddyPressMedia
15
+ * @subpackage Main
16
+ *
17
+ * @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
18
+ * @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
19
+ * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
20
+ */
21
+ class RTMedia {
22
+
23
+ /**
24
+ * @var string default thumbnail url fallback for all media types
25
+ */
26
+ private $default_thumbnail;
27
+
28
+ /**
29
+ *
30
+ * @var array allowed media types
31
+ */
32
+ public $allowed_types;
33
+
34
+ /**
35
+ *
36
+ * @var array privacy settings
37
+ */
38
+ public $privacy_settings;
39
+
40
+ /**
41
+ *
42
+ * @var array default media sizes
43
+ */
44
+ public $default_sizes;
45
+
46
+ /**
47
+ *
48
+ * @var object default application wide privacy levels
49
+ */
50
+ public $default_privacy = array(
51
+ '0' => 'Public',
52
+ '20' => 'Users',
53
+ '40' => 'Friends',
54
+ '60' => 'Private'
55
+ );
56
+
57
+ /**
58
+ *
59
+ * @var string Support forum url
60
+ */
61
+ public $support_url = 'http://rtcamp.com/support/forum/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media';
62
+
63
+ /**
64
+ *
65
+ * @var int Number of media items to show in one view.
66
+ */
67
+ public $posts_per_page = 10;
68
+
69
+ /**
70
+ *
71
+ * @var array The types of activity BuddyPress Media creates
72
+ */
73
+ public $activity_types = array(
74
+ 'media_upload',
75
+ 'album_updated',
76
+ 'album_created'
77
+ );
78
+ public $options;
79
+ public $render_options;
80
+
81
+ /**
82
+ * Constructs the class
83
+ * Defines constants and excerpt lengths, initiates admin notices,
84
+ * loads and initiates the plugin, loads translations.
85
+ * Initialises media counter
86
+ *
87
+ * @global int $bp_media_counter Media counter
88
+ */
89
+ public function __construct() {
90
+
91
+ // Rewrite API flush before activating and after deactivating the plugin
92
+ register_activation_hook( __FILE__, array( $this, 'flush_rewrite' ) );
93
+ register_deactivation_hook( __FILE__, array( $this, 'flush_rewrite' ) );
94
+
95
+ $this->default_thumbnail = apply_filters( 'rtmedia_default_thumbnail', RTMEDIA_URL . 'assets/thumb_default.png' );
96
+
97
+ // check for global album --- after wordpress is fully loaded
98
+ add_action( 'init', array( $this, 'check_global_album' ) );
99
+
100
+ // Hook it to WordPress
101
+ add_action( 'plugins_loaded', array( $this, 'init' ), 20 );
102
+
103
+ // Load translations
104
+ add_action( 'plugins_loaded', array( $this, 'load_translation' ), 10 );
105
+
106
+ //Admin Panel
107
+ add_action( 'init', array( $this, 'admin_init' ) );
108
+
109
+ add_action('wp_enqueue_scripts', array('RTMediaGalleryShortcode', 'register_scripts'));
110
+ //add_action('wp_footer', array('RTMediaGalleryShortcode', 'print_script'));
111
+
112
+ // Enqueue Plugin Scripts and Styles
113
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ), 11 );
114
+
115
+
116
+ /* Includes db specific wrapper functions required to render the template */
117
+ include(RTMEDIA_PATH . 'app/main/controllers/template/rt-template-functions.php');
118
+
119
+
120
+
121
+ }
122
+
123
+ function set_site_options() {
124
+
125
+ $rtmedia_options = rtmedia_get_site_option( 'rtmedia-options' );
126
+ $bp_media_options = rtmedia_get_site_option( 'bp_media_options' );
127
+
128
+ if ( $rtmedia_options == false ) {
129
+ $this->init_site_options();
130
+ } else {
131
+ /* if new options added via filter then it needs to be updated */
132
+ $this->options = $rtmedia_options;
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Default allowed media types array
138
+ */
139
+ function set_allowed_types() {
140
+ $allowed_types = array(
141
+ 'photo' => array(
142
+ 'name' => 'photo',
143
+ 'plural' => 'photos',
144
+ 'label' => __( 'Photo', 'rtmedia' ),
145
+ 'plural_label' => __( 'Photos', 'rtmedia' ),
146
+ 'extn' => array( 'jpeg', 'png' ),
147
+ 'thumbnail' => RTMEDIA_URL . 'app/assets/img/image_thumb.png'
148
+ ),
149
+ 'video' => array(
150
+ 'name' => 'video',
151
+ 'plural' => 'videos',
152
+ 'label' => __( 'Video', 'rtmedia' ),
153
+ 'plural_label' => __( 'Videos', 'rtmedia' ),
154
+ 'extn' => array( 'mp4' ),
155
+ 'thumbnail' => RTMEDIA_URL . 'app/assets/img/video_thumb.png'
156
+ ),
157
+ 'music' => array(
158
+ 'name' => 'music',
159
+ 'plural' => 'music',
160
+ 'label' => __( 'Music', 'rtmedia' ),
161
+ 'plural_label' => __( 'Music', 'rtmedia' ),
162
+ 'extn' => array( 'mp3' ),
163
+ 'thumbnail' => RTMEDIA_URL . 'app/assets/img/audio_thumb.png'
164
+ )
165
+ );
166
+
167
+ // filter for hooking additional media types
168
+ $allowed_types = apply_filters( 'rtmedia_allowed_types', $allowed_types );
169
+
170
+ // sanitize all the types
171
+ $allowed_types = $this->sanitize_allowed_types( $allowed_types );
172
+
173
+ // set the allowed types property
174
+ $this->allowed_types = $allowed_types;
175
+ }
176
+
177
+ /**
178
+ * Sanitize all media sizes after hooking custom media types
179
+ *
180
+ * @param array $allowed_types allowed media types after hooking custom types
181
+ * @return array $allowed_types sanitized media types
182
+ */
183
+ function sanitize_allowed_types( $allowed_types ) {
184
+ // check if the array is formatted properly
185
+ if ( ! is_array( $allowed_types ) && count( $allowed_types ) < 1 )
186
+ return;
187
+
188
+ //loop through each type
189
+ foreach ( $allowed_types as $key => &$type ) {
190
+
191
+ if ( ! isset( $type[ 'name' ] ) || // check if a name is set
192
+ empty( $type[ 'name' ] ) ||
193
+ ! isset( $type[ 'extn' ] ) || // check if file extensions are set
194
+ empty( $type[ 'extn' ] ) || strstr( $type[ 'name' ], " " ) || strstr( $type[ 'name' ], "_" ) ) {
195
+ unset( $allowed_types[ $key ] ); // if not unset this type
196
+ continue;
197
+ }
198
+
199
+ // if thumbnail is not supplied, use the default thumbnail
200
+ if ( ! isset( $type[ 'thumbnail' ] ) || empty( $type[ 'thumbnail' ] ) ) {
201
+ $type[ 'thumbnail' ] = $this->default_thumbnail;
202
+ }
203
+ }
204
+ return $allowed_types;
205
+ }
206
+
207
+ /**
208
+ * Set the default sizes
209
+ */
210
+ function set_default_sizes() {
211
+ $this->default_sizes = array(
212
+ 'photo' => array(
213
+ 'thumbnail' => array( 'width' => 150, 'height' => 150, 'crop' => 1 ),
214
+ 'medium' => array( 'width' => 320, 'height' => 240, 'crop' => 1 ),
215
+ 'large' => array( 'width' => 800, 'height' => 0, 'crop' => 1 )
216
+ ),
217
+ 'video' => array(
218
+ 'activityPlayer' => array( 'width' => 320, 'height' => 240 ),
219
+ 'singlePlayer' => array( 'width' => 640, 'height' => 480 )
220
+ ),
221
+ 'music' => array(
222
+ 'activityPlayer' => array( 'width' => 320 ),
223
+ 'singlePlayer' => array( 'width' => 640 )
224
+ ),
225
+ 'featured' => array(
226
+ 'default' => array( 'width' => 100, 'height' => 100, 'crop' => 1 )
227
+ )
228
+ );
229
+
230
+ $this->default_sizes = apply_filters( 'rtmedia_allowed_sizes', $this->default_sizes );
231
+ }
232
+
233
+ /**
234
+ * Set privacy options
235
+ */
236
+ function set_privacy() {
237
+
238
+ $this->privacy_settings = array(
239
+ 'levels' => array(
240
+ 60 => __( '<strong>Private</strong> - Visible only to the user', 'rtmedia' ),
241
+ 40 => __( '<strong>Friends</strong> - Visible to user\'s friends', 'rtmedia' ),
242
+ 20 => __( '<strong>Users</strong> - Visible to registered users', 'rtmedia' ),
243
+ 0 => __( '<strong>Public</strong> - Visible to the world', 'rtmedia' )
244
+ )
245
+ );
246
+ $this->privacy_settings = apply_filters( 'rtmedia_privacy_levels', $this->privacy_settings );
247
+
248
+ if ( function_exists( "bp_is_active" ) && ! bp_is_active( 'friends' ) ) {
249
+ unset( $this->privacy_settings[ 'levels' ][ 40 ] );
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Load admin screens
255
+ *
256
+ * @global RTMediaAdmin $rtmedia_admin Class for loading admin screen
257
+ */
258
+ function admin_init() {
259
+ global $rtmedia_admin;
260
+ $rtmedia_admin = new RTMediaAdmin();
261
+ }
262
+
263
+ function media_screen() {
264
+ return;
265
+ }
266
+
267
+ function get_user_link( $user ) {
268
+
269
+ if ( function_exists( 'bp_core_get_user_domain' ) ) {
270
+ $parent_link = bp_core_get_user_domain( $user );
271
+ } else {
272
+ $parent_link = get_author_posts_url( $user );
273
+ }
274
+
275
+ return $parent_link;
276
+ }
277
+
278
+ public function init_buddypress_options() {
279
+ /**
280
+ * BuddyPress Settings
281
+ */
282
+ $bp_media_options = rtmedia_get_site_option( 'bp_media_options' );
283
+
284
+ $group = 0;
285
+ if ( isset( $bp_media_options[ 'enable_on_group' ] ) && ! empty( $bp_media_options[ 'enable_on_group' ] ) )
286
+ $group = $bp_media_options[ 'enable_on_group' ];
287
+ else if ( function_exists( "bp_is_active" ) )
288
+ $group = bp_is_active( 'groups' );
289
+ $this->options[ 'buddypress_enableOnGroup' ] = $group;
290
+
291
+ $activity = 0;
292
+ if ( isset( $bp_media_options[ 'activity_upload' ] ) && ! empty( $bp_media_options[ 'activity_upload' ] ) )
293
+ $activity = $bp_media_options[ 'activity_upload' ];
294
+ else if ( function_exists( "bp_is_active" ) )
295
+ $activity = bp_is_active( 'activity' );
296
+ $this->options[ 'buddypress_enableOnActivity' ] = $activity;
297
+
298
+ $this->options[ 'buddypress_enableOnProfile' ] = 1;
299
+
300
+ /* Last settings updated in options. Update them in DB & after this no other option would be saved in db */
301
+ rtmedia_update_site_option( 'rtmedia-options', $this->options );
302
+ }
303
+
304
+ public function init_site_options() {
305
+
306
+ $bp_media_options = rtmedia_get_site_option( 'bp_media_options' );
307
+
308
+ $defaults = array(
309
+ 'general_enableAlbums' => 0,
310
+ 'general_enableComments' => 0,
311
+ 'general_downloadButton' => (isset( $bp_media_options[ 'download_enabled' ] )) ? $bp_media_options[ 'download_enabled' ] : 0,
312
+ 'general_enableLightbox' => (isset( $bp_media_options[ 'enable_lightbox' ] )) ? $bp_media_options[ 'enable_lightbox' ] : 0,
313
+ 'general_perPageMedia' => (isset( $bp_media_options[ 'default_count' ] )) ? $bp_media_options[ 'default_count' ] : 10,
314
+ 'general_enableMediaEndPoint' => 0,
315
+ 'general_showAdminMenu' => (isset( $bp_media_options[ 'show_admin_menu' ] )) ? $bp_media_options[ 'show_admin_menu' ] : 0,
316
+ );
317
+
318
+
319
+ foreach ( $this->allowed_types as $type ) {
320
+ // invalid keys handled in sanitize method
321
+ $defaults[ 'allowedTypes_' . $type[ 'name' ] . '_enabled' ] = 1;
322
+ $defaults[ 'allowedTypes_' . $type[ 'name' ] . '_featured' ] = 0;
323
+ }
324
+
325
+ /* Previous Sizes values from buddypress is migrated */
326
+ foreach ( $this->default_sizes as $type => $typeValue ) {
327
+ foreach ( $typeValue as $size => $sizeValue ) {
328
+ foreach ( $sizeValue as $dimension => $value ) {
329
+ switch ( $type ) {
330
+ case 'photo':
331
+ if ( isset( $bp_media_options[ 'sizes' ][ 'image' ][ $size ][ $dimension ] ) && ! empty( $bp_media_options[ 'sizes' ][ 'image' ][ $size ][ $dimension ] ) )
332
+ $value = $bp_media_options[ 'sizes' ][ 'image' ][ $size ][ $dimension ];
333
+ break;
334
+ case 'video':
335
+ case 'music':
336
+ $old = ($type == 'video') ? 'video' : ($type == 'music') ? 'audio' : '';
337
+ switch ( $size ) {
338
+ case 'activityPlayer':
339
+ if ( isset( $bp_media_options[ 'sizes' ][ $old ][ 'medium' ][ $dimension ] ) && ! empty( $bp_media_options[ 'sizes' ][ $old ][ 'medium' ][ $dimension ] ) )
340
+ $value = $bp_media_options[ 'sizes' ][ $old ][ 'medium' ][ $dimension ];
341
+ break;
342
+ case 'singlePlayer':
343
+ if ( isset( $bp_media_options[ 'sizes' ][ $old ][ 'large' ][ $dimension ] ) && ! empty( $bp_media_options[ 'sizes' ][ $old ][ 'large' ][ $dimension ] ) )
344
+ $value = $bp_media_options[ 'sizes' ][ $old ][ 'large' ][ $dimension ];
345
+ break;
346
+ }
347
+ break;
348
+ }
349
+ $defaults[ 'defaultSizes_' . $type . '_' . $size . '_' . $dimension ] = $value;
350
+ }
351
+ }
352
+ }
353
+
354
+ /* Privacy */
355
+ $defaults[ 'privacy_enabled' ] = (isset( $bp_media_options[ 'privacy_enabled' ] )) ? $bp_media_options[ 'privacy_enabled' ] : 0;
356
+ $defaults[ 'privacy_default' ] = (isset( $bp_media_options[ 'default_privacy_level' ] )) ? $bp_media_options[ 'default_privacy_level' ] : 0;
357
+ $defaults[ 'privacy_userOverride' ] = (isset( $bp_media_options[ 'privacy_override_enabled' ] )) ? $bp_media_options[ 'privacy_override_enabled' ] : 0;
358
+
359
+ $this->options = $defaults;
360
+
361
+ $this->init_buddypress_options();
362
+ }
363
+
364
+ /**
365
+ * Defines all the constants if undefined. Can be overridden by
366
+ * defining them elsewhere, say wp-config.php
367
+ */
368
+ public function constants() {
369
+
370
+ /* If the plugin is installed. */
371
+ if ( ! defined( 'RTMEDIA_IS_INSTALLED' ) )
372
+ define( 'RTMEDIA_IS_INSTALLED', 1 );
373
+
374
+ /* Current Version. */
375
+ if ( ! defined( 'RTMEDIA_VERSION' ) )
376
+ define( 'RTMEDIA_VERSION', '3.0.0' );
377
+
378
+ /* Required Version */
379
+ if ( ! defined( 'RTMEDIA_REQUIRED_BP' ) )
380
+ define( 'RTMEDIA_REQUIRED_BP', '1.7' );
381
+
382
+
383
+ /* Slug Constants for building urls */
384
+
385
+ /* Media slugs */
386
+
387
+ if ( ! defined( 'RTMEDIA_MEDIA_SLUG' ) )
388
+ define( 'RTMEDIA_MEDIA_SLUG', 'media' );
389
+
390
+ if ( ! defined( 'RTMEDIA_MEDIA_LABEL' ) )
391
+ define( 'RTMEDIA_MEDIA_LABEL', __( 'Media', 'rtmedia' ) );
392
+
393
+ if ( ! defined( 'RTMEDIA_ALL_SLUG' ) )
394
+ define( 'RTMEDIA_ALL_SLUG', 'all' );
395
+
396
+ if ( ! defined( 'RTMEDIA_ALL_LABEL' ) )
397
+ define( 'RTMEDIA_ALL_LABEL', __( 'All', 'rtmedia' ) );
398
+
399
+ if ( ! defined( 'RTMEDIA_ALBUM_SLUG' ) )
400
+ define( 'RTMEDIA_ALBUM_SLUG', 'album' );
401
+
402
+ if ( ! defined( 'RTMEDIA_ALBUM_PLURAL_SLUG' ) )
403
+ define( 'RTMEDIA_ALBUM_PLURAL_SLUG', 'albums' );
404
+
405
+ if ( ! defined( 'RTMEDIA_ALBUM_LABEL' ) )
406
+ define( 'RTMEDIA_ALBUM_LABEL', __( 'Album', 'rtmedia' ) );
407
+
408
+ if ( ! defined( 'RTMEDIA_ALBUM_PLURAL_LABEL' ) )
409
+ define( 'RTMEDIA_ALBUM_PLURAL_LABEL', __( 'Albums', 'rtmedia' ) );
410
+
411
+ /* Upload slug */
412
+ if ( ! defined( 'RTMEDIA_UPLOAD_SLUG' ) )
413
+ define( 'RTMEDIA_UPLOAD_SLUG', 'upload' );
414
+
415
+ /* Upload slug */
416
+ if ( ! defined( 'RTMEDIA_UPLOAD_LABEL' ) )
417
+ define( 'RTMEDIA_UPLOAD_LABEL', __( 'Upload', 'rtmedia' ) );
418
+
419
+ /* Global Album/Wall Post */
420
+ if ( ! defined( 'RTMEDIA_GLOBAL_ALBUM_LABEL' ) )
421
+ define( 'RTMEDIA_GLOBAL_ALBUM_LABEL', __( 'Wall Post', 'rtmedia' ) );
422
+
423
+ $this->define_type_constants();
424
+ }
425
+
426
+ function define_type_constants() {
427
+
428
+ if ( ! isset( $this->allowed_types ) )
429
+ return;
430
+ foreach ( $this->allowed_types as $type ) {
431
+
432
+ if ( ! isset( $type[ 'name' ] ) || $type[ 'name' ] === '' )
433
+ continue;
434
+
435
+ $name = $type[ 'name' ];
436
+
437
+ if ( isset( $type[ 'plural' ] ) && $type[ 'plural' ] != '' ) {
438
+ $plural = $type[ 'plural' ];
439
+ } else {
440
+ $plural = $name . 's';
441
+ }
442
+
443
+ if ( isset( $type[ 'label' ] ) && $type[ 'label' ] != '' ) {
444
+ $label = $type[ 'label' ];
445
+ } else {
446
+ $label = ucfirst( $name );
447
+ }
448
+
449
+ if ( isset( $type[ 'label_plural' ] ) && $type[ 'label_plural' ] != '' ) {
450
+ $label_plural = $type[ 'label_plural' ];
451
+ } else {
452
+ $label_plural = ucfirst( $plural );
453
+ }
454
+
455
+ $slug = strtoupper( $name );
456
+
457
+ if ( ! defined( 'RTMEDIA_' . $slug . '_SLUG' ) )
458
+ define( 'RTMEDIA_' . $slug . '_SLUG', $name );
459
+ if ( ! defined( 'RTMEDIA_' . $slug . '_PLURAL_SLUG' ) )
460
+ define( 'RTMEDIA_' . $slug . '_PLURAL_SLUG', $plural );
461
+ if ( ! defined( 'RTMEDIA_' . $slug . '_LABEL' ) )
462
+ define( 'RTMEDIA_' . $slug . '_LABEL', $label );
463
+ if ( ! defined( 'RTMEDIA_' . $slug . '_PLURAL_LABEL' ) )
464
+ define( 'RTMEDIA_' . $slug . '_PLURAL_LABEL', $label_plural );
465
+ }
466
+ }
467
+
468
+ /**
469
+ * Hooks the plugin into BuddyPress via 'bp_include' action.
470
+ * Initialises the plugin's functionalities, options,
471
+ * loads media for Profiles and Groups.
472
+ * Creates Admin panels
473
+ * Loads accessory functions
474
+ *
475
+ * @global BPMediaAdmin $bp_media_admin
476
+ */
477
+ function init() {
478
+
479
+ $this->set_allowed_types(); // Define allowed types
480
+ $this->constants(); // Define constants
481
+ $this->set_default_sizes(); // set default sizes
482
+ $this->set_privacy(); // set privacy
483
+
484
+ /**
485
+ * Load options/settings
486
+ */
487
+ $this->set_site_options();
488
+
489
+ /**
490
+ *
491
+ * Buddypress Media Auto Upgradation
492
+ */
493
+ $this->update_db();
494
+
495
+ /**
496
+ * Add a settings link to the Plugin list screen
497
+ */
498
+ // add_filter('plugin_action_links', array($this, 'settings_link'), 10, 2);
499
+
500
+ /**
501
+ * BuddyPress - Media Navigation Tab Inject
502
+ *
503
+ */
504
+
505
+
506
+ /**
507
+ * Load accessory functions
508
+ */
509
+ // new BPMediaActivity();
510
+ $class_construct = array(
511
+ 'deprecated' => true,
512
+ 'interaction' => true,
513
+ //'template' => false,
514
+ 'upload_shortcode' => false,
515
+ 'gallery_shortcode' => false,
516
+ 'upload_endpoint' => false,
517
+ 'privacy' => false,
518
+ 'nav' => true,
519
+ 'like' => false,
520
+ 'cover_art' => false,
521
+ 'featured' => false
522
+
523
+ //'query' => false
524
+ );
525
+ global $rtmedia_nav;
526
+ $class_construct = apply_filters( 'rtmedia_class_construct', $class_construct );
527
+
528
+ foreach ( $class_construct as $key => $global_scope ) {
529
+ $classname = '';
530
+ $ck = explode( '_', $key );
531
+
532
+ foreach ( $ck as $cn ) {
533
+ $classname .= ucfirst( $cn );
534
+ }
535
+
536
+ $class = 'RTMedia' . $classname;
537
+
538
+ if ( class_exists( $class ) ) {
539
+ if ( $global_scope == true ) {
540
+ global ${'rtmedia_' . $key};
541
+ ${'rtmedia_' . $key} = new $class();
542
+ } else {
543
+ new $class();
544
+ }
545
+ }
546
+ }
547
+
548
+ global $rtmedia_buddypress_activity;
549
+ $rtmedia_buddypress_activity = new RTMediaBuddyPressActivity();
550
+ $media = new RTMediaMedia();
551
+ $media->delete_hook();
552
+
553
+
554
+ global $rtmedia_ajax;
555
+ $rtmedia_ajax = new RTMediaAJAX();
556
+
557
+ do_action( 'rtmedia_init' );
558
+ }
559
+
560
+ /**
561
+ * Loads translations
562
+ */
563
+ static function load_translation() {
564
+ load_plugin_textdomain( 'rtmedia', false, basename( RTMEDIA_PATH ) . '/languages/' );
565
+ }
566
+
567
+ function flush_rewrite() {
568
+ error_log( 'flush' );
569
+ flush_rewrite_rules();
570
+ }
571
+
572
+ function check_global_album() {
573
+ $album = new RTMediaAlbum();
574
+ $global_album = $album->get_default();
575
+ //** Hack for plupload default name
576
+ if ( isset( $_POST[ "action" ] ) && isset( $_POST[ "mode" ] ) && $_POST[ "mode" ] == "file_upload" ) {
577
+ unset( $_POST[ "name" ] );
578
+ }
579
+
580
+ //**
581
+ if ( ! $global_album ) {
582
+ $global_album = $album->add_global( __( "Wall Posts", "rtmedia", true ) );
583
+ }
584
+ }
585
+
586
+ function default_count() {
587
+ $count = $this->posts_per_page;
588
+ if ( array_key_exists( 'default_count', $this->options ) ) {
589
+ $count = $this->options[ 'default_count' ];
590
+ }
591
+ $count = ( ! is_int( $count )) ? 0 : $count;
592
+ return ( ! $count) ? 10 : $count;
593
+ }
594
+
595
+ static function plugin_get_version( $path = NULL ) {
596
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
597
+ $path = ($path) ? $path : RTMEDIA_PATH . 'index.php';
598
+ $plugin_data = get_plugin_data( $path );
599
+ $plugin_version = $plugin_data[ 'Version' ];
600
+ return $plugin_version;
601
+ }
602
+
603
+ function update_db() {
604
+ $update = new RTDBUpdate();
605
+ if ( $update->check_upgrade() ) {
606
+ $update->do_upgrade();
607
+ }
608
+ new RTMediaMigration();
609
+ }
610
+
611
+ function enqueue_scripts_styles() {
612
+ wp_enqueue_script( 'rtmedia-mejs', RTMEDIA_URL . 'lib/media-element/mediaelement-and-player.min.js', '', RTMEDIA_VERSION );
613
+ wp_enqueue_style( 'rtmedia-mecss', RTMEDIA_URL . 'lib/media-element/mediaelementplayer.min.css', '', RTMEDIA_VERSION );
614
+ wp_enqueue_style( 'rtmedia-main', RTMEDIA_URL . 'app/assets/css/main.css', '', RTMEDIA_VERSION );
615
+ wp_enqueue_script( 'rtmedia-main', RTMEDIA_URL . 'app/assets/js/rtMedia.js', array( 'jquery', 'rtmedia-mejs' ), RTMEDIA_VERSION );
616
+ wp_enqueue_style( 'rtmedia-magnific', RTMEDIA_URL . 'lib/magnific/magnific.css', '', RTMEDIA_VERSION );
617
+ wp_enqueue_script( 'rtmedia-magnific', RTMEDIA_URL . 'lib/magnific/magnific.js', '', RTMEDIA_VERSION );
618
+ wp_localize_script( 'rtmedia-main', 'rtmedia_ajax_url', admin_url( 'admin-ajax.php' ) );
619
+ }
620
+
621
+ function set_bp_bar() {
622
+ remove_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );
623
+ }
624
+
625
+ function set_friends_object(){
626
+ if(is_user_logged_in()){
627
+ $user = get_current_user_id();
628
+ $friends = friends_get_friend_user_ids($user);
629
+ }else{
630
+ $user = 0;
631
+ }
632
+
633
+ }
634
+
635
+ }
636
+
637
+ function get_rtmedia_permalink( $id ) {
638
+ $mediaModel = new RTMediaModel();
639
+
640
+ $media = $mediaModel->get( array( 'id' => $id ) );
641
+ global $rtmedia_query;
642
+
643
+ if ($media[ 0 ]->context == 'group' )
644
+ $parent_link = get_rtmedia_group_link( $media[ 0 ]->context_id );
645
+ else{
646
+ if(isset($rtmedia_query->query) && isset($rtmedia_query->query["context"]) && $rtmedia_query->query["context"] == "group"){
647
+ $parent_link = get_rtmedia_group_link( $rtmedia_query->query["context_id"] );
648
+ }else{
649
+ $parent_link = get_rtmedia_user_link( $media[ 0 ]->media_author );
650
+ }
651
+ }
652
+
653
+
654
+ $parent_link = trailingslashit($parent_link);
655
+ return trailingslashit( $parent_link . 'media/' . $id );
656
+ }
657
+
658
+ function get_rtmedia_user_link( $id ) {
659
+ if ( function_exists( 'bp_core_get_user_domain' ) ) {
660
+ $parent_link = bp_core_get_user_domain( $id );
661
+ } else {
662
+ $parent_link = get_author_posts_url( $id );
663
+ }
664
+ return $parent_link;
665
+ }
666
+
667
+ function rtmedia_update_site_option( $option_name, $option_value ) {
668
+ update_site_option( $option_name, $option_value );
669
+ }
670
+
671
+ function get_rtmedia_group_link( $group_id ){
672
+ global $bp;
673
+ $group = groups_get_group( array( 'group_id' => $group_id ) );
674
+ return home_url( $bp->groups->slug . '/' . $group -> slug );
675
+ }
676
+
677
+ function rtmedia_get_site_option( $option_name, $default = false ) {
678
+ $return_val = get_site_option( $option_name );
679
+ if ( $return_val === false ) {
680
+ if ( function_exists( "bp_get_option" ) ) {
681
+ $return_val = bp_get_option( $option_name, $default );
682
+ rtmedia_update_site_option( $option_name, $return_val );
683
+ }
684
+ }
685
+ if ( $default !== false && $return_val === false ) {
686
+ $return_val = $default;
687
+ }
688
+ return $return_val;
689
+ }
690
+
691
+ /**
692
+ * This wraps up the main rtMedia class. Three important notes:
693
+ *
694
+ * 1. All the constants can be overridden.
695
+ * So, you could use, 'portfolio' instead of 'media'
696
+ * 2. The default thumbnail and display sizes can be filtered
697
+ * using 'bpmedia_media_sizes' hook
698
+ * 3. The excerpts and string sizes can be filtered
699
+ * using 'bpmedia_excerpt_lengths' hook
700
+ *
701
+ */
702
+
app/main/activity/BPMediaActivity.php DELETED
@@ -1,173 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaActivity
4
- *
5
- * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
6
- */
7
- if ( ! class_exists( 'BPMediaActivity' ) ) {
8
-
9
- class BPMediaActivity {
10
-
11
- var $default_album_id;
12
- var $attachment_id = 0;
13
- var $content = '';
14
- var $media_count = 1;
15
-
16
- public function __construct() {
17
- global $bp_media;
18
- $options = $bp_media->options;
19
- if ( isset( $options[ 'activity_upload' ] ) && $options[ 'activity_upload' ] != 0 ) {
20
- add_action( 'bp_activity_post_form_options', array( $this, 'activity_uploader' ) );
21
- add_action( 'bp_groups_posted_update', array( $this, 'override_media_album_id' ), '', 4 );
22
- add_filter( 'bp_activity_new_update_content', array( $this, 'override_update' ) );
23
- add_filter( 'bp_activity_latest_update_content', array( $this, 'override_update' ) );
24
- add_filter( 'bp_get_member_latest_update', array( $this, 'latest_update' ) );
25
- add_filter( 'bp_get_activity_latest_update', array( $this, 'latest_update' ) );
26
- add_action( 'wp_ajax_bp_media_get_latest_activity', array( $this, 'latest_update' ) );
27
- add_filter( 'groups_activity_new_update_content', array( $this, 'override_update' ) );
28
-
29
- add_filter( 'bp_activity_allowed_tags', 'BPMediaFunction::override_allowed_tags', 1 );
30
- add_action( 'init', array( $this, 'scripts' ) );
31
- //remove_filter( 'bp_get_activity_content_body', 'wptexturize' );
32
- remove_filter( 'bp_get_activity_content', 'wptexturize' );
33
- }
34
- }
35
-
36
- public function scripts() {
37
- wp_enqueue_script( 'json2' );
38
- }
39
-
40
- public function activity_uploader() {
41
- ?>
42
- <input type ="hidden" id="bp-media-update-text" />
43
- <input type ="hidden" id="bp-media-update-json" />
44
- <input type ="hidden" id="bp-media-latest-update" />
45
- <div id="bp-media-activity-upload-ui" class="hide-if-no-js drag-drop">
46
- <input id="bp-media-activity-upload-browse-button" type="button" value="<?php _e( 'Attach Media', 'buddypress-media' ); ?>" class="button" />
47
- <div id="bp-media-activity-uploaded-files"></div>
48
- </div>
49
- <?php
50
- }
51
-
52
- public function decode( $content ) {
53
- $content = stripslashes( $content );
54
- $activity_json = json_decode( $content, true );
55
- return $activity_json;
56
- }
57
-
58
- public function get_media( $content ) {
59
- $activity_json = $this->decode( $content );
60
- $activity_media = json_decode( $activity_json[ 'media' ], true );
61
- return $activity_media;
62
- }
63
-
64
- public function get_text( $content ) {
65
- $activity_json = $this->decode( $content );
66
- $activity_text = rawurldecode($activity_json[ 'update_txt' ]);
67
- return $activity_text;
68
- }
69
-
70
- public function latest_update( $content ) {
71
- global $bp;
72
- if ( isset( $_GET[ 'content' ] ) ) {
73
- $update_id = $_GET[ 'id' ];
74
- $content = $_GET[ 'content' ];
75
- } else {
76
- if ( bp_displayed_user_id() )
77
- $user_id = bp_displayed_user_id();
78
- else
79
- $user_id = bp_get_member_user_id();
80
- if ( ! $update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) )
81
- return $content;
82
- $update_id = $update[ 'id' ];
83
- $content = $update[ 'content' ];
84
- }
85
- //$activity_id = $update[''];
86
- $activity_media = $this->get_media( $content );
87
- $newcontent = $this->get_text( $content );
88
- if ( isset( $activity_media ) ) {
89
- if ( ! is_array( $activity_media ) ) {
90
- $activity_media[ ] = $activity_media;
91
- }
92
- $media_id = $activity_media[ count( $activity_media ) - 1 ];
93
- try {
94
- $media = new BPMediaHostWordpress( $media_id );
95
- $newcontent .= '<a href="' . $media->get_url() . '">
96
- <img src="' . $media->get_media_thumbnail() . '"/>
97
- </a>';
98
- } catch ( Exception $e ) {
99
- echo $e->getMessage();
100
- }
101
- }
102
-
103
- $newcontent .= ' <a href="' . bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $update_id . '/"> ' . __( 'View', 'buddypress' ) . '</a>';
104
- if ( isset( $_GET[ 'content' ] ) ) {
105
- echo $newcontent;
106
- die;
107
- } else {
108
- return $newcontent;
109
- }
110
- }
111
-
112
- public function override_update( $content ) {
113
- $this->content = $content;
114
- $activity_media = $this->get_media( $content );
115
- $newcontent = '<p>' . $this->get_text( $content ) . '</p>';
116
- if ( isset( $activity_media ) ) {
117
- if ( ! is_array( $activity_media ) ) {
118
- $activity_media[ ] = $activity_media;
119
- }
120
-
121
- if ( count( $activity_media ) > 1 ) {
122
- $newcontent .= '<ul class="bp-media-list-media">';
123
- }
124
-
125
- foreach ( $activity_media as $media_id ) {
126
- try {
127
- $media = new BPMediaHostWordpress( $media_id );
128
- if ( count( $activity_media ) > 1 ) {
129
- $newcontent .= $media->get_album_activity_content();
130
- } else {
131
- add_filter( 'bp_media_single_activity_title', create_function( '', 'return;' ) );
132
- $newcontent .= $media->get_media_activity_content();
133
- }
134
- } catch ( Exception $e ) {
135
- echo $e->getMessage();
136
- }
137
- }
138
- if ( count( $activity_media ) > 1 ) {
139
- $newcontent .= '</ul>';
140
- }
141
- }
142
- return $newcontent;
143
- }
144
-
145
- public function override_media_album_id( $content, $user_id, $group_id, $activity_id ) {
146
- global $bp;
147
- $activity_media = $this->get_media( $content );
148
- if ( isset( $activity_media ) ) {
149
- if ( ! is_array( $activity_media ) ) {
150
- $activity_media[ ] = $activity_media;
151
- }
152
-
153
- foreach ( $activity_media as $media_id ) {
154
- update_post_meta( $media_id, 'bp-media-key', -$group_id );
155
- $attachment = get_post( $media_id );
156
- $attachment->post_parent = groups_get_groupmeta( $group_id, 'bp_media_default_album' );
157
- wp_update_post( $attachment );
158
- $activity_id = groups_record_activity( array(
159
- 'id' => $activity_id,
160
- 'user_id' => $user_id,
161
- 'action' => sprintf( __( '%1$s posted an update in the group %2$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' ),
162
- 'content' => $this->override_update( $this->content ),
163
- 'type' => 'activity_update',
164
- 'item_id' => $group_id
165
- ) );
166
- }
167
- }
168
- }
169
-
170
- }
171
-
172
- }
173
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/contexts/RTMediaContext.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaContext
10
+ *
11
+ * Default Context - The page on from which the request is generating will be taken
12
+ * as the default context; if any context/context_id is not passed while uploading any media
13
+ * or displaying the gallery.
14
+ *
15
+ * @author saurabh
16
+ */
17
+ class RTMediaContext {
18
+
19
+ /**
20
+ *
21
+ * @var type
22
+ *
23
+ * $type - Context Type. It can be any type among these. (post, page, custom_post, home_page, archive etc.)
24
+ * $id - context id of the context
25
+ */
26
+ public $type, $id;
27
+
28
+ /**
29
+ *
30
+ * @return \RTMediaContext
31
+ */
32
+ function __construct() {
33
+ $this->set_context();
34
+ return $this;
35
+ }
36
+
37
+ /**
38
+ *
39
+ */
40
+ function set_context() {
41
+ global $post;
42
+ if (class_exists('BuddyPress')) {
43
+ $this->set_bp_context();
44
+ } else {
45
+ $this->set_wp_context();
46
+ }
47
+ }
48
+
49
+ /**
50
+ *
51
+ * @global type $post
52
+ */
53
+ function set_wp_context() {
54
+ global $post;
55
+ if(is_author()) {
56
+ $this->type = 'profile';
57
+ $this->id = get_query_var('author');
58
+ } elseif (isset($post->post_type)) {
59
+ $this->type = $post->post_type;
60
+ $this->id = $post->ID;
61
+ }
62
+ }
63
+
64
+ /**
65
+ *
66
+ */
67
+ function set_bp_context() {
68
+ if (bp_is_blog_page()) {
69
+ $this->set_wp_context();
70
+ } else {
71
+ $this->set_bp_component_context();
72
+ }
73
+ }
74
+
75
+ /**
76
+ *
77
+ */
78
+ function set_bp_component_context() {
79
+ if (bp_displayed_user_id() && !bp_is_group())
80
+ $this->type = 'profile';
81
+ else if (!bp_displayed_user_id() && bp_is_group())
82
+ $this->type = 'group';
83
+
84
+ $this->id = $this->get_current_bp_component_id();
85
+ }
86
+
87
+ /**
88
+ *
89
+ * @return type
90
+ */
91
+ function get_current_bp_component_id() {
92
+ switch (bp_current_component()) {
93
+ case 'groups': return bp_get_current_group_id();
94
+ break;
95
+ default:
96
+ return bp_displayed_user_id();
97
+ break;
98
+ }
99
+ }
100
+
101
+ }
102
+
103
+ ?>
app/main/controllers/activity/RTMediaActivity.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaActivity
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaActivity {
14
+
15
+
16
+ var $media = array();
17
+ var $activity_text = '';
18
+ var $privacy;
19
+
20
+ /**
21
+ *
22
+ */
23
+ function __construct($media, $privacy=0, $activity_text=false) {
24
+ if(!isset($media))
25
+ return false;
26
+ if(!is_array($media))
27
+ $media = array($media);
28
+
29
+ $this->media = $media;
30
+ $this->activity_text = $activity_text;
31
+ $this->privacy = $privacy;
32
+ }
33
+
34
+ function create_activity_html(){
35
+
36
+
37
+ $html = '';
38
+
39
+ $html .='<div class="rtmedia-activity-container">';
40
+
41
+ if(!empty($this->activity_text)) {
42
+ $html .= '<span class="rtmedia-activity-text">';
43
+ $html .= $this->activity_text;
44
+ $html .= '</span>';
45
+ }
46
+
47
+ $mediaObj = new RTMediaModel();
48
+ $media_details = $mediaObj->get(array('id'=> $this->media));
49
+
50
+ $html .= '<ul class="rtmedia-list large-block-grid-3">';
51
+ foreach ($media_details as $media) {
52
+ $html .= '<li class="rtmedia-list-item">';
53
+ if ( $media->media_type == 'photo' )
54
+ $html .= '<a href ="'. get_rtmedia_permalink($media->id) .'">';
55
+ $html .= '<div class="rtmedia-item-thumbnail">';
56
+
57
+ $html .= $this->media($media);
58
+
59
+ $html .= '</div>';
60
+
61
+ $html .= '<div class="rtmedia-item-title">';
62
+ $html .= '<h4 title="'. $media->media_title .'">';
63
+ if ( $media->media_type != 'photo' )
64
+ $html .= '<a href="'. get_rtmedia_permalink($media->id) .'">';
65
+
66
+ $html .= $media->media_title;
67
+ if ( $media->media_type != 'photo' )
68
+ $html .= '</a>';
69
+ $html .= '</h4>';
70
+ $html .= '</div>';
71
+ if ( $media->media_type == 'photo' )
72
+ $html .= '</a>';
73
+
74
+ $html .= '<div class="rtmedia-item-actions">';
75
+ $html .= $this->actions();
76
+ $html .= '</div>';
77
+ $html .= '</li>';
78
+ }
79
+ $html .= '</ul>';
80
+ $html .= '</div>';
81
+ return $html;
82
+ }
83
+
84
+ function actions(){
85
+
86
+ }
87
+ function media($media) {
88
+ if (isset($media->media_type)) {
89
+ // if ($media->media_type == 'album' ||
90
+ // $media->media_type != 'photo') {
91
+ // $thumbnail_id = get_rtmedia_meta($media->media_id,'cover_art');
92
+ // if ( $thumbnail_id ) {
93
+ // list($src, $width, $height) = wp_get_attachment_image_src($thumbnail_id);
94
+ // return '<img src="'.$src.'" />';
95
+ // }
96
+ // }
97
+
98
+ if ( $media->media_type == 'photo' ) {
99
+ $thumbnail_id = $media->media_id;
100
+ if ( $thumbnail_id ) {
101
+ list($src, $width, $height) = wp_get_attachment_image_src($thumbnail_id);
102
+ $html = '<img src="'.$src.'" />';
103
+ }
104
+ } elseif ( $media->media_type == 'video' ) {
105
+ $html = '<video src="' . wp_get_attachment_url($media->media_id) . '" width="320" height="240" type="video/mp4" class="wp-video-shortcode" id="bp_media_video_' . $media->id . '" controls="controls" preload="none"></video>';
106
+ } elseif ( $media->media_type == 'music' ) {
107
+ $html = '<audio src="' . wp_get_attachment_url($media->media_id) . '" width="320" height="0" type="audio/mp3" class="wp-audio-shortcode" id="bp_media_audio_' . $media->id . '" controls="controls" preload="none"></audio>';
108
+ } else {
109
+ $html = false;
110
+ }
111
+ } else {
112
+ $html = false;
113
+ }
114
+ return apply_filters('rtmedia_single_activity_filter',$html,$media,true);
115
+ }
116
+ }
117
+
118
+ ?>
app/main/controllers/activity/RTMediaBuddyPressActivity.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaBuddyPressActivity
10
+ *
11
+ * @author faishal
12
+ */
13
+ class RTMediaBuddyPressActivity {
14
+
15
+ function __construct() {
16
+ global $rtmedia;
17
+ if($rtmedia->options["buddypress_enableOnActivity"]!==0){
18
+ add_action("bp_after_activity_post_form", array(&$this, "bp_after_activity_post_form"));
19
+ add_action("bp_activity_posted_update", array(&$this, "bp_activity_posted_update"), 99, 3);
20
+ add_action("bp_groups_posted_update", array(&$this, "bp_groups_posted_update"), 99, 4);
21
+ }
22
+ add_action("bp_init", array($this, 'non_threaded_comments'));
23
+ add_action("bp_activity_comment_posted", array($this, "comment_sync"), 10, 2);
24
+ add_filter('bp_activity_allowed_tags', array(&$this, 'override_allowed_tags'));
25
+ }
26
+
27
+ function comment_sync($comment_id, $param) {
28
+
29
+ // comment_id 40
30
+ // Array( [id] => [content] => testing [user_id] => 1 [activity_id] => 26 [parent_id] => 26)
31
+ $activity = new BP_Activity_Activity($param['activity_id']);
32
+ if ($activity->type == 'rtmedia_update') {
33
+ $media_id = $activity->item_id;
34
+ $comment = new RTMediaComment();
35
+ $comment->add(array('comment_content' => $param['content'], 'comment_post_ID' => $media_id));
36
+ }
37
+ }
38
+
39
+ function non_threaded_comments() {
40
+ if (isset($_POST['action']) && $_POST['action'] == 'new_activity_comment') {
41
+ $activity_id = $_POST['form_id'];
42
+ $act = new BP_Activity_Activity($activity_id);
43
+
44
+ if ($act->type == 'rtmedia_update')
45
+ $_POST['comment_id'] = $_POST['form_id'];
46
+ }
47
+ }
48
+
49
+ function bp_groups_posted_update($content, $user_id, $group_id, $activity_id) {
50
+ $this->bp_activity_posted_update($content, $user_id, $activity_id);
51
+ }
52
+
53
+ function bp_activity_posted_update($content, $user_id, $activity_id) {
54
+ if (isset($_POST["rtMedia_attached_files"]) && is_array($_POST["rtMedia_attached_files"])) {
55
+ $objActivity = new RTMediaActivity($_POST["rtMedia_attached_files"], 0, $content);
56
+ global $wpdb, $bp;
57
+ $wpdb->update($bp->activity->table_name, array("type" => "rtmedia_update", "content" => $objActivity->create_activity_html()), array("id" => $activity_id));
58
+ }
59
+ if (isset($_POST['rtmedia-privacy']))
60
+ bp_activity_update_meta($activity_id, 'rtmedia_privacy', ($_POST['rtmedia-privacy'] == 0) ? -1 : $_POST['rtmedia-privacy']);
61
+ }
62
+
63
+ function bp_after_activity_post_form() {
64
+ $url = $_SERVER["REQUEST_URI"];
65
+ $url = trailingslashit($url);
66
+
67
+ $params = array(
68
+ 'url' => (isset($url) && (strpos($url, "/media/") !== false)) ? str_replace("/media/", "/upload/", $url) : 'upload/',
69
+ 'runtimes' => 'gears,html5,flash,silverlight,browserplus',
70
+ 'browse_button' => 'rtmedia-whts-new-upload-button',
71
+ 'container' => 'rtmedia-whts-new-upload-container',
72
+ 'drop_element' => 'rtmedia-whts-new-drag-drop-area',
73
+ 'filters' => apply_filters('bp_media_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => "mp4,jpg,png,jpeg,gif,mp3"))),
74
+ 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))),
75
+ 'multipart' => true,
76
+ 'urlstream_upload' => true,
77
+ 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
78
+ 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
79
+ 'file_data_name' => 'rtmedia_file', // key passed to $_FILE.
80
+ 'multi_selection' => true,
81
+ 'multipart_params' => apply_filters('rtmedia-multi-params', array('redirect' => 'no', 'rtmedia_update' => 'true', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER['REQUEST_URI'], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator(false, true)))
82
+ );
83
+ wp_enqueue_script('rtmedia-backbone', false, '', false, true);
84
+ $is_album = is_rtmedia_album() ? true : false;
85
+ $is_edit_allowed = is_rtmedia_edit_allowed() ? true: false;
86
+ wp_localize_script('rtmedia-backbone', 'is_album', $is_album);
87
+ wp_localize_script('rtmedia-backbone', 'is_edit_allowed', $is_edit_allowed);
88
+ wp_localize_script('rtmedia-backbone', 'rtMedia_update_plupload_config', $params);
89
+
90
+
91
+ $uploadView = new RTMediaUploadView(array('activity' => true));
92
+ $uploadView->render('uploader');
93
+ }
94
+
95
+ function override_allowed_tags($activity_allowedtags) {
96
+
97
+ $activity_allowedtags['video'] = array();
98
+ $activity_allowedtags['video']['id'] = array();
99
+ $activity_allowedtags['video']['class'] = array();
100
+ $activity_allowedtags['video']['src'] = array();
101
+ $activity_allowedtags['video']['controls'] = array();
102
+ $activity_allowedtags['video']['preload'] = array();
103
+ $activity_allowedtags['video']['alt'] = array();
104
+ $activity_allowedtags['video']['title'] = array();
105
+ $activity_allowedtags['video']['width'] = array();
106
+ $activity_allowedtags['video']['height'] = array();
107
+ $activity_allowedtags['video']['poster'] = array();
108
+ $activity_allowedtags['audio'] = array();
109
+ $activity_allowedtags['audio']['id'] = array();
110
+ $activity_allowedtags['audio']['class'] = array();
111
+ $activity_allowedtags['audio']['src'] = array();
112
+ $activity_allowedtags['audio']['controls'] = array();
113
+ $activity_allowedtags['audio']['preload'] = array();
114
+ $activity_allowedtags['audio']['alt'] = array();
115
+ $activity_allowedtags['audio']['title'] = array();
116
+ $activity_allowedtags['audio']['width'] = array();
117
+ $activity_allowedtags['audio']['poster'] = array();
118
+ $activity_allowedtags['div'] = array();
119
+ $activity_allowedtags['div']['id'] = array();
120
+ $activity_allowedtags['div']['class'] = array();
121
+ $activity_allowedtags['a'] = array();
122
+ $activity_allowedtags['a']['title'] = array();
123
+ $activity_allowedtags['a']['href'] = array();
124
+ $activity_allowedtags['ul'] = array();
125
+ $activity_allowedtags['ul']['class'] = array();
126
+ $activity_allowedtags['li'] = array();
127
+
128
+ return $activity_allowedtags;
129
+ }
130
+
131
+ }
132
+
133
+ ?>
app/main/controllers/media/RTMediaAlbum.php ADDED
@@ -0,0 +1,506 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaAlbum
10
+ *
11
+ * @author Udit Desai <udit.desai@rtcamp.com>
12
+ */
13
+ class RTMediaAlbum {
14
+
15
+ /**
16
+ *
17
+ * @var type
18
+ *
19
+ * Media object associated with the album. It works as an interface
20
+ * for the actions specific the media from this album
21
+ */
22
+ var $media;
23
+
24
+ /**
25
+ *
26
+ */
27
+ public function __construct() {
28
+ add_action('init', array(&$this,'register_post_types'),12);
29
+ $this->media = new RTMediaMedia();
30
+ }
31
+
32
+ /**
33
+ * Register Custom Post Types required by rtMedia
34
+ */
35
+ function register_post_types() {
36
+
37
+ /* Set up Album labels */
38
+ $album_labels = array(
39
+ 'name' => __( 'Albums', 'rtmedia' ),
40
+ 'singular_name' => __( 'Album', 'rtmedia' ),
41
+ 'add_new' => __( 'Create', 'rtmedia' ),
42
+ 'add_new_item' => __( 'Create Album', 'rtmedia' ),
43
+ 'edit_item' => __( 'Edit Album', 'rtmedia' ),
44
+ 'new_item' => __( 'New Album', 'rtmedia' ),
45
+ 'all_items' => __( 'All Albums', 'rtmedia' ),
46
+ 'view_item' => __( 'View Album', 'rtmedia' ),
47
+ 'search_items' => __( 'Search Albums', 'rtmedia' ),
48
+ 'not_found' => __( 'No album found', 'rtmedia' ),
49
+ 'not_found_in_trash' => __( 'No album found in Trash', 'rtmedia' ),
50
+ 'parent_item_colon' => '',
51
+ 'menu_name' => __( 'Albums', 'rtmedia' )
52
+ );
53
+
54
+ /* Set up Album post type arguments */
55
+ $album_args = array(
56
+ 'labels' => $album_labels,
57
+ 'public' => true,
58
+ 'publicly_queryable' => true,
59
+ 'show_ui' => false,
60
+ 'show_in_menu' => false,
61
+ 'query_var' => true,
62
+ 'capability_type' => 'post',
63
+ 'has_archive' => true,
64
+ 'hierarchical' => false,
65
+ 'menu_position' => null,
66
+ 'supports' => array(
67
+ 'title',
68
+ 'author',
69
+ 'thumbnail',
70
+ 'excerpt',
71
+ 'comments'
72
+ )
73
+ );
74
+
75
+ /* register Album post type */
76
+ register_post_type( 'rtmedia_album', $album_args );
77
+ }
78
+
79
+
80
+ /**
81
+ * Method verifies the nonce passed while performing any CRUD operations
82
+ * on the album.
83
+ *
84
+ * @param type $mode
85
+ * @return boolean
86
+ */
87
+ function verify_nonce($mode) {
88
+
89
+ $nonce = $_REQUEST["rtmedia_{$mode}_album_nonce"];
90
+ $mode = $_REQUEST['mode'];
91
+ if (wp_verify_nonce($nonce, 'rtmedia_' . $mode))
92
+ return true;
93
+ else
94
+ return false;
95
+ }
96
+
97
+ /**
98
+ * returns user_id of the current logged in user in wordpress
99
+ *
100
+ * @global type $current_user
101
+ * @return type
102
+ */
103
+ function get_current_author() {
104
+
105
+ return get_current_user_id();
106
+ }
107
+
108
+ /**
109
+ * Adds a new album
110
+ *
111
+ * @global type $rtmedia_interaction
112
+ * @param type $title
113
+ * @param type $author_id
114
+ * @param type $new
115
+ * @param type $post_id
116
+ * @return type
117
+ */
118
+ function add($title = '', $author_id = false, $new = true, $post_id = false, $context = false, $context_id = false) {
119
+
120
+ /* action to perform any task before adding the album */
121
+ do_action('rtmedia_before_add_album');
122
+
123
+ $author_id = $author_id ? $author_id : $this->get_current_author();
124
+
125
+ /* Album Details which will be passed to Database query to add the album */
126
+ $post_vars = array(
127
+ 'post_title' => (empty($title)) ? 'Untitled Album' : $title,
128
+ 'post_type' => 'rtmedia_album',
129
+ 'post_author' => $author_id,
130
+ 'post_status' => 'publish'
131
+ );
132
+
133
+ /* Check whether to create a new album in wp_post table
134
+ * This is the case when a user creates a album of his own. We need to
135
+ * create a separte post in wp_post which will work as parent for
136
+ * all the media uploaded to that album
137
+ *
138
+ * */
139
+ if($new)
140
+ $album_id = wp_insert_post($post_vars);
141
+ /**
142
+ * if user uploads any media directly to a post or a page or any custom
143
+ * post then the context in which the user is uploading a media becomes
144
+ * an album in itself. We do not need to create a separate album in this
145
+ * case.
146
+ */
147
+ else $album_id = $post_id;
148
+
149
+ $current_album = get_post($album_id, ARRAY_A);
150
+ if($context===false){
151
+ $context = (isset($rtmedia_interaction->context->type))
152
+ ? $rtmedia_interaction->context->type : NULL;
153
+ }
154
+ if($context_id===false){
155
+ $context = (isset($rtmedia_interaction->context->id))
156
+ ? $rtmedia_interaction->context->id : NULL;
157
+ }
158
+ // add in the media since album is also a media
159
+ //defaults
160
+ global $rtmedia_interaction;
161
+ $attributes = array(
162
+ 'blog_id' => get_current_blog_id(),
163
+ 'media_id' => $album_id,
164
+ 'album_id' => NULL,
165
+ 'media_title' => $current_album['post_title'],
166
+ 'media_author' => $current_album['post_author'],
167
+ 'media_type' => 'album',
168
+ 'context' => $context,
169
+ 'context_id' => $context_id,
170
+ 'activity_id' => NULL,
171
+ 'privacy' => NULL
172
+ );
173
+
174
+ $rtmedia_id = $this->media->insert_album($attributes);
175
+
176
+ /* action to perform any task after adding the album */
177
+ do_action('rtmedia_after_add_album', $this);
178
+
179
+ return $rtmedia_id;
180
+ }
181
+
182
+ /**
183
+ * Wrapper method to add a global album
184
+ *
185
+ * @param type $title
186
+ * @return boolean
187
+ */
188
+ function add_global($title ='') {
189
+
190
+ // $super_user_ids = get_super_admins();
191
+ $author_id = $this->get_current_author();
192
+ /**
193
+ * only admin privilaged user can add a global album
194
+ */
195
+
196
+ if( current_user_can('activate_plugins') ) {
197
+
198
+ $album_id = $this->add($title, $author_id,true,false);
199
+
200
+ $this->save_globals($album_id);
201
+
202
+ return $album_id;
203
+ } else
204
+ return false;
205
+ }
206
+
207
+ /**
208
+ * Get the list of all global albums
209
+ * @return type
210
+ */
211
+ static function get_globals() {
212
+ return get_site_option('rtmedia-global-albums');
213
+ }
214
+
215
+ /**
216
+ * There is a default global album which works as a Wall Post Album for the
217
+ * user.
218
+ *
219
+ * @return type
220
+ */
221
+ static function get_default() {
222
+ $albums = self::get_globals();
223
+
224
+ if(isset($albums[0]))
225
+ return $albums[0];
226
+ else return false;
227
+ }
228
+
229
+ /**
230
+ * Save global albums for newly added album
231
+ *
232
+ * @param type $album_ids
233
+ * @return boolean
234
+ */
235
+ function save_globals($album_ids = false) {
236
+
237
+ if(!$album_ids)
238
+ return false;
239
+
240
+ $albums = self::get_globals();
241
+
242
+ if(!$albums)
243
+ $albums = array();
244
+
245
+ if(!is_array($album_ids))
246
+ $album_ids = array($album_ids);
247
+
248
+ $albums = array_merge($albums, $album_ids);
249
+ update_site_option('rtmedia-global-albums', $albums);
250
+ }
251
+
252
+ /**
253
+ * Wrapper method to update details for any global album
254
+ *
255
+ * @param type $id
256
+ * @param type $title
257
+ * @return boolean
258
+ */
259
+ function update_global($id, $title = '') {
260
+
261
+ /**
262
+ * Only admin can update global albums
263
+ */
264
+ $super_user_ids = get_super_admins();
265
+ if( in_array($this->get_current_author(), $super_user_ids) ) {
266
+
267
+ return $this->update($id, $title);
268
+ }
269
+ else
270
+ return false;
271
+ }
272
+
273
+ /**
274
+ * Update any album. Generic method for all the user.
275
+ *
276
+ * @param type $id
277
+ * @param type $title
278
+ * @return boolean
279
+ */
280
+ function update($id, $title = '') {
281
+
282
+ /* Action to perform before updating the album */
283
+ do_action('rtmedia_before_update_album', $this);
284
+ if ( empty($title) && empty($id) ) {
285
+ return false;
286
+ } else {
287
+
288
+ $args = array(
289
+ 'ID' => $id,
290
+ 'post_title' => $title
291
+ );
292
+ $status = wp_insert_post($args);
293
+ if (get_class($status) == 'WP_Error' || $status == 0) {
294
+ return false;
295
+ } else {
296
+ /* Action to perform after updating the album */
297
+ do_action('rtmedia_after_update_album', $this);
298
+ return true;
299
+ }
300
+ }
301
+
302
+ }
303
+
304
+ /**
305
+ * Wrapper method to delete a global album
306
+ *
307
+ * @param type $id
308
+ * @return boolean
309
+ */
310
+ function delete_global($id) {
311
+
312
+ /**
313
+ * Only admin can delete a global album
314
+ */
315
+ $super_user_ids = get_super_admins();
316
+ if( in_array($this->get_current_author(), $super_user_ids) ) {
317
+
318
+ $default_album = self::get_default();
319
+
320
+ /**
321
+ * Default album is NEVER deleted.
322
+ */
323
+ if($id == $default_album)
324
+ return false;
325
+
326
+ /**
327
+ * If a global album is deleted then all the media of that album
328
+ * is merged to the default global album and then the album is deleted.
329
+ */
330
+ //merge with the default album
331
+ $this->merge($default_album, $id);
332
+
333
+ return $this->delete($id);
334
+ }
335
+ else
336
+ return false;
337
+ }
338
+
339
+ /**
340
+ * Generic method to delete any album
341
+ *
342
+ * @param type $id
343
+ * @return type
344
+ */
345
+ function delete($id) {
346
+
347
+ /* action to perform any task befor deleting an album */
348
+ do_action('rtmedia_before_delete_album', $this);
349
+
350
+ /**
351
+ * First fetch all the media from that album
352
+ */
353
+ add_filter('rt_db_model_per_page', array($this,'set_queries_per_page'),10,2);
354
+ $page = 1;
355
+ $flag = true;
356
+
357
+ /**
358
+ * Delete each media from the album first
359
+ */
360
+ while( $media = $this->media->model->get_by_album_id($id, $page) ) {
361
+
362
+ $media_id = $media['result'][0]['media_id'];
363
+
364
+ $flag = wp_delete_attachment($media_id);
365
+
366
+ if(!$flag)
367
+ break;
368
+
369
+ $page++;
370
+ }
371
+
372
+ /**
373
+ * If all the media are deleted from the album then delete the album at last.
374
+ */
375
+ if($flag) {
376
+ $this->media->delete($id);
377
+ }
378
+
379
+ /* action to perform any task after deleting an album */
380
+ do_action('rtmedia_after_delete_album', $this);
381
+ return $flag;
382
+
383
+ }
384
+
385
+ /**
386
+ * Helper function to set number of queries in pagination
387
+ *
388
+ * @param int $per_page
389
+ * @param type $table_name
390
+ * @return int
391
+ */
392
+ function set_queries_per_page($per_page, $table_name) {
393
+
394
+ $per_page = 1;
395
+ return $per_page;
396
+ }
397
+
398
+ /**
399
+ * Generic function to merge two albums
400
+ *
401
+ * @param type $primary_album_id
402
+ * @param type $secondary_album_id
403
+ * @return type
404
+ */
405
+ function merge($primary_album_id, $secondary_album_id) {
406
+
407
+ add_filter('rt_db_model_per_page', array($this,'set_queries_per_page'),10,2);
408
+ $page = 1;
409
+
410
+ /**
411
+ * Transfer all the media from secondary album to primary album
412
+ */
413
+ while( $media = $this->media->model->get_by_album_id($secondary_album_id, $page) ) {
414
+
415
+ $media_id = $media['result'][0]['media_id'];
416
+ $this->media->move($media_id,$primary_album_id);
417
+
418
+ $page++;
419
+ }
420
+
421
+ $author = $this->get_current_author();
422
+ $admins = get_super_admins();
423
+ $global_albums = self::get_globals();
424
+
425
+ if(in_array ($secondary_album_id, $global_albums) )
426
+ if( in_array($author, $admins) )
427
+ $this->delete_global ($secondary_album_id);
428
+ else return false;
429
+ else
430
+ $this->delete ($secondary_album_id);
431
+
432
+ return $primary_album_id;
433
+ }
434
+
435
+ /**
436
+ * Convert a post which is not indexed in rtMedia to an album.
437
+ *
438
+ * All the attachments from that post will become media of the new album.
439
+ *
440
+ * @global type $wpdb
441
+ * @param type $post_id
442
+ * @return boolean
443
+ */
444
+ function convert_post($post_id) {
445
+
446
+ global $wpdb;
447
+ /**
448
+ * Fetch all the attachments from the given post
449
+ */
450
+ $attachment_ids = $wpdb->get_results("SELECT ID
451
+ FROM $wpdb->posts
452
+ WHERE post_parent = $post_id");
453
+
454
+ /**
455
+ * Create a album. Not a new album. Just give index to this post in rtMedia
456
+ */
457
+ $album_id = $this->add($post['post_title'], $post['post_author'], false, $post_id);
458
+
459
+ $album_data = $this->model->get_by_media_id($album_id);
460
+
461
+ /* Album details */
462
+ $album_meta = array(
463
+ 'album_id' => $album_id,
464
+ 'context' => $album_data['results'][0]['context'],
465
+ 'context_id' => $album_data['results'][0]['context_id'],
466
+ 'activity_id' => $album_data['results'][0]['activity_id'],
467
+ 'privacy' => $album_data['results'][0]['privacy']
468
+ );
469
+
470
+ /**
471
+ * Index attachments in rtMedia
472
+ */
473
+ $this->media->insertmedia($attachment_ids, $album_meta);
474
+
475
+ return true;
476
+ }
477
+
478
+ /**
479
+ * Check if a post is being indexed as an rtMedia album
480
+ * @param integer $post_id the post id to check
481
+ * @return boolean if a post is an rtmedia album
482
+ */
483
+ function is_post_album($post_id){
484
+ $album = $this->model->get(array('album_id'=>$post_id));
485
+ if(!empty($album) && count($album)>0){
486
+ return true;
487
+ }
488
+ return false;
489
+
490
+ }
491
+
492
+ /**
493
+ * Convert an existing post, with attachments indexed by rtMedia to rtMedia album
494
+ * @param integer $post_id The post id to convert
495
+ */
496
+ function post_to_album($post_id){
497
+ $album_id = $this->add($post['post_title'], $post['post_author'], false, $post_id);
498
+ $this->model->update(
499
+ array('album_id'=>$album_id),
500
+ array('context'=>$post['post_type'],'context_id'=>$post_id)
501
+ );
502
+
503
+ }
504
+ }
505
+
506
+ ?>
app/main/controllers/media/RTMediaComment.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaComment
10
+ *
11
+ * @author udit
12
+ */
13
+ class RTMediaComment {
14
+
15
+ var $rtmedia_comment_model;
16
+
17
+ public function __construct() {
18
+ $this->rtmedia_comment_model = new RTMediaCommentModel();
19
+ }
20
+
21
+ static function comment_nonce_generator($echo = true) {
22
+ if($echo) {
23
+ wp_nonce_field('rtmedia_comment_nonce','rtmedia_comment_nonce');
24
+ } else {
25
+ $token = array(
26
+ 'action' => 'rtmedia_comment_nonce',
27
+ 'nonce' => wp_create_nonce('rtmedia_comment_nonce')
28
+ );
29
+
30
+ return json_encode($token);
31
+ }
32
+ }
33
+
34
+ /**
35
+ * returns user_id of the current logged in user in wordpress
36
+ *
37
+ * @global type $current_user
38
+ * @return type
39
+ */
40
+ function get_current_id() {
41
+
42
+ global $current_user;
43
+ get_currentuserinfo();
44
+ return $current_user->ID;
45
+ }
46
+
47
+ /**
48
+ * returns user_id of the current logged in user in wordpress
49
+ *
50
+ * @global type $current_user
51
+ * @return type
52
+ */
53
+ function get_current_author() {
54
+
55
+ global $current_user;
56
+ get_currentuserinfo();
57
+ return $current_user->user_login;
58
+ }
59
+
60
+ function add($attr) {
61
+
62
+ do_action('rtmedia_before_add_comment', $attr);
63
+
64
+ $attr['comment_author'] = $this->get_current_author();
65
+ $attr['user_id'] = $this->get_current_id();
66
+ $attr['comment_date'] = current_time('mysql');
67
+ $id = $this->rtmedia_comment_model->insert($attr);
68
+
69
+ do_action('rtmedia_before_add_comment', $attr);
70
+
71
+ return $id;
72
+ }
73
+
74
+ function remove($id) {
75
+
76
+ do_action('rtmedia_before_remove_comment', $attr);
77
+ }
78
+ }
79
+
80
+ ?>
app/main/controllers/media/RTMediaCoverArt.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaCoverArt
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaCoverArt extends RTMediaUserInteraction{
14
+
15
+ /**
16
+ *
17
+ */
18
+ function __construct() {
19
+ $defaults = array(
20
+ 'action' => 'cover',
21
+ 'label' => 'Set as Album Cover',
22
+ 'plural' => '',
23
+ 'undo_label' => 'Unset as Album Cover',
24
+ 'privacy' => 1000, //60,
25
+ 'countable' => false,
26
+ 'single' => false,
27
+ 'repeatable' => false,
28
+ 'undoable' => true
29
+ );
30
+ parent::__construct($defaults);
31
+
32
+ }
33
+
34
+ function process(){
35
+ global $rtmedia_query;
36
+ $media_id = $rtmedia_query->action_query->id;
37
+
38
+ $this->model = new RTMediaModel();
39
+
40
+ $media = $this->model->get(array('id'=>$media_id));
41
+
42
+ $media = $media[0];
43
+
44
+ $album = $media->album_id;
45
+
46
+ $this->model->update(array('cover_art',$media_id),array('id'=>$album));
47
+ return 1;
48
+ }
49
+
50
+ function before_render() {
51
+ $globa_id = RTMediaAlbum::get_default();
52
+
53
+ if(isset($this->media->album_id ) && $this->media->album_id > 0){
54
+ $album = ($this->model->get(array('media_id'=>$globa_id)));
55
+ if($album && isset($album[0])){
56
+ if($album[0]->id == $this->media->album_id){
57
+ $this->privacy =1000;
58
+ return;
59
+ }
60
+ }
61
+ $album = ($this->model->get(array('id'=>$this->media->album_id)));
62
+ if($album && isset($album[0])){
63
+ if($album[0]->media_author != $this->interactor ){
64
+ $this->privacy =1000;
65
+ return;
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ }
72
+
73
+ ?>
app/main/controllers/media/RTMediaFeatured.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaFeatured
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaFeatured extends RTMediaUserInteraction {
14
+
15
+ /**
16
+ *
17
+ */
18
+ public $user_id;
19
+ public $featured;
20
+ public $settings;
21
+
22
+ function __construct($user_id = false, $flag = false) {
23
+ $args = array(
24
+ 'action' => 'featured',
25
+ 'label' => 'Set Featured',
26
+ 'plural' => '',
27
+ 'undo_label' => 'Unset Featured',
28
+ 'privacy' => 60,
29
+ 'countable' => false,
30
+ 'single' => true,
31
+ 'repeatable' => false,
32
+ 'undoable' => true
33
+ );
34
+
35
+
36
+ $this->user_id = $user_id;
37
+ parent::__construct($args);
38
+ $this->settings();
39
+ //$this->get();
40
+ }
41
+ function before_render() {
42
+ $this->get();
43
+ if(! $this->settings[$this->media->media_type])
44
+ return false;
45
+ if(isset($this->action_query) && isset($this->action_query->id) && $this->action_query->id == $this->featured){
46
+ $this->label = $this->undo_label;
47
+ }
48
+
49
+ }
50
+
51
+ function set($media_id = false) {
52
+ if ($media_id === false) {
53
+ return;
54
+ }
55
+ if ($this->user_id === false)
56
+ $this->user_id = get_current_user_id();
57
+ update_user_meta($this->user_id, 'rtmedia_featured_media', $media_id);
58
+ }
59
+
60
+ function get() {
61
+ if ($this->user_id === false){
62
+ $this->user_id = get_current_user_id();
63
+ }
64
+ $this->featured = get_user_meta($this->user_id, "rtmedia_featured_media", true);
65
+ if ($this->featured == "")
66
+ $this->featured = get_user_meta($this->user_id, "bp_media_featured_media", true);
67
+ return $this->featured;
68
+ }
69
+
70
+ function settings() {
71
+ global $rtmedia;
72
+ $this->settings['photo'] = isset($rtmedia->options['allowedTypes_photo_featured']) ? $rtmedia->options['allowedTypes_photo_featured'] : 0;
73
+ $this->settings['video'] = isset($rtmedia->options['allowedTypes_video_featured']) ? $rtmedia->options['allowedTypes_video_featured'] : 0;
74
+ $this->settings['music'] = isset($rtmedia->options['allowedTypes_music_featured']) ? $rtmedia->options['allowedTypes_music_featured'] : 0;
75
+ $this->settings['width'] = isset($rtmedia->options['defaultSizes_featured_default_width']) ? $rtmedia->options['defaultSizes_featured_default_width'] : 400;
76
+ $this->settings['height'] = isset($rtmedia->options['defaultSizes_featured_default_height']) ? $rtmedia->options['defaultSizes_featured_default_height'] : 300;
77
+ $this->settings['crop'] = isset($rtmedia->options['defaultSizes_featured_default_crop']) ? $rtmedia->options['defaultSizes_featured_default_crop'] : 1;
78
+ }
79
+
80
+ function valid_type($type) {
81
+ if (isset($this->settings[$type]) && $this->settings[$type] > 0) {
82
+ return true;
83
+ }
84
+ return false;
85
+ }
86
+ function get_last_media(){
87
+
88
+ }
89
+ function generate_featured_size($media_id) {
90
+ $metadata = wp_get_attachment_metadata($media_id);
91
+ $resized = image_make_intermediate_size(get_attached_file($media_id), $this->settings['width'], $this->settings['height'], $this->settings['crop']);
92
+ if ($resized) {
93
+ $metadata['sizes']['rtmedia-featured'] = $resized;
94
+ wp_update_attachment_metadata($media_id, $metadata);
95
+ }
96
+ }
97
+
98
+ function media_exists($id) {
99
+ global $wpdb;
100
+ $post_exists = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE id = '" . $id . "'", 'ARRAY_A');
101
+ if ($post_exists)
102
+ return true;
103
+ else
104
+ return false;
105
+ }
106
+
107
+ function content() {
108
+ $this->get();
109
+ $actions = $this->model->get(array('id' => $this->featured));
110
+ if(!$actions)
111
+ return false;
112
+
113
+ $featured = $actions[0];
114
+ $type = $featured->media_type;
115
+
116
+ $content_xtra = '';
117
+ switch ($type) {
118
+ case 'video' :
119
+ $this->generate_featured_size($this->featured);
120
+ if ($featured->media_id) {
121
+ $image_array = image_downsize($featured->media_id, 'rtmedia-featured');
122
+ $content_xtra = 'poster="' . $image_array[0] . '" ';
123
+ }
124
+ $content = '<video class="bp-media-featured-media"' . $content_xtra . 'src="' . wp_get_attachment_url($this->featured) . '" width="' . $this->settings['width'] . '" height="' . $this->settings['height'] . '" type="video/mp4" id="bp_media_video_' . $this->featured . '" controls="controls" preload="none"></video>';
125
+ break;
126
+ case 'music' :
127
+ $content = '<audio class="bp-media-featured-media"' . $content_xtra . 'src="' . wp_get_attachment_url($this->featured) . '" width="' . $this->settings['width'] . '" type="audio/mp3" id="bp_media_audio_' . $this->featured . '" controls="controls" preload="none"></video>';
128
+ break;
129
+ case 'photo' :
130
+ $this->generate_featured_size($featured->media_id);
131
+ $image_array = image_downsize($featured->media_id, 'rtmedia-featured');
132
+ $content = '<img src="' . $image_array[0] . '" alt="' . $featured->media_title . '" />';
133
+ break;
134
+ default :
135
+ return false;
136
+ }
137
+ return $content;
138
+ }
139
+
140
+ function process() {
141
+ if (!isset($this->action_query->id))
142
+ return;
143
+ $return = array();
144
+ $this->model = new RTMediaModel();
145
+ $actions = $this->model->get(array('id' => $this->action_query->id));
146
+ $this->get();
147
+ if (intval($this->settings[$actions[0]->media_type]) == 1){
148
+ if($this->action_query->id == $this->featured){
149
+ $this->set(0);
150
+ $return["next"] = $this->label;
151
+ }else{
152
+ $this->set($this->action_query->id);
153
+ $return["next"] = $this->undo_label;
154
+ }
155
+ $return["status"] = true;
156
+
157
+ }else{
158
+ $return["status"] = false;
159
+ $return["error"] = "Media type is not allowed";
160
+ }
161
+ if (isset($_REQUEST["json"]) && $_REQUEST["json"] == "true") {
162
+ echo json_encode($return);
163
+ die();
164
+ } else {
165
+ wp_safe_redirect($_SERVER["HTTP_REFERER"]);
166
+ }
167
+ }
168
+
169
+ }
170
+
171
+ function rtmedia_featured($user_id = false) {
172
+ echo rtmedia_get_featured($user_id);
173
+ }
174
+
175
+ function rtmedia_get_featured($user_id = false) {
176
+ $featured = new RTMediaFeatured($user_id, false);
177
+ return $featured->content();
178
+ }
179
+ if(! function_exists("bp_media_featured")){
180
+ function bp_media_featured($user_id = false) {
181
+ echo rtmedia_get_featured($user_id);
182
+ }
183
+
184
+ function bp_media_get_featured($user_id = false) {
185
+ return rtmedia_get_featured($user_id);
186
+ }
187
+ }
188
+
189
+ ?>
app/main/controllers/media/RTMediaLike.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaLike
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaLike extends RTMediaUserInteraction {
14
+
15
+ /**
16
+ *
17
+ */
18
+ function __construct() {
19
+ $args = array(
20
+ 'action' => 'like',
21
+ 'label' => 'Like',
22
+ 'plural' => 'Likes',
23
+ 'undo_label' => 'Unlike',
24
+ 'privacy' => 20,
25
+ 'countable' => true,
26
+ 'single' => false,
27
+ 'repeatable' => false,
28
+ 'undoable' => true
29
+ );
30
+ parent::__construct($args);
31
+
32
+ }
33
+
34
+ function process() {
35
+
36
+ $actions = $this->model->get( array( 'id' => $this->action_query->id ) );
37
+ $like_media = get_user_meta($this->interactor,"rtmedia_liked_media",true);
38
+ if(strpos("," . $like_media . ",","," . $this->action_query->id . ",") === false){
39
+ $this->increase =true;
40
+ if($like_media =="")
41
+ $like_media = $this->action_query->id . ",";
42
+ else
43
+ $like_media .= "," . $this->action_query->id;
44
+ } else {
45
+ $this->increase =false;
46
+ $like_media = trim(str_replace("," . $this->action_query->id . ",", ",",",". $like_media .","), ",");
47
+ }
48
+ $actionwa = $this->action.'s';
49
+
50
+ $return = array();
51
+
52
+ $actions = intval($actions[ 0 ]->{$actionwa});
53
+ if ( $this->increase === true ) {
54
+ $actions ++;
55
+ $return["next"] = $this->undo_label;
56
+ } else {
57
+ $actions --;
58
+ $return["next"] = $this->label;
59
+ }
60
+ if($actions <0)
61
+ $actions = 0;
62
+
63
+ $return["count"] = $actions;
64
+ $this->model->update( array( $this->plural => $actions ), array( 'id' => $this->action_query->id ) );
65
+
66
+ update_user_meta($this->interactor,'rtmedia_liked_media',$like_media);
67
+ if(isset($_REQUEST["json"]) && $_REQUEST["json"]=="true"){
68
+ echo json_encode($return);
69
+ die();
70
+ }
71
+ else{
72
+ wp_safe_redirect ($_SERVER["HTTP_REFERER"]);
73
+ }
74
+ return $actions;
75
+ }
76
+
77
+ function is_liked() {
78
+ $like_media = get_user_meta($this->interactor, "rtmedia_liked_media", true);
79
+ if (strpos("," . $like_media . ",", "," . $this->action_query->id . ",") === false) {
80
+ $this->increase = true;
81
+ return false;
82
+ } else {
83
+ $this->increase = false;
84
+ return true;
85
+ }
86
+ }
87
+ function before_render(){
88
+ if($this->is_liked()){
89
+ $this->label =$this->undo_label;
90
+ }
91
+ }
92
+
93
+ }
94
+
95
+ ?>
app/main/controllers/media/RTMediaMedia.php ADDED
@@ -0,0 +1,474 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaMedia
10
+ *
11
+ * @author Udit Desai <udit.desai@rtcamp.com>
12
+ */
13
+ class RTMediaMedia {
14
+
15
+ static $default_object = array(
16
+ 'id', 'blog_id', 'media_id', 'media_author', 'media_title', 'album_id',
17
+ 'media_type', 'context', 'context_id', 'source', 'source_id', 'activity_id',
18
+ 'cover_art', 'privacy', 'views', 'downloads', 'ratings_total',
19
+ 'ratings_count', 'ratings_average', 'likes', 'dislikes'
20
+ );
21
+
22
+ /**
23
+ * DB Model object to interact on Database operations
24
+ *
25
+ * @var object the database model
26
+ */
27
+ var $model;
28
+
29
+ /**
30
+ * Initialises the model object of the mediua object
31
+ */
32
+ public function __construct() {
33
+
34
+ $this->model = new RTMediaModel();
35
+ }
36
+
37
+ /**
38
+ * Generate nonce
39
+ * @param boolean $echo whether nonce should be echoed
40
+ * @return string json encoded nonce
41
+ */
42
+ static function media_nonce_generator($id, $echo = true) {
43
+ if ($echo) {
44
+ wp_nonce_field('rtmedia_' . $id, 'rtmedia_media_nonce');
45
+ } else {
46
+ $token = array(
47
+ 'action' => 'rtmedia_media_nonce',
48
+ 'nonce' => wp_create_nonce('rtmedia_' . $id)
49
+ );
50
+
51
+ return json_encode($token);
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Method verifies the nonce passed while performing any CRUD operations
57
+ * on the media.
58
+ *
59
+ * @param string $mode The upload mode
60
+ * @return boolean whether the nonce is valid
61
+ */
62
+ function verify_nonce($mode) {
63
+
64
+ $nonce = $_REQUEST["rtmedia_{$mode}_media_nonce"];
65
+ $mode = $_REQUEST['mode'];
66
+
67
+ if (wp_verify_nonce($nonce, 'rtmedia_' . $mode))
68
+ return true;
69
+ else
70
+ return false;
71
+ }
72
+
73
+ /**
74
+ * Adds a hook to delete_attachment tag called
75
+ * when a media is deleted externally out of rtMedia context
76
+ */
77
+ public function delete_hook() {
78
+ add_action('delete_attachment', array($this, 'delete_wordpress_attachment'));
79
+ }
80
+
81
+ /**
82
+ * Adds taxonomy
83
+ * @param array $attachments ids of the attachments created after upload
84
+ * @param array $taxonomies array of terms indexed by a taxonomy
85
+ */
86
+ function add_taxonomy($attachments, $taxonomies) {
87
+
88
+ foreach ($attachments as $id) {
89
+
90
+ foreach ($taxonomies as $taxonomy => $terms) {
91
+ if (!taxonomy_exists($taxonomy)) {
92
+ continue;
93
+ }
94
+
95
+ wp_set_object_terms($id, $terms, $taxonomy);
96
+ }
97
+ }
98
+ }
99
+
100
+ /**
101
+ *
102
+ * @param array $attachments attachment ids
103
+ * @param array $custom_fields array of key value pairs of meta
104
+ * @return boolean success of meta
105
+ */
106
+ function add_meta($attachments, $custom_fields) {
107
+
108
+ foreach ($attachments as $id) {
109
+ $row = array('media_id' => $id);
110
+
111
+ foreach ($custom_fields as $key => $value) {
112
+
113
+ if (!is_null($value)) {
114
+ $row['meta_key'] = $key;
115
+ $row['meta_value'] = $value;
116
+ $status = add_rtmedia_meta($id, $key, $value);
117
+
118
+ if (get_class($status) == 'WP_Error' || $status == 0)
119
+ return false;
120
+ }
121
+ }
122
+ }
123
+
124
+ return true;
125
+ }
126
+
127
+ /**
128
+ * Helper method to check for multisite - will add a few additional checks
129
+ * for handling taxonomies
130
+ * @return boolean
131
+ */
132
+ function is_multisite() {
133
+ return is_multisite();
134
+ }
135
+
136
+ /**
137
+ * Generic method to add a media
138
+ *
139
+ * @param type $uploaded
140
+ * @param type $file_object
141
+ * @return type
142
+ */
143
+ function add($uploaded, $file_object) {
144
+
145
+ /* action to perform any task before adding a media */
146
+ do_action('rtmedia_before_add_media', $file_object, $uploaded);
147
+
148
+ /* Generate media details required to feed in database */
149
+ $attachments = $this->generate_post_array($uploaded, $file_object);
150
+
151
+ /* Insert the media as an attachment in Wordpress context */
152
+ $attachment_ids = $this->insert_attachment($attachments, $file_object);
153
+
154
+ /* check for multisite and if valid then add taxonomies */
155
+ if (!$this->is_multisite())
156
+ $this->add_taxonomy($attachment_ids, $uploaded['taxonomy']);
157
+
158
+ /* fetch custom fields and add them to meta table */
159
+ $this->add_meta($attachment_ids, $uploaded['custom_fields']);
160
+
161
+
162
+ /* add media in rtMedia context */
163
+ $media_ids = $this->insertmedia($attachment_ids, $uploaded);
164
+
165
+ /* action to perform any task after adding a media */
166
+ do_action('rtmedia_after_add_media', $media_ids, $file_object, $uploaded);
167
+
168
+ return $media_ids;
169
+ }
170
+
171
+ /**
172
+ * Generic method to update a media. media details can be changed from this method
173
+ *
174
+ * @param type $media_id
175
+ * @param type $meta
176
+ * @return boolean
177
+ */
178
+ function update($id, $data, $media_id) {
179
+
180
+ /* action to perform any task before updating a media */
181
+ do_action('rtmedia_before_update_media', $id);
182
+
183
+ $defaults = array();
184
+ $data = wp_parse_args($data, $defaults);
185
+ $where = array('id' => $id);
186
+
187
+ if (array_key_exists('media_title', $data) || array_key_exists('description', $data)) {
188
+ $post_data['ID'] = $media_id;
189
+ if (isset($data['media_title'])) {
190
+ $post_data['post_title'] = $data['media_title'];
191
+ $post_data['post_name'] = sanitize_title($data['media_title']);
192
+ }
193
+ if (isset($data['description'])) {
194
+ $post_data['post_content'] = $data['description'];
195
+ unset($data['description']);
196
+ }
197
+ wp_update_post($post_data);
198
+ }
199
+
200
+ $status = $this->model->update($data, $where);
201
+
202
+ /* action to perform any task after updating a media */
203
+ do_action('rtmedia_after_update_media', $id);
204
+
205
+ if ($status == 0) {
206
+ return false;
207
+ } else {
208
+ return true;
209
+ }
210
+ }
211
+
212
+ /**
213
+ * Generic method to delete a media from wordpress media library ( other than by rtMedia )
214
+ *
215
+ * @param type $media_id
216
+ * @return boolean
217
+ */
218
+ function delete_wordpress_attachment($id){
219
+ $media = $this->model->get(array('media_id' => $id), false, false);
220
+
221
+ if ($media) {
222
+ $this->delete($media[0]->id,true);
223
+ }
224
+ }
225
+
226
+ /**
227
+ * Generic method to delete a media
228
+ *
229
+ * @param type $media_id
230
+ * @return boolean
231
+ */
232
+ function delete($id,$core=false) {
233
+ do_action('rtmedia_before_delete_media', $id);
234
+
235
+ $media = $this->model->get(array('id' => $id), false, false);
236
+
237
+ $status = 0;
238
+
239
+ if ($media) {
240
+ /* delete meta */
241
+ delete_rtmedia_meta($id);
242
+ if ($media[0]->activity_id && function_exists('bp_activity_delete_by_activity_id'))
243
+ bp_activity_delete_by_activity_id ($media[0]->activity_id);
244
+ if(!$core)
245
+ wp_delete_post($media[0]->media_id, true);
246
+ $status = $this->model->delete(array('id' => $id));
247
+ }
248
+
249
+ if ($status == 0) {
250
+ return false;
251
+ } else {
252
+ do_action('rtmedia_after_delete_media', $id);
253
+ return true;
254
+ }
255
+ }
256
+
257
+ /**
258
+ * Move a media from one album to another
259
+ *
260
+ * @global type $wpdb
261
+ * @param type $media_id
262
+ * @param type $album_id
263
+ * @return boolean
264
+ */
265
+ function move($media_id, $album_id) {
266
+
267
+ global $wpdb;
268
+ /* update the post_parent value in wp_post table */
269
+ $status = $wpdb->update($wpdb->posts, array('post_parent' => $album_id), array('ID' => $media_id));
270
+
271
+ if (get_class($status) == 'WP_Error' || $status == 0) {
272
+ return false;
273
+ } else {
274
+ /* update album_id, context, context_id and privacy in rtMedia context */
275
+ $album_data = $this->model->get(array('media_id' => $media_id));
276
+ $data = array(
277
+ 'album_id' => $album_id,
278
+ 'context' => $album_data->context,
279
+ 'context_id' => $album_data->context_id,
280
+ 'privacy' => $album_data->privacy
281
+ );
282
+ return $this->update($media_id, $data);
283
+ }
284
+ }
285
+
286
+ /**
287
+ * Imports attachment as media
288
+ */
289
+ function import_attachment() {
290
+
291
+ }
292
+
293
+ /**
294
+ * Check if BuddyPress and the activity component are enabled
295
+ * @return boolean
296
+ */
297
+ function activity_enabled() {
298
+
299
+ if (!function_exists('bp_is_active') || !bp_is_active('activity'))
300
+ return false;
301
+
302
+ global $rtmedia;
303
+ return $rtmedia->options['buddypress_enableOnActivity'];
304
+ }
305
+
306
+ /**
307
+ *
308
+ * @param type $uploaded
309
+ * @param type $file_object
310
+ * @return type
311
+ */
312
+ function generate_post_array($uploaded, $file_object) {
313
+ if ($uploaded['album_id']) {
314
+ $model = new RTMediaModel();
315
+ $parent_details = $model->get(array('id' => $uploaded['album_id']));
316
+ $album_id = $parent_details[0]->media_id;
317
+ } else {
318
+ $album_id = 0;
319
+ }
320
+ if ( ! in_array( $uploaded["context"] , array("profile", "group") ) ) {
321
+ $album_id = $uploaded["context_id"];
322
+ }
323
+ foreach ($file_object as $file) {
324
+ $attachments[] = array(
325
+ 'post_mime_type' => $file['type'],
326
+ 'guid' => $file['url'],
327
+ 'post_title' => $uploaded['title'] ? $uploaded['title'] : $file['name'],
328
+ 'post_content' => $uploaded['description'] ? $uploaded['description'] : '',
329
+ 'post_parent' => $album_id,
330
+ 'post_author' => $uploaded['media_author']
331
+ );
332
+ }
333
+ return $attachments;
334
+ }
335
+
336
+ /**
337
+ *
338
+ * @param type $attachments
339
+ * @param type $file_object
340
+ * @return type
341
+ * @throws Exception
342
+ */
343
+ function insert_attachment($attachments, $file_object) {
344
+ foreach ($attachments as $key => $attachment) {
345
+ $attachment_id = wp_insert_attachment($attachment, $file_object[$key]['file'], $attachment['post_parent']);
346
+ if (!is_wp_error($attachment_id)) {
347
+ // add_filter('intermediate_image_sizes', array($this, 'rtmedia_image_sizes'), 99);
348
+ wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $file_object[$key]['file']));
349
+ } else {
350
+ unlink($file_object[$key]['file']);
351
+ throw new Exception(__('Error creating attachment for the media file, please try again', 'buddypress-media'));
352
+ }
353
+ $updated_attachment_ids[] = $attachment_id;
354
+ }
355
+
356
+ return $updated_attachment_ids;
357
+ }
358
+
359
+ /**
360
+ *
361
+ * @param type $sizes
362
+ * @return type
363
+ */
364
+ function image_sizes($sizes) {
365
+ return array('bp_media_thumbnail', 'bp_media_activity_image', 'bp_media_single_image');
366
+ }
367
+
368
+ /**
369
+ *
370
+ * @param type $attributes
371
+ */
372
+ function insert_album($attributes) {
373
+
374
+ return $this->model->insert($attributes);
375
+ }
376
+
377
+ function set_media_type($mime_type) {
378
+ switch ($mime_type) {
379
+ case 'image':
380
+ return 'photo';
381
+ break;
382
+ case 'audio':
383
+ return 'music';
384
+ break;
385
+ default:
386
+ return $mime_type;
387
+ break;
388
+ }
389
+ }
390
+
391
+ /**
392
+ *
393
+ * @param type $attachment_ids
394
+ * @param type $uploaded
395
+ */
396
+ function insertmedia($attachment_ids, $uploaded) {
397
+
398
+ $defaults = array(
399
+ 'activity_id' => $this->activity_enabled(),
400
+ 'privacy' => 0
401
+ );
402
+
403
+ $uploaded = wp_parse_args($uploaded, $defaults);
404
+
405
+ $blog_id = get_current_blog_id();
406
+ $media_id = Array();
407
+ foreach ($attachment_ids as $id) {
408
+ $attachment = get_post($id, ARRAY_A);
409
+ $mime_type = explode('/', $attachment['post_mime_type']);
410
+
411
+ $media = array(
412
+ 'blog_id' => $blog_id,
413
+ 'media_id' => $id,
414
+ 'album_id' => $uploaded['album_id'],
415
+ 'media_author' => $attachment['post_author'],
416
+ 'media_title' => $attachment['post_title'],
417
+ 'media_type' => $this->set_media_type($mime_type[0]),
418
+ 'context' => $uploaded['context'],
419
+ 'context_id' => $uploaded['context_id'],
420
+ 'privacy' => $uploaded['privacy']
421
+ );
422
+
423
+ $media_id[] = $this->model->insert($media);
424
+ }
425
+ return $media_id;
426
+ }
427
+
428
+ function insert_activity($id, $media) {
429
+ if (!$this->activity_enabled())
430
+ return;
431
+ $activity = new RTMediaActivity($id, $media->privacy);
432
+ $activity_content = $activity->create_activity_html();
433
+ $user = get_userdata($media->media_author);
434
+ $username = '<a href="' . get_rtmedia_user_link($media->media_author) . '">' . $user->user_nicename . '</a>';
435
+ $count = count($id);
436
+ $media_const = 'RTMEDIA_' . strtoupper($media->media_type);
437
+ if ($count > 1) {
438
+ $media_const .= '_PLURAL';
439
+ }
440
+ $media_const.='_LABEL';
441
+
442
+ $media_str = constant($media_const);
443
+
444
+ $action = sprintf(
445
+ _n(
446
+ '%s added a %s', '%s added %d %s.', $count, 'rtmedia'
447
+ ), $username, $media->media_type, $media_str
448
+ );
449
+
450
+ $activity_args = array(
451
+ 'action' => $action,
452
+ 'content' => $activity_content,
453
+ 'type' => 'rtmedia_update',
454
+ 'primary_link' => '',
455
+ 'item_id' => $id
456
+ );
457
+ if ($media->context == 'group' || 'profile') {
458
+ $activity_args['component'] = $media->context;
459
+ }
460
+
461
+ $activity_id = bp_activity_add($activity_args);
462
+ bp_activity_update_meta($activity_id, 'rtmedia_privacy', ($media->privacy==0)?-1:$media->privacy);
463
+
464
+
465
+ $this->model->update(
466
+ array('activity_id' => $activity_id), array('id' => $id)
467
+ );
468
+
469
+ return $activity_id;
470
+ }
471
+
472
+ }
473
+
474
+ ?>
app/main/controllers/media/RTMediaMeta.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaMetaQuery
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaMeta {
14
+
15
+ /**
16
+ *
17
+ */
18
+ function __construct() {
19
+ $this->model = new RTDBModel('rtm_media_meta');
20
+ }
21
+
22
+ function get_meta($id=false,$key=false){
23
+ if($id===false)return false;
24
+ if($key===false){
25
+ return $this->get_all_meta($id);
26
+ }else{
27
+ return $this->get_single_meta($id,$key);
28
+ }
29
+
30
+ }
31
+
32
+ private function get_all_meta($id=false){
33
+ if($id===false) return false;
34
+ return maybe_unserialize($this->model->get(array('media_id'=>$id)));
35
+ }
36
+
37
+ private function get_single_meta($id=false, $key=false){
38
+ if($id===false) return false;
39
+ if($key===false) return false;
40
+ $value = $this->model->get(array('media_id'=>$id,'meta_key'=>$key));
41
+ if(isset($value[0]))
42
+ return maybe_unserialize($value[0]->meta_value);
43
+ else
44
+ return false;
45
+ }
46
+
47
+ function add_meta($id=false,$key=false,$value=false,$duplicate=false){
48
+ $this->update_meta($id=false,$key=false,$value=false,$duplicate=true);
49
+ }
50
+
51
+ function update_meta($id=false,$key=false,$value=false,$duplicate=false){
52
+ if($id===false) return false;
53
+ if($key===false) return false;
54
+ if($value===false) return false;
55
+ $value = maybe_serialize($value);
56
+
57
+ if($duplicate===true){
58
+ $media_meta = $this->model->insert(array('media_id'=>$id,'meta_key'=>$key, 'meta_value'=>$value));
59
+ }else{
60
+ if($this->get_single_meta($id,$key)){
61
+ $meta = array('meta_value' => $value);
62
+ $where = array('media_id' => $id, 'meta_key' => $key);
63
+ $media_meta = $this->model->update($meta, $where);
64
+ } else {
65
+ $media_meta = $this->model->insert(array('media_id'=>$id,'meta_key'=>$key, 'meta_value'=>$value));
66
+ }
67
+ }
68
+ }
69
+
70
+ function delete_meta($id=false,$key=false){
71
+ if($id===false) return false;
72
+ if($key===false){
73
+ $where = array('media_id' => $id);
74
+ }else{
75
+ $where = array('media_id' => $id, 'meta_key' => $key);
76
+ }
77
+ $this->model->delete($where);
78
+ }
79
+
80
+ }
81
+
82
+ ?>
app/main/controllers/media/RTMediaUserInteraction.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaUserInteractions
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaUserInteraction {
14
+
15
+ /**
16
+ *
17
+ * @var string The singular action word (like, unlike, view, download, etc)
18
+ */
19
+ public $action;
20
+
21
+ /**
22
+ *
23
+ * @var string The plural of the action (likes, unlikes, etc)
24
+ */
25
+ public $actions;
26
+
27
+ /**
28
+ *
29
+ * @var boolean Whether the action increases the count or decreases the count
30
+ */
31
+ public $increase;
32
+
33
+
34
+ /**
35
+ *
36
+ * @var object The action query populated by the default query
37
+ */
38
+ public $action_query;
39
+
40
+ /**
41
+ *
42
+ * @var object The db model
43
+ */
44
+ public $model;
45
+ public $interactor;
46
+ public $owner;
47
+ public $media;
48
+ public $privacy;
49
+
50
+ /**
51
+ * Initialise the user interaction
52
+ *
53
+ * @global object $rtmedia_query Default query
54
+ * @param string $action The user action
55
+ * @param boolean $private Whether other users are allowed the action
56
+ * @param string $label The label for the button
57
+ * @param boolean $increase Increase or decrease the action count
58
+ */
59
+ function __construct($args = array()) {
60
+ $defaults = array(
61
+ 'action' => '',
62
+ 'label' => '',
63
+ 'plural' => '',
64
+ 'undo_label' => '',
65
+ 'privacy' => 60,
66
+ 'countable' => false,
67
+ 'single' => false,
68
+ 'repeatable' => false,
69
+ 'undoable' => false
70
+ );
71
+
72
+ $args = wp_parse_args($args,$defaults);
73
+ foreach($args as $key=>$val){
74
+ $this->{$key} = $val;
75
+ }
76
+
77
+
78
+
79
+ $this->init();
80
+
81
+
82
+
83
+ // filter the default actions with this new one
84
+ add_filter( 'rtmedia_query_actions', array( $this, 'register' ) );
85
+ // hook into the template for this action
86
+ add_action( 'rtmedia_pre_action_' . $this->action, array( $this, 'preprocess' ) );
87
+ add_filter( 'rtmedia_action_buttons_before_delete', array($this,'button_filter') );
88
+ }
89
+
90
+
91
+ function init(){
92
+ global $rtmedia_query;
93
+ if(!isset($rtmedia_query->action_query)) return;
94
+ if(!isset($rtmedia_query->action_query->id)) return;
95
+
96
+ $this->model = new RTMediaModel();
97
+ $this->set_label();
98
+ $this->set_plural();
99
+ $this->set_media();
100
+ $this->set_interactor();
101
+
102
+ }
103
+
104
+ /**
105
+ * Checks if there's a label, if not creates from the action name
106
+ */
107
+ function set_label() {
108
+ if ( empty($this->label) ) {
109
+ $this->label = ucfirst( $this->action );
110
+ }
111
+ }
112
+
113
+ function set_plural() {
114
+ if ( empty($this->plural) ) {
115
+ $this->plural = $this->label .'s';
116
+ }
117
+ }
118
+
119
+ function set_media() {
120
+
121
+ $media_id = false;
122
+ $this->media = false;
123
+
124
+ global $rtmedia_query;
125
+ $this->action_query = $rtmedia_query->action_query;
126
+
127
+ if (isset( $this->action_query->id ) ){
128
+ $media_id = $this->action_query->id;
129
+ $media = $this->model->get( array( 'id' => $media_id ) );
130
+ if(!empty($media)){
131
+ $this->media = $media[0];
132
+ $this->owner = $this->media->media_author;
133
+ }
134
+ }
135
+
136
+
137
+ }
138
+
139
+ function set_interactor() {
140
+ $this->interactor = false;
141
+ if( is_user_logged_in()){
142
+ $this->interactor = get_current_user_id();
143
+ }
144
+ $this->interactor_privacy = $this->interactor_privacy();
145
+ }
146
+
147
+ function interactor_privacy(){
148
+
149
+ if(!isset($this->interactor)) return 0;
150
+ if($this->interactor === false ) return 0;
151
+ if($this->interactor ==$this->owner) return 60;
152
+
153
+ $friends = new RTMediaFriends();
154
+ $friends = $friends->get_friends_cache($this->interactor);
155
+
156
+ if(in_array($this->owner,$friends)) return 40;
157
+
158
+ return 20;
159
+ }
160
+
161
+ function is_visible(){
162
+ if($this->interactor_privacy >= $this->privacy) return true;
163
+ return false;
164
+ }
165
+
166
+ function is_clickable(){
167
+ $clickable = false;
168
+ if($this->repeatable){
169
+ $clickable = true;
170
+ if($this->undoable){
171
+ $clickable = true;
172
+ }
173
+ }else{
174
+ if($this->undoable){
175
+ $clickable = true;
176
+ }
177
+ }
178
+
179
+ return $clickable;
180
+ }
181
+ function before_render(){
182
+
183
+ }
184
+
185
+ function render(){
186
+ $before_render = $this->before_render();
187
+ if($before_render === false )
188
+ return false;
189
+ $button = '';
190
+ if($this->is_visible()){
191
+ $link = trailingslashit(get_rtmedia_permalink($this->media->id)).
192
+ $this->action.'/';
193
+ $disabled = '';
194
+ if(!$this->is_clickable()){
195
+ $disabled = ' disabled';
196
+ }
197
+ $button = '<form action="'. $link .'"><button type="submit" id="rtmedia-action-button-'
198
+ .$this->media->id.'" class="rtmedia-'.$this->action
199
+ .' rtmedia-action-buttons button'.$disabled.'">'
200
+ .$this->label.'</button></form>';
201
+ }
202
+
203
+ return $button;
204
+ }
205
+
206
+ function button_filter($buttons){
207
+ if(empty($this->media)){
208
+ $this->init();
209
+ }
210
+ $buttons[] = $this->render();
211
+ return $buttons;
212
+ }
213
+ /**
214
+ *
215
+ * @param array $actions The default array of actions
216
+ * @return array $actions Filtered actions array
217
+ */
218
+ function register( $actions ) {
219
+ if(empty($this->media)){
220
+ $this->init();
221
+ }
222
+
223
+ $actions[ $this->action ] = array( $this->label, false );
224
+ return $actions;
225
+ }
226
+
227
+ /**
228
+ * Checks if an id is set
229
+ * Creates pre and post process hooks for the action
230
+ * Calls the process
231
+ *
232
+ */
233
+ function preprocess() {
234
+ global $rtmedia_query;
235
+ $this->action_query = $rtmedia_query->action_query;
236
+
237
+ if ( $this->action_query->action != $this->action )
238
+ return false;
239
+
240
+ if ( ! isset( $this->action_query->id ) )
241
+ return false;
242
+ $result = false;
243
+
244
+ do_action( 'rtmedia_pre_process_' . $this->action );
245
+ if(empty($this->media)){
246
+ $this->init();
247
+ }
248
+
249
+ if($this->interactor_privacy >=$this->privacy){
250
+
251
+ $result = $this->process();
252
+ }
253
+
254
+ do_action( 'rtmedia_post_process_' . $this->action, $result );
255
+
256
+ print_r( $result );
257
+
258
+ die();
259
+ }
260
+
261
+ /**
262
+ * Updates count of the action
263
+ *
264
+ * @return integer New count
265
+ */
266
+ function process() {
267
+
268
+ return $false;
269
+ }
270
+
271
+ }
272
+
273
+ ?>
app/main/controllers/privacy/RTMediaFriends.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaFriends
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaFriends {
14
+
15
+ /**
16
+ *
17
+ */
18
+ function __construct() {
19
+ if(!class_exists('BuddyPress')) return;
20
+ if(!bp_is_active('friend'))return;
21
+ add_action('friends_friendship_accepted',array($this,'refresh_friends_cache'));
22
+ add_action('friends_friendship_deleted',array($this,'refresh_friends_cache'));
23
+ }
24
+
25
+ function get_friends_cache( $user ) {
26
+
27
+ if(!class_exists('BuddyPress')) return;
28
+ if(!bp_is_active('friends'))return;
29
+
30
+ if ( ! $user )
31
+ return array();
32
+ $friends = wp_cache_get( 'rtmedia-user-friends-' . $user );
33
+ if ( $friends === false ) {
34
+ $friends = $this->refresh_friends_cache($user);
35
+ }
36
+ return $friends;
37
+ }
38
+
39
+ function refresh_friends_cache($user){
40
+ if(!class_exists('BuddyPress')) return;
41
+ if(!bp_is_active('friends'))return;
42
+ $friends = friends_get_friend_user_ids($user);
43
+ wp_cache_set( 'rtmedia-user-friends-' . $user, $friends );
44
+ return $friends;
45
+ }
46
+
47
+ }
48
+
49
+ ?>
app/main/controllers/privacy/RTMediaPrivacy.php ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaPrivacy
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaPrivacy {
14
+
15
+
16
+ /**
17
+ *
18
+ * @var object default application wide privacy levels
19
+ */
20
+ public $default_privacy;
21
+
22
+ function __construct() {
23
+ add_action('rtmedia_after_file_upload_ui',array($this,'uploader_privacy_ui'));
24
+ add_action('rtmedia_add_edit_fields',array($this,'select_privacy_ui'));
25
+ add_action('bp_init',array($this,'add_nav'));
26
+ add_action('bp_template_content',array($this,'content'));
27
+ add_filter('bp_activity_get_user_join_filter',array($this,'activity_privacy'),10,6);
28
+ }
29
+
30
+ function uploader_privacy_ui($attr){
31
+ if(!isset($attr['privacy'])) {
32
+ global $rtmedia;
33
+ if($rtmedia->options["privacy_enabled"] != "0")
34
+ $this->select_privacy_ui();
35
+ }
36
+ }
37
+
38
+ function select_privacy_ui() {
39
+ global $rtmedia_media;
40
+ $default = 0;
41
+ if(isset($rtmedia_media->privacy))
42
+ $default = $rtmedia_media->privacy;
43
+
44
+ $form = new rtForm();
45
+ $attributes = array(
46
+ 'name' => 'privacy',
47
+ 'id' => 'privacy'
48
+ );
49
+ global $rtmedia;
50
+ $privacy_levels = $rtmedia->privacy_settings['levels'];
51
+ if(class_exists('BuddyPress')){
52
+ if(!bp_is_active('friends')){
53
+ unset($privacy_levels[40]);
54
+ }
55
+ }else{
56
+ unset($privacy_levels[40]);
57
+ }
58
+ foreach ( $privacy_levels as $key => $value) {
59
+ $privacy = explode(' - ', $value);
60
+ $attributes['rtForm_options'][] = array(
61
+ $privacy[0] => $key,
62
+ 'selected' => ($key==$default) ? 1 : 0
63
+ );
64
+ }
65
+
66
+
67
+ echo $form->get_select($attributes);
68
+ }
69
+
70
+ public function system_default(){
71
+ return 0;
72
+ }
73
+
74
+ public function site_default(){
75
+ global $rtmedia;
76
+
77
+ return rtmedia_get_site_option('privacy_settings');
78
+ }
79
+
80
+ public function user_default(){
81
+ return;
82
+
83
+ }
84
+
85
+ public function get_default(){
86
+ $default_privacy = $this->user_default();
87
+
88
+ if($default_privacy===false){
89
+ $default_privacy = $this->site_default();
90
+ }
91
+
92
+ if(!$default_privacy ===false){
93
+ $default_privacy = $this->system_default();
94
+ }
95
+ }
96
+
97
+
98
+ static function is_enabled() {
99
+ global $bp_media;
100
+ $options = $bp_media->options;
101
+ if ( ! array_key_exists( 'privacy_enabled', $options ) ) {
102
+ return false;
103
+ } else {
104
+ if ( $options[ 'privacy_enabled' ] != true ) {
105
+ return false;
106
+ }
107
+ }
108
+ return true;
109
+ }
110
+
111
+ static function save_user_default( $level = 0, $user_id = false ) {
112
+ if ( $user_id == false ) {
113
+ global $bp;
114
+ $user_id = $bp->loggedin_user->id;
115
+ }
116
+ return update_user_meta( $user_id, 'bp_media_privacy', $level );
117
+ }
118
+
119
+ static function get_user_default( $user_id = false ) {
120
+ if ( $user_id == false ) {
121
+ global $bp;
122
+ $user_id = $bp->loggedin_user->id;
123
+ }
124
+ $user_privacy = get_user_meta( $user_id, 'bp_media_privacy', true );
125
+ if ( $user_privacy === false ) {
126
+
127
+ }
128
+ return $user_privacy;
129
+ }
130
+
131
+ static function required_access( $object_id = false ) {
132
+ if ( BPMediaPrivacy::is_enabled() == false )
133
+ return;
134
+ if ( $object_id == false )
135
+ return;
136
+ $privacy = BPMediaPrivacy::get_privacy( $object_id );
137
+ $parent = get_post_field( 'post_parent', $object_id, 'raw' );
138
+ $parent_privacy = BPMediaPrivacy::get_privacy( $parent );
139
+
140
+ if ( $privacy === false ) {
141
+ if ( $parent_privacy !== false ) {
142
+ $privacy = $parent_privacy;
143
+ } else {
144
+ $privacy = BPMediaPrivacy::default_privacy();
145
+ }
146
+ }
147
+ return $privacy;
148
+ }
149
+
150
+
151
+
152
+ function add_nav(){
153
+
154
+ if ( bp_displayed_user_domain() ) {
155
+ $user_domain = bp_displayed_user_domain();
156
+ } elseif ( bp_loggedin_user_domain() ) {
157
+ $user_domain = bp_loggedin_user_domain();
158
+ } else {
159
+ return;
160
+ }
161
+
162
+
163
+
164
+ $settings_link = trailingslashit( $user_domain . 'settings' );
165
+
166
+ $defaults = array(
167
+ 'name' => $this->title(), // Display name for the nav item
168
+ 'slug' => 'privacy', // URL slug for the nav item
169
+ 'parent_slug' => 'settings', // URL slug of the parent nav item
170
+ 'parent_url' => $settings_link, // URL of the parent item
171
+ 'item_css_id' => 'rtmedia-privacy-settings', // The CSS ID to apply to the HTML of the nav item
172
+ 'user_has_access' => true, // Can the logged in user see this nav item?
173
+ 'site_admin_only' => false, // Can only site admins see this nav item?
174
+ 'position' => 900, // Index of where this nav item should be positioned
175
+ 'screen_function' => array($this,'settings_ui'), // The name of the function to run when clicked
176
+ 'link' => '' // The link for the subnav item; optional, not usually required.
177
+ );
178
+ bp_core_new_subnav_item($defaults);
179
+ }
180
+
181
+ function settings_ui(){
182
+ if ( bp_action_variables() ) {
183
+ bp_do_404();
184
+ return;
185
+ }
186
+
187
+
188
+ // Load the template
189
+ bp_core_load_template( apply_filters( 'bp_settings_screen_delete_account', 'members/single/plugins' ) );
190
+
191
+ }
192
+
193
+ function content(){
194
+ if (buddypress()->current_action != 'privacy') return;
195
+
196
+ global $rtmedia;
197
+ $default_user_privacy = array(
198
+ 'title' => __("Default Privacy","rtmedia"),
199
+ 'callback' => array("RTMediaFormHandler","radio"),
200
+ 'args' => array(
201
+ 'key' => 'privacy_default',
202
+ 'radios' => $rtmedia->privacy_settings['levels'],
203
+ 'default' => get_user_meta(get_current_user_id(),'rtmedia-default-privacy')
204
+ )
205
+ );
206
+ ?>
207
+ <div class="large-12">
208
+ <div class="row section">
209
+ <div class="columns large-2"><?php echo $default_user_privacy['title']; ?></div>
210
+ <div class="columns large-5">
211
+ <?php call_user_func($default_user_privacy['callback'], $default_user_privacy['args']); ?>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ <?php }
216
+
217
+ function title(){
218
+ return __('Privacy','rtmedia');
219
+ }
220
+
221
+ function activity_privacy($sql, $select_sql, $from_sql, $where_sql,$sort,$pag_sql=''){
222
+ //apply_filters( 'bp_activity_get_user_join_filter', "
223
+ //"{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}",
224
+ //$select_sql,
225
+ //$from_sql,
226
+ //$where_sql,
227
+ //$sort,
228
+ //$pag_sql
229
+
230
+ $sql = '';
231
+
232
+ $where = '';
233
+
234
+ // $from_sql = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID";
235
+
236
+ global $bp,$wpdb;
237
+
238
+ if ( is_user_logged_in() ) {
239
+ $user = get_current_user_id();
240
+ } else {
241
+ $user = 0;
242
+ }
243
+
244
+ $where .= "AND (m.meta_value <= 0)";
245
+
246
+ if ( $user ) {
247
+ $where .= "OR ((m.meta_value=20)";
248
+ $where .= " OR (a.user_id={$user} AND m.meta_value>=40)";
249
+ if ( class_exists( 'BuddyPress' ) ) {
250
+ if ( bp_is_active( 'friends' ) ) {
251
+ $friendship = new RTMediaFriends();
252
+ $friends = $friendship->get_friends_cache( $user );
253
+ $where .= " OR (m.meta_value=40 AND a.user_id IN ('". implode("','", $friends)."'))";
254
+ }
255
+ }
256
+ $where .= ')';
257
+ }
258
+ if (function_exists("bp_core_get_table_prefix"))
259
+ $bp_prefix = bp_core_get_table_prefix();
260
+ else
261
+ $bp_prefix = "";
262
+
263
+ $select_sql = str_replace("SELECT", "SELECT distinct", $select_sql);
264
+
265
+ $from_sql = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID LEFT JOIN {$bp->activity->table_name_meta} m ON a.id = m.activity_id";
266
+ $where_sql = $where_sql . " AND (NOT EXISTS (SELECT m.activity_id FROM {$bp_prefix}bp_activity_meta m WHERE m.meta_key='rtmedia_privacy' AND m.activity_id=a.id) OR (m.meta_key='rtmedia_privacy' {$where} ) )";
267
+ $newsql = "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}";
268
+ return $newsql;
269
+
270
+ }
271
+
272
+
273
+
274
+ }
275
+
276
+
277
+
278
+ ?>
app/main/controllers/shortcodes/RTMediaGalleryShortcode.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaGalleryShortcode
10
+ *
11
+ * rtMedia Gallery Shortcode to embedd a gallery of media anywhere
12
+ *
13
+ * @author Udit Desai <udit.desai@rtcamp.com>
14
+ */
15
+ class RTMediaGalleryShortcode {
16
+
17
+ static $add_script;
18
+
19
+ /**
20
+ *
21
+ */
22
+ public function __construct() {
23
+
24
+ add_shortcode('rtmedia_gallery', array('RTMediaGalleryShortcode', 'render'));
25
+ //add_action('init', array($this, 'register_scripts'));
26
+ //add_action('wp_footer', array($this, 'print_script'));
27
+ }
28
+
29
+ function register_scripts() {
30
+ wp_enqueue_script('plupload-all');
31
+ wp_enqueue_script('rtmedia-backbone', RTMEDIA_URL . 'app/assets/js/rtMedia.backbone.js', array('plupload','backbone'),false,true);
32
+ wp_localize_script('rtmedia-backbone', 'template_url', RTMEDIA_URL . 'templates/media');
33
+ $url = $_SERVER["REQUEST_URI"];
34
+ $url = trailingslashit($url);
35
+
36
+ $params = array(
37
+ 'url' => (isset($url) && (strpos($url,"/media/") !== false))?str_replace("/media/", "/upload/", $url):'upload/',
38
+ 'runtimes' => 'gears,html5,flash,silverlight,browserplus',
39
+ 'browse_button' => 'rtMedia-upload-button',
40
+ 'container' => 'rtmedia-upload-container',
41
+ 'drop_element' => 'drag-drop-area',
42
+ 'filters' => apply_filters('rtmedia_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => "mp4,jpg,png,jpeg,gif,mp3"))),
43
+ 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))),
44
+ 'multipart' => true,
45
+ 'urlstream_upload' => true,
46
+ 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
47
+ 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
48
+ 'file_data_name' => 'rtmedia_file', // key passed to $_FILE.
49
+ 'multi_selection' => true,
50
+ 'multipart_params' => apply_filters('rtmedia-multi-params', array('redirect'=>'no','action' => 'wp_handle_upload','_wp_http_referer'=> $_SERVER['REQUEST_URI'],'mode'=>'file_upload','rtmedia_upload_nonce'=>RTMediaUploadView::upload_nonce_generator(false,true)))
51
+ );
52
+ wp_localize_script('rtmedia-backbone', 'rtMedia_plupload_config', $params);
53
+ wp_localize_script('rtmedia-backbone', 'rMedia_loading_file', admin_url("/images/loading.gif"));
54
+ }
55
+
56
+ /**
57
+ * Helper function to check whether the shortcode should be rendered or not
58
+ *
59
+ * @return type
60
+ */
61
+ static function display_allowed() {
62
+ $flag=true;
63
+
64
+ //$flag = !(is_home() || is_post_type_archive() || is_author());
65
+ $flag = apply_filters('before_rtmedia_gallery_display', $flag);
66
+ return $flag;
67
+ }
68
+
69
+ /**
70
+ * Render a shortcode according to the attributes passed with it
71
+ *
72
+ * @param boolean $attr
73
+ */
74
+ static function render($attr) {
75
+ if (self::display_allowed()) {
76
+ self::$add_script = true;
77
+
78
+ ob_start();
79
+
80
+ if ((!isset($attr)) || empty($attr))
81
+ $attr = true;
82
+
83
+ $attr = array('name' => 'gallery', 'attr' => $attr);
84
+
85
+ $template = new RTMediaTemplate();
86
+ $template->set_template('media-gallery', $attr);
87
+
88
+ return ob_get_clean();
89
+ }
90
+ }
91
+
92
+ static function print_script() {
93
+ if (!self::$add_script)
94
+ return;
95
+ if (!wp_script_is('rtmedia-backbone')){
96
+ wp_print_scripts('rtmedia-backbone');
97
+ }
98
+ }
99
+
100
+ }
101
+
102
+ ?>
app/main/controllers/shortcodes/RTMediaUploadShortcode.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUploadShortcode
5
+ *
6
+ * rtMedia uploader shortcode
7
+ *
8
+ * @author joshua
9
+ */
10
+ class RTMediaUploadShortcode {
11
+
12
+ static $add_sc_script = false;
13
+ var $deprecated = false;
14
+ static $uploader_displayed = false;
15
+
16
+ /**
17
+ *
18
+ */
19
+ public function __construct() {
20
+
21
+
22
+
23
+ add_shortcode('rtmedia_uploader', array('RTMediaUploadShortcode', 'pre_render'));
24
+ $method_name = strtolower(str_replace('RTMedia', '', __CLASS__));
25
+
26
+ if (is_callable("RTMediaDeprecated::{$method_name}", true, $callable_name)) {
27
+ $this->deprecated = RTMediaDeprecated::$method_name();
28
+ }
29
+
30
+ }
31
+
32
+ /**
33
+ * Helper function to check whether the shortcode should be rendered or not
34
+ *
35
+ * @return type
36
+ */
37
+ static function display_allowed() {
38
+
39
+ $flag = (!(is_home() || is_post_type_archive() || is_author())) && is_user_logged_in();
40
+
41
+ $flag = apply_filters('before_rtmedia_uploader_display', $flag);
42
+ return $flag;
43
+ }
44
+
45
+ /**
46
+ * Render the uploader shortcode and attach the uploader panel
47
+ *
48
+ * @param type $attr
49
+ */
50
+ static function pre_render($attr) {
51
+
52
+ if (self::display_allowed()) {
53
+
54
+ ob_start();
55
+
56
+ self::$add_sc_script = true;
57
+ RTMediaUploadTemplate::render($attr);
58
+
59
+ self::$uploader_displayed = true;
60
+ return ob_get_clean();
61
+ }
62
+ }
63
+
64
+ }
65
+
66
+ ?>
app/main/controllers/template/RTMediaAJAX.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaAJAX
10
+ *
11
+ * @author udit
12
+ */
13
+ class RTMediaAJAX {
14
+
15
+ public function __construct() {
16
+ add_action('wp_ajax_rtmedia_backbone_template',array($this,'backbone_template'));
17
+ add_action('wp_ajax_rtmedia_create_album',array($this,'create_album'));
18
+ }
19
+
20
+ function backbone_template() {
21
+ include RTMEDIA_PATH.'templates/media/media-gallery-item.php';
22
+ }
23
+
24
+ function create_album(){
25
+ if ( isset($_POST['name']) && $_POST['name'] ) {
26
+ $album = new RTMediaAlbum();
27
+ $rtmedia_id = $album->add($_POST['name'], get_current_user_id(), true, false, $_POST['context'], $_POST['context_id']);
28
+
29
+ if ( $rtmedia_id )
30
+ echo $rtmedia_id;
31
+ else
32
+ echo false;
33
+
34
+ } else {
35
+ echo false;
36
+ }
37
+ wp_die();
38
+ }
39
+ }
40
+
41
+ ?>
app/main/controllers/template/RTMediaNav.php ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaNav
10
+ *
11
+ * @author saurabh
12
+ */
13
+ class RTMediaNav {
14
+
15
+ /**
16
+ *
17
+ */
18
+ function __construct() {
19
+
20
+ add_action( 'admin_bar_menu', array( $this, 'admin_nav' ), 99 );
21
+
22
+ if ( class_exists( 'BuddyPress' ) ) {
23
+ add_action( 'bp_init', array( $this, 'custom_media_nav_tab' ), 10, 1 );
24
+ //add_action( 'bp_init', array( $this, 'custom_media_sub_nav_tab' ), 10, 20 );
25
+ }
26
+
27
+
28
+ }
29
+
30
+ function media_screen() {
31
+ return;
32
+ }
33
+
34
+ /**
35
+ * Load Custom tabs on BuddyPress
36
+ *
37
+ * @global object $bp global BuddyPress object
38
+ */
39
+ function custom_media_nav_tab() {
40
+ //$counts = $this->actual_counts();
41
+ if (! function_exists("bp_core_new_nav_item"))
42
+ return;
43
+ //print_r($counts);die();
44
+ global $rtmedia;
45
+ if($rtmedia->options["buddypress_enableOnProfile"]!==0){
46
+ bp_core_new_nav_item( array(
47
+ 'name' => RTMEDIA_MEDIA_LABEL,// '<span>'.$counts['total']['all'].'</span>',
48
+ 'slug' => RTMEDIA_MEDIA_SLUG,
49
+ 'screen_function' => array($this,'media_screen'),
50
+ 'default_subnav_slug' => 'all'
51
+ ) );
52
+ }
53
+
54
+ if ( bp_is_group() && $rtmedia->options["buddypress_enableOnGroup"]!==0 ) {
55
+ global $bp;
56
+ $bp->bp_options_nav[ bp_get_current_group_slug() ][ 'media' ] = array(
57
+ 'name' => RTMEDIA_MEDIA_LABEL,//. '<span>'.$counts['total']['all'].'</span>',
58
+ 'link' => ( (is_multisite()) ? get_site_url( get_current_blog_id() ) : get_site_url() ) . '/groups/' . bp_get_current_group_slug() . '/media',
59
+ 'slug' => RTMEDIA_MEDIA_SLUG,
60
+ 'user_has_access' => true,
61
+ 'css_id' => 'rtmedia-media-nav',
62
+ 'position' => 99,
63
+ 'screen_function' => array($this,'media_screen'),
64
+ 'default_subnav_slug' => 'all'
65
+ );
66
+ }
67
+ }
68
+
69
+ function admin_nav() {
70
+ // $wp_admin_bar->add_menu( array(
71
+ // 'parent' => 'my-account',
72
+ // 'id' => 'my-account-buddypress',
73
+ // 'title' => __( 'My Account' ),
74
+ // 'group' => true,
75
+ // 'meta' => array(
76
+ // 'class' => 'ab-sub-secondary'
77
+ // )
78
+ // ) );
79
+ global $wp_admin_bar;
80
+
81
+ if(! function_exists("bp_use_wp_admin_bar"))
82
+ return;
83
+ // Bail if this is an ajax request
84
+ if ( ! bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) )
85
+ return;
86
+
87
+ // Only add menu for logged in user
88
+ if ( is_user_logged_in() ) {
89
+
90
+ // Add secondary parent item for all BuddyPress components
91
+ $wp_admin_bar->add_menu( array(
92
+ 'parent' => 'my-account',
93
+ 'id' => 'my-account-' . RTMEDIA_MEDIA_SLUG,
94
+ 'title' => RTMEDIA_MEDIA_LABEL,
95
+ 'href' => trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . 'media/'
96
+ ) );
97
+
98
+ // $wp_admin_bar->add_menu( array(
99
+ // 'parent' => 'my-account-' . RTMEDIA_MEDIA_SLUG,
100
+ // 'id' => 'my-account-media-' . RTMEDIA_MEDIA_SLUG,
101
+ // 'title' => __('Wall Posts','rtmedia'),
102
+ // 'href' => trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . 'media/'.RTMediaAlbum::get_default().'/'
103
+ // ) );
104
+
105
+ $wp_admin_bar->add_menu( array(
106
+ 'parent' => 'my-account-' . RTMEDIA_MEDIA_SLUG,
107
+ 'id' => 'my-account-media-' . RTMEDIA_ALBUM_SLUG,
108
+ 'title' => __('Albums','rtmedia'),
109
+ 'href' => trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . 'media/album/'
110
+ ) );
111
+
112
+ global $rtmedia;
113
+
114
+ foreach ( $rtmedia->allowed_types as $type ) {
115
+ if ( ! $rtmedia->options[ 'allowedTypes_' . $type[ 'name' ] . '_enabled' ] )
116
+ continue;
117
+ $name = strtoupper( $type[ 'name' ] );
118
+ $wp_admin_bar->add_menu( array(
119
+ 'parent' => 'my-account-' . constant( 'RTMEDIA_MEDIA_SLUG' ),
120
+ 'id' => 'my-account-media-' . constant( 'RTMEDIA_' . $name . '_SLUG' ),
121
+ 'title' => $type[ 'plural_label' ],
122
+ 'href' => trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . 'media/' . constant( 'RTMEDIA_' . $name . '_SLUG' ) . '/'
123
+ ) );
124
+ }
125
+ }
126
+ }
127
+
128
+ static function sub_nav() {
129
+ global $rtmedia, $rtmedia_query;
130
+
131
+ $default = false;
132
+
133
+ if(!isset($rtmedia_query->action_query->action)||empty($rtmedia_query->action_query->action)){
134
+ $default = true;
135
+ }
136
+ //print_r($rtmedia_query->action_query);
137
+
138
+ $global_album = '';
139
+ // if(isset($rtmedia_query->action_query->id) && $rtmedia_query->action_query->id==RTMediaAlbum::get_default())
140
+ // $global_album = 'class = "current selected"';
141
+ // echo apply_filters( 'rtmedia_sub_nav_wall_post' ,
142
+ // '<li id="rtmedia-nav-item-wall-post-li" ' . $global_album . '><a id="rtmedia-nav-item-wall-post" href="' . trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . 'media/' . RTMediaAlbum::get_default() . '/' . '">' . __("Wall Posts","rtmedia") . '</a></li>' );
143
+
144
+ $albums = '';
145
+ if(isset($rtmedia_query->action_query->media_type) && $rtmedia_query->action_query->media_type=='album')
146
+ $albums = 'class="current selected"';
147
+
148
+ if ( function_exists('bp_is_group') && bp_is_group() )
149
+ $link = get_rtmedia_group_link(bp_get_group_id());
150
+ else
151
+ $link = get_rtmedia_user_link( get_current_user_id() );
152
+ echo apply_filters( 'rtmedia_sub_nav_albums' ,
153
+ '<li id="rtmedia-nav-item-albums-li" ' . $albums . '><a id="rtmedia-nav-item-albums" href="' . trailingslashit( $link ) . 'media/album/">' . __("Albums","rtmedia") . '</a></li>' );
154
+
155
+ foreach ( $rtmedia->allowed_types as $type ) {
156
+ //print_r($type);
157
+ if ( ! $rtmedia->options[ 'allowedTypes_' . $type[ 'name' ] . '_enabled' ] )
158
+ continue;
159
+
160
+ $selected = '';
161
+
162
+ if ( isset($rtmedia_query->action_query->media_type) && $type[ 'name' ] == $rtmedia_query->action_query->media_type ) {
163
+ $selected = ' class="current selected"';
164
+ } else {
165
+ $selected = '';
166
+ }
167
+
168
+ $context = isset($rtmedia_query->query['context'])?$rtmedia_query->query['context']:'default';
169
+ $context_id = isset($rtmedia_query->query['context_id'])?$rtmedia_query->query['context_id']:0;
170
+ $name = strtoupper( $type[ 'name' ] );
171
+ $is_group = false;
172
+ $profile = self::profile_id();
173
+ if(!$profile){
174
+ $profile = self::group_id();
175
+ $is_group = true;
176
+ }
177
+
178
+
179
+ if(!$is_group){
180
+ $profile_link = trailingslashit(
181
+ get_rtmedia_user_link(
182
+ $profile
183
+ )
184
+ ) ;
185
+ }else{
186
+ $profile_link = trailingslashit(
187
+ get_rtmedia_group_link(
188
+ $profile
189
+ )
190
+ ) ;
191
+ }
192
+
193
+ echo apply_filters( 'rtmedia_sub_nav_' .$type['name'] ,
194
+ '<li id="rtmedia-nav-item-' . $type['name']
195
+ . '-' . $context .'-'. $context_id. '-li" ' . $selected
196
+ . '><a id="rtmedia-nav-item-' . $type['name'] . '" href="'
197
+ . $profile_link. 'media/'
198
+ . constant( 'RTMEDIA_' . $name . '_SLUG' ) . '/' . '">'
199
+ . $type['plural_label'] . '</a></li>',
200
+ $type['name']
201
+ );
202
+
203
+ }
204
+
205
+ }
206
+
207
+ function refresh_counts($user_id){
208
+ $model = new RTMediaModel();
209
+ $counts = $model->get_counts($user_id);
210
+
211
+ $media_count = array();
212
+ foreach($counts as $count){
213
+ $media_count[$count->privacy]= $count;
214
+ unset($media_count[$count->privacy]->privacy);
215
+
216
+ }
217
+
218
+ update_user_meta($user_id, 'rtmedia_count', $counts);
219
+ return $media_count;
220
+ }
221
+
222
+ function get_counts(){
223
+ $profile_id = $this->profile_id();
224
+ if(!$profile_id)return false;
225
+ $counts = get_user_meta($profile_id, 'rtmedia_count');
226
+ if(empty($counts)){
227
+ echo 'wtf';
228
+ $counts = $this->refresh_counts($profile_id);
229
+ }
230
+
231
+ return $counts;
232
+
233
+ }
234
+
235
+ function profile_id(){
236
+ global $rtmedia_query;
237
+ if(isset($rtmedia_query->query['context']) && ($rtmedia_query->query['context']=='profile')){
238
+ return $rtmedia_query->query['context_id'];
239
+ }
240
+
241
+ return false;
242
+
243
+ }
244
+
245
+ function group_id(){
246
+ global $rtmedia_query;
247
+ if(isset($rtmedia_query->query['context']) && ($rtmedia_query->query['context']=='group')){
248
+ return $rtmedia_query->query['context_id'];
249
+ }
250
+ }
251
+
252
+ function actual_counts(){
253
+ if(!$this->profile_id()) return;
254
+ $media_count = $this->get_counts();
255
+ $privacy = $this->set_privacy();
256
+ $total = array('all'=>0);
257
+ //print_r($media_count);die();
258
+
259
+ foreach($media_count as $private=>$ind_count){
260
+ if($private<=$privacy){
261
+ foreach($ind_count as $type=>$ind_ind_count){
262
+ if($type!='album'){
263
+ $total['all']+= (int)$ind_ind_count;
264
+ }
265
+ $total[$type]+=(int)$ind_ind_count;
266
+ }
267
+ }else{
268
+ unset($media_count[$private]);
269
+ }
270
+ }
271
+
272
+ $media_count['total'] = $total;
273
+ //print_r($media_count);
274
+ return $media_count;
275
+ }
276
+
277
+ function visitor_id() {
278
+ if ( is_user_logged_in() ) {
279
+ $user = get_current_user_id();
280
+ } else {
281
+ $user = 0;
282
+ }
283
+ return $user;
284
+ }
285
+
286
+ function set_privacy() {
287
+ $user = $this->visitor_id();
288
+ $privacy = 0;
289
+ if ( $user ) {
290
+ $privacy = 20;
291
+ }
292
+ $profile = $this->profile_id();
293
+ if(class_exists('BuddyPress')&&bp_is_active('friends')){
294
+
295
+ if(friends_check_friendship_status( $user, $profile )){
296
+ $privacy = 40;
297
+ }
298
+ }
299
+ if($user===$profile){
300
+ $privacy = 60;
301
+ }
302
+
303
+ return $privacy;
304
+ }
305
+
306
+
307
+
308
+
309
+ }
310
+
311
+ ?>
app/main/controllers/template/RTMediaTemplate.php ADDED
@@ -0,0 +1,467 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaTemplate
5
+ *
6
+ * Template to display rtMedia Gallery.
7
+ * A stand alone template that renders the gallery/uploader on the page.
8
+ *
9
+ * @author saurabh
10
+ */
11
+ class RTMediaTemplate {
12
+
13
+ public $media_args;
14
+
15
+ function __construct() {
16
+ global $rtmedia_query;
17
+ if ( $rtmedia_query ) {
18
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
19
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_image_editor_scripts' ) );
20
+ }
21
+
22
+ }
23
+
24
+ /**
25
+ * Enqueues required scripts on the page
26
+ */
27
+ function enqueue_scripts() {
28
+ wp_enqueue_script( 'rtmedia-backbone' );
29
+ $is_album = is_rtmedia_album() ? true : false;
30
+ $is_edit_allowed = is_rtmedia_edit_allowed() ? true: false;
31
+ wp_localize_script('rtmedia-backbone', 'is_album', array($is_album));
32
+ wp_localize_script('rtmedia-backbone', 'is_edit_allowed', array($is_edit_allowed));
33
+ }
34
+
35
+ function enqueue_image_editor_scripts() {
36
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
37
+ wp_enqueue_script( 'wp-ajax-response' );
38
+ wp_enqueue_script( 'rtmedia-image-edit', admin_url( "js/image-edit$suffix.js" ), array( 'jquery', 'json2', 'imgareaselect' ), false, 1 );
39
+ wp_enqueue_style( 'rtmedia-image-edit', RTMEDIA_URL . 'app/assets/css/image-edit.css' );
40
+ wp_enqueue_style( 'rtmedia-image-area-select', includes_url('/js/imgareaselect/imgareaselect.css') );
41
+
42
+ }
43
+
44
+ /**
45
+ * redirects to the template according to the page request
46
+ * Pass on the shortcode attributes to the template so that the shortcode can berendered accordingly.
47
+ *
48
+ * Also handles the json request coming from the AJAX calls for the media
49
+ *
50
+ * @global type $rtmedia_query
51
+ * @global type $rtmedia_interaction
52
+ * @param type $template
53
+ * @param type $shortcode_attr
54
+ * @return type
55
+ */
56
+ function set_template( $template, $shortcode_attr = false ) {
57
+
58
+ global $rtmedia_query, $rtmedia_interaction, $rtmedia_media;
59
+
60
+ do_action( 'rtmedia_pre_template' );
61
+
62
+ //print_r($rtmedia_query);
63
+
64
+ if(isset($rtmedia_query->action_query->action)){
65
+ //echo $rtmedia_query->action_query->action;
66
+ do_action( 'rtmedia_pre_action_' . $rtmedia_query->action_query->action );
67
+ }else{
68
+ do_action( 'rtmedia_pre_action_default' );
69
+ }
70
+
71
+ $this->check_return_json();
72
+
73
+ $this->check_return_upload();
74
+
75
+ if ( in_array( $rtmedia_interaction->context->type, array( "profile", "group" ) ) ) {
76
+
77
+
78
+ $this->check_return_edit();
79
+
80
+ $this->check_return_delete();
81
+
82
+ $this->check_return_merge();
83
+
84
+ $this->check_return_comments();
85
+
86
+ return $this->get_default_template();
87
+
88
+ } else if ( ! $shortcode_attr ){
89
+ return $this->get_default_template();
90
+ } else if ( $shortcode_attr[ 'name' ] == 'gallery' ) {
91
+ $valid = $this->sanitize_gallery_attributes( $shortcode_attr[ 'attr' ] );
92
+
93
+ if ( $valid ) {
94
+ if ( is_array( $shortcode_attr[ 'attr' ] ) )
95
+ $this->update_global_query( $shortcode_attr[ 'attr' ] );
96
+ include $this->locate_template( $template );
97
+ } else {
98
+ echo __('Invalid attribute passed for rtmedia_gallery shortcode.','rtmedia');
99
+ return false;
100
+ }
101
+ }
102
+ }
103
+
104
+ function check_return_json() {
105
+ global $rtmedia_query;
106
+ if ( $rtmedia_query->format == 'json' ) {
107
+ $this->json_output();
108
+ } else {
109
+ return;
110
+ }
111
+ }
112
+
113
+ function check_return_upload(){
114
+ global $rtmedia_query;
115
+ if ( $rtmedia_query->action_query->action != 'upload' ) return;
116
+ $upload = new RTMediaUploadEndpoint();
117
+ $upload->template_redirect();
118
+ }
119
+
120
+ function json_output() {
121
+ global $rtmedia_query;
122
+ $media_array = array( );
123
+ if ( $rtmedia_query->media ) {
124
+ foreach ( $rtmedia_query->media as $key => $media ) {
125
+ $media_array[ $key ] = $media;
126
+ list($src, $width, $height) = wp_get_attachment_image_src( $media->media_id, 'thumbnail' );
127
+ if(!$src){
128
+ global $rtmedia;
129
+ $src = $rtmedia->allowed_types[$media->media_type]["thumbnail"];
130
+ }
131
+ $media_array[ $key ]->guid = $src;
132
+ $media_array[ $key ]->rt_permalink = get_rtmedia_permalink( $media->id );
133
+ }
134
+ }
135
+ $return_array[ 'data' ] = $media_array;
136
+ $return_array[ 'prev' ] = rtmedia_page() - 1;
137
+ $return_array[ 'next' ] = (rtmedia_offset() + rtmedia_per_page_media() < rtmedia_count()) ? (rtmedia_page() + 1) : -1;
138
+ echo json_encode( $return_array );
139
+ die;
140
+ }
141
+
142
+ function check_return_edit() {
143
+ global $rtmedia_query;
144
+ if ( $rtmedia_query->action_query->action == 'edit' && count( $_POST ) )
145
+ $this->save_edit();
146
+ return $this->get_default_template();
147
+ }
148
+
149
+ function save_edit() {
150
+ if ( is_rtmedia_single() ) {
151
+ $this->save_single_edit();
152
+ } elseif ( is_rtmedia_album() ) {
153
+ $this->save_album_edit();
154
+ }
155
+ }
156
+
157
+ function save_single_edit() {
158
+ global $rtmedia_query;
159
+ $nonce = $_POST[ 'rtmedia_media_nonce' ];
160
+ if ( wp_verify_nonce( $nonce, 'rtmedia_' . $rtmedia_query->action_query->id ) ) {
161
+
162
+ // do_action('rtmedia_before_update_media',$rtmedia_query->action_query->id);
163
+
164
+ $data = rtmedia_sanitize_object($_POST, array('media_title','description','privacy'));
165
+ $media = new RTMediaMedia();
166
+ $media->update( $rtmedia_query->action_query->id, $data, $rtmedia_query->media[ 0 ]->media_id );
167
+ $rtmedia_query->query( false );
168
+
169
+ // do_action('rtmedia_after_update_media',$rtmedia_query->action_query->id);
170
+
171
+ } else {
172
+ echo __( "Ooops !!! Invalid access. No nonce was found !!", "rtmedia" );
173
+ }
174
+ }
175
+
176
+ function save_album_edit() {
177
+ global $rtmedia_query;
178
+ $nonce = $_REQUEST[ 'rtmedia_media_nonce' ];
179
+ if ( wp_verify_nonce( $nonce, 'rtmedia_' . $rtmedia_query->media_query[ 'album_id' ] ) ) {
180
+ $media = new RTMediaMedia();
181
+ $model = new RTMediaModel();
182
+ if ( isset( $_POST[ 'submit' ] ) ) {
183
+ $data = $_POST;
184
+ unset( $data[ 'rtmedia_media_nonce' ] );
185
+ unset( $data[ '_wp_http_referer' ] );
186
+ unset( $data[ 'submit' ] );
187
+ $album = $model->get_media( array( 'id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
188
+ $media->update( $album[ 0 ]->id, $data, $album[ 0 ]->media_id );
189
+ } elseif ( isset( $_POST[ 'move-selected' ] ) ) {
190
+ // print_r($_POST);die;
191
+ $album_move = $_POST[ 'album' ];
192
+ $selected_ids = NULL;
193
+
194
+ if ( isset( $_POST[ 'selected' ] ) ) {
195
+ $selected_ids = $_POST[ 'selected' ];
196
+ unset( $_POST[ 'selected' ] );
197
+ }
198
+ if ( ! empty( $selected_ids ) && is_array( $selected_ids ) ) {
199
+ $album_move_details = $model->get_media( array( 'id' => $album_move ), false, false );
200
+ foreach ( $selected_ids as $media_id ) {
201
+ $media_details = $model->get_media( array( 'id' => $media_id ), false, false );
202
+ $post_array[ 'ID' ] = $media_details[ 0 ]->media_id;
203
+ $post_array[ 'post_parent' ] = $album_move_details[ 0 ]->media_id;
204
+ wp_update_post( $post_array );
205
+ $media->update( $media_details[ 0 ]->id, array( 'album_id' => $album_move_details[ 0 ]->id ), $media_details[ 0 ]->media_id );
206
+ }
207
+ }
208
+ }
209
+ wp_safe_redirect( get_rtmedia_permalink( $rtmedia_query->media_query[ 'album_id' ] ) . 'edit/' );
210
+ } else {
211
+ echo __( "Ooops !!! Invalid access. No nonce was found !!", "rtmedia" );
212
+ }
213
+ }
214
+
215
+ function check_return_delete() {
216
+
217
+ global $rtmedia_query;
218
+ if ( $rtmedia_query->action_query->action != 'delete' )
219
+ return;
220
+ if ( ! count( $_POST ) )
221
+ return;
222
+
223
+ if ( isset( $rtmedia_query->action_query->default ) && $rtmedia_query->action_query->default == 'delete' ) {
224
+ $this->bulk_delete();
225
+ } else {
226
+ if ( is_rtmedia_single() ) {
227
+ $this->single_delete();
228
+ } elseif ( is_rtmedia_album() ) {
229
+
230
+ $this->album_delete();
231
+ }
232
+ }
233
+ }
234
+
235
+ function bulk_delete() {
236
+ $nonce = $_POST[ 'rtmedia_bulk_delete_nonce' ];
237
+
238
+ $media = new RTMediaMedia();
239
+ if ( wp_verify_nonce( $nonce, 'rtmedia_bulk_delete_nonce' ) && isset( $_POST[ 'selected' ] ) ) {
240
+ $ids = $_POST[ 'selected' ];
241
+ foreach ( $ids as $id ) {
242
+ $media->delete( $id );
243
+ }
244
+ }
245
+ wp_safe_redirect( $_POST[ '_wp_http_referer' ] );
246
+ }
247
+
248
+ function single_delete() {
249
+ global $rtmedia_query;
250
+ $nonce = $_REQUEST[ 'rtmedia_media_nonce' ];
251
+ if ( wp_verify_nonce( $nonce, 'rtmedia_' . $rtmedia_query->media[ 0 ]->id ) ) {
252
+
253
+ // do_action('rtmedia_before_delete_media',$rtmedia_query->media[ 0 ]->id);
254
+
255
+ $id = $_POST;
256
+ unset( $id[ 'rtmedia_media_nonce' ] );
257
+ unset( $id[ '_wp_http_referer' ] );
258
+ $media = new RTMediaMedia();
259
+ $media->delete( $rtmedia_query->media[ 0 ]->id );
260
+
261
+ $post = get_post( $rtmedia_query->media[ 0 ] );
262
+
263
+ $parent_link = '';
264
+ if ( function_exists( 'bp_core_get_user_domain' ) ) {
265
+ $parent_link = bp_core_get_user_domain( $post->media_author );
266
+ } else {
267
+ $parent_link = get_author_posts_url( $post->media_author );
268
+ }
269
+
270
+ // do_action('rtmedia_after_delete_media',$rtmedia_query->media[ 0 ]->id);
271
+
272
+ wp_redirect( $parent_link );
273
+ } else {
274
+ echo __( "Ooops !!! Invalid access. No nonce was found !!", "rtmedia" );
275
+ }
276
+ }
277
+
278
+ function album_delete() {
279
+ global $rtmedia_query;
280
+ $nonce = $_REQUEST[ 'rtmedia_delete_album_nonce' ];
281
+ if ( wp_verify_nonce( $nonce, 'rtmedia_delete_album_' . $rtmedia_query->media_query[ 'album_id' ] ) ) {
282
+ $media = new RTMediaMedia();
283
+ $model = new RTMediaModel();
284
+ $album_contents = $model->get( array( 'album_id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
285
+ foreach ( $album_contents as $album_media ) {
286
+ $media->delete( $album_media->id );
287
+ }
288
+ $media->delete( $rtmedia_query->media_query[ 'album_id' ] );
289
+ }
290
+ wp_safe_redirect( get_rtmedia_user_link( get_current_user_id() ) . 'media/album/' );
291
+ exit;
292
+ }
293
+
294
+ function check_return_merge() {
295
+ global $rtmedia_query;
296
+ if ( $rtmedia_query->action_query->action != 'merge' )
297
+ return;
298
+ $nonce = $_REQUEST[ 'rtmedia_merge_album_nonce' ];
299
+ if ( wp_verify_nonce( $nonce, 'rtmedia_merge_album_' . $rtmedia_query->media_query[ 'album_id' ] ) ) {
300
+ $media = new RTMediaMedia();
301
+ $model = new RTMediaModel();
302
+ $album_contents = $model->get( array( 'album_id' => $rtmedia_query->media_query[ 'album_id' ] ), false, false );
303
+ // print_r($album_contents); die;
304
+ $album_move_details = $model->get_media( array( 'id' => $_POST[ 'album' ] ), false, false );
305
+ foreach ( $album_contents as $album_media ) {
306
+
307
+ $post_array[ 'ID' ] = $album_media->media_id;
308
+ $post_array[ 'post_parent' ] = $album_move_details[ 0 ]->media_id;
309
+ wp_update_post( $post_array );
310
+ $media->update( $album_media->id, array( 'album_id' => $album_move_details[ 0 ]->id ), $album_media->media_id );
311
+ }
312
+ $media->delete( $rtmedia_query->media_query[ 'album_id' ] );
313
+ }
314
+ wp_safe_redirect( get_rtmedia_user_link( get_current_user_id() ) . 'media/album/' );
315
+ exit;
316
+ }
317
+
318
+
319
+
320
+
321
+
322
+ function check_return_comments(){
323
+ global $rtmedia_query;
324
+
325
+ if ( $rtmedia_query->action_query->action != 'comment' ) return;
326
+ if ( isset( $rtmedia_query->action_query->id ) && count( $_POST ) ) {
327
+ /**
328
+ * /media/comments [POST]
329
+ * Post a comment to the album by post id
330
+ */
331
+ $nonce = $_REQUEST[ 'rtmedia_comment_nonce' ];
332
+ if ( wp_verify_nonce( $nonce, 'rtmedia_comment_nonce' ) ) {
333
+ if(empty($_POST['comment_content'])){
334
+ return false;
335
+ }
336
+ $comment = new RTMediaComment();
337
+ $attr = $_POST;
338
+ if ( ! isset( $attr[ 'comment_post_ID' ] ) )
339
+ $attr[ 'comment_post_ID' ] = $rtmedia_query->action_query->id;
340
+ $id = $comment->add( $attr );
341
+
342
+ $mediaModel = new RTMediaModel();
343
+ $result=$mediaModel->get(array('id'=>$rtmedia_query->action_query->id));
344
+
345
+ if($result[0]->activity_id!=NULL) {
346
+ global $rtmedia_buddypress_activity;
347
+ remove_action("bp_activity_comment_posted", array($rtmedia_buddypress_activity,"comment_sync"),10,2);
348
+ if(function_exists('bp_activity_new_comment')) {
349
+ bp_activity_new_comment(array('content'=> $_POST['comment_content'], 'activity_id'=> $result[0]->activity_id));
350
+ }
351
+ }
352
+ if(isset($_POST["rtajax"])){
353
+ global $wpdb;
354
+ $comments = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d",$id), ARRAY_A);
355
+ echo rmedia_single_comment($comments);
356
+ exit;
357
+ }
358
+ }
359
+ else {
360
+ echo "Ooops !!! Invalid access. No nonce was found !!";
361
+ }
362
+ }
363
+
364
+ }
365
+
366
+ /**
367
+ * Helper method to fetch allowed media types from each section
368
+ *
369
+ * @param type $allowed_type
370
+ * @return type
371
+ */
372
+ function get_allowed_type_name( $allowed_type ) {
373
+ return $allowed_type[ 'name' ];
374
+ }
375
+
376
+ /**
377
+ * Validates all the attributes for gallery shortcode
378
+ *
379
+ * @global type $rtmedia
380
+ * @param string $attr
381
+ * @return type
382
+ */
383
+ function sanitize_gallery_attributes( &$attr ) {
384
+ global $rtmedia;
385
+
386
+ $flag = true;
387
+
388
+ if ( isset( $attr[ 'media_type' ] ) ) {
389
+ $allowed_type_names = array_map( array( $this, 'get_allowed_type_name' ), $rtmedia->allowed_types );
390
+
391
+ if ( strtolower( $attr[ 'media_type' ] ) == 'all' ) {
392
+ $flag = $flag && true;
393
+ unset( $attr[ 'media_type' ] );
394
+ } else
395
+ $flag = $flag && in_array( $attr[ 'media_type' ], $allowed_type_names );
396
+ }
397
+
398
+ if ( isset( $attr[ 'order_by' ] ) ) {
399
+
400
+ $allowed_columns = array( 'date', 'views', 'downloads', 'ratings', 'likes', 'dislikes' );
401
+ $allowed_columns = apply_filters( 'filter_allowed_sorting_columns', $allowed_columns );
402
+
403
+ $flag = $flag && in_array( $attr[ 'order_by' ], $allowed_columns );
404
+
405
+ if ( strtolower( $attr[ 'order_by' ] ) == 'date' )
406
+ $attr[ 'order_by' ] = 'media_id';
407
+ }
408
+
409
+ if ( isset( $attr[ 'order' ] ) ) {
410
+ $flag = $flag && strtolower( $attr[ 'order' ] ) == 'asc' || strtolower( $attr[ 'order' ] ) == 'desc';
411
+ }
412
+
413
+ return $flag;
414
+ }
415
+
416
+ function update_global_query( $attr ) {
417
+
418
+ global $rtmedia_query;
419
+
420
+ $rtmedia_query->query( $attr );
421
+
422
+ }
423
+
424
+ /**
425
+ * filter to change the template path independent of the plugin
426
+ *
427
+ * @return type
428
+ */
429
+ function get_default_template() {
430
+
431
+ return apply_filters( 'rtmedia_media_template_include', RTMEDIA_PATH . 'app/main/controllers/template/template.php' );
432
+ }
433
+
434
+ /**
435
+ * Template Locator
436
+ *
437
+ * @param type $template
438
+ * @return string
439
+ */
440
+ static function locate_template( $template, $context = false ) {
441
+ $located = '';
442
+ if ( ! $template )
443
+ return;
444
+
445
+ $template_name = $template . '.php';
446
+
447
+ if ( ! $context )
448
+ $context = 'rtmedia';
449
+
450
+ $path = '/' . $context . '/';
451
+ $ogpath = 'templates/media/';
452
+
453
+
454
+ if ( file_exists( STYLESHEETPATH . $path . $template_name ) ) {
455
+ $located = STYLESHEETPATH . $path . $template_name;
456
+ } else if ( file_exists( TEMPLATEPATH . $path . $template_name ) ) {
457
+ $located = TEMPLATEPATH . $path . $template_name;
458
+ } else {
459
+ $located = RTMEDIA_PATH . $ogpath . $template_name;
460
+ }
461
+
462
+ return $located;
463
+ }
464
+
465
+ }
466
+
467
+ ?>
app/main/controllers/template/RTMediaUploadTemplate.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUploadTemplate
5
+ *
6
+ * Template that handles the upload shortcode and it's rendering
7
+ *
8
+ * @author saurabh
9
+ */
10
+ class RTMediaUploadTemplate {
11
+
12
+ /**
13
+ *
14
+ */
15
+ function __construct() {
16
+
17
+ }
18
+
19
+ static function render($attr){
20
+ $view = new RTMediaUploadView($attr);
21
+ return $view->render('uploader');
22
+ }
23
+
24
+ function register_script() {
25
+ wp_register_script('bpm-plupload', RTMEDIA_URL . 'app/assets/js/bpm-plupload.js', array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4', 'plupload-handlers'), '1.0', true);
26
+ }
27
+
28
+ function print_script() {
29
+ if (!$this->add_sc_script)
30
+ return;
31
+ $params = array(
32
+ 'url' => 'upload',
33
+ 'runtimes' => 'gears,html5,flash,silverlight,browserplus',
34
+ 'browse_button' => 'browse-button',
35
+ 'container' => 'bpm-file_upload-ui',
36
+ 'drop_element' => 'drag-drop-area',
37
+ 'filters' => apply_filters('bp_media_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => "mp4,jpg,png,jpeg,gif,mp3"))),
38
+ 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))),
39
+ 'multipart' => true,
40
+ 'urlstream_upload' => true,
41
+ 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
42
+ 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
43
+ 'file_data_name' => 'bp_media_file', // key passed to $_FILE.
44
+ 'multi_selection' => true,
45
+ 'multipart_params' => apply_filters('bp_media_multipart_params_filter', array('action' => 'wp_handle_upload'))
46
+ );
47
+
48
+ foreach ((array) $params as $key => $value) {
49
+ if (!is_scalar($value))
50
+ continue;
51
+
52
+ $params[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
53
+ }
54
+
55
+ echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5
56
+ echo "/* <![CDATA[ */\n";
57
+ echo "var bpm_plupload_params = " . json_encode($params) . ";\n";
58
+ echo "/* ]]> */\n";
59
+ echo "</script>\n";
60
+
61
+ wp_print_scripts('bpm-plupload');
62
+ }
63
+
64
+ }
65
+
66
+ ?>
app/main/controllers/template/rt-template-functions.php ADDED
@@ -0,0 +1,808 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Checks at any point of time any media is left to be processed in the db pool
5
+ * @global type $rtmedia_query
6
+ * @return type
7
+ */
8
+ function have_rtmedia() {
9
+ global $rtmedia_query;
10
+
11
+ return $rtmedia_query->have_media();
12
+ }
13
+
14
+ /**
15
+ * Rewinds the db pool of media album and resets it to begining
16
+ * @global type $rtmedia_query
17
+ * @return type
18
+ */
19
+ function rewind_rtmedia() {
20
+
21
+ global $rtmedia_query;
22
+
23
+ return $rtmedia_query->rewind_media();
24
+ }
25
+
26
+ /**
27
+ * moves ahead in the loop of media within the album
28
+ * @global type $rtmedia_query
29
+ * @return type
30
+ */
31
+ function rtmedia() {
32
+ global $rtmedia_query;
33
+
34
+ return $rtmedia_query->rtmedia();
35
+ }
36
+
37
+ /**
38
+ * echo the title of the media
39
+ * @global type $rtmedia_media
40
+ */
41
+ function rtmedia_title() {
42
+
43
+ global $rtmedia_backbone;
44
+ if ($rtmedia_backbone['backbone']) {
45
+ echo '<%= media_title %>';
46
+ } else {
47
+ global $rtmedia_media;
48
+ return $rtmedia_media->media_title;
49
+ }
50
+ }
51
+
52
+
53
+ function rtmedia_media_gallery_class(){
54
+ global $rtmedia_query;
55
+ if(isset($rtmedia_query->media_query) && isset($rtmedia_query->media_query["context_id"]))
56
+ echo "context-id-" . $rtmedia_query->media_query["context_id"];
57
+ }
58
+ function rtmedia_id($media_id = false) {
59
+ if ($media_id) {
60
+ $model = new RTMediaModel();
61
+ $media = $model->get_media(array('media_id' => $media_id), 0, 1);
62
+ return $media[0]->id;
63
+ } else {
64
+ global $rtmedia_media;
65
+ return $rtmedia_media->id;
66
+ }
67
+ }
68
+
69
+ function rtmedia_media_id($id = false) {
70
+ if ($id) {
71
+ $model = new RTMediaModel();
72
+ $media = $model->get_media(array('id' => $id), 0, 1);
73
+ return $media[0]->media_id;
74
+ } else {
75
+ global $rtmedia_media;
76
+ return $rtmedia_media->media_id;
77
+ }
78
+ }
79
+
80
+ function rtmedia_activity_id($id = false) {
81
+ if ($id) {
82
+ $model = new RTMediaModel();
83
+ $media = $model->get_media(array('id' => $id), 0, 1);
84
+ return $media[0]->activity_id;
85
+ } else {
86
+ global $rtmedia_media;
87
+ return $rtmedia_media->activity_id;
88
+ }
89
+ }
90
+
91
+ function rtmedia_type($id = false) {
92
+ if ($id) {
93
+ $model = new RTMediaModel();
94
+ $media = $model->get_media(array('id' => $id), 0, 1);
95
+ return $media[0]->media_type;
96
+ } else {
97
+ global $rtmedia_media;
98
+ return $rtmedia_media->media_type;
99
+ }
100
+ }
101
+
102
+ function rtmedia_cover_art($id=false) {
103
+ if ($id) {
104
+ $model = new RTMediaModel();
105
+ $media = $model->get_media(array('id' => $id), 0, 1);
106
+ return $media[0]->cover_art;
107
+ } else {
108
+ global $rtmedia_media;
109
+ return $rtmedia_media->cover_art;
110
+ }
111
+ }
112
+
113
+ /**
114
+ * echo parmalink of the media
115
+ * @global type $rtmedia_media
116
+ */
117
+ function rtmedia_permalink() {
118
+
119
+ global $rtmedia_backbone;
120
+
121
+ if ($rtmedia_backbone['backbone']) {
122
+ echo '<%= rt_permalink %>';
123
+ } else {
124
+ echo get_rtmedia_permalink(rtmedia_id());
125
+ }
126
+ }
127
+
128
+ function rtmedia_media($size_flag, $echo = true) {
129
+ $size_flag = true;
130
+ global $rtmedia_media, $rtmedia;
131
+ if (isset($rtmedia_media->media_type)) {
132
+ if ($rtmedia_media->media_type == 'photo') {
133
+ $html = wp_get_attachment_image($rtmedia_media->media_id, 'large');
134
+ } elseif ($rtmedia_media->media_type == 'video') {
135
+ $size = " width=\"" . $rtmedia->options["defaultSizes_video_singlePlayer_width"] . "\" height=\"" . $rtmedia->options["defaultSizes_video_singlePlayer_height"] . "\" ";
136
+
137
+ $html = '<video src="' . wp_get_attachment_url($rtmedia_media->media_id) . '" ' . $size . ' type="video/mp4" class="wp-video-shortcode" id="bp_media_video_' . $rtmedia_media->id . '" controls="controls" preload="none"></video>';
138
+ } elseif ($rtmedia_media->media_type == 'music') {
139
+ $size = ' width="600" height="0" ';
140
+ if (!$size_flag)
141
+ $size = '';
142
+ $html = '<audio src="' . wp_get_attachment_url($rtmedia_media->media_id) . '" ' . $size . ' type="audio/mp3" class="wp-audio-shortcode" id="bp_media_audio_' . $rtmedia_media->id . '" controls="controls" preload="none"></audio>';
143
+ } else {
144
+ $html = false;
145
+ }
146
+ } else {
147
+ $html = false;
148
+ }
149
+
150
+ do_action('rtmedia_after_'.$rtmedia_media->media_type,$rtmedia_media->id);
151
+
152
+ $html = apply_filters('rtmedia_single_content_filter', $html, $rtmedia_media);
153
+
154
+ if ($echo)
155
+ echo $html;
156
+ else
157
+ return $html;
158
+ }
159
+
160
+ /*
161
+ * echo http url of the media
162
+ */
163
+
164
+ function rtmedia_image($size = 'thumbnail', $id = false) {
165
+ global $rtmedia_backbone;
166
+
167
+ if ($rtmedia_backbone['backbone']) {
168
+ echo '<%= guid %>';
169
+ return;
170
+ }
171
+
172
+ if ($id) {
173
+ $model = new RTMediaModel();
174
+ $media = $model->get_media(array('id' => $id), false, false);
175
+ if (isset($media[0]))
176
+ $media_object = $media[0];
177
+ else
178
+ return false;
179
+ } else {
180
+ global $rtmedia_media;
181
+ $media_object = $rtmedia_media;
182
+ }
183
+
184
+ $thumbnail_id = 0;
185
+ if (isset($media_object->media_type)) {
186
+ if ($media_object->media_type == 'album' ||
187
+ $media_object->media_type != 'photo') {
188
+ $thumbnail_id = isset($media_object->cover_art) ? $media_object->cover_art : false;
189
+ } elseif ($media_object->media_type == 'photo') {
190
+ $thumbnail_id = $media_object->media_id;
191
+ } else {
192
+ $thumbnail_id = false;
193
+ }
194
+ } else {
195
+ $src = false;
196
+ }
197
+
198
+ if (!$thumbnail_id) {
199
+ global $rtmedia;
200
+ if (isset($rtmedia->allowed_types[$media_object->media_type])
201
+ && isset($rtmedia->allowed_types[$media_object->media_type]['thumbnail'])) {
202
+ $src = $rtmedia->allowed_types[$media_object->media_type]['thumbnail'];
203
+ } elseif ($media_object->media_type == 'album') {
204
+ $src = rtmedia_album_image($size);
205
+ } else {
206
+ $src = false;
207
+ }
208
+ } else {
209
+ list($src, $width, $height) = wp_get_attachment_image_src($thumbnail_id, $size);
210
+ }
211
+
212
+ $src = apply_filters('rtmedia_media_thumb', $src, $media_object->id, $media_object->media_type);
213
+
214
+ echo $src;
215
+ }
216
+
217
+ function rtmedia_album_image($size = 'thumbnail') {
218
+ global $rtmedia_media;
219
+ $model = new RTMediaModel();
220
+ $media = $model->get_media(array('album_id' => $rtmedia_media->id, 'media_type' => 'photo'), 0, 1);
221
+
222
+ if ($media) {
223
+ $src = rtmedia_image($size, $media[0]->id);
224
+ } else {
225
+ global $rtmedia;
226
+ $src = $rtmedia->allowed_types['photo']['thumbnail'];
227
+ }
228
+ return $src;
229
+ }
230
+
231
+ function rtmedia_sanitize_object($data, $exceptions = array()) {
232
+ foreach ($data as $key => $value) {
233
+ if (!in_array($key, array_merge(RTMediaMedia::$default_object, $exceptions)))
234
+ unset($data[$key]);
235
+ }
236
+ return $data;
237
+ }
238
+
239
+ function rtmedia_delete_allowed() {
240
+ global $rtmedia_media;
241
+
242
+ $flag = $rtmedia_media->media_author == get_current_user_id();
243
+
244
+ $flag = apply_filters('rtmedia_media_delete_priv', $flag);
245
+
246
+ return $flag;
247
+ }
248
+
249
+ function rtmedia_edit_allowed() {
250
+
251
+ global $rtmedia_media;
252
+
253
+ $flag = $rtmedia_media->media_author == get_current_user_id();
254
+
255
+ $flag = apply_filters('rtmedia_media_edit_priv', $flag);
256
+
257
+ return $flag;
258
+ }
259
+
260
+ function rtmedia_request_action() {
261
+ global $rtmedia_query;
262
+ return $rtmedia_query->action_query->action;
263
+ }
264
+
265
+
266
+ function rtmedia_title_input() {
267
+ global $rtmedia_media;
268
+
269
+ $name = 'media_title';
270
+ $value = $rtmedia_media->media_title;
271
+
272
+ $html = '';
273
+
274
+ if (rtmedia_request_action() == 'edit')
275
+ $html .= '<input type="text" name="' . $name . '" id="' . $name . '" value="' . $value . '">';
276
+ else
277
+ $html .= '<h2 name="' . $name . '" id="' . $name . '">' . $value . '</h2>';
278
+
279
+ $html .= '';
280
+
281
+ echo $html;
282
+ }
283
+
284
+ function rtmedia_description_input() {
285
+ global $rtmedia_media;
286
+
287
+ $name = 'description';
288
+ $value = $rtmedia_media->post_content;
289
+
290
+ $html = '';
291
+
292
+ if (rtmedia_request_action() == 'edit')
293
+ $html .= wp_editor($value, $name, array('media_buttons' => false));
294
+ else
295
+ $html .= '<div name="' . $name . '" id="' . $name . '">' . $value . '</div>';
296
+
297
+ $html .= '';
298
+
299
+ return $html;
300
+ }
301
+
302
+ /**
303
+ * echo media description
304
+ * @global type $rtmedia_media
305
+ */
306
+ function rtmedia_description() {
307
+ global $rtmedia_media;
308
+ echo $rtmedia_media->post_content;
309
+ }
310
+
311
+ /**
312
+ * returns total media count in the album
313
+ * @global type $rtmedia_query
314
+ * @return type
315
+ */
316
+ function rtmedia_count() {
317
+ global $rtmedia_query;
318
+
319
+ return $rtmedia_query->media_count;
320
+ }
321
+
322
+ /**
323
+ * returns the page offset for the media pool
324
+ * @global type $rtmedia_query
325
+ * @return type
326
+ */
327
+ function rtmedia_offset() {
328
+ global $rtmedia_query;
329
+
330
+ return ($rtmedia_query->action_query->page - 1) * $rtmedia_query->action_query->per_page_media;
331
+ }
332
+
333
+ /**
334
+ * returns number of media per page to be displayed
335
+ * @global type $rtmedia_query
336
+ * @return type
337
+ */
338
+ function rtmedia_per_page_media() {
339
+ global $rtmedia_query;
340
+
341
+ return $rtmedia_query->action_query->per_page_media;
342
+ }
343
+
344
+ /**
345
+ * returns the page number of media album in the pagination
346
+ * @global type $rtmedia_query
347
+ * @return type
348
+ */
349
+ function rtmedia_page() {
350
+ global $rtmedia_query;
351
+
352
+ return $rtmedia_query->action_query->page;
353
+ }
354
+
355
+ /**
356
+ * returns the current media number in the album pool
357
+ * @global type $rtmedia_query
358
+ * @return type
359
+ */
360
+ function rtmedia_current_media() {
361
+ global $rtmedia_query;
362
+
363
+ return $rtmedia_query->current_media;
364
+ }
365
+
366
+ /**
367
+ *
368
+ */
369
+ function rtmedia_actions() {
370
+
371
+ $actions = array();
372
+
373
+ if (is_user_logged_in() && rtmedia_edit_allowed()) {
374
+
375
+ $actions[] = '<form action="' . get_rtmedia_permalink(rtmedia_id()) . 'edit/">
376
+ <button type="submit" >' . __('Edit', 'rtmedia') . '</button></form>';
377
+ }
378
+ $actions = apply_filters('rtmedia_action_buttons_before_delete', $actions);
379
+ foreach ($actions as $action) {
380
+ echo $action;
381
+ }
382
+ $actions = array();
383
+ if (rtmedia_delete_allowed()) {
384
+ rtmedia_delete_form();
385
+ }
386
+ $actions = apply_filters('rtmedia_action_buttons_after_delete', $actions);
387
+
388
+ foreach ($actions as $action) {
389
+ echo $action;
390
+ }
391
+ }
392
+
393
+ /**
394
+ * rendering comments section
395
+ */
396
+ function rtmedia_comments() {
397
+
398
+ $html = '<ul id="rtmedia_comment_ul" class="large-block-grid-1">';
399
+
400
+ global $wpdb, $rtmedia_media;
401
+
402
+ $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '" . $rtmedia_media->id . "'", ARRAY_A);
403
+
404
+ foreach ($comments as $comment) {
405
+ $html .= rmedia_single_comment($comment);
406
+ }
407
+
408
+ $html .= '</ul>';
409
+
410
+ echo $html;
411
+ }
412
+
413
+ function rmedia_single_comment($comment) {
414
+ $html = "";
415
+ $html .= '<li class="rtmedia-comment">';
416
+ $html .= '<div class ="rtmedia-comment-author">' . (($comment['comment_author']) ? $comment['comment_author'] : 'Annonymous') . ' said : </div>';
417
+ $html .= '<div class="rtmedia-comment-content">' . $comment['comment_content'] . '</div>';
418
+ $html .= '<div class ="rtmedia-comment-date"> on ' . $comment['comment_date_gmt'] . '</div>';
419
+ // $html .= '<a href></a>';
420
+ $html .= '</li>';
421
+ return $html;
422
+ }
423
+
424
+ function rtmedia_pagination_prev_link() {
425
+
426
+ global $rtmedia_media, $rtmedia_interaction, $rtmedia_query;
427
+
428
+ $page_url = ((rtmedia_page() - 1) == 1) ? "" : "pg/" . (rtmedia_page() - 1);
429
+ $site_url = (is_multisite()) ? trailingslashit(get_site_url(get_current_blog_id())) : trailingslashit(get_site_url());
430
+ $author_name = get_query_var('author_name');
431
+ $link = '';
432
+
433
+ if ($rtmedia_interaction->context->type == "profile") {
434
+ if (function_exists("bp_core_get_user_domain"))
435
+ $link .= trailingslashit(bp_core_get_user_domain($rtmedia_media->media_author));
436
+ else
437
+ $link = $site_url . 'author/' . $author_name . '/';
438
+ } else if ($rtmedia_interaction->context->type == 'group') {
439
+ if (function_exists("bp_get_current_group_slug"))
440
+ $link .= $site_url . 'groups/' . bp_get_current_group_slug() . '/';
441
+ } else {
442
+ $post = get_post($rtmedia_media->post_parent);
443
+
444
+ $link .= $site_url . $post->post_name . '/';
445
+ }
446
+
447
+ $link .= 'media/';
448
+
449
+ if (isset($rtmedia_query->action_query->media_type)) {
450
+ if (in_array($rtmedia_query->action_query->media_type, array("photo", "music", "video", "album")))
451
+ $link .= $rtmedia_query->action_query->media_type . '/';
452
+ }
453
+ return $link . $page_url;
454
+ }
455
+
456
+ function rtmedia_pagination_next_link() {
457
+
458
+ global $rtmedia_media, $rtmedia_interaction, $rtmedia_query;
459
+
460
+ $page_url = 'pg/' . (rtmedia_page() + 1);
461
+ $site_url = (is_multisite()) ? trailingslashit(get_site_url(get_current_blog_id())) : trailingslashit(get_site_url());
462
+ $author_name = get_query_var('author_name');
463
+ $link = '';
464
+
465
+ if ($rtmedia_interaction->context->type == "profile") {
466
+ if (function_exists("bp_core_get_user_domain"))
467
+ $link .= trailingslashit(bp_core_get_user_domain($rtmedia_media->media_author));
468
+ else
469
+ $link .= $site_url . 'author/' . $author_name . '/';
470
+ } else if ($rtmedia_interaction->context->type == 'group') {
471
+ if (function_exists("bp_get_current_group_slug"))
472
+ $link .= $site_url . 'groups/' . bp_get_current_group_slug() . '/';
473
+ } else {
474
+ $post = get_post($rtmedia_media->post_parent);
475
+
476
+ $link .= $site_url . $post->post_name . '/';
477
+ }
478
+ $link .= 'media/';
479
+ if (isset($rtmedia_query->action_query->media_type)) {
480
+ if (in_array($rtmedia_query->action_query->media_type, array("photo", "music", "video", "album")))
481
+ $link .= $rtmedia_query->action_query->media_type . '/';
482
+ }
483
+ return $link . $page_url;
484
+ }
485
+
486
+ function rtmedia_comments_enabled() {
487
+ global $rtmedia;
488
+ return $rtmedia->options['general_enableComments'] && is_user_logged_in();
489
+ }
490
+
491
+ /**
492
+ *
493
+ * @return boolean
494
+ */
495
+ function is_rtmedia_gallery() {
496
+ global $rtmedia_query;
497
+ return $rtmedia_query->is_gallery();
498
+ }
499
+
500
+ /**
501
+ *
502
+ * @return boolean
503
+ */
504
+ function is_rtmedia_album_gallery() {
505
+ global $rtmedia_query;
506
+ return $rtmedia_query->is_album_gallery();
507
+ }
508
+
509
+ /**
510
+ *
511
+ * @return boolean
512
+ */
513
+ function is_rtmedia_single() {
514
+ global $rtmedia_query;
515
+ if ($rtmedia_query)
516
+ return $rtmedia_query->is_single();
517
+ else
518
+ return false;
519
+ }
520
+
521
+ /**
522
+ *
523
+ * @return boolean
524
+ */
525
+ function is_rtmedia_album() {
526
+ global $rtmedia_query;
527
+ if ($rtmedia_query)
528
+ return $rtmedia_query->is_album();
529
+ else
530
+ return false;
531
+ }
532
+
533
+ /**
534
+ *
535
+ * @return boolean
536
+ */
537
+ function is_rtmedia_edit_allowed() {
538
+ global $rtmedia_query;
539
+ if ($rtmedia_query) {
540
+ if (isset($rtmedia_query->media_query['media_author']) && get_current_user_id() == $rtmedia_query->media_query['media_author'] && $rtmedia_query->action_query->action == 'edit')
541
+ return true;
542
+ else
543
+ return false;
544
+ } else {
545
+ return false;
546
+ }
547
+ }
548
+
549
+ add_action('rtmedia_add_edit_fields', 'rtmedia_image_editor',999);
550
+
551
+ function rtmedia_image_editor() {
552
+ global $rtmedia_query;
553
+ if ($rtmedia_query->media[0]->media_type == 'photo') {
554
+ $media_id = $rtmedia_query->media[0]->media_id;
555
+ $id = $rtmedia_query->media[0]->id;
556
+ //$editor = wp_get_image_editor(get_attached_file($id));
557
+ include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
558
+ echo '<div class="rtmedia-image-editor-cotnainer">';
559
+ echo '<div class="rtmedia-image-editor" id="image-editor-' . $media_id . '"></div>';
560
+ $thumb_url = wp_get_attachment_image_src($media_id, 'thumbnail', true);
561
+ $nonce = wp_create_nonce("image_editor-$media_id");
562
+ echo '<div id="imgedit-response-' . $media_id . '"></div>';
563
+ echo '<div class="wp_attachment_image" id="media-head-' . $media_id . '">
564
+ <p id="thumbnail-head-' . $id . '"><img class="thumbnail" src="' . set_url_scheme($thumb_url[0]) . '" alt="" /></p>
565
+ <p><input type="button" class="rtmedia-image-edit" id="imgedit-open-btn-' . $media_id . '" onclick="imageEdit.open( \'' . $media_id . '\', \'' . $nonce . '\' )" class="button" value="Modifiy Image"> <span class="spinner"></span></p></div>';
566
+ echo '</div>';
567
+ }
568
+ }
569
+
570
+ function rtmedia_comment_form() {
571
+ ?>
572
+ <form method="post" id="rt_media_comment_form" action="<?php echo get_rtmedia_permalink(rtmedia_id()); ?>comment/">
573
+ <div class="row">
574
+ <div class="large-12 columns">
575
+ <textarea style="width:100%" placeholder="<?php _e("Type Comment...", 'rtmedia'); ?>" name="comment_content" id="comment_content"></textarea>
576
+ </div>
577
+ </div>
578
+ <input type="submit" id="rt_media_comment_submit" value="<?php _e('Comment', 'rtmedia'); ?>">
579
+ <?php RTMediaComment::comment_nonce_generator(); ?>
580
+ </form>
581
+ <?php
582
+ }
583
+
584
+ function rtmedia_delete_form() {
585
+
586
+ $html = '<form method="post" acction="' . get_rtmedia_permalink(rtmedia_id()) . 'delete/">';
587
+ $html .= '<input type="hidden" name="id" id="id" value="' . rtmedia_id() . '">';
588
+ $html .= '<input type="hidden" name="request_action" id="request_action" value="delete">';
589
+ echo $html;
590
+ RTMediaMedia::media_nonce_generator(rtmedia_id(), true);
591
+ echo '<input type="submit" value="' . __('Delete', 'rtmedia') . '"></form>';
592
+ }
593
+
594
+ /**
595
+ *
596
+ * @param type $attr
597
+ */
598
+ function rtmedia_uploader($attr = '') {
599
+
600
+ if (function_exists('bp_is_blog_page') && !bp_is_blog_page()) {
601
+ if (function_exists('bp_is_user') && bp_is_user() && function_exists('bp_displayed_user_id') && bp_displayed_user_id() == get_current_user_id())
602
+ echo RTMediaUploadShortcode::pre_render($attr);
603
+ else if (function_exists('bp_is_group') && bp_is_group() && function_exists('bp_group_is_member') && bp_group_is_member())
604
+ echo RTMediaUploadShortcode::pre_render($attr);
605
+ }
606
+ }
607
+
608
+ function rtmedia_gallery($attr = '') {
609
+ echo RTMediaGalleryShortcode::render($attr);
610
+ }
611
+
612
+ function get_rtmedia_meta($id = false, $key = false) {
613
+ $rtmediameta = new RTMediaMeta();
614
+ return $rtmediameta->get_meta($id, $key);
615
+ }
616
+
617
+ function add_rtmedia_meta($id = false, $key = false, $value = false, $duplicate = false) {
618
+ $rtmediameta = new RTMediaMeta($id, $key, $value, $duplicate);
619
+ return $rtmediameta->add_meta($id, $key, $value, $duplicate);
620
+ }
621
+
622
+ function update_rtmedia_meta($id = false, $key = false, $value = false, $duplicate = false) {
623
+ $rtmediameta = new RTMediaMeta();
624
+ return $rtmediameta->update_meta($id, $key, $value, $duplicate);
625
+ }
626
+
627
+ function delete_rtmedia_meta($id = false, $key = false) {
628
+ $rtmediameta = new RTMediaMeta();
629
+ return $rtmediameta->delete_meta($id, $key);
630
+ }
631
+
632
+ function rtmedia_global_albums(){
633
+ return RTMediaAlbum::get_globals(); //get_site_option('rtmedia-global-albums');
634
+
635
+ }
636
+ function rtmedia_global_album_list(){
637
+ global $rtmedia_query;
638
+ $model = new RTMediaModel();
639
+ $global_albums = rtmedia_global_albums();
640
+ $option = NULL;
641
+ $albums = implode(',',$global_albums);
642
+
643
+ $album_objects = $model->get_media(array('id' => ($albums)), false, false);
644
+ if($album_objects){
645
+ foreach ($album_objects as $album){
646
+ if ((isset($rtmedia_query->media_query['album_id']) && ($album_objects[0]->id != $rtmedia_query->media_query['album_id'])) || !isset($rtmedia_query->media_query['album_id']))
647
+ $option .= '<option value="' . $album->id . '">' . $album->media_title . '</option>';
648
+ }
649
+ }
650
+
651
+
652
+ return $option;
653
+
654
+ }
655
+
656
+ function rtmedia_user_album_list() {
657
+ global $rtmedia_query;
658
+ $model = new RTMediaModel();
659
+ $option = rtmedia_global_album_list();
660
+ $global_albums = rtmedia_global_albums();
661
+
662
+ $album_objects = $model->get_media(array('media_author' => get_current_user_id(), 'media_type' => 'album'), false, false);
663
+ if ($album_objects) {
664
+ foreach ($album_objects as $album) {
665
+ if (!in_array($album->id, $global_albums)
666
+ && (( isset($rtmedia_query->media_query['album_id'])
667
+ && (
668
+ $album->id != $rtmedia_query->media_query['album_id']))
669
+ || !isset($rtmedia_query->media_query['album_id'])
670
+ )
671
+ )
672
+ $option .= '<option value="' . $album->id . '">' . $album->media_title . '</option>';
673
+ }
674
+ }
675
+
676
+ if ($option)
677
+ return $option;
678
+ else
679
+ return false;
680
+ }
681
+
682
+ function rtmedia_group_album_list() {
683
+ global $rtmedia_query;
684
+ $model = new RTMediaModel();
685
+
686
+ $option = rtmedia_global_album_list();
687
+ $global_albums = rtmedia_global_albums();
688
+
689
+ $album_objects = $model->get_media(
690
+ array(
691
+ 'context' => $rtmedia_query->media_query['context'],
692
+ 'context_id' => $rtmedia_query->media_query['context_id'],
693
+ 'media_type' => 'album'
694
+ ),
695
+ false,
696
+ false
697
+ );
698
+ if ($album_objects) {
699
+ foreach ($album_objects as $album) {
700
+ if (!in_array($album->id, $global_albums) && (( isset($rtmedia_query->media_query['album_id']) && ($album->id != $rtmedia_query->media_query['album_id'])) || !isset($rtmedia_query->media_query['album_id']) ))
701
+ $option .= '<option value="' . $album->id . '">' . $album->media_title . '</option>';
702
+ }
703
+ }
704
+
705
+ if ($option)
706
+ return $option;
707
+ else
708
+ return false;
709
+ }
710
+
711
+
712
+ add_action('rtmedia_before_media_gallery', 'rtmedia_create_album');
713
+
714
+ add_action('rtmedia_before_album_gallery', 'rtmedia_create_album');
715
+
716
+ function rtmedia_create_album() {
717
+ global $rtmedia_query;
718
+ $user_id = get_current_user_id();
719
+ $display = false;
720
+ if(isset($rtmedia_query->query['context']) && in_array($rtmedia_query->query['context'], array('profile', 'group'))){
721
+ switch ($rtmedia_query->query['context']){
722
+ case 'profile':
723
+ if($rtmedia_query->query['context_id']== $user_id){
724
+ $display=true;
725
+ }
726
+ break;
727
+ case 'group':
728
+ $group_id = $rtmedia_query->query['context_id'];
729
+ if(groups_is_user_admin( $user_id, $group_id )||groups_is_user_mod( $user_id, $group_id )){
730
+ $display=true;
731
+ }
732
+ break;
733
+ }
734
+ }
735
+ if($display===true){
736
+ ?>
737
+ <button type="button" class="button rtmedia-create-new-album-button"> Create New Album </button>
738
+ <div class="rtmedia-create-new-album-container">
739
+ <input type="text" id="rtmedia_album_name" value="" />
740
+ <input type="hidden" id="rtmedia_album_context" value="<?php echo $rtmedia_query->query['context']; ?>">
741
+ <input type="hidden" id="rtmedia_album_context_id" value="<?php echo $rtmedia_query->query['context_id']; ?>">
742
+ <button type="button" id="rtmedia_create_new_album">Create Album</button>
743
+ </div><?php
744
+ }
745
+
746
+
747
+ }
748
+
749
+ add_action('rtmedia_before_media_gallery', 'rtmedia_album_edit');
750
+
751
+ function rtmedia_album_edit() {
752
+
753
+ if (!is_rtmedia_album() || !is_user_logged_in())
754
+ return;
755
+
756
+ global $rtmedia_query;
757
+ //var_dump($rtmedia_query);
758
+ if (isset($rtmedia_query->media_query)
759
+ && !in_array($rtmedia_query->media_query['album_id'], get_site_option('rtmedia-global-albums'))){
760
+ if(isset($rtmedia_query->media_query['media_author']) && get_current_user_id() == $rtmedia_query->media_query['media_author'] ) {
761
+ ?>
762
+ <a class="alignleft" href="edit/"><input type="button" class="button rtmedia-edit" value="<?php _e('Edit', 'rtmedia'); ?>" /></a>
763
+ <form method="post" class="album-delete-form alignleft" action="delete/">
764
+ <?php wp_nonce_field('rtmedia_delete_album_' . $rtmedia_query->media_query['album_id'], 'rtmedia_delete_album_nonce'); ?>
765
+ <input type="submit" name="album-delete" value="<?php _e('Delete', 'rtmedia'); ?>" />
766
+ </form>
767
+ <?php $album_list = rtmedia_user_album_list();
768
+ if ($album_list) { ?>
769
+ <input type="button" class="button rtmedia-merge" value="<?php _e('Merge', 'rtmedia'); ?>" />
770
+ <div class="rtmedia-merge-container">
771
+ <?php _e('Merge to', 'rtmedia'); ?>
772
+ <form method="post" class="album-merge-form" action="merge/">
773
+ <?php echo '<select name="album" class="rtmedia-merge-user-album-list">' . $album_list . '</select>'; ?>
774
+ <?php wp_nonce_field('rtmedia_merge_album_' . $rtmedia_query->media_query['album_id'], 'rtmedia_merge_album_nonce'); ?>
775
+ <input type="submit" class="rtmedia-move-selected" name="merge-album" value="<?php _e('Merge Album', 'rtmedia'); ?>" />
776
+ </form>
777
+ </div>
778
+ <?php
779
+ }
780
+ }
781
+ }
782
+ }
783
+
784
+ add_action('rtmedia_before_item', 'rtmedia_item_select');
785
+
786
+ function rtmedia_item_select() {
787
+ global $rtmedia_query, $rtmedia_backbone;
788
+ if ($rtmedia_backbone['backbone']) {
789
+ if ($rtmedia_backbone['is_album'] && $rtmedia_backbone['is_edit_allowed'])
790
+ echo '<input type="checkbox" name="move[]" value="<%= id %>" />';
791
+ } else if (is_rtmedia_album() && isset($rtmedia_query->media_query) && $rtmedia_query->action_query->action == 'edit') {
792
+ if(isset($rtmedia_query->media_query['media_author'])
793
+ && get_current_user_id() == $rtmedia_query->media_query['media_author'])
794
+ echo '<input type="checkbox" name="selected[]" value="' . rtmedia_id() . '" />';
795
+ }
796
+ }
797
+
798
+ add_action('rtmedia_query_actions', 'rtmedia_album_merge_action');
799
+
800
+ function rtmedia_album_merge_action($actions) {
801
+ $actions['merge'] = __('Merge', 'rtmedia');
802
+ return $actions;
803
+ }
804
+
805
+ function rtmedia_sub_nav() {
806
+ RTMediaNav::sub_nav();
807
+ }
808
+ ?>
app/main/controllers/template/template.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $rtmedia_query;
3
+
4
+ if ( is_rtmedia_album_gallery() ) {
5
+ $template = 'album-gallery';
6
+ } elseif ( is_rtmedia_album() || is_rtmedia_gallery() ) {
7
+ $template = 'media-gallery';
8
+ if (
9
+ is_rtmedia_album() &&
10
+ isset( $rtmedia_query->media_query ) &&
11
+ $rtmedia_query->action_query->action == 'edit'
12
+ ) {
13
+ if ( isset( $rtmedia_query->media_query[ 'media_author' ] ) && (get_current_user_id() == $rtmedia_query->media_query[ 'media_author' ]) ) {
14
+ $template = 'album-single-edit';
15
+ }
16
+ }
17
+ } else if ( is_rtmedia_single() ) {
18
+ $template = 'media-single';
19
+ if ( $rtmedia_query->action_query->action == 'edit' )
20
+ $template = 'media-single-edit';
21
+ }
22
+
23
+ $ajax = false;
24
+
25
+
26
+ if (
27
+ ! empty( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) &&
28
+ strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) == 'xmlhttprequest'
29
+ )
30
+ $ajax = true;
31
+
32
+
33
+ if ( ! $ajax ) {
34
+ ?>
35
+
36
+ <?php
37
+
38
+ if ( class_exists( 'BuddyPress' ) && ! bp_is_blog_page() ) {
39
+ $template_type = 'buddypress';
40
+ } else {
41
+ $template_type = '';
42
+ }
43
+
44
+ get_header( $template_type );
45
+ ?>
46
+ <div id="primary" class="site-content">
47
+ <?php
48
+
49
+ if ( $template_type == 'buddypress' ) {
50
+ ?>
51
+ <div id ="content">
52
+ <div id="buddypress" class="padder">
53
+
54
+ <?php if ( bp_displayed_user_id() ) { ?>
55
+ <div id="item-header">
56
+
57
+ <?php bp_get_template_part( 'members/single/member-header' ) ?>
58
+
59
+ </div>
60
+
61
+ <div id="item-nav">
62
+ <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
63
+ <ul>
64
+
65
+ <?php bp_get_displayed_user_nav(); ?>
66
+
67
+ <?php do_action( 'bp_member_options_nav' ); ?>
68
+
69
+ </ul>
70
+ </div>
71
+ </div>
72
+
73
+ <div id="item-body">
74
+
75
+ <?php do_action( 'bp_before_member_body' ); ?>
76
+ <?php do_action( 'bp_before_member_media' ); ?>
77
+ <div class="item-list-tabs no-ajax" id="subnav">
78
+ <ul>
79
+
80
+ <?php rtmedia_sub_nav(); ?>
81
+
82
+ <?php do_action( 'rtmedia_sub_nav' ); ?>
83
+
84
+ </ul>
85
+ </div><!-- .item-list-tabs -->
86
+
87
+ <?php
88
+ } else if ( bp_is_group() ) {
89
+ ?>
90
+
91
+ <?php
92
+ if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group();
93
+ ?>
94
+ <div id="item-header">
95
+
96
+ <?php bp_get_template_part( 'groups/single/group-header' ); ?>
97
+
98
+ </div>
99
+ <div id="item-nav">
100
+ <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
101
+ <ul>
102
+
103
+ <?php bp_get_options_nav(); ?>
104
+
105
+ <?php do_action( 'bp_group_options_nav' ); ?>
106
+
107
+ </ul>
108
+ </div>
109
+ </div><!-- #item-nav -->
110
+
111
+
112
+ <div id="item-body">
113
+
114
+ <?php do_action( 'bp_before_group_body' ); ?>
115
+ <?php do_action( 'bp_before_group_media' ); ?>
116
+ <div class="item-list-tabs no-ajax" id="subnav">
117
+ <ul>
118
+
119
+ <?php rtmedia_sub_nav(); ?>
120
+
121
+ <?php do_action( 'rtmedia_sub_nav' ); ?>
122
+
123
+ </ul>
124
+ </div><!-- .item-list-tabs -->
125
+ <?php
126
+ endwhile;
127
+ endif;
128
+ }
129
+ }
130
+ }
131
+ include(RTMediaTemplate::locate_template( $template ));
132
+ if ( ! $ajax ) {
133
+ if ( $template_type == 'buddypress' && (bp_displayed_user_id() || bp_is_group()) ) {
134
+
135
+ if ( bp_is_group() ) {
136
+ do_action( 'bp_after_group_media' );
137
+ do_action( 'bp_after_group_body' );
138
+
139
+ }
140
+ if ( bp_displayed_user_id() ) {
141
+ do_action( 'bp_after_member_media' );
142
+ do_action( 'bp_after_member_body' );
143
+
144
+ }
145
+ ?>
146
+
147
+
148
+
149
+
150
+ </div>
151
+ </div>
152
+ </div>
153
+
154
+ <?php
155
+ if ( ! $ajax ) {
156
+ ?>
157
+ </div>
158
+ <?php
159
+ }
160
+ }
161
+ get_sidebar( $template_type );
162
+
163
+ get_footer( $template_type );
164
+ }
165
+ ?>
app/main/controllers/upload/RTMediaUpload.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUpload
5
+ * Controller class to upload the media
6
+ * @author joshua
7
+ */
8
+ class RTMediaUpload {
9
+
10
+ private $default_modes = array('file_upload', 'link_input');
11
+ var $file = NULL;
12
+ var $media = NULL;
13
+ var $url = NULL;
14
+ var $media_ids = NULL;
15
+
16
+ /**
17
+ *
18
+ * @param type $uploaded
19
+ * @return boolean
20
+ */
21
+ public function __construct($uploaded) {
22
+ /**
23
+ * prepare to upload a file
24
+ */
25
+ $this->file = new RTMediaUploadFile($uploaded);
26
+ /**
27
+ * prepare to upload a url
28
+ */
29
+ $this->url = new RTMediaUploadUrl();
30
+ /**
31
+ * prepare media object to populate the album
32
+ */
33
+ $this->media = new RTMediaMedia();
34
+
35
+ /**
36
+ * upload the intity according to the mode of request
37
+ * either file_upload or link_input
38
+ */
39
+ $file_object = $this->upload($uploaded);
40
+
41
+ /**
42
+ * if upload successful then populate the rtMedia database and insert the media into album
43
+ */
44
+ if ($file_object && $uploaded) {
45
+ $this->media_ids= $this->media->add($uploaded, $file_object);
46
+ if ($this->media_ids) {
47
+ return true;
48
+ } else {
49
+ return false;
50
+ }
51
+ } else {
52
+ return false;
53
+ }
54
+ }
55
+
56
+ /**
57
+ * upload a file or a link input
58
+ * @param type $uploaded
59
+ * @return type
60
+ */
61
+ function upload($uploaded) {
62
+ switch ($uploaded['mode']) {
63
+ case 'file_upload': return $this->file->init($uploaded['files']);
64
+ break;
65
+ case 'link_input': return $this->url->init($uploaded);
66
+ break;
67
+ default:
68
+ do_action('rtmedia_upload_' . $uploaded['mode'], $uploaded);
69
+ }
70
+ }
71
+
72
+ }
73
+
74
+ ?>
app/main/controllers/upload/RTMediaUploadEndpoint.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUploadEndpoint
5
+ *
6
+ * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
+ */
8
+ class RTMediaUploadEndpoint {
9
+
10
+ public $upload;
11
+
12
+ /**
13
+ *
14
+ */
15
+ public function __construct() {
16
+ add_action('rtmedia_upload_redirect', array($this, 'template_redirect'));
17
+ }
18
+
19
+ /**
20
+ *
21
+ */
22
+ function template_redirect() {
23
+
24
+ if (!count($_POST)) {
25
+ include get_404_template();
26
+ } else {
27
+ $nonce = $_REQUEST['rtmedia_upload_nonce'];
28
+ $mode = $_REQUEST['mode'];
29
+ $rtupload =false;
30
+ $activity_id = -1;
31
+ if (wp_verify_nonce($nonce, 'rtmedia_upload_nonce')) {
32
+ $model = new RTMediaUploadModel();
33
+ $this->upload = $model->set_post_object();
34
+ if(isset($_POST['activity_id']) && $_POST['activity_id']!=-1) {
35
+ $this->upload['activity_id'] = $_POST['activity_id'];
36
+ $activity_id = $_POST['activity_id'];
37
+ }
38
+ $rtupload = new RTMediaUpload($this->upload);
39
+ $mediaObj = new RTMediaMedia();
40
+ $media = $mediaObj->model->get(array('id'=>$rtupload->media_ids[0]));
41
+ if($activity_id==-1) {
42
+ $activity_id = $mediaObj->insert_activity($rtupload->media_ids[0], $media[0]);
43
+ } else {
44
+ $mediaObj->model->update(array( 'activity_id' => $activity_id ), array( 'id' => $rtupload->media_ids[0] ));
45
+ }
46
+ }
47
+ if(isset($_POST["redirect"]) && $_POST["redirect"]=="no" ){
48
+ // Ha ha ha
49
+ if(isset($_POST["rtmedia_update"]) && $_POST["rtmedia_update"]=="true"){
50
+ header('Content-type: application/json');
51
+ echo json_encode($rtupload->media_ids);
52
+ } else {
53
+ // Media Upload Case - on album/post/profile/group
54
+ $data = array('activity_id'=>$activity_id);
55
+ header('Content-type: application/json');
56
+ echo json_encode($data);
57
+ }
58
+ die();
59
+ }else{
60
+ //wp_safe_redirect(wp_get_referer());
61
+ }
62
+ }
63
+
64
+ die();
65
+ }
66
+
67
+ }
68
+
69
+ ?>
app/main/controllers/upload/RTMediaUploadHelper.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaPLUploadHelper
5
+ *
6
+ * Helper class for PL Upload - Upload files via AJAX Request
7
+ *
8
+ * @author Udit Desai <udit.desai@rtcamp.com>
9
+ */
10
+ class RTMediaUploadHelper {
11
+
12
+ /**
13
+ *
14
+ */
15
+ public function __construct() {
16
+
17
+ }
18
+
19
+ /**
20
+ *
21
+ */
22
+ static function file_upload() {
23
+
24
+ $end_point = new RTMediaUploadEndpoint();
25
+ $end_point->template_redirect();
26
+ }
27
+ }
28
+
29
+
30
+
31
+ ?>
app/main/controllers/upload/RTMediaUploadModel.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUploadModel
5
+ *
6
+ * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
7
+ */
8
+ class RTMediaUploadModel {
9
+ public $upload = array(
10
+ 'mode' => 'file_upload',
11
+ 'context' => false,
12
+ 'context_id' => false,
13
+ 'privacy' => 0,
14
+ 'custom_fields' => array(),
15
+ 'taxonomy' => array(),
16
+ 'album_id' => false,
17
+ 'files' => false,
18
+ 'title' => false,
19
+ 'description' => false,
20
+ 'media_author' => false
21
+ );
22
+
23
+ /**
24
+ *
25
+ * @return type
26
+ */
27
+ function set_post_object() {
28
+ $this->upload = wp_parse_args($_POST, $this->upload);
29
+ $this->sanitize_object();
30
+ return $this->upload;
31
+ }
32
+
33
+ /**
34
+ *
35
+ * @return boolean
36
+ */
37
+ function has_context() {
38
+ if (isset($this->upload['context_id']) && !empty($this->upload['context_id']))
39
+ return true;
40
+ return false;
41
+ }
42
+
43
+ /**
44
+ *
45
+ * @global type $rtmedia_interaction
46
+ */
47
+ function sanitize_object() {
48
+ if (!$this->has_context()){
49
+
50
+ global $rtmedia_interaction;
51
+
52
+ $this->upload['context']= $rtmedia_interaction->context->type;
53
+ $this->upload['context_id'] = $rtmedia_interaction->context->id;
54
+ }
55
+
56
+ if (!is_array($this->upload['taxonomy']))
57
+ $this->upload['taxonomy'] = array($this->upload['taxonomy']);
58
+
59
+ if (!is_array($this->upload['custom_fields']))
60
+ $this->upload['custom_fields'] = array($this->upload['custom_fields']);
61
+
62
+ if ( !$this->has_album_id() || !$this->has_album_permissions() )
63
+ $this->set_album_id();
64
+
65
+ if( !$this->has_author() )
66
+ $this->set_author();
67
+ }
68
+
69
+ /**
70
+ *
71
+ * @return type
72
+ */
73
+ function has_author() {
74
+ return $this->upload['media_author'];
75
+ }
76
+
77
+ function set_author() {
78
+ $this->upload['media_author'] = get_current_user_id();
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @return boolean
84
+ */
85
+ function has_album_id(){
86
+ if(!$this->upload['album_id'])
87
+ return false;
88
+ return true;
89
+ }
90
+
91
+ /**
92
+ *
93
+ * @return boolean
94
+ */
95
+ function has_album_permissions(){
96
+ //yet to be coded for the privacy options of the album
97
+ return true;
98
+ }
99
+
100
+ /**
101
+ *
102
+ * @param type $id
103
+ * @return boolean
104
+ */
105
+ function album_id_exists($id) {
106
+ return true;
107
+ }
108
+
109
+ /**
110
+ *
111
+ */
112
+ function set_album_id(){
113
+ if (class_exists('BuddyPress')) {
114
+ $this->set_bp_album_id();
115
+ } else {
116
+ $this->set_wp_album_id();
117
+ }
118
+ }
119
+
120
+ /**
121
+ *
122
+ */
123
+ function set_bp_album_id(){
124
+ if (bp_is_blog_page()) {
125
+ $this->set_wp_album_id();
126
+ } else {
127
+ $this->set_bp_component_album_id();
128
+ }
129
+ }
130
+
131
+ /**
132
+ *
133
+ * @throws RTMediaUploadException
134
+ */
135
+ function set_wp_album_id(){
136
+ if(isset($this->upload['context']))
137
+ $this->upload['album_id'] = $this->upload['context_id'];
138
+ else
139
+ throw new RTMediaUploadException(9); // Invalid Context
140
+ }
141
+
142
+ /**
143
+ *
144
+ */
145
+ function set_bp_component_album_id() {
146
+ switch (bp_current_component()) {
147
+ case 'groups': $this->upload['album_id'] = RTMediaAlbum::get_default();
148
+ break;
149
+ default:
150
+ $this->upload['album_id'] = RTMediaAlbum::get_default();
151
+ break;
152
+ }
153
+ }
154
+ }
155
+
156
+ ?>
app/main/controllers/upload/RTMediaUploadView.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUploadView
5
+ *
6
+ * @author joshua
7
+ */
8
+ class RTMediaUploadView {
9
+
10
+ private $attributes;
11
+
12
+ /**
13
+ *
14
+ * @param type $attr
15
+ */
16
+ function __construct($attr) {
17
+
18
+ $this->attributes = $attr;
19
+
20
+ }
21
+
22
+ static function upload_nonce_generator($echo = true,$only_nonce =false) {
23
+
24
+ if($echo) {
25
+ wp_nonce_field('rtmedia_upload_nonce','rtmedia_upload_nonce');
26
+ } else {
27
+ if($only_nonce)
28
+ return wp_create_nonce('rtmedia_upload_nonce');
29
+ $token = array(
30
+ 'action' => 'rtmedia_upload_nonce',
31
+ 'nonce' => wp_create_nonce('rtmedia_upload_nonce')
32
+ );
33
+
34
+ return json_encode($token);
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Render the uploader shortcode and attach the uploader panel
40
+ *
41
+ * @param type $template_name
42
+ */
43
+ public function render($template_name) {
44
+ global $rtmedia_query;
45
+ $album = '';
46
+ if ( $rtmedia_query && is_rtmedia_album()){
47
+ $album = '<input class="rtmedia-current-album" type="hidden" name="rtmedia-current-album" value="'.$rtmedia_query->media_query['album_id'].'" />';
48
+ }elseif ( $rtmedia_query && is_rtmedia_gallery() ){
49
+
50
+ if($rtmedia_query->query['context']=='profile'){
51
+ $album = '<select name="album" class="rtmedia-user-album-list">'.rtmedia_user_album_list().'</select>';
52
+ }
53
+ if($rtmedia_query->query['context']=='group'){
54
+ $album = '<select name="album" class="rtmedia-user-album-list">'.rtmedia_group_album_list().'</select>';
55
+ }
56
+
57
+ }
58
+ $tabs = array(
59
+ 'file_upload' => array(
60
+ 'default' => array('title' => __('File Upload','rtmedia'), 'content' => '<div id="rtmedia-upload-container" ><div id="drag-drop-area" class="drag-drop">'.$album.'<input id="rtMedia-upload-button" value="Select" type="button" class="rtmedia-upload-input rtmedia-file" /></div><table id="rtMedia-queue-list"><tbody></tbody></table></div>' ),
61
+ 'activity' => array('title' => __('File Upload','rtmedia'), 'content' => '<div class="rtmedia-container"><div id="rtmedia-action-update"><input type="button" class="rtmedia-add-media-button" id="rtmedia-add-media-button-post-update" value="' . __("Add Media","rtmedia") . '" /></div><div id="div-attache-rtmedia"><div id="rtmedia-whts-new-upload-container" ><div id="rtmedia-whts-new-drag-drop-area" class="drag-drop"><input id="rtmedia-whts-new-upload-button" value="Select" type="button" class="rtmedia-upload-input rtmedia-file" /></div><div id="rtMedia-update-queue-list"></div></div></div></div>')
62
+ ),
63
+ // 'file_upload' => array( 'title' => __('File Upload','rtmedia'), 'content' => '<div id="rtmedia-uploader"><p>Your browser does not have HTML5 support.</p></div>'),
64
+ 'link_input' => array( 'title' => __('Insert from URL','rtmedia'),'content' => '<input type="url" name="bp-media-url" class="rtmedia-upload-input rtmedia-url" />' ),
65
+ );
66
+ $tabs = apply_filters('rtmedia_upload_tabs', $tabs );
67
+
68
+ $attr = $this->attributes;
69
+ $mode = (isset($_GET['mode']) && array_key_exists($_GET['mode'], $tabs)) ? $_GET['mode'] : 'file_upload';
70
+
71
+ $upload_type = 'default';
72
+ if(isset($attr['activity']) && $attr['activity'])
73
+ $upload_type = 'activity';
74
+
75
+ $uploadHelper = new RTMediaUploadHelper();
76
+ include $this->locate_template($template_name);
77
+
78
+ }
79
+
80
+ /**
81
+ * Template Locator
82
+ *
83
+ * @param type $template
84
+ * @return string
85
+ */
86
+ protected function locate_template($template) {
87
+ $located = '';
88
+
89
+ $template_name = $template . '.php';
90
+
91
+ if (!$template_name)
92
+ $located = false;
93
+ if (file_exists(STYLESHEETPATH . '/rtmedia/' . $template_name)) {
94
+ $located = STYLESHEETPATH . '/rtmedia/' . $template_name;
95
+ } else if (file_exists(TEMPLATEPATH . '/rtmedia/' . $template_name)) {
96
+ $located = TEMPLATEPATH . '/rtmedia/' . $template_name;
97
+ } else {
98
+ $located = RTMEDIA_PATH . 'templates/upload/' . $template_name;
99
+ }
100
+
101
+ return $located;
102
+ }
103
+
104
+ }
105
+
106
+ ?>
app/main/controllers/upload/processors/RTMediaUploadFile.php ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of RTMediaUploadFile
5
+ * Class responsible for uploading a file to the website.
6
+ *
7
+ * @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
8
+ */
9
+ class RTMediaUploadFile {
10
+
11
+ var $files;
12
+ var $fake = false;
13
+ var $uploaded = false;
14
+
15
+ function __construct($uploaded) {
16
+ $this->uploaded = $uploaded;
17
+ }
18
+ /**
19
+ * Initialize the upload process
20
+ *
21
+ * @param type $files
22
+ * @return type
23
+ */
24
+ function init($files) {
25
+
26
+ $this->set_file($files);
27
+ $this->unset_invalid_files();
28
+ $uploaded_file = $this->process();
29
+ return $uploaded_file;
30
+ }
31
+
32
+ /**
33
+ * core process of upload
34
+ */
35
+ function process() {
36
+ include_once(ABSPATH . 'wp-admin/includes/file.php');
37
+ include_once(ABSPATH . 'wp-admin/includes/image.php');
38
+
39
+ $upload_type = $this->fake ? 'wp_handle_sideload' : 'wp_handle_upload';
40
+
41
+ add_filter('upload_dir', array($this, 'upload_dir'));
42
+ foreach ($this->files as $key => $file) {
43
+
44
+ $uploaded_file[] = $upload_type($file, array('test_form' => false));
45
+ try {
46
+ if (isset($uploaded_file[$key]['error']) || $uploaded_file[$key] === null) {
47
+ array_pop($uploaded_file);
48
+
49
+ throw new RTMediaUploadException(0, __('Error Uploading File', 'rtmedia'));
50
+ }
51
+ $uploaded_file[$key]['name'] = $file['name'];
52
+ } catch (RTMediaUploadException $e) {
53
+ echo $e->getMessage();
54
+ }
55
+
56
+ if (strpos($file['type'], 'image') !== false) {
57
+ if (function_exists('read_exif_data')) {
58
+ $file = $this->exif($uploaded_file[$key]);
59
+ }
60
+ }
61
+ }
62
+
63
+ return $uploaded_file;
64
+ }
65
+
66
+ function upload_dir($upload_dir) {
67
+ global $rtmedia_interaction;
68
+ if(isset($this->uploaded["context"]) && isset($this->uploaded["context_id"])){
69
+ if ($this->uploaded["context"] != 'group') {
70
+ $rtmedia_upload_prefix = 'users/';
71
+ $id = get_current_user_id();
72
+ } else {
73
+ $rtmedia_upload_prefix = 'groups/';
74
+ $id = $this->uploaded["context_id"];
75
+ }
76
+ }else{
77
+ if ($rtmedia_interaction->context->type != 'group') {
78
+ $rtmedia_upload_prefix = 'users/';
79
+ $id = get_current_user_id();
80
+ } else {
81
+ $rtmedia_upload_prefix = 'groups/';
82
+ $id = $rtmedia_interaction->context->id;
83
+ }
84
+ }
85
+
86
+
87
+ $upload_dir['path'] = trailingslashit(
88
+ str_replace($upload_dir['subdir'], '', $upload_dir['path']))
89
+ . 'rtMedia/' . $rtmedia_upload_prefix . $id .
90
+ $upload_dir['subdir'];
91
+ $upload_dir['url'] = trailingslashit(
92
+ str_replace($upload_dir['subdir'], '', $upload_dir['url']))
93
+ . 'rtMedia/' . $rtmedia_upload_prefix . $id
94
+ . $upload_dir['subdir'];
95
+
96
+ return $upload_dir;
97
+ }
98
+
99
+ function set_file($files) {
100
+ /**
101
+ * if files parameter is provided then take th file details from that object
102
+ */
103
+ if ($files) {
104
+ $this->fake = true;
105
+ $this->populate_file_array((array) $uploaded['files']);
106
+ /**
107
+ * otherwise check for $_FILES global object from the form submitted
108
+ */
109
+ } elseif (isset($_FILES['rtmedia_file'])) {
110
+ $this->populate_file_array($_FILES['rtmedia_file']);
111
+ } else {
112
+ /**
113
+ * No files could be found to upload
114
+ */
115
+ throw new RTMediaUploadException(UPLOAD_ERR_NO_FILE);
116
+ }
117
+ }
118
+
119
+ /**
120
+ * gather the file information for upload process
121
+ * @param type $file_array
122
+ */
123
+ function populate_file_array($file_array) {
124
+ $this->files[] = array(
125
+ 'name' => isset($file_array['name']) ? $file_array['name'] : '',
126
+ 'type' => isset($file_array['type']) ? $file_array['type']: '',
127
+ 'tmp_name' => isset($file_array['tmp_name']) ? $file_array['tmp_name'] : '',
128
+ 'error' => isset($file_array['error']) ? $file_array['error']: '',
129
+ 'size' => isset($file_array['size']) ? $file_array['size']: 0,
130
+ );
131
+ }
132
+
133
+ /**
134
+ * Check for valid file types for rtMedia
135
+ * @global type $rtmedia
136
+ * @param type $file
137
+ * @return boolean
138
+ * @throws RTMediaUploadException
139
+ */
140
+ function is_valid_type($file) {
141
+ try {
142
+ global $rtmedia;
143
+ $allowed_types = array();
144
+ $rtmedia->allowed_types = apply_filters('rtmedia_allowed_types',$rtmedia->allowed_types);
145
+ foreach ($rtmedia->allowed_types as $type) {
146
+ foreach ($type['extn'] as $extn) {
147
+ $allowed_types[] = $extn;
148
+ }
149
+ }
150
+ if (!preg_match('/' . implode('|', $allowed_types) . '/i', $file['type'], $result) || !isset($result[0])) {
151
+ throw new RTMediaUploadException(UPLOAD_ERR_EXTENSION);
152
+ }
153
+ // $is_valid = $this->id3_validate_type($file);
154
+ } catch (RTMediaUploadException $e) {
155
+ echo $e->getMessage();
156
+ return false;
157
+ }
158
+ return true;
159
+ }
160
+
161
+ /**
162
+ * Remove invalid files
163
+ */
164
+ function unset_invalid_files() {
165
+ $temp_array = $this->files;
166
+ $this->files = null;
167
+ foreach ($temp_array as $key => $file) {
168
+ if (apply_filters('rtmedia_valid_type_check',$this->is_valid_type($file),$file)) {
169
+ $this->files[] = $file;
170
+ }
171
+ }
172
+ }
173
+
174
+ function id3_validate_type($file) {
175
+ $file_type = explode('/',$file['type']);
176
+ $type = $file_type[0];
177
+ switch ($type) {
178
+ case 'video' :
179
+ include_once(trailingslashit(RTMEDIA_PATH) . 'lib/getid3/getid3.php');
180
+ try {
181
+ $getID3 = new getID3;
182
+ $vid_info = $getID3->analyze($file['tmp_name']);
183
+ } catch (Exception $e) {
184
+ $this->safe_unlink($file['tmp_name']);
185
+ $activity_content = false;
186
+ throw new RTMediaUploadException(0, __('MP4 file you have uploaded is corrupt.', 'buddypress-media'));
187
+ }
188
+ if (is_array($vid_info)) {
189
+ if (!array_key_exists('error', $vid_info) && array_key_exists('fileformat', $vid_info) && array_key_exists('video', $vid_info) && array_key_exists('fourcc', $vid_info['video'])) {
190
+ if (!($vid_info['fileformat'] == 'mp4' && $vid_info['video']['fourcc'] == 'avc1')) {
191
+ $this->safe_unlink($file['tmp_name']);
192
+ $activity_content = false;
193
+ throw new RTMediaUploadException(0, __('The MP4 file you have uploaded is using an unsupported video codec. Supported video codec is H.264.', 'buddypress-media'));
194
+ }
195
+ } else {
196
+ $this->safe_unlink($file['tmp_name']);
197
+ $activity_content = false;
198
+ throw new RTMediaUploadException(0, __('The MP4 file you have uploaded is using an unsupported video codec. Supported video codec is H.264.', 'buddypress-media'));
199
+ }
200
+ } else {
201
+ $this->safe_unlink($file['tmp_name']);
202
+ $activity_content = false;
203
+ throw new RTMediaUploadException(0, __('The MP4 file you have uploaded is not a video file.', 'buddypress-media'));
204
+ }
205
+ break;
206
+ case 'audio' :
207
+ include_once(trailingslashit(RTMEDIA_PATH) . 'lib/getid3/getid3.php');
208
+ try {
209
+ $getID3 = new getID3;
210
+ $file_info = $getID3->analyze($file['tmp_name']);
211
+ } catch (Exception $e) {
212
+ $this->safe_unlink($file['tmp_name']);
213
+ $activity_content = false;
214
+ throw new RTMediaUploadException(0, __('MP3 file you have uploaded is currupt.', 'buddypress-media'));
215
+ }
216
+ if (is_array($file_info)) {
217
+ if (!array_key_exists('error', $file_info) && array_key_exists('fileformat', $file_info) && array_key_exists('audio', $file_info) && array_key_exists('dataformat', $file_info['audio'])) {
218
+ if (!($file_info['fileformat'] == 'mp3' && $file_info['audio']['dataformat'] == 'mp3')) {
219
+ $this->safe_unlink($file['tmp_name']);
220
+ $activity_content = false;
221
+ throw new RTMediaUploadException(0, __('The MP3 file you have uploaded is using an unsupported audio format. Supported audio format is MP3.', 'buddypress-media'));
222
+ }
223
+ } else {
224
+ $this->safe_unlink($file['tmp_name']);
225
+ $activity_content = false;
226
+ throw new RTMediaUploadException(0, __('The MP3 file you have uploaded is using an unsupported audio format. Supported audio format is MP3.', 'buddypress-media'));
227
+ }
228
+ } else {
229
+ $this->safe_unlink($file['tmp_name']);
230
+ $activity_content = false;
231
+ throw new RTMediaUploadException(0, __('The MP3 file you have uploaded is not an audio file.', 'buddypress-media'));
232
+ }
233
+ break;
234
+ case 'image' :
235
+ break;
236
+ default :
237
+ $this->safe_unlink($file['tmp_name']);
238
+ $activity_content = false;
239
+ throw new RTMediaUploadException(0, __('Media File you have tried to upload is not supported. Supported media files are .jpg, .png, .gif, .mp3, .mov and .mp4.', 'buddypress-media'));
240
+ }
241
+
242
+ return true;
243
+ }
244
+
245
+ function safe_unlink($file_path) {
246
+ if (file_exists($file_path))
247
+ unlink($file_path);
248
+ }
249
+
250
+ function exif($file) {
251
+ $file_parts = pathinfo($file['file']);
252
+ if (in_array(strtolower($file_parts['extension']), array('jpg', 'jpeg', 'tiff'))) {
253
+ $exif = read_exif_data($file['file']);
254
+ $exif_orient = isset($exif['Orientation']) ? $exif['Orientation'] : 0;
255
+ $rotateImage = 0;
256
+
257
+ if (6 == $exif_orient) {
258
+ $rotateImage = 90;
259
+ $imageOrientation = 1;
260
+ } elseif (3 == $exif_orient) {
261
+ $rotateImage = 180;
262
+ $imageOrientation = 1;
263
+ } elseif (8 == $exif_orient) {
264
+ $rotateImage = 270;
265
+ $imageOrientation = 1;
266
+ }
267
+
268
+ if ($rotateImage) {
269
+ if (class_exists('Imagick')) {
270
+ $imagick = new Imagick();
271
+ $imagick->readImage($file['file']);
272
+ $imagick->rotateImage(new ImagickPixel(), $rotateImage);
273
+ $imagick->setImageOrientation($imageOrientation);
274
+ $imagick->writeImage($file['file']);
275
+ $imagick->clear();
276
+ $imagick->destroy();
277
+ } else {
278
+ $rotateImage = -$rotateImage;
279
+
280
+ switch ($file['type']) {
281
+ case 'image/jpeg':
282
+ $source = imagecreatefromjpeg($file['file']);
283
+ $rotate = imagerotate($source, $rotateImage, 0);
284
+ imagejpeg($rotate, $file['file']);
285
+ break;
286
+ case 'image/png':
287
+ $source = imagecreatefrompng($file['file']);
288
+ $rotate = imagerotate($source, $rotateImage, 0);
289
+ imagepng($rotate, $file['file']);
290
+ break;
291
+ case 'image/gif':
292
+ $source = imagecreatefromgif($file['file']);
293
+ $rotate = imagerotate($source, $rotateImage, 0);
294
+ imagegif($rotate, $file['file']);
295
+ break;
296
+ default:
297
+ break;
298
+ }
299
+ }
300
+ }
301
+ }
302
+ return $file;
303
+ }
304
+
305
+ function arrayify($files) {
306
+ if (isset($files['name']) && !is_array($files['name'])) {
307
+ $updated_files[0] = $files;
308
+ } else {
309
+ foreach ($files as $key => $array) {
310
+ foreach ($array as $index => $value)
311
+ $updated_files[$index][$key] = $value;
312
+ }
313
+ }
314
+ return $updated_files;
315
+ }
316
+
317
+ }
318
+
319
+ ?>
app/main/controllers/upload/processors/RTMediaUploadUrl.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 RTMediaUploadUrl
10
+ *
11
+ * @author joshua
12
+ */
13
+ class RTMediaUploadUrl {
14
+ //put your code here
15
+ }
16
+
17
+ ?>
app/main/deprecated/RTMediaDeprecated.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 rtMediaDeprecated
10
+ *
11
+ * @author Udit Desai <udit.desai@rtcamp.com>
12
+ */
13
+ class RTMediaDeprecated {
14
+ //put your code here
15
+
16
+ var $deprecate_notice = false;
17
+
18
+ static function uploadshortcode() {
19
+ //
20
+ //add_shortcode('rtmedia_uploader', array($this, 'pre_render'));
21
+ $deprecated = false;
22
+ $deprecate_notice = '';
23
+ // echo self::generate_notice(__METHOD__, $deprecated, $deprecate_notice);
24
+ }
25
+
26
+ static function generate_notice($method, $deprecated=false, $notice='') {
27
+ return sprintf(__("Deprecated %s. Please use %s.",'rtmedia' ), $deprecated, $method);
28
+ }
29
+ }
30
+
31
+ ?>
app/main/group/BPMediaGroupAction.php DELETED
@@ -1,169 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Description of BPMediaGroupLoader
5
- *
6
- * @author faishal
7
- */
8
- class BPMediaGroupAction {
9
- static function bp_media_groups_set_query() {
10
- global $bp, $bp_media, $bp_media_query, $bp_media_posts_per_page;
11
- $enabled = $bp_media->enabled();
12
- $default_tab = $bp_media->default_tab();
13
- $defaults_tab= $default_tab;
14
- if($default_tab!='audio') $defaults_tab.='s';
15
-
16
- if (isset($bp->current_action) && $bp->current_action == BP_MEDIA_SLUG) {
17
- $current_tab = constant('BP_MEDIA_'.strtoupper($defaults_tab).'_SLUG');
18
- if (isset($bp->action_variables[0])) {
19
- $current_tab = $bp->action_variables[0];
20
- }
21
- if ($current_tab) {
22
- switch ($current_tab) {
23
- case BP_MEDIA_IMAGES_SLUG:
24
- $type = 'image';
25
- break;
26
- case BP_MEDIA_AUDIO_SLUG:
27
- $type = 'audio';
28
- break;
29
- case BP_MEDIA_VIDEOS_SLUG:
30
- $type = 'video';
31
- break;
32
- default :
33
- $type = null;
34
- }
35
- if (bp_action_variable(1) == 'page' && is_numeric(bp_action_variable(2))) {
36
- $paged = bp_action_variable(2);
37
- } else {
38
- $paged = 1;
39
- }
40
- if ($type) {
41
- $args = array(
42
- 'post_type' => 'attachment',
43
- 'post_status' => 'any',
44
- 'post_mime_type' => $type,
45
- 'meta_key' => 'bp-media-key',
46
- 'meta_value' => -bp_get_current_group_id(),
47
- 'meta_compare' => '=',
48
- 'paged' => $paged,
49
- 'posts_per_page' => $bp_media_posts_per_page
50
- );
51
- $bp_media_query = new WP_Query($args);
52
- }
53
- }
54
- }
55
- }
56
- static function filter_entries(){
57
- global $bp_media;
58
- $enabled = $bp_media->enabled();
59
- if(isset($enabled['upload'])) unset($enabled['upload']);
60
- if(isset($enabled['album'])) unset($enabled['album']);
61
- foreach($enabled as $type=>$active){
62
- if($active==true){
63
- $filters[] = $type;
64
- }
65
-
66
- }
67
-
68
- if(count($filters)==1) $filters = $filters[0];
69
- return $filters;
70
- }
71
-
72
- /**
73
- * Called on bp_init by screen functions
74
- * Initializes the albums query for groups
75
- *
76
- * @uses global $bp, $bp_media_albums_query
77
- *
78
- * @since BuddyPress Media 2.2
79
- */
80
-
81
- /**
82
- *
83
- * @global type $bp
84
- * @global WP_Query $bp_media_albums_query
85
- */
86
- static function bp_media_groups_albums_set_query() {
87
- global $bp, $bp_media, $bp_media_albums_query;
88
- if (isset($bp->action_variables) && isset($bp->action_variables[1]) && $bp->action_variables[1] == 'page' && isset($bp->action_variables[2]) && is_numeric($bp->action_variables[2])) {
89
- $paged = $bp->action_variables[2];
90
- } else {
91
- $paged = 1;
92
- }
93
-
94
- if (isset($bp->action_variables[0]) && $bp->action_variables[0] == BP_MEDIA_ALBUMS_SLUG) {
95
- $args = array(
96
- 'post_type' => 'bp_media_album',
97
- 'paged' => $paged,
98
- 'meta_key' => 'bp-media-key',
99
- 'meta_value' => -bp_get_current_group_id(),
100
- 'meta_compare' => '=',
101
- 'posts_per_page' => $bp_media->default_count()
102
- );
103
- $bp_media_albums_query = new WP_Query($args);
104
- }
105
- }
106
-
107
- /**
108
- *
109
- * @param BPMediaHostWordpress $media
110
- * @param type $hidden
111
- * @return boolean
112
- */
113
- static function bp_media_groups_activity_create_after_add_media($media, $hidden = false) {
114
- global $bp;
115
- if (function_exists('bp_activity_add')) {
116
- if (!is_object($media)) {
117
- try {
118
- $media = new BPMediaHostWordpress($media);
119
- } catch (exception $e) {
120
- return false;
121
- }
122
- }
123
- $args = array(
124
- 'action' => apply_filters('bp_media_added_media', sprintf(__('%1$s added a %2$s', 'buddypress-media'), bp_core_get_userlink($media->get_author()), '<a href="' . $media->get_url() . '">' . $media->get_media_activity_type() . '</a>')),
125
- 'content' => $media->get_media_activity_content(),
126
- 'primary_link' => $media->get_url(),
127
- 'component' => $bp->groups->id,
128
- 'item_id' => $media->group_id,
129
- 'type' => 'activity_update',
130
- 'user_id' => $media->get_author()
131
- );
132
- $hidden = apply_filters('bp_media_force_hide_activity', $hidden);
133
- if ($hidden) {
134
- $args['secondary_item_id'] = -999;
135
- //do_action('bp_media_album_updated',$media->get_album_id());
136
- }
137
- $activity_id = BPMediaFunction::record_activity($args);
138
- add_post_meta($media->get_id(), 'bp_media_child_activity', $activity_id);
139
- }
140
- }
141
-
142
- //add_action('bp_media_groups_after_add_media','bp_media_groups_activity_create_after_add_media',10,2);
143
- /**
144
- *
145
- * @global type $bp
146
- */
147
-
148
- /**
149
- *
150
- * @global type $bp
151
- */
152
- static function bp_media_groups_redirection_handler() {
153
- global $bp;
154
- echo '<pre>';
155
- var_dump($bp);
156
- echo '</pre>';
157
- die();
158
- }
159
-
160
- //add_action('bp_media_init','bp_media_groups_redirection_handler');
161
- /**
162
- *
163
- * @return boolean
164
- */
165
- static function bp_media_groups_force_hide_activity() {
166
- return true;
167
- }
168
-
169
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/group/BPMediaGroupElementExtension.php DELETED
@@ -1,146 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaGroupElementExtension
4
- *
5
- * @author faishal
6
- */
7
- if (class_exists('BP_Group_Extension')) :
8
-
9
- class BPMediaGroupElementExtension extends BP_Group_Extension {
10
-
11
- var $enable_edit_item = false;
12
- var $enable_create_step = false;
13
-
14
- /**
15
- *
16
- * @param type $name
17
- * @param type $slug
18
- */
19
- function __construct($name, $slug) {
20
- $this->name = $name;
21
- $this->slug = $slug;
22
- }
23
-
24
- /**
25
- *
26
- * @global type $bp
27
- * @global BPMediaHostWordpress $bp_media_current_entry
28
- * @return type
29
- * @throws Exception
30
- */
31
- function display() {
32
- global $bp,$bp_media_current_entry;
33
- //For saving the data if the form is submitted
34
- if ( bp_action_variable(2) )
35
- $bp_media_current_entry = new BPMediaHostWordpress(bp_action_variable(2));
36
- $current_tab = BP_MEDIA_IMAGES_SLUG;
37
- if (isset($bp->action_variables[0])) {
38
- $current_tab = $bp->action_variables[0];
39
- }
40
- BPMediaGroupLoader::navigation_menu();
41
- $media_type = "";
42
- $slug = "";
43
- switch ($current_tab) {
44
- case BP_MEDIA_IMAGES_SLUG:
45
- $media_type = "image";
46
- $slug = BP_MEDIA_IMAGES_SLUG;
47
- break;
48
- case BP_MEDIA_VIDEOS_SLUG:
49
- $media_type = "video";
50
- $slug = BP_MEDIA_VIDEOS_SLUG;
51
- break;
52
- case BP_MEDIA_AUDIO_SLUG:
53
- $media_type = "audio";
54
- $slug = BP_MEDIA_AUDIO_SLUG;
55
- break;
56
- case BP_MEDIA_ALBUMS_SLUG:
57
- $media_type = "album";
58
- $slug = BP_MEDIA_ALBUMS_SLUG;
59
- break;
60
- case BP_MEDIA_UPLOAD_SLUG:
61
- $media_type = "upload";
62
- $slug = BP_MEDIA_ALBUMS_SLUG;
63
- break;
64
- default:
65
- /** @todo Error is to be displayed for 404 */
66
- }
67
- if ($media_type == "album") {
68
- $bp_media_content = new BPMediaAlbumScreen($media_type, $slug);
69
- } else if ($media_type == 'upload') {
70
- if (BPMediaGroupLoader::can_upload()) {
71
- $bp_media_content = new BPMediaUploadScreen('upload', BP_MEDIA_UPLOAD_SLUG);
72
- }
73
- } else {
74
- $bp_media_content = new BPMediaScreen($media_type, $slug);
75
- }
76
- if ($slug != "" && $media_type != "") {
77
- if (isset($bp->action_variables[1])) {
78
- switch ($bp->action_variables[1]) {
79
- case 'edit':
80
- //$bp_media_content->edit_screen_content();
81
- break;
82
- case 'delete':
83
- //Delete function for media file
84
- break;
85
- default:
86
- if (intval(bp_action_variable(1)) > 0) {
87
- global $bp_media_current_entry;
88
- try {
89
- $bp_media_current_entry = new BPMediaHostWordpress(bp_action_variable(1));
90
- if ($bp_media_current_entry->get_group_id() != bp_get_current_group_id())
91
- throw new Exception(__('Sorry, the requested media does not belong to the group', 'buddypress-media'));
92
- } catch (Exception $e) {
93
- /** Error Handling when media not present or not belong to the group */
94
- $this->bp_media_display_error($e->getMessage());
95
- return;
96
- }
97
- if ($media_type == "album") {
98
- $bp->action_variables[0] = BP_MEDIA_ALBUMS_VIEW_SLUG;
99
- echo '<h3>'.get_the_title($bp->action_variables[1]).'</h3>';
100
- $bp_media_content->entry_screen();
101
- }
102
- $bp_media_content->entry_screen_content();
103
-
104
- break;
105
- } else {
106
- /** @todo display 404 */
107
- }
108
- }
109
- } else {
110
- if ($media_type == "album") {
111
- BPMediaGroupAction::bp_media_groups_albums_set_query();
112
- $bp_media_content->screen_content();
113
- } else if ($media_type == 'upload') {
114
- if (BPMediaGroupLoader::can_upload()) {
115
- $bp_media_content->upload_screen_content();
116
- }
117
- } else {
118
- $bp_media_content->screen_content();
119
- }
120
- }
121
- }
122
- }
123
-
124
- function widget_display() {
125
-
126
- }
127
-
128
- /**
129
- *
130
- * @param type $errorMessage
131
- */
132
- function bp_media_display_error($errorMessage) {
133
- ?>
134
- <div id="message" class="error">
135
- <p>
136
- <?php _e($errorMessage, 'buddypress-media'); ?>
137
- </p>
138
- </div>
139
- <?php
140
- }
141
-
142
- }
143
-
144
- endif;
145
- //bp_register_group_extension("BP_Media_Group_Extension_' . constant('BP_MEDIA_' . $item . '_SLUG') . '" );
146
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/group/BPMediaGroupsExtension.php DELETED
@@ -1,167 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaGroupLoader
4
- *
5
- * @author faishal
6
- */
7
- if (class_exists('BP_Group_Extension')) :// Recommended, to prevent problems during upgrade or when Groups are disabled
8
-
9
- class BPMediaGroupsExtension extends BPMediaGroupElementExtension {
10
- /**
11
- * Constructor for the BP_Group_Extension adding values to the variables defined
12
- *
13
- * @uses global $bp
14
- *
15
- * @since BuddyPress Media 2.3
16
- */
17
-
18
- /**
19
- *
20
- * @global type $bp
21
- */
22
- function __construct() {
23
- global $bp;
24
- $this->name = __(BP_MEDIA_LABEL, 'buddypress-media');
25
- $this->slug = BP_MEDIA_SLUG;
26
- $this->create_step_position = 21;
27
- $this->nav_item_position = 31;
28
- }
29
-
30
- /**
31
- *
32
- * @global type $bp_media
33
- * @return boolean
34
- */
35
- function create_screen() {
36
- global $bp_media;
37
- if (!bp_is_group_creation_step($this->slug))
38
- return false;
39
- ?>
40
- <h4><?php _e("Album Creation Control", 'buddypress-media'); ?></h4>
41
- <p><?php _e("Who can create Albums in this group?", 'buddypress-media'); ?></p>
42
- <div class="radio">
43
- <label>
44
- <input name="bp_album_creation_control" type="radio" id="bp_media_group_level_moderators" checked="checked" value="all">
45
- <strong><?php _e("All Group Members", 'buddypress-media'); ?></strong>
46
- </label>
47
- <label>
48
- <input name="bp_album_creation_control" type="radio" id="bp_media_group_level_moderators" value="moderators">
49
- <strong><?php _e("Group Admins and Mods only", 'buddypress-media'); ?></strong>
50
- </label>
51
- <label>
52
- <input name="bp_album_creation_control" type="radio" id="bp_media_group_level_admin" value="admin">
53
- <strong><?php _e("Group Admin only", 'buddypress-media'); ?></strong>
54
- </label>
55
- </div>
56
-
57
- <?php
58
- wp_nonce_field('groups_create_save_' . $this->slug);
59
- }
60
-
61
- /**
62
- *
63
- * @global type $bp
64
- */
65
- function create_screen_save() {
66
- global $bp;
67
-
68
- check_admin_referer('groups_create_save_' . $this->slug);
69
-
70
- /* Save any details submitted here */
71
- if (isset($_POST['bp_album_creation_control']) && $_POST['bp_album_creation_control'] != '')
72
- groups_update_groupmeta($bp->groups->new_group_id, 'bp_media_group_control_level', $_POST['bp_album_creation_control']);
73
- }
74
-
75
- /**
76
- *
77
- * @global type $bp_media
78
- * @return boolean
79
- */
80
- function edit_screen() {
81
- global $bp_media;
82
- if (!bp_is_group_admin_screen($this->slug))
83
- return false;
84
- $current_level = groups_get_groupmeta(bp_get_current_group_id(), 'bp_media_group_control_level');
85
- ?>
86
-
87
- <h4><?php _e("Album Creation Control", 'buddypress-media'); ?></h4>
88
- <p><?php _e("Who can create Albums in this group?", 'buddypress-media'); ?></p>
89
- <div class="radio">
90
- <label>
91
- <input name="bp_album_creation_control" type="radio" id="bp_media_group_level_moderators" value="all"<?php checked($current_level, 'all', true) ?>>
92
- <strong><?php _e("All Group Members", 'buddypress-media'); ?></strong>
93
- </label>
94
- <label>
95
- <input name="bp_album_creation_control" type="radio" id="bp_media_group_level_moderators" value="moderators" <?php checked($current_level, 'moderators', true) ?>>
96
- <strong><?php _e("Group Admins and Mods only", 'buddypress-media'); ?></strong>
97
- </label>
98
- <label>
99
- <input name="bp_album_creation_control" type="radio" id="bp_media_group_level_admin" value="admin" <?php checked($current_level, 'admin', true) ?>>
100
- <strong><?php _e("Group Admin only", 'buddypress-media'); ?></strong>
101
- </label>
102
- </div>
103
- <hr>
104
- <input type="submit" name="save" value="<?php _e("Save Changes", 'buddypress-media'); ?> />
105
- <?php
106
- wp_nonce_field('groups_edit_save_' . $this->slug);
107
- }
108
-
109
- /**
110
- *
111
- * @global type $bp
112
- * @global type $bp_media
113
- * @return boolean
114
- */
115
- function edit_screen_save() {
116
- global $bp, $bp_media;
117
-
118
- if (!isset($_POST['save']))
119
- return false;
120
-
121
- check_admin_referer('groups_edit_save_' . $this->slug);
122
-
123
- if (isset($_POST['bp_album_creation_control']) && $_POST['bp_album_creation_control'] != '')
124
- $success = groups_update_groupmeta(bp_get_current_group_id(), 'bp_media_group_control_level', $_POST['bp_album_creation_control']);
125
- else
126
- $success = false;
127
-
128
- /* To post an error/success message to the screen, use the following */
129
- if (!$success)
130
- bp_core_add_message(__('There was an error saving, please try again', 'buddypress-media'), 'error');
131
- else
132
- bp_core_add_message(__('Settings saved successfully', 'buddypress-media'));
133
-
134
- bp_core_redirect(bp_get_group_permalink($bp->groups->current_group) . '/admin/' . $this->slug);
135
- }
136
-
137
- /**
138
- * The display method for the extension
139
- *
140
- * @since BuddyPress Media 2.3
141
- */
142
-
143
- /**
144
- *
145
- * @global type $bp_media
146
- */
147
- function widget_display() {
148
- global $bp_media;
149
- ?>
150
- <div class="info-group" >
151
- <h4><?php echo esc_attr($this->name) ?></h4>
152
- <p>
153
- <?php _e("You could display a small snippet of information from your group extension here. It will show on the group
154
- home screen.", 'buddypress-media'); ?>
155
- </p>
156
- </div>
157
- <?php
158
- }
159
-
160
- }
161
-
162
-
163
-
164
-
165
-
166
-
167
- endif; // class_exists( 'BP_Group_Extension' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/group/dummy/BPMediaGroupAlbums.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Description of BPMediaGroupImage
5
- *
6
- * @author faishal
7
- */
8
- if (class_exists('BP_Group_Extension')) :
9
-
10
- class BPMediaGroupAlbums extends BPMediaGroupElementExtension {
11
-
12
- function __construct() {
13
- parent::__construct(BP_MEDIA_ALBUMS_LABEL, BP_MEDIA_ALBUMS_SLUG);
14
- bp_register_group_extension("BPMediaGroupAlbums");
15
- }
16
-
17
- }
18
-
19
- endif;
20
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/group/dummy/BPMediaGroupAudio.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaGroupImage
4
- *
5
- * @author faishal
6
- */
7
- if ( class_exists( 'BP_Group_Extension' ) ) :
8
- class BPMediaGroupAudio extends BPMediaGroupElementExtension {
9
-
10
- function __construct() {
11
- parent::__construct(BP_MEDIA_AUDIO_LABEL, BP_MEDIA_AUDIO_SLUG);
12
- bp_register_group_extension("BPMediaGroupAudio");
13
- }
14
-
15
- }
16
- endif;
17
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/group/dummy/BPMediaGroupImages.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaGroupImage
4
- *
5
- * @author faishal
6
- */
7
- if ( class_exists( 'BP_Group_Extension' ) ) :
8
- class BPMediaGroupImages extends BPMediaGroupElementExtension {
9
-
10
- function __construct() {
11
- parent::__construct(BP_MEDIA_IMAGES_LABEL, BP_MEDIA_IMAGES_SLUG);
12
- bp_register_group_extension("BPMediaGroupImages");
13
- }
14
-
15
- }
16
- endif;
17
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/group/dummy/BPMediaGroupUpload.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * Registers BPMediaGroupUpload class in groups in buddypress
4
- *
5
- * @package BuddyPressMedia
6
- * @subpackage Group
7
- *
8
- * @author Hrishikesh Vaipurkar <hrishikesh.vaipurkar@rtcamp.com>
9
- */
10
- if ( class_exists( 'BP_Group_Extension' ) ) :
11
- class BPMediaGroupUpload extends BPMediaGroupElementExtension {
12
-
13
- function __construct() {
14
- parent::__construct(BP_MEDIA_UPLOAD_LABEL, BP_MEDIA_UPLOAD_SLUG);
15
- bp_register_group_extension("BPMediaGroupUpload");
16
- }
17
-
18
- }
19
- endif;
20
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/group/dummy/BPMediaGroupVideos.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- /**
3
- * Description of BPMediaGroupImage
4
- *
5
- * @author faishal
6
- */
7
- if ( class_exists( 'BP_Group_Extension' ) ) :
8
- class BPMediaGroupVideos extends BPMediaGroupElementExtension {
9
-
10
- function __construct() {
11
- parent::__construct(BP_MEDIA_VIDEOS_LABEL, BP_MEDIA_VIDEOS_SLUG);
12
- bp_register_group_extension("BPMediaGroupVideos");
13
- }
14
-
15
- }
16
- endif;
17
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/includes/BPMediaActions.php DELETED
@@ -1,1211 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Description of BPMediaActions
5
- *
6
- * @author faishal
7
- */
8
- class BPMediaActions {
9
-
10
- /**
11
- *
12
- * @global type $bp_media_options
13
- */
14
- function __construct() {
15
- add_action('bp_media_before_content', 'BPMediaActions::show_messages');
16
- add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles'), 11);
17
- add_action('bp_before_activity_delete', 'BPMediaActions::delete_activity_handler');
18
- add_action('wp_enqueue_scripts', array($this, 'upload_enqueue'));
19
- add_action('init', 'BPMediaActions::init_count');
20
- add_action('init', array($this, 'default_user_album'));
21
- add_action('bp_init', array($this, 'default_group_album'));
22
- add_action('bp_activity_entry_meta', array($this, 'action_buttons'));
23
- add_action('bp_media_no_activity_entry_meta', array($this, 'action_buttons'));
24
- add_action('bp_media_before_delete_media', 'BPMediaActions::delete_media_handler');
25
- add_action('bp_media_after_add_album', array($this, 'album_create_activity'));
26
- add_action('bp_media_after_add_album', array($this, 'update_count'), 999);
27
- add_action('bp_media_album_updated', 'BPMediaActions::album_activity_update');
28
- add_action('bp_media_album_updated', array($this, 'update_count'), 999);
29
- add_action('bp_media_after_edit_album', array($this, 'update_count'), 999);
30
- add_action('bp_media_after_delete_album', array($this, 'update_count'), 999);
31
- add_action('bp_media_after_delete_media', array($this, 'album_activity_sync'));
32
- add_action('bp_media_after_add_media', 'BPMediaActions::activity_create_after_add_media', 10, 4);
33
- add_action('bp_activity_posted_update', array($this, 'activity_update'), '', 3);
34
- add_action('wp_ajax_bp_media_load_more', array($this, 'load_more'));
35
- add_action('wp_ajax_nopriv_bp_media_load_more', array($this, 'load_more'));
36
- add_action('wp_ajax_bp_media_load_more_sc', array($this, 'load_more_sc'));
37
- add_action('wp_ajax_nopriv_bp_media_load_more_sc', array($this, 'load_more_sc'));
38
- add_action('wp_ajax_bp_media_move_selected_media', array($this, 'move_selected_media'));
39
- add_action('wp_ajax_bp_media_delete_selected_media', array($this, 'delete_selected_media'));
40
- add_action('wp_ajax_bp_media_merge_album', array($this, 'merge_album'));
41
- add_action('wp_ajax_bp_media_set_album_cover', array($this, 'set_album_cover'));
42
- add_action('delete_attachment', array($this, 'delete_attachment_handler'));
43
- add_action('wp_ajax_bp_media_add_album', array($this, 'add_album'));
44
- add_action('bp_media_after_privacy_install', array($this, 'update_count'), 999);
45
- add_action('bp_media_after_add_media', array($this, 'update_count'), 999);
46
- add_action('bp_media_after_update_media', array($this, 'update_count'), 999);
47
- add_action('bp_media_after_delete_media', array($this, 'update_count'), 999);
48
- add_action('bp_before_group_settings_creation_step', array($this, 'group_create_default_album'));
49
- add_filter('intermediate_image_sizes_advanced', array($this, 'filter_image_sizes_details'));
50
- add_filter('intermediate_image_sizes', array($this, 'filter_image_sizes'));
51
- add_shortcode('bpmedia', array($this, 'bpmedia_shortcode'));
52
- $linkback = bp_get_option('bp_media_add_linkback', false);
53
- if ($linkback)
54
- add_action('bp_footer', array($this, 'footer'));
55
- }
56
-
57
- /**
58
- * Handles the uploads and creates respective posts for the upload
59
- *
60
- * @since BuddyPress Media 2.0
61
- */
62
-
63
- /**
64
- *
65
- * @global type $bp
66
- * @global type $bp_media_options
67
- * @return type
68
- */
69
- static function handle_uploads() {
70
- global $bp, $bp_media;
71
- $bp_media_options = $bp_media->options;
72
- if (isset($_POST['action']) && $_POST['action'] == 'wp_handle_upload') {
73
- /* @var $bp_media_entry BPMediaHostWordpress */
74
- if (isset($_FILES) && is_array($_FILES) && array_key_exists('bp_media_file', $_FILES) && $_FILES['bp_media_file']['name'] != '') {
75
- if (!preg_match('/audio|video|image/i', $_FILES['bp_media_file']['type'], $result) || !isset($result[0])) {
76
- $bp->{BP_MEDIA_SLUG}->messages['error'][] = __('File uploaded is not supported');
77
- return;
78
- }
79
- $type = $result[0];
80
- switch ($result[0]) {
81
- case 'image' :
82
- if ($bp_media_options['images_enabled'] == false) {
83
- $bp->{BP_MEDIA_SLUG}->messages['error'][] = __('Image uploads are disabled');
84
- return;
85
- }
86
- break;
87
- case 'video' :
88
- if ($bp_media_options['videos_enabled'] == false) {
89
- $bp->{BP_MEDIA_SLUG}->messages['error'][] = __('Video uploads are disabled');
90
- return;
91
- }
92
- break;
93
- case 'audio' :
94
- if ($bp_media_options['audio_enabled'] == false) {
95
- $bp->{BP_MEDIA_SLUG}->messages['error'][] = __('Audio uploads are disabled');
96
- return;
97
- }
98
- break;
99
- default :
100
- $bp->{BP_MEDIA_SLUG}->messages['error'][] = __('File uploaded is not supported');
101
- return;
102
- }
103
- $class_name = apply_filters('bp_media_transcoder', 'BPMediaHostWordpress', $type);
104
- $bp_media_entry = new $class_name();
105
- try {
106
- $title = isset($_POST['bp_media_title']) ? ($_POST['bp_media_title'] != "") ? $_POST['bp_media_title'] : pathinfo($_FILES['bp_media_file']['name'], PATHINFO_FILENAME) : pathinfo($_FILES['bp_media_file']['name'], PATHINFO_FILENAME);
107
- $album_id = isset($_POST['bp_media_album_id']) ? intval($_POST['bp_media_album_id']) : 0;
108
- $is_multiple = isset($_POST['is_multiple_upload']) ? ($_POST['is_multiple_upload'] == 'true' ? true : false) : false;
109
- $is_activity = isset($_POST['is_activity']) ? ($_POST['is_activity'] == 'true' ? true : false) : false;
110
- $description = isset($_POST['bp_media_description']) ? $_POST['bp_media_description'] : '';
111
- $group_id = isset($_POST['bp_media_group_id']) ? intval($_POST['bp_media_group_id']) : 0;
112
- $entry = $bp_media_entry->add_media($title, $description, $album_id, $group_id, $is_multiple, $is_activity);
113
- if (!isset($bp->{BP_MEDIA_SLUG}->messages['updated'][0]))
114
- $bp->{BP_MEDIA_SLUG}->messages['updated'][0] = __('Upload Successful', 'buddypress-media');
115
- } catch (Exception $e) {
116
- $bp->{BP_MEDIA_SLUG}->messages['error'][] = $e->getMessage();
117
- }
118
- } else {
119
- $bp->{BP_MEDIA_SLUG}->messages['error'][] = __('You did not specified a file to upload', 'buddypress-media');
120
- }
121
- }
122
- }
123
-
124
- //add_action('bp_init', 'handle_uploads');
125
-
126
- /**
127
- * Displays the messages that other functions/methods creates according to the BuddyPress' formating
128
- *
129
- * @since BuddyPress Media 2.0
130
- */
131
-
132
- /**
133
- *
134
- * @global type $bp
135
- */
136
- static function show_messages() {
137
- global $bp;
138
- if (is_array($bp->{BP_MEDIA_SLUG}->messages)) {
139
- $types = array('error', 'updated', 'info');
140
- foreach ($types as $type) {
141
- if (count($bp->{BP_MEDIA_SLUG}->messages[$type]) > 0) {
142
- BPMediaFunction::show_formatted_error_message($bp->{BP_MEDIA_SLUG}->messages[$type], $type);
143
- }
144
- }
145
- }
146
- }
147
-
148
- /**
149
- * Enqueues all the required scripts and stylesheets for the proper working of BuddyPress Media.
150
- *
151
- * @since BuddyPress Media 2.0
152
- */
153
-
154
- /**
155
- *
156
- * @global type $bp
157
- */
158
- function enqueue_scripts_styles() {
159
- global $bp_media, $bp;
160
- wp_enqueue_script('jquery-ui-tabs');
161
- wp_enqueue_script('bp-media-mejs', BP_MEDIA_URL . 'lib/media-element/mediaelement-and-player.min.js', '', BP_MEDIA_VERSION);
162
- wp_enqueue_script('bp-media-default', BP_MEDIA_URL . 'app/assets/js/main.js', '', BP_MEDIA_VERSION);
163
- $lightbox = isset($bp_media->options['enable_lightbox']) ? $bp_media->options['enable_lightbox'] : 0;
164
- if ($lightbox)
165
- wp_enqueue_script('bp-media-modal', BP_MEDIA_URL . 'lib/simplemodal/jquery.simplemodal-1.4.4.js', '', BP_MEDIA_VERSION);
166
- $cur_group_id = NULL;
167
- if (bp_is_active("groups"))
168
- $cur_group_id = bp_get_current_group_id();
169
- if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
170
- $schema = 'https';
171
- } else {
172
- $schema = 'http';
173
- }
174
- $bp_media_vars = array(
175
- 'ajaxurl' => admin_url('admin-ajax.php', $schema),
176
- 'page' => 1,
177
- 'current_action' => $cur_group_id ? (empty($bp->action_variables) ? BP_MEDIA_IMAGES_SLUG : $bp->action_variables[0]) : (isset($bp->current_action) ? $bp->current_action : false),
178
- 'action_variables' => isset($bp->action_variables) ? (empty($bp->action_variables) ? array(BP_MEDIA_IMAGES_SLUG) : $bp->action_variables) : array(BP_MEDIA_IMAGES_SLUG),
179
- 'displayed_user' => bp_displayed_user_id(),
180
- 'loggedin_user' => bp_loggedin_user_id(),
181
- 'current_group' => $cur_group_id,
182
- 'lightbox' => $lightbox,
183
- );
184
- $bp_media_main_strings = array(
185
- 'something_went_wrong' => __('Something went wrong. Please try again.', 'buddypress-media'),
186
- 'merge_confirmation' => __('Are you sure you want to merge this album?', 'buddypress-media'),
187
- 'delete_after_merge' => __('Would you like to delete this album after the merge?', 'buddypress-media'),
188
- 'delete_selected_media' => __('Are you sure you want to delete the selected media?', 'buddypress-media'),
189
- 'delete_activity_media' => __('Are you sure you want to delete this activity and associated media?', 'buddypress-media'),
190
- 'are_you_sure' => __('Are you sure?', 'buddypress-media'),
191
- 'select_media' => __('Please select media.', 'buddypress-media'),
192
- 'select_action' => __('Please select an action.', 'buddypress-media')
193
- );
194
-
195
- wp_localize_script('bp-media-default', 'bp_media_vars', $bp_media_vars);
196
- wp_localize_script('bp-media-default', 'bp_media_main_strings', $bp_media_main_strings);
197
- wp_enqueue_style('bp-media-mecss', BP_MEDIA_URL . 'lib/media-element/mediaelementplayer.min.css', '', BP_MEDIA_VERSION);
198
- wp_enqueue_style('bp-media-default', BP_MEDIA_URL . 'app/assets/css/main.css', '', BP_MEDIA_VERSION);
199
- }
200
-
201
- /**
202
- *
203
- * @global integer $bp_media_count
204
- * @global object $wpdb
205
- * @param array $args
206
- * @return boolean
207
- */
208
- static function delete_activity_handler($args) {
209
- if (!bp_is_active('activity'))
210
- return;
211
- remove_action('bp_media_before_delete_media', 'BPMediaActions::delete_media_handler');
212
- global $bp_media_count, $wpdb;
213
- if (!array_key_exists('id', $args))
214
- return;
215
-
216
- $activity_id = $args['id'];
217
- if (intval($activity_id)) {
218
- $query = "SELECT post_id from $wpdb->postmeta WHERE meta_key='bp_media_child_activity' AND meta_value={$activity_id}";
219
- $result = $wpdb->get_results($query);
220
- if (!(is_array($result) && count($result) == 1 ))
221
- return;
222
- $post_id = $result[0]->post_id;
223
- try {
224
- $post = get_post($post_id);
225
- if (!isset($post->post_type))
226
- return false;
227
- switch ($post->post_type) {
228
- case 'attachment':
229
- $media = new BPMediaHostWordpress($post_id);
230
- $media->delete_media();
231
- break;
232
- case 'bp_media_album':
233
- $album = new BPMediaAlbum($post_id);
234
- $album->delete_album();
235
- break;
236
- default:
237
- wp_delete_post($post_id);
238
- }
239
- } catch (Exception $e) {
240
- error_log('Media tried to delete was already deleted');
241
- }
242
- }
243
- }
244
-
245
- /**
246
- *
247
- * @param type $media_id
248
- * @return boolean
249
- */
250
- static function delete_media_handler($media_id) {
251
- /* @var $media BPMediaHostWordpress */
252
- if (bp_is_active('activity')) {
253
- remove_action('bp_before_activity_delete', 'BPMediaActions::delete_activity_handler');
254
- $activity_id = get_post_meta($media_id, 'bp_media_child_activity', true);
255
- if ($activity_id == NULL)
256
- return false;
257
- bp_activity_delete_by_activity_id($activity_id);
258
- }
259
- }
260
-
261
- /**
262
- * Called on bp_init by screen functions
263
- *
264
- * @uses global $bp, $bp_media_query
265
- *
266
- * @since BuddyPress Media 2.0
267
- */
268
-
269
- /**
270
- *
271
- * @global type $bp
272
- * @global WP_Query $bp_media_query
273
- * @global type $bp_media_posts_per_page
274
- */
275
- function set_query() {
276
- global $bp, $bp_media_query, $bp_media_posts_per_page;
277
- switch ($bp->current_action) {
278
- case BP_MEDIA_IMAGES_SLUG:
279
- $type = 'image';
280
- break;
281
- case BP_MEDIA_AUDIO_SLUG:
282
- $type = 'audio';
283
- break;
284
- case BP_MEDIA_VIDEOS_SLUG:
285
- $type = 'video';
286
- break;
287
- default :
288
- $type = null;
289
- }
290
- if (isset($bp->action_variables) && is_array($bp->action_variables) && isset($bp->action_variables[0]) && $bp->action_variables[0] == 'page' && isset($bp->action_variables[1]) && is_numeric($bp->action_variables[1])) {
291
- $paged = $bp->action_variables[1];
292
- } else {
293
- $paged = 1;
294
- }
295
- if ($type) {
296
- $args = array(
297
- 'post_type' => 'attachment',
298
- 'post_status' => 'any',
299
- 'post_mime_type' => $type,
300
- 'author' => $bp->displayed_user->id,
301
- 'meta_key' => 'bp-media-key',
302
- 'meta_value' => $bp->displayed_user->id,
303
- 'meta_compare' => '=',
304
- 'paged' => $paged,
305
- 'posts_per_page' => $bp_media_posts_per_page
306
- );
307
- $bp_media_query = new WP_Query($args);
308
- }
309
- }
310
-
311
- /**
312
- * Adds a download button and edit button on single entry pages of media files.
313
- *
314
- * @uses $bp_media_options Global variable
315
- *
316
- * @since BuddyPress Media 2.0
317
- */
318
-
319
- /**
320
- *
321
- * @global type $bp_media_current_entry
322
- * @global type $bp_media_options
323
- * @return boolean
324
- */
325
- function action_buttons() {
326
- if (!in_array('bp_media_current_entry', $GLOBALS))
327
- return false;
328
- global $bp_media_current_entry, $bp_media;
329
-
330
- $action_buttons = array();
331
- if ($bp_media_current_entry != NULL) {
332
-
333
- if (isset($bp_media->options['download_enabled']))
334
- $action_buttons[] = '<a href="' . admin_url('admin-ajax.php') . '?action=bp_media_download&file=' . $bp_media_current_entry->get_attachment_url()
335
- . '" target="_blank" class="button item-button bp-secondary-action bp-media-download" title="'
336
- . __('Download', 'buddypress-media') . '">' . __('Download', 'buddypress-media') . '</a>';
337
-
338
- if ((bp_displayed_user_id() == bp_loggedin_user_id()) && ($bp_media_current_entry->get_type() == 'image')) {
339
- if (get_post_thumbnail_id($bp_media_current_entry->get_album_id()) != $bp_media_current_entry->get_id())
340
- $action_buttons[] = '<a href="#" data-album-id="' . $bp_media_current_entry->get_album_id()
341
- . '" data-post-id="' . $bp_media_current_entry->get_id()
342
- . '" class="button item-button bp-secondary-action bp-media-featured" title="'
343
- . __('Set as Album Cover', 'buddypress-media') . '">' . __('Set as Album Cover', 'buddypress-media') . '</a>';
344
- else
345
- $action_buttons[] = '<a href="#" data-album-id="'
346
- . $bp_media_current_entry->get_album_id() . '" data-post-id="' . $bp_media_current_entry->get_id()
347
- . '" class="button item-button bp-secondary-action bp-media-featured" title="'
348
- . __('Unset as Album Cover', 'buddypress-media') . '">' . __('Unset as Album Cover', 'buddypress-media') . '</a>';
349
- }
350
-
351
- if (bp_displayed_user_id() == bp_loggedin_user_id())
352
- $action_buttons[] = '<a href="' . $bp_media_current_entry->get_edit_url()
353
- . '" class="button item-button bp-secondary-action bp-media-edit" title="'
354
- . __('Edit Media', 'buddypress-media') . '">' . __('Edit', 'buddypress-media') . '</a>';
355
- $action_buttons = apply_filters('bp_media_action_buttons', $action_buttons);
356
-
357
- if (!bp_is_active('activity') || !get_post_meta($bp_media_current_entry->get_id(), 'bp_media_child_activity')) {
358
- $action_buttons[] = '<a href="' . $bp_media_current_entry->get_delete_url()
359
- . '" class="button item-button bp-secondary-action delete-activity-single confirm" title="'
360
- . __('Delete Media', 'buddypress-media') . '">' . __('Delete', 'buddypress-media') . '</a>';
361
- }
362
- }
363
-
364
- foreach ($action_buttons as $action_button) {
365
- echo $action_button;
366
- }
367
- }
368
-
369
- /* Should be used with Content Disposition Type for media files set to attachment */
370
-
371
- /**
372
- * Shows the media count of a user in the tabs
373
- *
374
- * @since BuddyPress Media 2.0
375
- */
376
-
377
- /**
378
- *
379
- * @global type $bp_media_count
380
- * @param type $user
381
- * @return boolean
382
- */
383
- static function init_count($user = null) {
384
- global $bp_media_count, $bp_media;
385
- $enabled = $bp_media->enabled();
386
- $current_access = BPMediaPrivacy::current_access();
387
- if (!$user)
388
- $user = bp_displayed_user_id();
389
- if ($user < 1) {
390
- $bp_media_count = null;
391
- return false;
392
- }
393
- $count = bp_get_user_meta($user, 'bp_media_count', true);
394
- if (!$count) {
395
- $bp_media_count = array(
396
- 0 => array('images' => 0, 'videos' => 0, 'audio' => 0, 'albums' => 0),
397
- 2 => array('images' => 0, 'videos' => 0, 'audio' => 0, 'albums' => 0),
398
- 4 => array('images' => 0, 'videos' => 0, 'audio' => 0, 'albums' => 0),
399
- 6 => array('images' => 0, 'videos' => 0, 'audio' => 0, 'albums' => 0),
400
- );
401
- bp_update_user_meta($user, 'bp_media_count', $bp_media_count);
402
- } else {
403
- $total = array(
404
- 'images' => 0,
405
- 'videos' => 0,
406
- 'audio' => 0,
407
- 'albums' => 0,
408
- 'total' => 0
409
- );
410
- $total_count = 0;
411
- if (isset($count) && is_array($count) && count($count) > 0) {
412
- foreach ($count as $level => $counts) {
413
- if ($level <= $current_access) {
414
- if (isset($counts) && is_array($counts) && count($counts) > 0) {
415
- foreach ($counts as $media => $number) {
416
- if (array_key_exists($media, $enabled) || array_key_exists($media . 's', $enabled)) {
417
- if ($enabled[$media]) {
418
- $medias = $media;
419
- if ($media != 'audio')
420
- $medias .='s';
421
- $total[$medias] = $total[$medias] + $number;
422
- if ($media != 'album') {
423
- $total_count = $total_count + $total[$medias];
424
- }
425
- }
426
- }
427
- }
428
- }
429
- $total['total'] = $total_count;
430
- }
431
- }
432
- }
433
-
434
- $bp_media_count = $total;
435
- }
436
- add_filter('bp_get_displayed_user_nav_' . BP_MEDIA_SLUG, 'BPMediaFilters::items_count_filter', 10, 2);
437
-
438
- if (bp_current_component() == BP_MEDIA_SLUG) {
439
- add_filter('bp_get_options_nav_' . BP_MEDIA_IMAGES_SLUG, 'BPMediaFilters::items_count_filter', 10, 2);
440
- add_filter('bp_get_options_nav_' . BP_MEDIA_VIDEOS_SLUG, 'BPMediaFilters::items_count_filter', 10, 2);
441
- add_filter('bp_get_options_nav_' . BP_MEDIA_AUDIO_SLUG, 'BPMediaFilters::items_count_filter', 10, 2);
442
- add_filter('bp_get_options_nav_' . BP_MEDIA_ALBUMS_SLUG, 'BPMediaFilters::items_count_filter', 10, 2);
443
- }
444
- return true;
445
- }
446
-
447
- public function update_count($object) {
448
-
449
- global $bp;
450
- $user_id = $bp->loggedin_user->id;
451
- global $wpdb;
452
- $formatted = array();
453
- $query =
454
- "SELECT
455
- SUM(CASE WHEN post_mime_type LIKE 'image%' THEN 1 ELSE 0 END) as Images,
456
- SUM(CASE WHEN post_mime_type LIKE 'audio%' THEN 1 ELSE 0 END) as Audio,
457
- SUM(CASE WHEN post_mime_type LIKE 'video%' THEN 1 ELSE 0 END) as Videos,
458
- SUM(CASE WHEN post_type LIKE 'bp_media_album' THEN 1 ELSE 0 END) as Albums
459
- FROM
460
- $wpdb->posts p inner join $wpdb->postmeta pm on pm.post_id = p.id INNER JOIN $wpdb->postmeta pmp
461
- on pmp.post_id = p.id WHERE
462
- p.post_author = $user_id AND
463
- pm.meta_key = 'bp-media-key' AND
464
- pm.meta_value > 0 AND
465
- pmp.meta_key = 'bp_media_privacy' AND
466
- ( post_mime_type LIKE 'image%' OR post_mime_type LIKE 'audio%' OR post_mime_type LIKE 'video%' OR post_type LIKE 'bp_media_album')
467
- GROUP BY pmp.meta_value";
468
- $result = $wpdb->get_results($query);
469
- if (!is_array($result))
470
- return false;
471
- foreach ($result as $level => $obj) {
472
- $formatted[$level * 2] = array(
473
- 'image' => $obj->Images,
474
- 'video' => $obj->Videos,
475
- 'audio' => $obj->Audio,
476
- 'album' => $obj->Albums,
477
- );
478
- }
479
- bp_update_user_meta($user_id, 'bp_media_count', $formatted);
480
- return true;
481
- }
482
-
483
- /**
484
- * Displays the footer of the BuddyPress Media Plugin if enabled through the dashboard options page
485
- *
486
- * @since BuddyPress Media 2.0
487
- */
488
- function footer() {
489
- ?>
490
- <div id="bp-media-footer"><p>Using <a title="BuddyPress Media adds photos, video and audio upload/management feature" href="http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media">BuddyPress Media</a>.</p></div>
491
- <?php
492
- }
493
-
494
- function upload_enqueue() {
495
- if (is_user_logged_in()) {
496
- if (bp_is_activity_component() || bp_is_group_home()) {
497
- $params = array(
498
- 'url' => BP_MEDIA_URL . 'app/main/includes/bp-media-upload-handler.php',
499
- 'runtimes' => 'gears,html5,flash,silverlight,browserplus',
500
- 'browse_button' => 'bp-media-activity-upload-browse-button',
501
- 'container' => 'bp-media-activity-upload-ui',
502
- 'drop_element' => 'drag-drop-area',
503
- 'filters' => apply_filters('bp_media_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => "mp4,jpg,png,jpeg,gif,mp3"))),
504
- 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))),
505
- 'multipart' => true,
506
- 'urlstream_upload' => true,
507
- 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
508
- 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
509
- 'file_data_name' => 'bp_media_file', // key passed to $_FILE.
510
- 'multi_selection' => true,
511
- 'multipart_params' => apply_filters('bp_media_multipart_params_filter', array('action' => 'wp_handle_upload'))
512
- );
513
- wp_enqueue_script('bp-media-activity-uploader', BP_MEDIA_URL . 'app/assets/js/bp-media-activity-uploader.js', array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4', 'plupload-handlers'), BP_MEDIA_VERSION, true);
514
- wp_localize_script('bp-media-activity-uploader', 'bp_media_uploader_params', $params);
515
- wp_localize_script('bp-media-activity-uploader', 'activity_ajax_url', admin_url('admin-ajax.php'));
516
- if (bp_is_active('groups') && bp_get_current_group_id())
517
- $default_album = (string) $this->default_group_album();
518
- else
519
- $default_album = (string) $this->default_user_album();
520
- wp_localize_script('bp-media-activity-uploader', 'default_album', $default_album ? $default_album : '0');
521
- } elseif (in_array(bp_current_action(), array(BP_MEDIA_IMAGES_SLUG, BP_MEDIA_VIDEOS_SLUG, BP_MEDIA_AUDIO_SLUG, BP_MEDIA_SLUG, BP_MEDIA_ALBUMS_SLUG))) {
522
- $params = array(
523
- 'url' => BP_MEDIA_URL . 'app/main/includes/bp-media-upload-handler.php',
524
- 'runtimes' => 'gears,html5,flash,silverlight,browserplus',
525
- 'browse_button' => 'bp-media-upload-browse-button',
526
- 'container' => 'bp-media-upload-ui',
527
- 'drop_element' => 'drag-drop-area',
528
- 'filters' => apply_filters('bp_media_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => "mp4,jpg,png,jpeg,gif,mp3"))),
529
- 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))),
530
- 'multipart' => true,
531
- 'urlstream_upload' => true,
532
- 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
533
- 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
534
- 'file_data_name' => 'bp_media_file', // key passed to $_FILE.
535
- 'multi_selection' => true,
536
- 'multipart_params' => apply_filters('bp_media_multipart_params_filter', array('action' => 'wp_handle_upload'))
537
- );
538
- wp_enqueue_script('bp-media-uploader', BP_MEDIA_URL . 'app/assets/js/bp-media-uploader.js', array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4', 'plupload-handlers'), BP_MEDIA_VERSION, true);
539
- wp_localize_script('bp-media-uploader', 'bp_media_uploader_params', $params);
540
- $bp_media_uploader_strings = array(
541
- 'no_name' => __('You have not filled the album name', 'buddypress-media'),
542
- 'cant_upload_group_album' => __('Sorry you cannot create albums in this group', 'buddypress-media'),
543
- 'select_album' => __('Please Select an Album!', 'buddypress-media')
544
- );
545
- wp_localize_script('bp-media-uploader', 'bp_media_uploader_strings', $bp_media_uploader_strings);
546
- }
547
- }
548
- wp_enqueue_style('bp-media-default', BP_MEDIA_URL . 'app/assets/css/main.css', '', BP_MEDIA_VERSION);
549
- }
550
-
551
- //This is used only on the uploads page so its added as action in the screens function of upload page.
552
-
553
- /**
554
- * Called on bp_init by screen functions
555
- *
556
- * @uses global $bp, $bp_media_albums_query
557
- *
558
- * @since BuddyPress Media 2.2
559
- */
560
-
561
- /**
562
- *
563
- * @global type $bp
564
- * @global WP_Query $bp_media_albums_query
565
- */
566
- function albums_set_query() {
567
- global $bp, $bp_media_albums_query;
568
- if (isset($bp->action_variables) && is_array($bp->action_variables) && isset($bp->action_variables[0]) && $bp->action_variables[0] == 'page' && isset($bp->action_variables[1]) && is_numeric($bp->action_variables[1])) {
569
- $paged = $bp->action_variables[1];
570
- } else {
571
- $paged = 1;
572
- }
573
- if ($bp->current_action == BP_MEDIA_ALBUMS_SLUG) {
574
- $args = array(
575
- 'post_type' => 'bp_media_album',
576
- 'author' => $bp->displayed_user->id,
577
- 'paged' => $paged,
578
- 'meta_key' => 'bp-media-key',
579
- 'meta_value' => $bp->displayed_user->id,
580
- 'meta_compare' => '='
581
- );
582
- $bp_media_albums_query = new WP_Query($args);
583
- }
584
- }
585
-
586
- function filter_entries() {
587
- global $bp_media;
588
- $enabled = $bp_media->enabled();
589
- if (isset($enabled['upload']))
590
- unset($enabled['upload']);
591
- if (isset($enabled['album']))
592
- unset($enabled['album']);
593
- foreach ($enabled as $type => $active) {
594
- if ($active == true) {
595
- $filters[] = $type;
596
- }
597
- }
598
-
599
- if (count($filters) == 1)
600
- $filters = $filters[0];
601
- return $filters;
602
- }
603
-
604
- /**
605
- * Function to return the media for the ajax requests
606
- */
607
-
608
- /**
609
- *
610
- * @global type $bp
611
- * @global WP_Query $bp_media_query
612
- * @global type $bp_media_posts_per_page
613
- */
614
- function load_more() {
615
- global $bp, $bp_media_query, $bp_media, $bp_media_albums_query;
616
- $page = isset($_GET['page']) ? $_GET['page'] : die();
617
- $current_action = isset($_GET['current_action']) ? $_GET['current_action'] : null;
618
- $action_variables = isset($_GET['action_variables']) ? $_GET['action_variables'] : null;
619
- $displayed_user = isset($_GET['displayed_user']) ? $_GET['displayed_user'] : null;
620
- $loggedin_user = isset($_GET['loggedin_user']) ? $_GET['loggedin_user'] : null;
621
- $current_group = isset($_GET['current_group']) ? $_GET['current_group'] : null;
622
- $move = isset($_GET['move']) ? $_GET['move'] : null;
623
- $album_id = isset($_GET['album_id']) ? $_GET['album_id'] : false;
624
- if ($current_group && isset($action_variables[1])) {
625
- $type_var = 'list';
626
- } elseif ((isset($action_variables[0]) && $action_variables[0])) {
627
- $type_var = $action_variables[0];
628
- } else {
629
- $type_var = $current_action;
630
- }
631
-
632
- if ($current_action == 'albums') {
633
- if (isset($action_variables[1])) {
634
- $album_id = $action_variables[1];
635
- }
636
- }
637
-
638
- if ((!$displayed_user || intval($displayed_user) == 0) && (!$current_group || intval($current_group) == 0)) {
639
- die();
640
- }
641
- switch ($type_var) {
642
- case BP_MEDIA_IMAGES_SLUG:
643
- $type = 'image';
644
- break;
645
- case BP_MEDIA_AUDIO_SLUG:
646
- $type = 'audio';
647
- break;
648
- case BP_MEDIA_VIDEOS_SLUG:
649
- $type = 'video';
650
- break;
651
- case BP_MEDIA_ALBUMS_SLUG:
652
- $type = 'album';
653
- break;
654
- default :
655
- $type = null;
656
- }
657
-
658
- $query = new BPMediaQuery();
659
- $args = $query->init($type, $album_id, false, $page);
660
- if ($type == 'album') {
661
- $bp_media_albums_query = new WP_Query($args);
662
- if (isset($bp_media_albums_query->posts) && is_array($bp_media_albums_query->posts) && count($bp_media_albums_query->posts)) {
663
- foreach ($bp_media_albums_query->posts as $attachment) {
664
- try {
665
- $media = new BPMediaAlbum($attachment->ID);
666
- echo $media->get_album_gallery_content($move);
667
- } catch (exception $e) {
668
- die();
669
- }
670
- }
671
- }
672
- } else {
673
- $bp_media_query = new WP_Query($args);
674
- if (isset($bp_media_query->posts) && is_array($bp_media_query->posts) && count($bp_media_query->posts)) {
675
- foreach ($bp_media_query->posts as $attachment) {
676
- try {
677
- $media = new BPMediaHostWordpress($attachment->ID);
678
- echo $media->get_media_gallery_content($move);
679
- } catch (exception $e) {
680
- die();
681
- }
682
- }
683
- }
684
- }
685
- die();
686
- }
687
-
688
- function load_more_sc() {
689
- global $bp, $bp_media_query, $bp_media, $bp_media_albums_query;
690
- $page = isset($_GET['page']) ? $_GET['page'] : die();
691
- $type = isset($_GET['media']) ? $_GET['media'] : 'all';
692
- $count = isset($_GET['count']) ? $_GET['count'] : 1;
693
-
694
- $value = 0;
695
- if (is_user_logged_in()) {
696
- $value = 2;
697
- }
698
- $privacy_query = array(
699
- array(
700
- 'key' => 'bp_media_privacy',
701
- 'value' => $value,
702
- 'compare' => '<='
703
- )
704
- );
705
-
706
- $args = array(
707
- 'paged' => $page,
708
- 'post_type' => 'attachment',
709
- 'post_status' => 'any',
710
- 'meta_query' => $privacy_query,
711
- 'posts_per_page' => $count
712
- );
713
- if ($type != 'all')
714
- $args['post_mime_type'] = $type;
715
- $bp_media_widget_query = new WP_Query($args);
716
- if ($bp_media_widget_query->have_posts()) {
717
- while ($bp_media_widget_query->have_posts()) {
718
- $bp_media_widget_query->the_post();
719
- try {
720
- $entry = new BPMediaHostWordpress(get_the_ID());
721
- echo $entry->get_media_gallery_content();
722
- } catch (Exception $e) {
723
- echo '<li>';
724
- echo $e->getMessage();
725
- echo '<h3><a>Private</h3>';
726
- echo '</li>';
727
- }
728
- }
729
- }
730
-
731
- die();
732
- }
733
-
734
- function move_selected_media() {
735
- $media = isset($_POST['media']) ? $_POST['media'] : array();
736
- $parent = isset($_POST['parent']) ? $_POST['parent'] : 0;
737
- if (!empty($media)) {
738
- foreach ($media as $item) {
739
- $post['ID'] = $item;
740
- $post['post_parent'] = $parent;
741
- wp_update_post($post);
742
- }
743
- echo true;
744
- }
745
- die();
746
- }
747
-
748
- function delete_selected_media() {
749
- $media = isset($_POST['media']) ? $_POST['media'] : array();
750
- if (!empty($media)) {
751
- foreach ($media as $item) {
752
- $delete_handler = new BPMediaHostWordpress($item);
753
- $delete_handler->delete_media();
754
- }
755
- echo true;
756
- }
757
- die();
758
- }
759
-
760
- function merge_album() {
761
- $to = isset($_POST['to']) ? $_POST['to'] : null;
762
- $from = isset($_POST['from']) ? $_POST['from'] : null;
763
- $delete = isset($_POST['delete_album']) ? $_POST['delete_album'] : null;
764
- if ($to && $from) {
765
- global $wpdb;
766
- $results = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent = $from");
767
- if ($results) {
768
- foreach ($results as $media) {
769
- $post['ID'] = $media->ID;
770
- $post['post_parent'] = $to;
771
- wp_update_post($post);
772
- }
773
- $activity_id = get_post_meta($from, 'bp_media_child_activity', true);
774
- if ($delete == 'true') {
775
- if (bp_is_active('activity')) {
776
- if ($activity_id) {
777
- bp_activity_delete_by_activity_id($activity_id);
778
- } else {
779
- $delete_handler = new BPMediaAlbum($from);
780
- $delete_handler->delete_album();
781
- }
782
- }
783
- echo 'redirect';
784
- die();
785
- } elseif ($activity_id) {
786
- BPMediaFunction::update_album_activity($from);
787
- }
788
- }
789
- echo true;
790
- }
791
- die();
792
- }
793
-
794
- /**
795
- *
796
- * @global type $bp_media_count
797
- * @param type $attachment_id
798
- * @return boolean
799
- */
800
- function delete_attachment_handler($attachment_id) {
801
- if (get_post_meta($attachment_id, 'bp-media-key')) {
802
- do_action('bp_media_before_delete_media', $attachment_id);
803
- global $bp_media_count;
804
- $attachment = get_post($attachment_id);
805
- preg_match_all('/audio|video|image/i', $attachment->post_mime_type, $result);
806
- if (isset($result[0][0]))
807
- $type = $result[0][0];
808
- else
809
- return false;
810
- BPMediaActions::init_count($attachment->post_author);
811
- switch ($type) {
812
- case 'image':
813
- $images = intval($bp_media_count['images']) ? intval($bp_media_count['images']) : 0;
814
- $bp_media_count['images'] = $images - 1;
815
- break;
816
- case 'audio':
817
- $bp_media_count['audio'] = intval($bp_media_count['audio']) - 1;
818
- break;
819
- case 'video':
820
- $bp_media_count['videos'] = intval($bp_media_count['videos']) - 1;
821
- break;
822
- default:
823
- return false;
824
- }
825
- bp_update_user_meta($attachment->post_author, 'bp_media_count', $bp_media_count);
826
- do_action('bp_media_after_delete_media', $attachment_id);
827
- return true;
828
- }
829
- }
830
-
831
- /**
832
- * Function to create new album called via ajax request
833
- */
834
- function add_album() {
835
- if (isset($_POST['bp_media_album_name']) && $_POST['bp_media_album_name'] != '') {
836
- $album = new BPMediaAlbum();
837
- if (isset($_POST['bp_media_group_id']) && intval($_POST['bp_media_group_id']) > 0) {
838
- $group_id = intval($_POST['bp_media_group_id']);
839
- if (BPMediaGroupLoader::user_can_create_album($group_id, get_current_user_id())) {
840
- try {
841
- $album->add_album($_POST['bp_media_album_name'], 0, $group_id);
842
- echo $album->get_id();
843
- } catch (exception $e) {
844
- echo '0';
845
- }
846
- } else {
847
- echo '0';
848
- }
849
- } else {
850
- try {
851
- $album->add_album($_POST['bp_media_album_name']);
852
- echo $album->get_id();
853
- } catch (exception $e) {
854
- echo '0';
855
- }
856
- }
857
- } else {
858
- echo '0';
859
- }
860
- die();
861
- }
862
-
863
- function add_new_from_activity() {
864
- BPMediaTemplateFunctions::show_upload_form_multiple_activity();
865
- }
866
-
867
- //add_action('bp_after_activity_post_form','add_new_from_activity');
868
-
869
- /**
870
- *
871
- * @param type $album
872
- */
873
- function album_create_activity($album) {
874
- /* @var $album BP_Media_Album */
875
- global $bp;
876
- $album_info = new BPMediaHostWordpress($album->get_id());
877
- if ($album_info->get_group_id() > 0 && bp_is_active('groups')) {
878
- $component = $bp->groups->id;
879
- $item_id = $album_info->get_group_id();
880
- } else {
881
- $component = $bp->activity->id;
882
- $item_id = 0;
883
- }
884
-
885
- $args = array(
886
- 'action' => apply_filters('bp_media_album_created', sprintf(__('%1$s created an album %2$s', 'buddypress-media'), bp_core_get_userlink($album->get_owner()), '<a href="' . $album->get_url() . '">' . $album->get_title() . '</a>')),
887
- 'component' => $component,
888
- 'type' => 'activity_update',
889
- 'primary_link' => $album->get_url(),
890
- 'user_id' => $album->get_owner(),
891
- 'item_id' => $item_id
892
- );
893
- $activity_id = BPMediaFunction::record_activity($args);
894
- update_post_meta($album->get_id(), 'bp_media_child_activity', $activity_id);
895
- }
896
-
897
- /**
898
- *
899
- * @param type $album_id
900
- */
901
- function album_activity_update($album_id) {
902
- BPMediaFunction::update_album_activity($album_id);
903
- }
904
-
905
- /**
906
- *
907
- * @param type $media_id
908
- */
909
- function album_activity_sync($media_id) {
910
- if (!bp_is_active('activity'))
911
- return;
912
- $album_id = wp_get_post_parent_id($media_id);
913
- BPMediaFunction::update_album_activity($album_id, false, $media_id);
914
- }
915
-
916
- /**
917
- *
918
- * @param BPMediaHostWordpress $media
919
- * @param type $hidden
920
- * @return boolean
921
- */
922
- static function activity_create_after_add_media($media, $hidden = false, $activity = false, $group = false) {
923
- global $bp;
924
- if (function_exists('bp_activity_add')) {
925
- $update_activity_id = false;
926
- if (!is_object($media)) {
927
- try {
928
- $media = new BPMediaHostWordpress($media);
929
- } catch (exception $e) {
930
- return false;
931
- }
932
- }
933
- $activity_content = $media->get_media_activity_content();
934
- $args = array(
935
- 'action' => apply_filters('bp_media_added_media', sprintf(__('%1$s added a %2$s', 'buddypress-media'), bp_core_get_userlink($media->get_author()), '<a href="' . $media->get_url() . '">' . $media->get_media_activity_type() . '</a>')),
936
- 'content' => $activity_content,
937
- 'primary_link' => $media->get_url(),
938
- 'item_id' => $media->get_id(),
939
- 'type' => 'activity_update',
940
- 'user_id' => $media->get_author()
941
- );
942
-
943
- $hidden = apply_filters('bp_media_force_hide_activity', $hidden);
944
-
945
- if ($activity || $hidden) {
946
- $args['secondary_item_id'] = -999;
947
- } else {
948
- $update_activity_id = get_post_meta($media->get_id(), 'bp_media_child_activity', true);
949
- if ($update_activity_id) {
950
- $args['id'] = $update_activity_id;
951
- $args['secondary_item_id'] = false;
952
- }
953
- }
954
-
955
- if ($hidden && !$activity) {
956
- do_action('bp_media_album_updated', $media->get_album_id());
957
- }
958
-
959
- if ($group) {
960
- $group_info = groups_get_group(array('group_id' => $group));
961
- $args['component'] = $bp->groups->id;
962
- $args['item_id'] = $group;
963
- if ('public' != $group_info->status) {
964
- $args['hide_sitewide'] = 1;
965
- }
966
- }
967
-
968
- $activity_id = BPMediaFunction::record_activity($args);
969
-
970
- if ($group)
971
- bp_activity_update_meta($activity_id, 'group_id', $group);
972
-
973
- if (!$update_activity_id)
974
- add_post_meta($media->get_id(), 'bp_media_child_activity', $activity_id);
975
- }
976
- }
977
-
978
- public function set_album_cover() {
979
- $id = $_GET['post_id'];
980
- $album_id = $_GET['album_id'];
981
- $album_cover = get_post_thumbnail_id($album_id);
982
- $text = NULL;
983
- if ($album_cover && ($album_cover == $id)) {
984
- delete_post_thumbnail($album_id);
985
- $text = __('Set as Album Cover', 'buddypress-media');
986
- } else {
987
- set_post_thumbnail($album_id, $id);
988
- $text = __('Unset as Album Cover', 'buddypress-media');
989
- }
990
- echo $text;
991
- die;
992
- }
993
-
994
- public function default_user_album() {
995
- $album_id = 0;
996
- if (is_user_logged_in()) {
997
- $current_user_id = get_current_user_id();
998
- $album_id = get_user_meta($current_user_id, 'bp-media-default-album', true);
999
- if (!$album_id) {
1000
- $query = new WP_Query(array('post_type' => 'bp_media_album', 'author' => $current_user_id, 'order' => 'ASC', 'posts_per_page' => 1));
1001
- wp_reset_postdata();
1002
- if (isset($query->posts) && isset($query->posts[0])) {
1003
- $album_id = $query->posts[0]->ID;
1004
- }
1005
- if ($album_id) {
1006
- update_user_meta($current_user_id, 'bp-media-default-album', $album_id);
1007
- }
1008
- } else {
1009
- global $wpdb;
1010
- $exists = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE ID = $album_id");
1011
- if (!$exists) {
1012
- $bpm_host_wp = new BPMediaHostWordpress();
1013
- $album_id = $bpm_host_wp->check_and_create_album(0, 0, $current_user_id);
1014
- update_user_meta($current_user_id, 'bp-media-default-album', $album_id);
1015
- }
1016
- }
1017
- return $album_id;
1018
- }
1019
- }
1020
-
1021
- public function default_group_album() {
1022
- $album_id = 0;
1023
- if (bp_is_active('groups')) {
1024
- if ($group_id = bp_get_current_group_id()) {
1025
- $album_id = groups_get_groupmeta($group_id, 'bp_media_default_album');
1026
- if (!$album_id) {
1027
- $args = array(
1028
- 'post_type' => 'bp_media_album',
1029
- 'posts_per_page' => 1,
1030
- 'meta_key' => 'bp-media-key',
1031
- 'meta_value' => -$group_id,
1032
- 'meta_compare' => '=',
1033
- 'order' => 'ASC'
1034
- );
1035
- $query = new WP_Query($args);
1036
- wp_reset_postdata();
1037
- if (isset($query->posts) && isset($query->posts[0])) {
1038
- $album_id = $query->posts[0]->ID;
1039
- }
1040
- if ($album_id) {
1041
- groups_update_groupmeta($group_id, 'bp_media_default_album', $album_id);
1042
- }
1043
- } else {
1044
- global $wpdb;
1045
- $exists = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE ID = $album_id");
1046
- if (!$exists) {
1047
- $bp_album = new BPMediaHostWordpress();
1048
- $album_id = $bp_album->check_and_create_album(0, bp_get_current_group_id());
1049
- groups_update_groupmeta($group_id, 'bp_media_default_album', $album_id);
1050
- }
1051
- }
1052
- }
1053
- }
1054
- return $album_id;
1055
- }
1056
-
1057
- function group_create_default_album() {
1058
- $bp_album = new BPMediaHostWordpress();
1059
- $bp_album->check_and_create_album(0, bp_get_new_group_id());
1060
- }
1061
-
1062
- function filter_image_sizes_details($sizes) {
1063
- if (isset($_REQUEST['post_id'])) {
1064
- $sizes = $this->unset_bp_media_image_sizes_details($sizes);
1065
- } elseif (isset($_REQUEST['id'])) { //For Regenerate Thumbnails Plugin
1066
- if ($parent_id = get_post_field('post_parent', $_REQUEST['id'])) {
1067
- $post_type = get_post_field('post_type', $parent_id);
1068
- if ($post_type == 'bp_media_album') {
1069
- global $bp_media;
1070
- $bp_media_sizes = $bp_media->media_sizes();
1071
- $sizes = array(
1072
- 'bp_media_thumbnail' => $bp_media_sizes['image']['thumbnail'],
1073
- 'bp_media_activity_image' => $bp_media_sizes['image']['medium'],
1074
- 'bp_media_single_image' => $bp_media_sizes['image']['large']
1075
- );
1076
- } else {
1077
- $sizes = $this->unset_bp_media_image_sizes_details($sizes);
1078
- }
1079
- } else {
1080
- $sizes = $this->unset_bp_media_image_sizes_details($sizes);
1081
- }
1082
- }
1083
-
1084
- return $sizes;
1085
- }
1086
-
1087
- function filter_image_sizes($sizes) {
1088
- if (isset($_REQUEST['postid'])) { //For Regenerate Thumbnails Plugin
1089
- if ($parent_id = get_post_field('post_parent', $_REQUEST['postid'])) {
1090
- $post_type = get_post_field('post_type', $parent_id);
1091
- if ($post_type == 'bp_media_album') {
1092
- $sizes = array(
1093
- 'bp_media_thumbnail', 'bp_media_activity_image', 'bp_media_single_image'
1094
- );
1095
- } else {
1096
- $sizes = $this->unset_bp_media_image_sizes($sizes);
1097
- }
1098
- } else {
1099
- $sizes = $this->unset_bp_media_image_sizes($sizes);
1100
- }
1101
- }
1102
-
1103
- return $sizes;
1104
- }
1105
-
1106
- function unset_bp_media_image_sizes_details($sizes) {
1107
- if (isset($sizes['bp_media_thumbnail']))
1108
- unset($sizes['bp_media_thumbnail']);
1109
- if (isset($sizes['bp_media_activity_image']))
1110
- unset($sizes['bp_media_activity_image']);
1111
- if (isset($sizes['bp_media_single_image']))
1112
- unset($sizes['bp_media_single_image']);
1113
- return $sizes;
1114
- }
1115
-
1116
- function unset_bp_media_image_sizes($sizes) {
1117
- if (($key = array_search('bp_media_thumbnail', $sizes)) !== false)
1118
- unset($sizes[$key]);
1119
- if (($key = array_search('bp_media_activity_image', $sizes)) !== false)
1120
- unset($sizes[$key]);
1121
- if (($key = array_search('bp_media_single_image', $sizes)) !== false)
1122
- unset($sizes[$key]);
1123
- return $sizes;
1124
- }
1125
-
1126
- function bpmedia_shortcode($atts) {
1127
- global $bp_media;
1128
- extract(shortcode_atts(array(
1129
- 'type' => 'all',
1130
- 'count' => $bp_media->options['default_count'] ? $bp_media->options['default_count'] : 10,
1131
- 'loadmore' => true
1132
- ), $atts));
1133
- $value = 0;
1134
- if (is_user_logged_in()) {
1135
- $value = 2;
1136
- }
1137
- $privacy_query = array(
1138
- array(
1139
- 'key' => 'bp_media_privacy',
1140
- 'value' => $value,
1141
- 'compare' => '<='
1142
- )
1143
- );
1144
-
1145
-
1146
- $args = array(
1147
- 'post_type' => 'attachment',
1148
- 'post_type' => 'attachment',
1149
- 'post_status' => 'any',
1150
- 'meta_query' => $privacy_query,
1151
- 'posts_per_page' => $count
1152
- );
1153
-
1154
- if ($count != -1) {
1155
- $paged = get_query_var('paged') ? get_query_var('paged') : 1;
1156
- $args['paged'] = $paged;
1157
- }
1158
-
1159
-
1160
- $type = str_replace(array('music', 'photos'), array('audio', 'image'), $type);
1161
-
1162
- if ($type != 'all')
1163
- $args['post_mime_type'] = $type;
1164
- $query = new WP_Query($args);
1165
- $markup = '';
1166
- if ($query->have_posts()) {
1167
- $markup .= '<div id="item-body" class="bp-media-sc-list">';
1168
- $markup .= '<ul class="bp-media-gallery item-list">';
1169
- while ($query->have_posts()) {
1170
- $query->the_post();
1171
- try {
1172
- $entry = new BPMediaHostWordpress(get_the_ID());
1173
- $markup .= $entry->get_media_gallery_content(false, false);
1174
- } catch (Exception $e) {
1175
- $markup .= '<li>';
1176
- $markup .= $e->getMessage();
1177
- $markup .= '<h3>' . __('Private', 'buddypress-media') . '</h3>';
1178
- $markup .= '</li>';
1179
- }
1180
- }
1181
-
1182
- $markup .= '</ul>';
1183
- $markup .= '</div>';
1184
- $loadmore = strtolower($loadmore);
1185
- if ($loadmore != 'false' && $loadmore != '0' && $loadmore != 'no' && $count != -1) {
1186
- $markup .= '<div class="bp-media-actions"><button data-media="' . $type . '" data-count="' . $count . '" data-page="' . $paged . '" class="button" id="bp-media-show-more-sc">Show More</button></div>';
1187
- }
1188
- } else {
1189
- $markup .= __('No media found', 'buddypress-media');
1190
- }
1191
- wp_reset_query();
1192
- return $markup;
1193
- }
1194
-
1195
- public function activity_update($content, $user_id, $activity_id) {
1196
- $content = stripslashes($content);
1197
- $activity_json = json_decode($content, true);
1198
- $activity_media = json_decode($activity_json['media'], true);
1199
- if (isset($activity_media)) {
1200
- if (!is_array($activity_media)) {
1201
- $activity_media[] = $activity_media;
1202
- }
1203
- $media_ids = null;
1204
- foreach ($activity_media as $media_id) {
1205
- update_post_meta($media_id, 'bp-media-activity-upload-id', $activity_id);
1206
- }
1207
- }
1208
- }
1209
-
1210
- }
1211
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/includes/BPMediaDownload.php DELETED
@@ -1,68 +0,0 @@
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 BPMediaDownload
10
- *
11
- * @author saurabh
12
- */
13
- class BPMediaDownload {
14
-
15
- /**
16
- *
17
- */
18
- function __construct() {
19
- add_action('wp_ajax_bp_media_download', array($this,'download_now'));
20
- add_action('wp_ajax_no_priv_bp_media_download', array($this,'download_now'));
21
- }
22
-
23
- function force_download($file) {
24
- if ( file_exists( $file ) ) {
25
- header( 'Content-Description: File Transfer' );
26
- header( 'Content-Type: application/octet-stream' );
27
- header( 'Content-Disposition: attachment; filename=' . basename( $file ) );
28
- header( 'Content-Transfer-Encoding: binary' );
29
- header( 'Expires: 0' );
30
- header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
31
- header( 'Pragma: public' );
32
- header( 'Content-Length: ' . filesize( $file ) );
33
- echo readfile( $file );
34
- exit;
35
- }
36
- return false;
37
- }
38
-
39
- function get_path_from_url($file){
40
- $upload_info = wp_upload_dir();
41
- if(empty($upload_info['error'])){
42
-
43
- $upload_base_path = $upload_info['basedir'];
44
- $upload_base_url = $upload_info['baseurl'];
45
- $file_path = str_replace($upload_base_url,$upload_base_path,$file);
46
-
47
- $path_info= pathinfo($file_path);
48
- if (in_array($path_info['extension'],array('gif','png','jpg','mp4','mp3'))){
49
- return $file_path;
50
- }
51
-
52
-
53
- }
54
- return false;
55
- }
56
-
57
- function download_now(){
58
- if ( isset( $_GET[ 'file' ] ) ) {
59
- $file = $_GET[ 'file' ];
60
- $file = $this->get_path_from_url($file);
61
- $this->force_download($file);
62
- die();
63
- }
64
- }
65
-
66
- }
67
-
68
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/includes/BPMediaFilters.php DELETED
@@ -1,517 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Description of BPMediaFilters
5
- *
6
- * @author faishal
7
- */
8
- class BPMediaFilters {
9
-
10
- /**
11
- *
12
- * @global array $bp_media_activity_types
13
- */
14
- function __construct() {
15
- add_filter('bp_activity_get_permalink', array($this, 'activity_permalink_filter'), 10, 2);
16
- add_filter('bp_get_activity_delete_link', array($this, 'delete_button_handler'));
17
- add_filter('bp_activity_get_user_join_filter', 'BPMediaFilters::activity_query_filter', 10);
18
- // and we hook our function via wp_before_admin_bar_render
19
- add_action('admin_bar_menu', array($this, 'my_account_menu'), 1);
20
-
21
- //WordPress Edit Image ( For applying edit image changes to custom sizes hack )
22
- global $bp_media;
23
- $media_sizes = $bp_media->media_sizes();
24
- $image_size = $media_sizes['image'];
25
- add_filter( 'pre_option_bp_media_thumbnail_size_w', create_function('','return '.$image_size['thumbnail']['width'].';') );
26
- add_filter( 'pre_option_bp_media_thumbnail_size_h', create_function('','return '. $image_size['thumbnail']['height'].';') );
27
- add_filter( 'pre_option_bp_media_thumbnail_crop', create_function('','return '. $image_size['thumbnail']['crop'].';') );
28
- add_filter( 'pre_option_bp_media_activity_image_size_w', create_function('','return '.$image_size['medium']['width'].';') );
29
- add_filter( 'pre_option_bp_media_activity_image_size_h', create_function('','return '. $image_size['medium']['height'].';') );
30
- add_filter( 'pre_option_bp_media_activity_image_crop', create_function('','return '. $image_size['medium']['crop'].';') );
31
- add_filter( 'pre_option_bp_media_single_image_size_w', create_function('','return '. $image_size['large']['width'].';') );
32
- add_filter( 'pre_option_bp_media_single_image_size_h', create_function('','return '. $image_size['large']['height'].';') );
33
- add_filter( 'pre_option_bp_media_single_image_crop', create_function('','return '. $image_size['large']['crop'].';') );
34
-
35
- // and we hook our function via wp_before_admin_bar_render
36
- global $bp_media;
37
- if (isset($bp_media->options['show_admin_menu']) && ($bp_media->options['show_admin_menu'] == true)) {
38
- add_action('wp_before_admin_bar_render', 'BPMediaFilters::adminbar_settings_menu');
39
- }
40
- global $bp_media_activity_types;
41
- $bp_media_activity_types = array('media_upload', 'album_updated', 'album_created');
42
- }
43
-
44
- /**
45
- *
46
- * @global array $bp_media_activity_types
47
- * @global type $activities_template
48
- * @param type $link
49
- * @param type $activity_obj
50
- * @return type
51
- */
52
- function activity_permalink_filter($link, $activity_obj = null) {
53
- global $bp_media_activity_types;
54
- if ($activity_obj != null && in_array($activity_obj->type, $bp_media_activity_types)) {
55
- if ($activity_obj->primary_link != '') {
56
- try {
57
- return $activity_obj->primary_link;
58
- } catch (Exception $e) {
59
- return $link;
60
- }
61
- }
62
- }
63
- if ($activity_obj != null && 'activity_comment' == $activity_obj->type) {
64
- global $activities_template;
65
- remove_filter('bp_activity_get_user_join_filter', array($this, 'activity_query_filter'), 10);
66
- $parent = $activity_obj->item_id;
67
- if ($parent) {
68
- try {
69
- if (isset($activities_template->activity_parents[$parent])) {
70
- return $activities_template->activity_parents[$parent]->primary_link;
71
- } else {
72
- $activities = bp_activity_get(array('in' => $parent));
73
- if (isset($activities['activities'][0])) {
74
- $activities_template->activity_parents[$parent] = $activities['activities'][0];
75
- return $activities['activities'][0]->primary_link;
76
- }
77
- }
78
- } catch (Exception $e) {
79
- return $link;
80
- }
81
- }
82
- }
83
- return $link;
84
- }
85
-
86
- /**
87
- *
88
- * @global type $activities_template
89
- * @param type $activity_content
90
- * @return boolean
91
- */
92
- function activity_parent_content_filter($activity_content) {
93
- global $activities_template;
94
- $defaults = array(
95
- 'hide_user' => false
96
- );
97
- if (!$parent_id = $activities_template->activity->item_id)
98
- return false;
99
- if (!isset($bp_media_hidden_activity_cache[$parent_id])) {
100
- $activities = bp_activity_get(array('in' => $parent_id));
101
- if (isset($activities['activities'][0])) {
102
- $bp_media_hidden_activity_cache[$parent_id] = $activities['activities'][0];
103
- }
104
- }
105
- if (empty($bp_media_hidden_activity_cache[$parent_id]))
106
- return false;
107
-
108
- if (empty($bp_media_hidden_activity_cache[$parent_id]->content))
109
- $content = $bp_media_hidden_activity_cache[$parent_id]->action;
110
- else
111
- $content = $bp_media_hidden_activity_cache[$parent_id]->action . ' ' . $bp_media_hidden_activity_cache[$parent_id]->content;
112
-
113
- // Remove the time since content for backwards compatibility
114
- $content = str_replace('<span class="time-since">%s</span>', '', $content);
115
-
116
- // Remove images
117
- $content = preg_replace('/<img[^>]*>/Ui', '', $content);
118
-
119
- return $content;
120
- return $activity_content;
121
- }
122
-
123
- //add_filter('bp_get_activity_parent_content', 'activity_parent_content_filter', 1);
124
- /**
125
- *
126
- * @global type $activities_template
127
- * @param type $link
128
- * @return type
129
- */
130
- function delete_button_handler($link) {
131
- global $activities_template;
132
- $media_label = NULL;
133
- $link = str_replace('delete-activity ', 'delete-activity-single ', $link);
134
- $activity_type = bp_get_activity_type();
135
- $activity_id = bp_get_activity_id();
136
- $activity_item_id = bp_get_activity_item_id();
137
-
138
- if ('album_updated' == $activity_type) {
139
- $media_label = BP_MEDIA_ALBUMS_LABEL_SINGULAR;
140
- } elseif ($activity_id) {
141
- $query = new WP_Query(array('post_type' => 'attachment', 'post_status' => 'inherit', 'id' => $activity_item_id, 'meta_key' => 'bp_media_child_activity', 'meta_value' => "$activity_id"));
142
- wp_reset_postdata();
143
- wp_reset_query();
144
- if ($query->found_posts) {
145
- $mime_type = get_post_field('post_mime_type', bp_get_activity_item_id());
146
- $media_type = explode('/', $mime_type);
147
- switch ($media_type[0]) {
148
- case 'image': $media_label = BP_MEDIA_IMAGES_LABEL_SINGULAR;
149
- break;
150
- case 'audio': $media_label = BP_MEDIA_AUDIO_LABEL_SINGULAR;
151
- break;
152
- case 'video': $media_label = BP_MEDIA_VIDEOS_LABEL_SINGULAR;
153
- break;
154
- }
155
- }
156
- }
157
- if ($media_label)
158
- $link = str_replace('Delete', sprintf(__('Delete %s', 'buddypress-media'), $media_label), $link);
159
- return $link;
160
- }
161
-
162
- /**
163
- *
164
- * @global type $bp_media_count
165
- * @param type $title
166
- * @param type $nav_item
167
- * @return type
168
- */
169
- static function items_count_filter($title, $nav_item) {
170
- global $bp_media_count;
171
- $bp_media_count = wp_parse_args($bp_media_count, array(
172
- 'images' => 0,
173
- 'videos' => 0,
174
- 'audio' => 0,
175
- 'albums' => 0
176
- ));
177
- switch ($nav_item['slug']) {
178
- case BP_MEDIA_SLUG :
179
- $count = intval($bp_media_count['images']) + intval($bp_media_count['videos']) + intval($bp_media_count['audio']);
180
- break;
181
- case BP_MEDIA_IMAGES_SLUG:
182
- $count = intval($bp_media_count['images']);
183
- break;
184
- case BP_MEDIA_VIDEOS_SLUG:
185
- $count = intval($bp_media_count['videos']);
186
- break;
187
- case BP_MEDIA_AUDIO_SLUG:
188
- $count = intval($bp_media_count['audio']);
189
- break;
190
- case BP_MEDIA_ALBUMS_SLUG:
191
- $count = intval($bp_media_count['albums']);
192
- break;
193
- }
194
- $count_html = ' <span>' . $count . '</span>';
195
- return str_replace('</a>', $count_html . '</a>', $title);
196
- }
197
-
198
- /**
199
- * To hide some activities of multiple uploads
200
- */
201
-
202
- /**
203
- *
204
- * @global type $wpdb
205
- * @param type $query
206
- * @return type
207
- */
208
- static function activity_query_filter($query) {
209
- global $wpdb;
210
- $query = preg_replace('/WHERE/i', 'WHERE a.secondary_item_id!=-999 AND ', $query);
211
- return $query;
212
- }
213
-
214
- /**
215
- *
216
- * @global type $wpdb
217
- * @param type $query
218
- * @return type
219
- */
220
- static function group_activity_query_filter($query) {
221
- global $wpdb, $bp;
222
- $activity_meta_table = $bp->activity->table_name_meta;
223
- $query = preg_replace("/LEFT JOIN/i", "LEFT JOIN $activity_meta_table am ON a.id = am.activity_id LEFT JOIN", $query);
224
- $query = preg_replace("/a.component IN \( 'groups' \) AND a.item_id IN \((.*)\)/i", "( ( a.component IN ( 'groups' ) AND a.item_id IN ( $1 ) ) OR ( a.component IN ( 'media' ) AND am.meta_key = 'group_id' AND am.meta_value IN ( $1 ) ) )", $query);
225
- return $query;
226
- }
227
-
228
- /**
229
- * Added menu under buddypress menu 'my account' in admin bar
230
- *
231
- * @global type $wp_admin_bar
232
- */
233
-
234
- /**
235
- *
236
- * @global type $wp_admin_bar
237
- */
238
- function my_account_menu() {
239
- global $wp_admin_bar;
240
-
241
- $bp_media_admin_nav = array();
242
-
243
- // Added Main menu for BuddyPress Media
244
- $bp_media_admin_nav[] = array(
245
- 'parent' => 'my-account-buddypress',
246
- 'id' => 'my-account-bpmedia',
247
- 'title' => __('Media', 'buddypress-media'),
248
- 'href' => trailingslashit(bp_loggedin_user_domain() . BP_MEDIA_SLUG),
249
- 'meta' => array(
250
- 'class' => 'menupop')
251
- );
252
-
253
- // Uplaod Media
254
- /* $bp_media_admin_nav[] = array(
255
- 'parent' => 'my-account-bpmedia',
256
- 'id' => 'my-account-upload-media',
257
- 'title' => __('Upload Media','buddypress-media'),
258
- 'href' => trailingslashit(bp_loggedin_user_domain() . BP_MEDIA_SLUG),
259
- ); */
260
-
261
- // Photos
262
- $bp_media_admin_nav[] = array(
263
- 'parent' => 'my-account-bpmedia',
264
- 'id' => 'my-account-photos',
265
- 'title' => __('Photos', 'buddypress-media'),
266
- 'href' => trailingslashit(bp_loggedin_user_domain() . BP_MEDIA_IMAGES_SLUG)
267
- );
268
-
269
- // Video
270
- $bp_media_admin_nav[] = array(
271
- 'parent' => 'my-account-bpmedia',
272
- 'id' => 'my-account-videos',
273
- 'title' => __('Videos', 'buddypress-media'),
274
- 'href' => trailingslashit(bp_loggedin_user_domain() . BP_MEDIA_VIDEOS_SLUG)
275
- );
276
-
277
- // Audio
278
- $bp_media_admin_nav[] = array(
279
- 'parent' => 'my-account-bpmedia',
280
- 'id' => 'my-account-audio',
281
- 'title' => __('Audio', 'buddypress-media'),
282
- 'href' => trailingslashit(bp_loggedin_user_domain() . BP_MEDIA_AUDIO_SLUG)
283
- );
284
-
285
- // Albums
286
- $bp_media_admin_nav[] = array(
287
- 'parent' => 'my-account-bpmedia',
288
- 'id' => 'my-account-album',
289
- 'title' => __('Albums', 'buddypress-media'),
290
- 'href' => trailingslashit(bp_loggedin_user_domain() . BP_MEDIA_ALBUMS_SLUG)
291
- );
292
-
293
- foreach ($bp_media_admin_nav as $admin_menu)
294
- $wp_admin_bar->add_menu($admin_menu);
295
- }
296
-
297
- /**
298
- * Added menu under buddypress menu 'my account' in admin bar
299
- *
300
- * @global type $wp_admin_bar
301
- */
302
-
303
- /**
304
- *
305
- * @global type $wp_admin_bar
306
- */
307
- static function adminbar_settings_menu() {
308
- global $wp_admin_bar;
309
-
310
- if (current_user_can('manage_options') && is_super_admin()) {
311
-
312
- $bp_media_admin_nav = array();
313
- $title = '<span class="ab-icon"></span><span class="ab-label">' . _x('BuddyPress Media', 'admin bar menu group label') . '</span>';
314
-
315
- // Added Main menu for BuddyPress Media
316
- $bp_media_admin_nav[] = array(
317
- 'id' => 'bp-media-menu',
318
- 'title' => $title,
319
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
320
- 'meta' => array(
321
- 'class' => 'menupop bp-media-settings-menu')
322
- );
323
-
324
- // Settings
325
- $bp_media_admin_nav[] = array(
326
- 'parent' => 'bp-media-menu',
327
- 'id' => 'bp-media-settings',
328
- 'title' => __('Settings', 'buddypress-media'),
329
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php'))
330
- );
331
-
332
- // Addons
333
- $bp_media_admin_nav[] = array(
334
- 'parent' => 'bp-media-menu',
335
- 'id' => 'bp-media-addons',
336
- 'title' => __('Addons', 'buddypress-media'),
337
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php'))
338
- );
339
-
340
- // Support
341
- $bp_media_admin_nav[] = array(
342
- 'parent' => 'bp-media-menu',
343
- 'id' => 'bp-media-support',
344
- 'title' => __('Support', 'buddypress-media'),
345
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php'))
346
- );
347
-
348
- // Importer
349
- $bp_media_admin_nav[] = array(
350
- 'parent' => 'bp-media-menu',
351
- 'id' => 'bp-media-importer',
352
- 'title' => __('Importer', 'buddypress-media'),
353
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-importer'), 'admin.php'))
354
- );
355
-
356
- $bp_media_admin_nav = apply_filters('bp_media_add_admin_bar_item', $bp_media_admin_nav);
357
-
358
- foreach ($bp_media_admin_nav as $admin_menu)
359
- $wp_admin_bar->add_menu($admin_menu);
360
- }
361
- }
362
-
363
- /**
364
- * Set BuddyPress Media dashboard widget
365
- *
366
- */
367
- //add_action('wp_dashboard_setup','dashboard_widgets');
368
- /**
369
- *
370
- * @global array $wp_meta_boxes
371
- * @global array $wp_meta_boxes
372
- */
373
- function dashboard_widgets() {
374
- global $wp_meta_boxes;
375
- // BuddyPress Media
376
- // if ( is_user_admin() )
377
- wp_add_dashboard_widget('dashboard_media_widget', __('BuddyPress Media'), array($this, 'dashboard_media'));
378
-
379
- global $wp_meta_boxes;
380
-
381
- // Get the regular dashboard widgets array
382
- // (which has our new widget already but at the end)
383
-
384
- $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
385
-
386
- // Backup and delete our new dashbaord widget from the end of the array
387
-
388
- $example_widget_backup = array('dashboard_media_widget' => $normal_dashboard['dashboard_media_widget']);
389
- unset($normal_dashboard['dashboard_media_widget']);
390
-
391
- // Merge the two arrays together so our widget is at the beginning
392
-
393
- $sorted_dashboard = array_merge($example_widget_backup, $normal_dashboard);
394
-
395
- // Save the sorted array back into the original metaboxes
396
-
397
- $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
398
- }
399
-
400
- function dashboard_media() {
401
-
402
- /* Single user media counts */
403
- $photos_count = $this->admin_total_count('photo');
404
- $videos_count = $this->admin_total_count('video');
405
- $audio_count = $this->admin_total_count('audio');
406
- $albums_count = $this->admin_total_count('album');
407
-
408
- /* Group media counts */
409
- $g_photos_count = $this->group_total_count('photo');
410
- $g_videos_count = $this->group_total_count('video');
411
- $g_audio_count = $this->group_total_count('audio');
412
- $g_albums_count = $this->group_total_count('album');
413
- ?>
414
- <div class="bp-media-dashboard">
415
- <h3 class="sub"><?php _e('Users', 'buddypress-media'); ?> </h3>
416
- <div class="table table_user">
417
- <div class=""><span class="media-cnt"><?php echo $photos_count; ?></span><span class="media-label"><?php _e('Total Photos', 'buddypress-media'); ?></span></div>
418
- <div class=""><span class="media-cnt"><?php echo $videos_count; ?></span><span class="media-label"><?php _e('Total Videos', 'buddypress-media'); ?></span></div>
419
- <div class=""><span class="media-cnt"><?php echo $audio_count; ?></span><span class="media-label"><?php _e('Total Audio', 'buddypress-media'); ?></span></div>
420
- <div class=""><span class="media-cnt"><?php echo $albums_count; ?></span><span class="media-label"><?php _e('Total Albums', 'buddypress-media'); ?></span></div>
421
- </div><!-- .table_user -->
422
- <h3 class="sub"><?php _e('Groups', 'buddypress-media'); ?> </h3>
423
- <div class="table table_group">
424
-
425
- </div><!-- .table_group -->
426
- </div><!-- .bp-media-dashboard-->
427
-
428
- <?php
429
- }
430
-
431
- /**
432
- *
433
- * @param type $media_type
434
- * @return type
435
- */
436
- function admin_total_count($media_type) {
437
-
438
- switch ($media_type) {
439
- case 'photo':
440
- return $this->total_count_media('image');
441
-
442
- case 'video':
443
- return $this->total_count_media('video');
444
-
445
- case 'audio':
446
- return $this->total_count_media('audio');
447
-
448
- case 'album':
449
- return $this->total_count_albums();
450
- }
451
- }
452
-
453
- /**
454
- *
455
- * @param type $media_type
456
- * @return type
457
- */
458
- function group_total_count($media_type) {
459
-
460
- switch ($media_type) {
461
- case 'photo':
462
- return $this->total_count_media('image');
463
-
464
- case 'video':
465
- return $this->total_count_media('video');
466
-
467
- case 'audio':
468
- return $this->total_count_media('audio');
469
-
470
- case 'album':
471
- return $this->total_count_albums();
472
- }
473
- }
474
-
475
- /**
476
- *
477
- * @global type $wpdb
478
- * @param type $type
479
- * @return boolean
480
- */
481
- function total_count_media($type) {
482
- global $wpdb;
483
-
484
- $query = "SELECT COUNT(*) AS total
485
- FROM wp_posts RIGHT JOIN wp_postmeta on wp_postmeta.post_id = wp_posts.id
486
- WHERE wp_postmeta.meta_key = 'bp-media-key' AND wp_postmeta.meta_value > 0 AND ( wp_posts.post_mime_type LIKE '$type%')";
487
-
488
- $result = $wpdb->get_var(( $query));
489
-
490
- if (isset($result))
491
- return $result;
492
- else
493
- return false;
494
- }
495
-
496
- /**
497
- *
498
- * @global type $wpdb
499
- * @return boolean
500
- */
501
- function total_count_albums() {
502
- global $wpdb;
503
-
504
- $query = "SELECT COUNT(*) AS total
505
- FROM wp_posts RIGHT JOIN wp_postmeta on wp_postmeta.post_id = wp_posts.id
506
- WHERE wp_postmeta.meta_key = 'bp-media-key' AND wp_postmeta.meta_value < 0 ";
507
-
508
- $result = $wpdb->get_var(( $query));
509
-
510
- if (isset($result))
511
- return $result;
512
- else
513
- return false;
514
- }
515
-
516
- }
517
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main/includes/BPMediaFunction.php DELETED
@@ -1,277 +0,0 @@
1
- <?php
2
-
3
- /**
4
- *
5
- */
6
- class BPMediaFunction {
7
-
8
- function __construct() {
9
- add_filter('bp_get_activity_action', array($this, 'conditional_override_allowed_tags'), 1, 2);
10
- }
11
-
12
- /**
13
- *
14
- * @global type $bp
15
- * @param type $args
16
- * @return boolean
17
- */
18
- static function record_activity($args = '') {
19
- global $bp;
20
- if (!bp_is_active('activity'))
21
- return false;
22
- $defaults = array(
23
- 'component' => $bp->activity->id, // The name/ID of the component e.g. groups, profile, mycomponent
24
- );
25
- add_filter('bp_activity_allowed_tags', 'BPMediaFunction::override_allowed_tags');
26
- $r = wp_parse_args($args, $defaults);
27
- $activity_id = bp_activity_add($r);
28
- return $activity_id;
29
- }
30
-
31
- /**
32
- *
33
- * @param type $activity_allowedtags
34
- * @return array
35
- */
36
- static function override_allowed_tags($activity_allowedtags) {
37
- $activity_allowedtags['video'] = array();
38
- $activity_allowedtags['video']['id'] = array();
39
- $activity_allowedtags['video']['class'] = array();
40
- $activity_allowedtags['video']['src'] = array();
41
- $activity_allowedtags['video']['height'] = array();
42
- $activity_allowedtags['video']['width'] = array();
43
- $activity_allowedtags[