rtMedia for WordPress, BuddyPress and bbPress - Version 2.14

Version Description

  • Improves admin ui, preview of things to come.
  • Fixes some bugs.
  • Last release as BuddyPress Media. Now onwards, will be called rtMedia for WordPress, BuddyPress and bbPress.
Download this release

Release Info

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

Code changes from version 2.13.2 to 2.14

app/admin/BPMediaAdmin.php CHANGED
@@ -10,285 +10,376 @@
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'),9);
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
- $this->bp_media_encoding = new BPMediaEncoding();
53
- }
54
-
55
- /**
56
- * Generates the Admin UI.
57
- *
58
- * @param string $hook
59
- */
60
-
61
- /**
62
- *
63
- * @param type $hook
64
- */
65
- public function ui($hook) {
66
- $admin_ajax = admin_url('admin-ajax.php');
67
-
68
- wp_enqueue_script('bp-media-admin', BP_MEDIA_URL . 'app/assets/js/admin.js', array('jquery-ui-dialog'), BP_MEDIA_VERSION);
69
- wp_localize_script('bp-media-admin', 'bp_media_admin_ajax', $admin_ajax);
70
- wp_localize_script('bp-media-admin', 'bp_media_admin_url', admin_url());
71
- $bp_media_admin_strings = array(
72
- 'no_refresh' => __('Please do not refresh this page.', 'buddypress-media'),
73
- 'something_went_wrong' => __('Something went wronng. Please <a href onclick="location.reload();">refresh</a> page.', 'buddypress-media'),
74
- 'are_you_sure' => __('This will subscribe you to the free plan.', 'buddypress-media'),
75
- 'disable_encoding' => __('Are you sure you want to disable the encoding service? Make sure you note your api key before diabling it incase you want to activate it in future.', 'buddypress-media')
76
- );
77
- wp_localize_script('bp-media-admin', 'bp_media_admin_strings', $bp_media_admin_strings);
78
- wp_localize_script('bp-media-admin', 'settings_url', add_query_arg(
79
- array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
80
- ) . '#privacy_enabled');
81
- wp_localize_script('bp-media-admin', 'settings_bp_album_import_url', add_query_arg(
82
- array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
83
- ));
84
- wp_enqueue_style('bp-media-admin', BP_MEDIA_URL . 'app/assets/css/main.css', '', BP_MEDIA_VERSION);
85
- wp_enqueue_style('wp-jquery-ui-dialog');
86
- }
87
-
88
- /**
89
- * Admin Menu
90
- *
91
- * @global string 'buddypress-media'
92
- */
93
- public function menu() {
94
- global $wpdb;
95
- add_menu_page(__('BuddyPress Media Component', 'buddypress-media'), __('BuddyPress Media', 'buddypress-media'), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
96
- add_submenu_page('bp-media-settings', __('BuddyPress Media Settings', 'buddypress-media'), __('Settings', 'buddypress-media'), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
97
- add_submenu_page('bp-media-settings', __('BuddyPress Media Addons', 'buddypress-media'), __('Addons', 'buddypress-media'), 'manage_options', 'bp-media-addons', array($this, 'addons_page'));
98
- add_submenu_page('bp-media-settings', __('BuddyPress Media Support', 'buddypress-media'), __('Support ', 'buddypress-media'), 'manage_options', 'bp-media-support', array($this, 'support_page'));
99
- add_submenu_page('bp-media-settings', __('Importer', 'buddypress-media'), __('Importer', 'buddypress-media'), 'manage_options', 'bp-media-importer', array($this, 'bp_importer_page'));
100
- if (!BPMediaPrivacy::is_installed()) {
101
- 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'));
102
- }
103
- }
104
-
105
- /**
106
- * Render the BuddyPress Media Settings page
107
- */
108
- public function settings_page() {
109
- $this->render_page('bp-media-settings', 'bp_media');
110
- }
111
-
112
- public function privacy_page() {
113
- $this->render_page('bp-media-privacy');
114
- }
115
-
116
- public function bp_importer_page() {
117
- $this->render_page('bp-media-importer');
118
- }
119
-
120
- public function convert_videos_page() {
121
- $this->render_page('bp-media-convert-videos');
122
- }
123
-
124
- /**
125
- * Render the BuddyPress Media Addons page
126
- */
127
- public function addons_page() {
128
- $this->render_page('bp-media-addons');
129
- }
130
-
131
- /**
132
- * Render the BuddyPress Media Support page
133
- */
134
- public function support_page() {
135
- $this->render_page('bp-media-support');
136
- }
137
-
138
- /**
139
- *
140
- * @return type
141
- */
142
- static function get_current_tab() {
143
- return isset($_GET['page']) ? $_GET['page'] : "bp-media-settings";
144
- }
145
-
146
- /**
147
- * Render BPMedia Settings
148
- *
149
- * @global string 'buddypress-media'
150
- */
151
-
152
- /**
153
- *
154
- * @param type $page
155
- * @param type $option_group
156
- */
157
- public function render_page($page, $option_group = NULL) {
158
- ?>
159
-
160
- <div class="wrap bp-media-admin <?php echo $this->get_current_tab(); ?>">
161
- <div id="icon-buddypress" class="icon32"><br></div>
162
- <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs(__('Media', 'buddypress-media')); ?></h2>
163
- <?php settings_errors(); ?>
164
- <div class="columns-2">
165
- <h3 class="bp-media-settings-tabs"><?php
166
- $this->sub_tabs();
167
- ?>
168
- </h3>
169
-
170
- <div id="bp-media-settings-boxes">
171
- <?php
172
- $settings_url = ( is_multisite() ) ? network_admin_url('edit.php?action=' . $option_group) : 'options.php';
173
- ?>
174
- <?php if ($option_group) { ?>
175
- <form id="bp_media_settings_form" name="bp_media_settings_form" action="<?php echo $settings_url; ?>" method="post" enctype="multipart/form-data">
176
- <div class="bp-media-metabox-holder"><?php
177
- settings_fields($option_group);
178
- do_settings_sections($page);
179
- submit_button();
180
- ?><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>
181
- </div>
182
- </form><?php } else {
183
- ?>
184
- <div class="bp-media-metabox-holder"><?php do_settings_sections($page); ?>
185
- <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>
186
- </div><?php
187
- }
188
- ?>
189
-
190
-
191
- </div><!-- .bp-media-settings-boxes -->
192
- <div class="metabox-fixed metabox-holder alignright bp-media-metabox-holder">
193
- <?php $this->admin_sidebar(); ?>
194
- </div>
195
- </div><!-- .metabox-holder -->
196
- </div><!-- .bp-media-admin --><?php
197
- do_action('bp_media_admin_page_append', $page);
198
- }
199
-
200
- /**
201
- * Adds a tab for Media settings in the BuddyPress settings page
202
- *
203
- * @global type $bp_media
204
- */
205
- public function tab() {
206
-
207
- $tabs_html = '';
208
- $idle_class = 'nav-tab';
209
- $active_class = 'nav-tab nav-tab-active';
210
- $tabs = array();
211
212
// Check to see which tab we are on
213
- $tab = $this->get_current_tab();
214
- /* BuddyPress Media */
215
- $tabs[] = array(
216
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
217
- 'title' => __('BuddyPress Media', 'buddypress-media'),
218
- 'name' => __('BuddyPress Media', 'buddypress-media'),
219
- 'class' => ($tab == 'bp-media-settings' || $tab == 'bp-media-addons' || $tab == 'bp-media-support') ? $active_class : $idle_class
220
- );
221
-
222
-
223
- foreach ($tabs as $tab) {
224
- $tabs_html.= '<a id="bp-media" title= "' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . '">' . $tab['name'] . '</a>';
225
- }
226
- echo $tabs_html;
227
- }
228
-
229
- /**
230
- * Adds a sub tabs to the BuddyPress Media settings page
231
- *
232
- * @global type $bp_media
233
- */
234
- public function sub_tabs() {
235
- $tabs_html = '';
236
- $idle_class = 'nav-tab';
237
- $active_class = 'nav-tab nav-tab-active';
238
- $tabs = array();
239
-
240
- // Check to see which tab we are on
241
- $tab = $this->get_current_tab();
242
- /* BuddyPress Media */
243
- $tabs[] = array(
244
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
245
- 'title' => __('BuddyPress Media Settings', 'buddypress-media'),
246
- 'name' => __('Settings', 'buddypress-media'),
247
- 'class' => ($tab == 'bp-media-settings') ? $active_class : $idle_class . ' first_tab'
248
- );
249
-
250
- $tabs[] = array(
251
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php')),
252
- 'title' => __('BuddyPress Media Addons', 'buddypress-media'),
253
- 'name' => __('Addons', 'buddypress-media'),
254
- 'class' => ($tab == 'bp-media-addons') ? $active_class : $idle_class
255
- );
256
-
257
- $tabs[] = array(
258
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php')),
259
- 'title' => __('BuddyPress Media Support', 'buddypress-media'),
260
- 'name' => __('Support', 'buddypress-media'),
261
- 'class' => ($tab == 'bp-media-support') ? $active_class : $idle_class . ' last_tab'
262
- );
263
-
264
- $tabs[] = array(
265
- 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-importer'), 'admin.php')),
266
- 'title' => __('Importer', 'buddypress-media'),
267
- 'name' => __('Importer', 'buddypress-media'),
268
- 'class' => ($tab == 'bp-media-importer') ? $active_class : $idle_class
269
- );
270
-
271
- $tabs = apply_filters('bp_media_add_sub_tabs', $tabs, $tab);
272
- foreach ($tabs as $tab) {
273
- $tabs_html.= '<a title="' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . ' ' . sanitize_title($tab['name']) . '">' . $tab['name'] . '</a>';
274
- }
275
- echo $tabs_html;
276
- }
277
-
278
- /*
279
- * Updates the media count of all users.
280
- */
281
-
282
- /**
283
- *
284
- * @global type $wpdb
285
- * @return boolean
286
- */
287
- public function update_count() {
288
- global $wpdb;
289
-
290
- $query =
291
- "SELECT
292
p.post_author,pmp.meta_value,
293
SUM(CASE WHEN post_mime_type LIKE 'image%' THEN 1 ELSE 0 END) as Images,
294
SUM(CASE WHEN post_mime_type LIKE 'audio%' THEN 1 ELSE 0 END) as Audio,
@@ -302,70 +393,84 @@ if (!class_exists('BPMediaAdmin')) {
302
pmp.meta_key = 'bp_media_privacy' AND
303
( post_mime_type LIKE 'image%' OR post_mime_type LIKE 'audio%' OR post_mime_type LIKE 'video%' OR post_type LIKE 'bp_media_album')
304
GROUP BY p.post_author,pmp.meta_value order by p.post_author";
305
- $result = $wpdb->get_results($query);
306
- if (!is_array($result))
307
- return false;
308
- $formatted = array();
309
- foreach ($result as $obj) {
310
- $formatted[$obj->post_author][$obj->meta_value] = array(
311
- 'image' => $obj->Images,
312
- 'video' => $obj->Videos,
313
- 'audio' => $obj->Audio,
314
- 'album' => $obj->Albums,
315
- );
316
- }
317
-
318
- foreach ($formatted as $user => $obj) {
319
- bp_update_user_meta($user, 'bp_media_count', $obj);
320
- }
321
- return true;
322
- }
323
-
324
- /* Multisite Save Options - http://wordpress.stackexchange.com/questions/64968/settings-api-in-multisite-missing-update-message#answer-72503 */
325
-
326
- /**
327
- *
328
- * @global type $bp_media_admin
329
- */
330
- public function save_multisite_options() {
331
- global $bp_media_admin;
332
- if (isset($_POST['refresh-count'])) {
333
- $bp_media_admin->update_count();
334
- }
335
- do_action('bp_media_sanitize_settings', $_POST);
336
-
337
- if (isset($_POST['bp_media_options'])) {
338
- bp_update_option('bp_media_options', $_POST['bp_media_options']);
339
//
340
// // redirect to settings page in network
341
- wp_redirect(
342
- add_query_arg(
343
- array('page' => 'bp-media-settings', 'updated' => 'true'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
344
- )
345
- );
346
- exit;
347
- }
348
- }
349
-
350
- /* Admin Sidebar */
351
-
352
- /**
353
- *
354
- * @global type $bp_media
355
- */
356
- public function admin_sidebar() {
357
- do_action('bp_media_before_default_admin_widgets');
358
- $current_user = wp_get_current_user();
359
- 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="'.BP_MEDIA_URL.'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a></p>';
360
// $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="'.BP_MEDIA_URL.'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a>';
361
// new BPMediaAdminWidget('bpm-contest', __('', 'buddypress-media'), $contest);
362
-
363
- $message = sprintf(__('I use @buddypressmedia http://goo.gl/8Upmv on %s', 'buddypress-media'), home_url());
364
- $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>
365
- <a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank">' . __('Tweet', 'buddypress-media') . '</a>
366
- <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>';
367
- new BPMediaAdminWidget('spread-the-word', __('Spread the Word', 'buddypress-media'), $addons);
368
-
369
// $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
370
// <!-- Identify your business so that you can collect the payments. -->
371
// <input type="hidden" name="business"
@@ -388,148 +493,143 @@ if (!class_exists('BPMediaAdmin')) {
388
// ;
389
// new BPMediaAdminWidget('donate', __('Donate', 'buddypress-media'), $donate);
390
391
- $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>
392
- <div class="mc-field-group">
393
- <input type="email" value="' . $current_user->user_email . '" name="EMAIL" placeholder="Email" class="required email" id="mce-EMAIL">
394
- <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">
395
- <div id="mce-responses" class="clear">
396
- <div class="response" id="mce-error-response" style="display:none"></div>
397
- <div class="response" id="mce-success-response" style="display:none"></div>
398
- </div>
399
- <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
400
- </div>
401
- </form>
402
- <ul id="social">
403
- <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>
404
- <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>
405
- <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>
406
- </ul>';
407
- new BPMediaAdminWidget('branding', __('Subscribe', 'buddypress-media'), $branding);
408
-
409
- $news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
410
- new BPMediaAdminWidget('latest-news', __('Latest News', 'buddypress-media'), $news);
411
- do_action('bp_media_after_default_admin_widgets');
412
- }
413
-
414
- public function linkback() {
415
- if (isset($_POST['linkback']) && $_POST['linkback']) {
416
- return bp_update_option('bp_media_add_linkback', true);
417
- } else {
418
- return bp_update_option('bp_media_add_linkback', false);
419
- }
420
- die;
421
- }
422
-
423
- public function convert_videos_mailchimp_send() {
424
- if ($_POST['interested'] == 'Yes' && !empty($_POST['choice'])) {
425
- 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/'));
426
- } else {
427
- bp_update_option('bp-media-survey', 0);
428
- }
429
- echo 'Thank you for your time.';
430
- die;
431
- }
432
-
433
- public function video_transcoding_survey_response() {
434
- if (isset($_GET['survey-done']) && ($_GET['survey-done'] == md5('survey-done'))) {
435
- bp_update_option('bp-media-survey', 0);
436
- }
437
- }
438
-
439
- public function plugin_meta_premium_addon_link($plugin_meta, $plugin_file, $plugin_data, $status) {
440
- if (plugin_basename(BP_MEDIA_PATH . 'index.php') == $plugin_file)
441
- $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>';
442
- return $plugin_meta;
443
- }
444
-
445
- public function upload_filetypes_error() {
446
- global $bp_media;
447
- $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
448
- $upload_filetypes = explode(' ', $upload_filetypes);
449
- $flag = false;
450
- if (isset($bp_media->options['images_enabled']) && $bp_media->options['images_enabled']) {
451
- $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
452
- if (!empty($not_supported_image)) {
453
- echo '<div class="error upload-filetype-network-settings-error">
454
<p>
455
' . 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')) . '
456
<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') . '" />
457
</p>
458
</div>';
459
- $flag = true;
460
- }
461
- }
462
- if (isset($bp_media->options['videos_enabled']) && $bp_media->options['videos_enabled']) {
463
- if (!in_array('mp4', $upload_filetypes)) {
464
- echo '<div class="error upload-filetype-network-settings-error">
465
<p>
466
' . 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')) . '
467
<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') . '" />
468
</p>
469
</div>';
470
- $flag = true;
471
- }
472
- }
473
- if (isset($bp_media->options['audio_enabled']) && $bp_media->options['audio_enabled']) {
474
- if (!in_array('mp3', $upload_filetypes)) {
475
- 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')) . '
476
<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') . '" />
477
</p>
478
</div>';
479
- $flag = true;
480
- }
481
- }
482
- if ($flag) {
483
- ?>
484
- <script type="text/javascript">
485
- jQuery('.upload-filetype-network-settings-error').on('click','.update-network-settings-upload-filetypes', function(){
486
- jQuery('.update-network-settings-upload-filetypes').siblings('img').show();
487
- jQuery('.update-network-settings-upload-filetypes').prop('disabled',true);
488
- jQuery.post(ajaxurl,{action: 'bp_media_correct_upload_filetypes'}, function(response){
489
- if(response){
490
- 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>')
491
- jQuery('.upload-filetype-network-settings-error').remove();
492
- jQuery('.bp-media-network-settings-updated-successfully').show();
493
- }
494
- });
495
- }); </script><?php
496
- }
497
- }
498
-
499
- public function correct_upload_filetypes() {
500
- global $bp_media;
501
- $upload_filetypes_orig = $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
502
- $upload_filetypes = explode(' ', $upload_filetypes);
503
- if (isset($bp_media->options['images_enabled']) && $bp_media->options['images_enabled']) {
504
- $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
505
- if (!empty($not_supported_image)) {
506
- $update_image_support = NULL;
507
- foreach ($not_supported_image as $ns) {
508
- $update_image_support .= ' ' . $ns;
509
- }
510
- if ($update_image_support) {
511
- $upload_filetypes_orig .= $update_image_support;
512
- update_site_option('upload_filetypes', $upload_filetypes_orig);
513
- }
514
- }
515
- }
516
- if (isset($bp_media->options['videos_enabled']) && $bp_media->options['videos_enabled']) {
517
- if (!in_array('mp4', $upload_filetypes)) {
518
- $upload_filetypes_orig .= ' mp4';
519
- update_site_option('upload_filetypes', $upload_filetypes_orig);
520
- }
521
- }
522
- if (isset($bp_media->options['audio_enabled']) && $bp_media->options['audio_enabled']) {
523
- if (!in_array('mp3', $upload_filetypes)) {
524
- $upload_filetypes_orig .= ' mp3';
525
- update_site_option('upload_filetypes', $upload_filetypes_orig);
526
- }
527
- }
528
- echo true;
529
- die();
530
- }
531
-
532
- }
533
534
}
535
- ?>
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'), 9);
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
+ $this->bp_media_encoding = new BPMediaEncoding();
53
+ }
54
+
55
+ /**
56
+ * Generates the Admin UI.
57
+ *
58
+ * @param string $hook
59
+ */
60
+
61
+ /**
62
+ *
63
+ * @param type $hook
64
+ */
65
+ public function ui($hook) {
66
+ $admin_ajax = admin_url('admin-ajax.php');
67
+
68
+ wp_enqueue_script('bootstrap-switch', BP_MEDIA_URL . 'app/assets/js/bootstrap-switch.js', array('jquery'), BP_MEDIA_VERSION);
69
+ if (!wp_script_is("jquery-effects-core"))
70
+ wp_enqueue_script("jquery-effects-core");
71
+ wp_enqueue_script('slider-tabs', BP_MEDIA_URL . 'app/assets/js/jquery.sliderTabs.min.js', array('jquery-effects-core'), BP_MEDIA_VERSION,true);
72
+ wp_enqueue_script('power-tip', BP_MEDIA_URL . 'app/assets/js/jquery.powertip.min.js', array('jquery'), BP_MEDIA_VERSION);
73
+ wp_enqueue_script('bp-media-admin', BP_MEDIA_URL . 'app/assets/js/admin.js', array('slider-tabs','jquery-ui-dialog'), BP_MEDIA_VERSION,true);
74
+ wp_localize_script('bp-media-admin', 'bp_media_admin_ajax', $admin_ajax);
75
+ wp_localize_script('bp-media-admin', 'bp_media_admin_url', admin_url());
76
+ $bp_media_admin_strings = array(
77
+ 'no_refresh' => __('Please do not refresh this page.', 'buddypress-media'),
78
+ 'something_went_wrong' => __('Something went wronng. Please <a href onclick="location.reload();">refresh</a> page.', 'buddypress-media'),
79
+ 'are_you_sure' => __('This will subscribe you to the free plan.', 'buddypress-media'),
80
+ '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.', 'buddypress-media')
81
+ );
82
+ wp_localize_script('bp-media-admin', 'bp_media_admin_strings', $bp_media_admin_strings);
83
+ wp_localize_script('bp-media-admin', 'settings_url', add_query_arg(
84
+ array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
85
+ ) . '#privacy_enabled');
86
+ wp_localize_script('bp-media-admin', 'settings_bp_album_import_url', add_query_arg(
87
+ array('page' => 'bp-media-settings'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
88
+ ));
89
+ wp_enqueue_style('font-awesome', BP_MEDIA_URL . 'app/assets/css/font-awesome.min.css', '', BP_MEDIA_VERSION);
90
+ wp_enqueue_style('bootstrap-switch', BP_MEDIA_URL . 'app/assets/css/bootstrap-switch.css', '', BP_MEDIA_VERSION);
91
+ wp_enqueue_style('slider-tabs', BP_MEDIA_URL . 'app/assets/css/jquery.sliderTabs.min.css', '', BP_MEDIA_VERSION);
92
+ wp_enqueue_style('power-tip', BP_MEDIA_URL . 'app/assets/css/jquery.powertip.min.css', '', BP_MEDIA_VERSION);
93
+ wp_enqueue_style('grid-foundation', BP_MEDIA_URL . 'app/assets/css/grid-foundation.css', '', BP_MEDIA_VERSION);
94
+ wp_enqueue_style('bp-media-main', BP_MEDIA_URL . 'app/assets/css/main.css', '', BP_MEDIA_VERSION);
95
+ wp_enqueue_style('bp-media-admin', BP_MEDIA_URL . 'app/assets/css/admin.css', '', BP_MEDIA_VERSION);
96
+ wp_enqueue_style('wp-jquery-ui-dialog');
97
+ }
98
+
99
+ /**
100
+ * Admin Menu
101
+ *
102
+ * @global string 'buddypress-media'
103
+ */
104
+ public function menu() {
105
+ global $wpdb;
106
+ add_menu_page(__('BuddyPress Media Component', 'buddypress-media'), __('BuddyPress Media', 'buddypress-media'), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
107
+ add_submenu_page('bp-media-settings', __('BuddyPress Media Settings', 'buddypress-media'), __('Settings', 'buddypress-media'), 'manage_options', 'bp-media-settings', array($this, 'settings_page'));
108
+ add_submenu_page('bp-media-settings', __('BuddyPress Media Addons', 'buddypress-media'), __('Addons', 'buddypress-media'), 'manage_options', 'bp-media-addons', array($this, 'addons_page'));
109
+ add_submenu_page('bp-media-settings', __('BuddyPress Media Support', 'buddypress-media'), __('Support ', 'buddypress-media'), 'manage_options', 'bp-media-support', array($this, 'support_page'));
110
+ add_submenu_page('bp-media-settings', __('Importer', 'buddypress-media'), __('Importer', 'buddypress-media'), 'manage_options', 'bp-media-importer', array($this, 'bp_importer_page'));
111
+ if (!BPMediaPrivacy::is_installed()) {
112
+ 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'));
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Render the BuddyPress Media Settings page
118
+ */
119
+ public function settings_page() {
120
+ $this->render_page('bp-media-settings', 'bp_media');
121
+ }
122
+
123
+ public function privacy_page() {
124
+ $this->render_page('bp-media-privacy');
125
+ }
126
+
127
+ public function bp_importer_page() {
128
+ $this->render_page('bp-media-importer');
129
+ }
130
+
131
+ public function convert_videos_page() {
132
+ $this->render_page('bp-media-convert-videos');
133
+ }
134
+
135
+ /**
136
+ * Render the BuddyPress Media Addons page
137
+ */
138
+ public function addons_page() {
139
+ $this->render_page('bp-media-addons');
140
+ }
141
+
142
+ /**
143
+ * Render the BuddyPress Media Support page
144
+ */
145
+ public function support_page() {
146
+ $this->render_page('bp-media-support');
147
+ }
148
+
149
+ /**
150
+ *
151
+ * @return type
152
+ */
153
+ static function get_current_tab() {
154
+ return isset($_GET['page']) ? $_GET['page'] : "bp-media-settings";
155
+ }
156
+
157
+ /**
158
+ * Render BPMedia Settings
159
+ *
160
+ * @global string 'buddypress-media'
161
+ */
162
+
163
+ /**
164
+ *
165
+ * @param type $page
166
+ * @param type $option_group
167
+ */
168
+ public function render_page($page, $option_group = NULL) {
169
+ ?>
170
+
171
+ <div class="wrap bp-media-admin <?php echo $this->get_current_tab(); ?>">
172
+ <div id="icon-buddypress-media" class="icon32"><br></div>
173
+ <h2 class="nav-tab-wrapper"><?php $this->bp_media_tabs(); ?></h2>
174
+ <?php settings_errors(); ?>
175
+ <div class="row">
176
+ <div id="bp-media-settings-boxes" class="columns large-7">
177
+ <?php
178
+ $settings_url = ( is_multisite() ) ? network_admin_url('edit.php?action=' . $option_group) : 'options.php';
179
+ ?>
180
+ <?php if ($option_group) { ?>
181
+ <form id="bp_media_settings_form" name="bp_media_settings_form" action="<?php echo $settings_url; ?>" method="post" enctype="multipart/form-data">
182
+ <div class="bp-media-metabox-holder"><?php
183
+ settings_fields($option_group);
184
+
185
+ echo '<div id="bpm-settings-tabs">';
186
+ $sub_tabs = $this->settings_sub_tabs();
187
+ BPMediaFormHandler::rtForm_settings_tabs_content($page, $sub_tabs);
188
+ echo '</div>';
189
+ submit_button();
190
+ ?><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>
191
+ </div>
192
+ </form><?php } else {
193
+ ?>
194
+ <div class="bp-media-metabox-holder">
195
+
196
+
197
+ <?php do_settings_sections($page); ?>
198
+ <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>
199
+ </div><?php
200
+ }
201
+ ?>
202
+
203
+
204
+ </div><!-- .bp-media-settings-boxes -->
205
+ <div class="metabox-holder bp-media-metabox-holder columns large-2">
206
+ <?php $this->admin_sidebar(); ?>
207
+ </div>
208
+ </div><!-- .metabox-holder -->
209
+ </div><!-- .bp-media-admin --><?php
210
+ do_action('bp_media_admin_page_append', $page);
211
+ }
212
+
213
+ /**
214
+ * Adds a tab for Media settings in the BuddyPress settings page
215
+ *
216
+ * @global type $bp_media
217
+ */
218
+ public function tab() {
219
+
220
+ $tabs_html = '';
221
+ $idle_class = 'nav-tab';
222
+ $active_class = 'nav-tab nav-tab-active';
223
+ $tabs = array();
224
225
// Check to see which tab we are on
226
+ $tab = $this->get_current_tab();
227
+ /* BuddyPress Media */
228
+ $tabs[] = array(
229
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
230
+ 'title' => __('BuddyPress Media', 'buddypress-media'),
231
+ 'name' => __('BuddyPress Media', 'buddypress-media'),
232
+ 'class' => ($tab == 'bp-media-settings' || $tab == 'bp-media-addons' || $tab == 'bp-media-support') ? $active_class : $idle_class
233
+ );
234
+
235
+
236
+ foreach ($tabs as $tab) {
237
+ $tabs_html.= '<a id="bp-media" title= "' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . $tab['class'] . '">' . $tab['name'] . '</a>';
238
+ }
239
+ echo $tabs_html;
240
+ }
241
+
242
+ public function bp_media_tabs($active_tab = '') {
243
+ // Declare local variables
244
+ $tabs_html = '';
245
+ $idle_class = 'nav-tab';
246
+ $active_class = 'nav-tab nav-tab-active';
247
+
248
+ // Setup core admin tabs
249
+ $tabs = array(
250
+ '0' => array(
251
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
252
+ 'name' => __('Settings', 'buddypress-media'),
253
+ 'slug' => 'bp-media-settings'
254
+ ),
255
+ '1' => array(
256
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php')),
257
+ 'name' => __('Addons', 'buddypress-media'),
258
+ 'slug' => 'bp-media-addons'
259
+ ),
260
+ '2' => array(
261
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php')),
262
+ 'name' => __('Support', 'buddypress-media'),
263
+ 'slug' => 'bp-media-support'
264
+ ),
265
+ '3' => array(
266
+ 'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-importer'), 'admin.php')),
267
+ 'name' => __('Importer', 'buddypress-media'),
268
+ 'slug' => 'bp-media-importer'
269
+ ),
270
+ );
271
+
272
+ $tabs = apply_filters('bp_media_add_tabs', $tabs);
273
+
274
+ // Loop through tabs and build navigation
275
+ foreach (array_values($tabs) as $tab_data) {
276
+ $is_current = (bool) ( $tab_data['slug'] == $this->get_current_tab() );
277
+ $tab_class = $is_current ? $active_class : $idle_class;
278
+ $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
279
+ }
280
+
281
+ // Output the tabs
282
+ echo $tabs_html;
283
+
284
+ // // Do other fun things
285
+ // do_action('bp_media_admin_tabs');
286
+ }
287
+
288
+ public function settings_content_tabs($page) {
289
+ global $wp_settings_sections, $wp_settings_fields;
290
+
291
+ if (!isset($wp_settings_sections) || !isset($wp_settings_sections[$page]))
292
+ return;
293
+
294
+ foreach ((array) $wp_settings_sections[$page] as $section) {
295
+ if ($section['title'])
296
+ echo "<h3>{$section['title']}</h3>\n";
297
+
298
+ if ($section['callback'])
299
+ call_user_func($section['callback'], $section);
300
+
301
+ if (!isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]))
302
+ continue;
303
+ echo '<table class="form-table">';
304
+ do_settings_fields($page, $section['id']);
305
+ echo '</table>';
306
+ }
307
+ }
308
+
309
+ /**
310
+ * Adds a sub tabs to the BuddyPress Media settings page
311
+ *
312
+ * @global type $bp_media
313
+ */
314
+ public function settings_sub_tabs() {
315
+ $tabs_html = '';
316
+ $tabs = array();
317
+
318
+ // Check to see which tab we are on
319
+ $tab = $this->get_current_tab();
320
+ /* BuddyPress Media */
321
+ $tabs[] = array(
322
+ 'href' => '#bp-media-types',
323
+ 'icon' => 'icon-film',
324
+ 'title' => __('BuddyPress Media Types', 'buddypress-media'),
325
+ 'name' => __('Types', 'buddypress-media'),
326
+ 'callback' => array('BPMediaFormHandler', 'types_content')
327
+ );
328
+
329
+ $tabs[] = array(
330
+ 'href' => '#bp-media-sizes',
331
+ 'icon' => 'icon-resize-full',
332
+ 'title' => __('BuddyPress Media Sizes', 'buddypress-media'),
333
+ 'name' => __('Sizes', 'buddypress-media'),
334
+ 'callback' => array('BPMediaFormHandler', 'sizes_content')
335
+ );
336
+
337
+ $tabs[] = array(
338
+ 'href' => '#bp-media-privacy',
339
+ 'icon' => 'icon-lock',
340
+ 'title' => __('BuddyPress Media Privacy', 'buddypress-media'),
341
+ 'name' => __('Privacy', 'buddypress-media'),
342
+ 'callback' => array('BPMediaFormHandler', 'privacy_content')
343
+ );
344
+
345
+ $tabs[] = array(
346
+ 'href' => '#bp-media-misc',
347
+ 'icon' => 'icon-cog',
348
+ 'title' => __('BuddyPress Media Miscellaneous', 'buddypress-media'),
349
+ 'name' => __('Miscellaneous', 'buddypress-media'),
350
+ 'callback' => array('BPMediaFormHandler', 'misc_content')
351
+ );
352
+
353
+ $tabs = apply_filters('bp_media_add_settings_sub_tabs', $tabs, $tab);
354
+ $tabs_html .= '<ul>';
355
+ foreach ($tabs as $tab) {
356
+
357
+ $icon = '';
358
+ if (isset($tab['icon']) && !empty($tab['icon']))
359
+ $icon = '<i class="' . $tab['icon'] . '"></i>';
360
+
361
+ $tabs_html.= '<li><a title="' . $tab['title'] . '" href="' . $tab['href'] . '" class="' . sanitize_title($tab['name']) . '">' . $icon . ' ' . $tab['name'] . '</a></li>';
362
+ }
363
+ $tabs_html .= '</ul>';
364
+
365
+ echo $tabs_html;
366
+ return $tabs;
367
+ }
368
+
369
+ /*
370
+ * Updates the media count of all users.
371
+ */
372
+
373
+ /**
374
+ *
375
+ * @global type $wpdb
376
+ * @return boolean
377
+ */
378
+ public function update_count() {
379
+ global $wpdb;
380
+
381
+ $query =
382
+ "SELECT
383
p.post_author,pmp.meta_value,
384
SUM(CASE WHEN post_mime_type LIKE 'image%' THEN 1 ELSE 0 END) as Images,
385
SUM(CASE WHEN post_mime_type LIKE 'audio%' THEN 1 ELSE 0 END) as Audio,
393
pmp.meta_key = 'bp_media_privacy' AND
394
( post_mime_type LIKE 'image%' OR post_mime_type LIKE 'audio%' OR post_mime_type LIKE 'video%' OR post_type LIKE 'bp_media_album')
395
GROUP BY p.post_author,pmp.meta_value order by p.post_author";
396
+ $result = $wpdb->get_results($query);
397
+ if (!is_array($result))
398
+ return false;
399
+ $formatted = array();
400
+ foreach ($result as $obj) {
401
+ $formatted[$obj->post_author][$obj->meta_value] = array(
402
+ 'image' => $obj->Images,
403
+ 'video' => $obj->Videos,
404
+ 'audio' => $obj->Audio,
405
+ 'album' => $obj->Albums,
406
+ );
407
+ }
408
+
409
+ foreach ($formatted as $user => $obj) {
410
+ bp_update_user_meta($user, 'bp_media_count', $obj);
411
+ }
412
+ return true;
413
+ }
414
+
415
+ /* Multisite Save Options - http://wordpress.stackexchange.com/questions/64968/settings-api-in-multisite-missing-update-message#answer-72503 */
416
+
417
+ /**
418
+ *
419
+ * @global type $bp_media_admin
420
+ */
421
+ public function save_multisite_options() {
422
+ global $bp_media_admin;
423
+ if (isset($_POST['refresh-count'])) {
424
+ $bp_media_admin->update_count();
425
+ }
426
+ do_action('bp_media_sanitize_settings', $_POST);
427
+
428
+ if (isset($_POST['bp_media_options'])) {
429
+ bp_update_option('bp_media_options', $_POST['bp_media_options']);
430
//
431
// // redirect to settings page in network
432
+ wp_redirect(
433
+ add_query_arg(
434
+ array('page' => 'bp-media-settings', 'updated' => 'true'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
435
+ )
436
+ );
437
+ exit;
438
+ }
439
+ }
440
+
441
+ /* Admin Sidebar */
442
+
443
+ /**
444
+ *
445
+ * @global type $bp_media
446
+ */
447
+ public function admin_sidebar() {
448
+ do_action('bp_media_before_default_admin_widgets');
449
+ $current_user = wp_get_current_user();
450
+ // 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="' . BP_MEDIA_URL . 'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a></p>';
451
// $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="'.BP_MEDIA_URL.'app/assets/img/bpm-contest-banner.jpg" alt="BuddyPress Media Review Contest" /></a>';
452
// new BPMediaAdminWidget('bpm-contest', __('', 'buddypress-media'), $contest);
453
+
454
+ $message = sprintf(__('I use @buddypressmedia http://goo.gl/8Upmv on %s', 'buddypress-media'), home_url());
455
+ $addons = '<div id="social" class="row">
456
+ <label class="columns large-6 large-offset-2" 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>
457
+ <div class="row">
458
+ <div class="columns large-4 pull-left"><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:72px; height:21px; margin-top: 5px;" allowTransparency="true"></iframe></div>
459
+ <div class="columns large-4 pull-right"><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', 'buddypress-media') . '</a></div>
460
+ </div>
461
+ <div class="row">
462
+ <div class="columns large-4 pull-left"><iframe allowtransparency="true" frameborder="0" scrolling="no" src="//platform.twitter.com/widgets/follow_button.html?screen_name=buddypressmedia&show_count=false" style="width:109px; height:21px; margin-top: 5px;"></iframe></div>
463
+ <div class="columns large-4 pull-right"><a href="http://twitter.com/home/?status=' . $message . '" class="button button-tweet" target= "_blank"><i class="icon-twitter"></i> ' . __('Tweet', 'buddypress-media') . '</a></div>
464
+ </div>
465
+ <div class="row">
466
+ <div class="columns large-4 pull-left"><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', 'buddypress-media') . '</a></div>
467
+ <div class="columns large-4 pull-right"><a href="' . sprintf('%s', 'http://feeds.feedburner.com/rtcamp/') . '" title="' . __('Subscribe to our feeds', 'buddypress-media') . '" class="button"><i class="bp-media-rss icon-rss"></i> ' . __('Feeds', 'buddypress-media') . '</a></div>
468
+ </div>
469
+ </div>';
470
+ //<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>
471
+ //<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> ;
472
+ new BPMediaAdminWidget('spread-the-word', __('Spread the Word', 'buddypress-media'), $addons);
473
+
474
// $donate = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
475
// <!-- Identify your business so that you can collect the payments. -->
476
// <input type="hidden" name="business"
493
// ;
494
// new BPMediaAdminWidget('donate', __('Donate', 'buddypress-media'), $donate);
495
496
+ $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>
497
+ <div class="mc-field-group">
498
+ <input type="email" value="' . $current_user->user_email . '" name="EMAIL" placeholder="Email" class="required email" id="mce-EMAIL">
499
+ <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">
500
+ <div id="mce-responses" class="clear">
501
+ <div class="response" id="mce-error-response" style="display:none"></div>
502
+ <div class="response" id="mce-success-response" style="display:none"></div>
503
+ </div>
504
+ <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
505
+ </div>
506
+ </form>';
507
+ new BPMediaAdminWidget('branding', __('Subscribe', 'buddypress-media'), $branding);
508
+
509
+ $news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
510
+ new BPMediaAdminWidget('latest-news', __('Latest News', 'buddypress-media'), $news);
511
+ do_action('bp_media_after_default_admin_widgets');
512
+ }
513
+
514
+ public function linkback() {
515
+ if (isset($_POST['linkback']) && $_POST['linkback']) {
516
+ return bp_update_option('bp_media_add_linkback', true);
517
+ } else {
518
+ return bp_update_option('bp_media_add_linkback', false);
519
+ }
520
+ die;
521
+ }
522
+
523
+ public function convert_videos_mailchimp_send() {
524
+ if ($_POST['interested'] == 'Yes' && !empty($_POST['choice'])) {
525
+ 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/'));
526
+ } else {
527
+ bp_update_option('bp-media-survey', 0);
528
+ }
529
+ echo 'Thank you for your time.';
530
+ die;
531
+ }
532
+
533
+ public function video_transcoding_survey_response() {
534
+ if (isset($_GET['survey-done']) && ($_GET['survey-done'] == md5('survey-done'))) {
535
+ bp_update_option('bp-media-survey', 0);
536
+ }
537
+ }
538
+
539
+ public function plugin_meta_premium_addon_link($plugin_meta, $plugin_file, $plugin_data, $status) {
540
+ if (plugin_basename(BP_MEDIA_PATH . 'index.php') == $plugin_file)
541
+ $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>';
542
+ return $plugin_meta;
543
+ }
544
+
545
+ public function upload_filetypes_error() {
546
+ global $bp_media;
547
+ $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
548
+ $upload_filetypes = explode(' ', $upload_filetypes);
549
+ $flag = false;
550
+ if (isset($bp_media->options['images_enabled']) && $bp_media->options['images_enabled']) {
551
+ $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
552
+ if (!empty($not_supported_image)) {
553
+ echo '<div class="error upload-filetype-network-settings-error">
554
<p>
555
' . 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')) . '
556
<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') . '" />
557
</p>
558
</div>';
559
+ $flag = true;
560
+ }
561
+ }
562
+ if (isset($bp_media->options['videos_enabled']) && $bp_media->options['videos_enabled']) {
563
+ if (!in_array('mp4', $upload_filetypes)) {
564
+ echo '<div class="error upload-filetype-network-settings-error">
565
<p>
566
' . 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')) . '
567
<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') . '" />
568
</p>
569
</div>';
570
+ $flag = true;
571
+ }
572
+ }
573
+ if (isset($bp_media->options['audio_enabled']) && $bp_media->options['audio_enabled']) {
574
+ if (!in_array('mp3', $upload_filetypes)) {
575
+ 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')) . '
576
<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') . '" />
577
</p>
578
</div>';
579
+ $flag = true;
580
+ }
581
+ }
582
+ if ($flag) {
583
+ ?>
584
+ <script type="text/javascript">
585
+ jQuery('.upload-filetype-network-settings-error').on('click', '.update-network-settings-upload-filetypes', function() {
586
+ jQuery('.update-network-settings-upload-filetypes').siblings('img').show();
587
+ jQuery('.update-network-settings-upload-filetypes').prop('disabled', true);
588
+ jQuery.post(ajaxurl, {action: 'bp_media_correct_upload_filetypes'}, function(response) {
589
+ if (response) {
590
+ 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>')
591
+ jQuery('.upload-filetype-network-settings-error').remove();
592
+ jQuery('.bp-media-network-settings-updated-successfully').show();
593
+ }
594
+ });
595
+ });</script><?php
596
+ }
597
+ }
598
+
599
+ public function correct_upload_filetypes() {
600
+ global $bp_media;
601
+ $upload_filetypes_orig = $upload_filetypes = get_site_option('upload_filetypes', 'jpg jpeg png gif');
602
+ $upload_filetypes = explode(' ', $upload_filetypes);
603
+ if (isset($bp_media->options['images_enabled']) && $bp_media->options['images_enabled']) {
604
+ $not_supported_image = array_diff(array('jpg', 'jpeg', 'png', 'gif'), $upload_filetypes);
605
+ if (!empty($not_supported_image)) {
606
+ $update_image_support = NULL;
607
+ foreach ($not_supported_image as $ns) {
608
+ $update_image_support .= ' ' . $ns;
609
+ }
610
+ if ($update_image_support) {
611
+ $upload_filetypes_orig .= $update_image_support;
612
+ update_site_option('upload_filetypes', $upload_filetypes_orig);
613
+ }
614
+ }
615
+ }
616
+ if (isset($bp_media->options['videos_enabled']) && $bp_media->options['videos_enabled']) {
617
+ if (!in_array('mp4', $upload_filetypes)) {
618
+ $upload_filetypes_orig .= ' mp4';
619
+ update_site_option('upload_filetypes', $upload_filetypes_orig);
620
+ }
621
+ }
622
+ if (isset($bp_media->options['audio_enabled']) && $bp_media->options['audio_enabled']) {
623
+ if (!in_array('mp3', $upload_filetypes)) {
624
+ $upload_filetypes_orig .= ' mp3';
625
+ update_site_option('upload_filetypes', $upload_filetypes_orig);
626
+ }
627
+ }
628
+ echo true;
629
+ die();
630
+ }
631
+
632
+ }
633
634
}
635
+ ?>
app/admin/BPMediaFormHandler.php ADDED
@@ -0,0 +1,513 @@
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 BPMediaFormHandler
10
+ *
11
+ * @author udit
12
+ */
13
+ class BPMediaFormHandler {
14
+
15
+ public static function checkbox($args) {
16
+
17
+ global $bp_media;
18
+ $options = $bp_media->options;
19
+ $defaults = array(
20
+ 'setting' => '',
21
+ 'option' => '',
22
+ 'desc' => '',
23
+ 'show_desc' => false
24
+ );
25
+ $args = wp_parse_args($args, $defaults);
26
+ extract($args);
27
+
28
+ if (empty($option)) {
29
+ 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'));
30
+ return;
31
+ }
32
+
33
+ if (!empty($setting)) {
34
+ $args['name'] = $setting . '[' . $option . ']';
35
+ $options = bp_get_option($setting);
36
+ }
37
+ else
38
+ $args['name'] = $option;
39
+
40
+ if (!isset($options[$option]))
41
+ $options[$option] = '';
42
+
43
+ $args['rtForm_options'] = array(array('id' => $option, '' => 1, 'checked' => $options[$option]));
44
+
45
+ $chkObj = new rtForm();
46
+ // echo $chkObj->get_checkbox($args);
47
+ echo $chkObj->get_switch($args);
48
+ // echo $chkObj->get_switch_square($args);
49
+ }
50
+
51
+ public static function radio($args) {
52
+
53
+ global $bp_media;
54
+ $options = $bp_media->options;
55
+ $defaults = array(
56
+ 'setting' => '',
57
+ 'option' => '',
58
+ 'radios' => array(),
59
+ 'default' => '',
60
+ 'show_desc' => false
61
+ );
62
+ $args = wp_parse_args($args, $defaults);
63
+ extract($args);
64
+ if (empty($option) || ( 2 > count($radios) )) {
65
+ if (empty($option))
66
+ 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'));
67
+ if (2 > count($radios))
68
+ trigger_error(__('Need to specify atleast to radios else use a checkbox instead', 'buddypress-media'));
69
+ return;
70
+ }
71
+
72
+ if (!empty($setting)) {
73
+ $args['name'] = $setting . '[' . $option . ']';
74
+ $options = bp_get_option($setting);
75
+ }
76
+ else
77
+ $args['name'] = $option;
78
+
79
+ if ((isset($options[$option]) && empty($options[$option])) || !isset($options[$option])) {
80
+ $options[$option] = $default;
81
+ }
82
+
83
+ $args['rtForm_options'] = array();
84
+ foreach ($radios as $value => $key) {
85
+ $args['rtForm_options'][] = array(
86
+ 'id' => sanitize_title($key),
87
+ $key => $value,
88
+ 'checked' => ($options[$option] == $value) ? true : false
89
+ );
90
+ }
91
+
92
+ $objRad = new rtForm();
93
+ echo $objRad->get_radio($args);
94
+ }
95
+
96
+ public static function dimensions($args) {
97
+
98
+ $dmnObj = new rtDimensions();
99
+ echo $dmnObj->get_dimensions($args);
100
+ }
101
+
102
+ public static function number($args) {
103
+ global $bp_media;
104
+ $options = $bp_media->options;
105
+ $defaults = array(
106
+ 'setting' => '',
107
+ 'option' => '',
108
+ 'desc' => '',
109
+ 'password' => false,
110
+ 'hidden' => false,
111
+ 'number' => false,
112
+ );
113
+ $args = wp_parse_args($args, $defaults);
114
+ extract($args);
115
+
116
+ if (empty($option)) {
117
+ 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'));
118
+ return;
119
+ }
120
+
121
+ if (!empty($setting)) {
122
+ $args['name'] = $setting . '[' . $option . ']';
123
+ $options = bp_get_option($setting);
124
+ }
125
+ else
126
+ $args['name'] = $option;
127
+
128
+ if ((isset($options[$option]) && empty($options[$option])) || !isset($options[$option])) {
129
+ $options[$option] = '';
130
+ }
131
+
132
+ $args['id'] = sanitize_title($option);
133
+ $args['value'] = $options[$option];
134
+
135
+ $numObj = new rtForm();
136
+ echo $numObj->get_number($args);
137
+ }
138
+
139
+ public static function types_content($page = '') {
140
+
141
+ global $wp_settings_sections, $wp_settings_fields;
142
+
143
+ if (!isset($wp_settings_fields) ||
144
+ !isset($wp_settings_fields[$page]) ||
145
+ !isset($wp_settings_fields[$page]['bpm-settings']) ||
146
+ !isset($wp_settings_fields[$page]['bpm-featured']))
147
+ return;
148
+
149
+ $bpm_settings = $wp_settings_fields[$page]['bpm-settings'];
150
+ $bpm_featured = $wp_settings_fields[$page]['bpm-featured'];
151
+ $headers = array(
152
+ array(
153
+ 'id' => 'bpm-media-type',
154
+ 'title' => "Media Type",
155
+ 'class' => 'large-2',
156
+ 'desc' => ''
157
+ ),
158
+ array(
159
+ 'id' => 'bpm-allow-upload',
160
+ 'title' => "Allow Upload",
161
+ 'class' => 'large-2',
162
+ 'desc' => 'Allows you to upload a particular media type on your post.'
163
+ ),
164
+ array(
165
+ 'id' => 'bpm-set-feature',
166
+ 'title' => "Set Featured",
167
+ 'class' => 'large-2',
168
+ 'desc' => 'Put a specific media as a featured content on the post.'
169
+ ),
170
+ array(
171
+ 'id' => 'bpm-file-extn',
172
+ 'title' => "File Extensions",
173
+ 'class' => 'large-3',
174
+ 'desc' => 'File extensions that can be uploaded on the website.'
175
+ )
176
+ );
177
+
178
+ $image = array(
179
+ array(
180
+ 'class' => 'large-2',
181
+ 'content' => $bpm_settings['bpm-image']['title']
182
+ ),
183
+ array(
184
+ 'class' => 'large-2',
185
+ 'callback' => $bpm_settings['bpm-image']['callback'],
186
+ 'args' => $bpm_settings['bpm-image']['args']
187
+ ),
188
+ array(
189
+ 'class' => 'large-2',
190
+ 'callback' => $bpm_featured['bpm-featured-image']['callback'],
191
+ 'args' => $bpm_featured['bpm-featured-image']['args']
192
+ ),
193
+ array(
194
+ 'class' => 'large-3',
195
+ 'content' => "gif,jpeg,png"
196
+ ),
197
+ );
198
+
199
+ $video = array(
200
+ array(
201
+ 'class' => 'large-2',
202
+ 'content' => $bpm_settings['bpm-video']['title']
203
+ ),
204
+ array(
205
+ 'class' => 'large-2',
206
+ 'callback' => $bpm_settings['bpm-video']['callback'],
207
+ 'args' => $bpm_settings['bpm-video']['args']
208
+ ),
209
+ array(
210
+ 'class' => 'large-2',
211
+ 'callback' => $bpm_featured['bpm-featured-video']['callback'],
212
+ 'args' => $bpm_featured['bpm-featured-video']['args']
213
+ ),
214
+ array(
215
+ 'class' => 'large-3',
216
+ 'content' => "avi,mp4,mpeg"
217
+ ),
218
+ );
219
+
220
+ $audio = array(
221
+ array(
222
+ 'class' => 'large-2',
223
+ 'content' => $bpm_settings['bpm-audio']['title']
224
+ ),
225
+ array(
226
+ 'class' => 'large-2',
227
+ 'callback' => $bpm_settings['bpm-audio']['callback'],
228
+ 'args' => $bpm_settings['bpm-audio']['args']
229
+ ),
230
+ array(
231
+ 'class' => 'large-2',
232
+ 'callback' => $bpm_featured['bpm-featured-audio']['callback'],
233
+ 'args' => $bpm_featured['bpm-featured-audio']['args']
234
+ ),
235
+ array(
236
+ 'class' => 'large-3',
237
+ 'content' => "mp3,wav"
238
+ ),
239
+ );
240
+
241
+ $body = array($image, $video, $audio);
242
+
243
+ //container
244
+ echo '<div class="rt-table large-12">';
245
+
246
+ //header
247
+ $tooltip_ids = '';
248
+ echo '<div class="row rt-header">';
249
+ foreach ($headers as $val) {
250
+ if( isset($val['desc']) && !empty($val['desc']) ) {
251
+ echo '<h4 id="' . $val['id'] . '" class="columns ' . $val['class'] . '" title="' . $val['desc'] . '"><abbr>' . $val['title'] . '</abbr></h4>';
252
+ $tooltip_ids .= '#' . $val['id'] . ',';
253
+ }
254
+ else
255
+ echo '<h4 " class="columns ' . $val['class'] . '">' . $val['title'] . '</h4>';
256
+ }
257
+ echo '</div>';
258
+
259
+ $tooltip_ids = substr($tooltip_ids, 0, strlen($tooltip_ids)-1);
260
+
261
+ //body
262
+ $even = 0;
263
+ foreach ($body as $section) {
264
+ if( ++$even%2 )
265
+ echo '<div class="row rt-odd">';
266
+ else
267
+ echo '<div class="row rt-even">';
268
+
269
+ foreach ($section as $value) { ?>
270
+ <div class="columns<?php echo ' ' . $value['class']; ?>">
271
+ <?php
272
+ if (isset($value['content']))
273
+ echo $value['content'];
274
+ else
275
+ call_user_func($value['callback'], $value['args']);
276
+ ?>
277
+ </div>
278
+ <?php
279
+ } ?>
280
+ </div>
281
+ <?php
282
+ }
283
+ ?>
284
+ </div>
285
+ <script type="text/javascript">
286
+ var tooltip_ids = '<?php echo $tooltip_ids;?>';
287
+ </script>
288
+ <?php
289
+ }
290
+
291
+ public static function sizes_content($page = '') {
292
+
293
+ global $wp_settings_sections, $wp_settings_fields;
294
+
295
+ if (!isset($wp_settings_fields) ||
296
+ !isset($wp_settings_fields[$page]) ||
297
+ !isset($wp_settings_fields[$page]['bpm-image-settings']) ||
298
+ !isset($wp_settings_fields[$page]['bpm-video-settings']) ||
299
+ !isset($wp_settings_fields[$page]['bpm-audio-settings']) ||
300
+ !isset($wp_settings_fields[$page]['bpm-featured']))
301
+ return;
302
+
303
+ $dimension = '<span class="large-offset-1">Width</span>
304
+ <span class="large-offset-2">Height</span>
305
+ <span class="large-offset-2">Crop</span>';
306
+ $headers = array(
307
+ array('title' => 'Category', 'class' => 'large-3'),
308
+ array('title' => 'Entity', 'class' => 'large-3'),
309
+ array('title' => $dimension, 'class' => 'large-4')
310
+ );
311
+
312
+ $sections = array("bpm-image-settings", "bpm-video-settings", "bpm-audio-settings", "bpm-featured");
313
+
314
+ $contents = array();
315
+ $body = array();
316
+ foreach ($sections as $section) {
317
+
318
+ $contents[$section] = array(
319
+ 'entity_names' => array(),
320
+ 'callbacks' => array(),
321
+ 'args' => array()
322
+ );
323
+
324
+ if ($section == "bpm-featured") {
325
+ $contents[$section]['entity_names'][] = $wp_settings_fields[$page][$section]['bpm-featured-media-dimensions']['title'];
326
+ $contents[$section]['callbacks'][] = $wp_settings_fields[$page][$section]['bpm-featured-media-dimensions']['callback'];
327
+ $contents[$section]['args'][] = $wp_settings_fields[$page][$section]['bpm-featured-media-dimensions']['args'];
328
+ } else {
329
+ foreach ($wp_settings_fields[$page][$section] as $value) {
330
+ $contents[$section]['entity_names'][] = $value['title'];
331
+ $contents[$section]['callbacks'][] = $value['callback'];
332
+ $contents[$section]['args'][] = $value['args'];
333
+ }
334
+ }
335
+
336
+ $body[$section] = array(
337
+ //title
338
+ array(
339
+ 'class' => 'large-3',
340
+ 'content' => ( $section == "bpm-featured" ) ? "Featured Media" : $wp_settings_sections[$page][$section]['title']
341
+ ),
342
+ //entity names
343
+ array(
344
+ 'class' => 'large-3',
345
+ 'content' => ( $section == "bpm-featured" ) ? $wp_settings_fields[$page][$section]['bpm-featured-media-dimensions']['title'] : $contents[$section]['entity_names']
346
+ ),
347
+ //dimensions
348
+ array(
349
+ 'class' => 'large-4',
350
+ 'callbacks' => $contents[$section]['callbacks'],
351
+ 'args' => $contents[$section]['args']
352
+ )
353
+ );
354
+ }
355
+
356
+
357
+ //container
358
+ echo '<div class="rt-table large-12">';
359
+
360
+ //header
361
+ echo '<div class="rt-header row">';
362
+ foreach ($headers as $value) {
363
+ echo '<h4 class="columns ' . $value['class'] . '">' . $value['title'] . '</h4>';
364
+ }
365
+ echo'</div>';
366
+
367
+ //body
368
+ $even = 0;
369
+ foreach ($body as $section) {
370
+ if( ++$even%2 )
371
+ echo '<div class="row rt-odd">';
372
+ else
373
+ echo '<div class="row rt-even">';
374
+
375
+ foreach ($section as $value) {
376
+ echo '<div class="columns ' . $value['class'] . '">';
377
+ if (isset($value['content'])) {
378
+ if (is_array($value['content'])) {
379
+ foreach ($value['content'] as $entity) {
380
+ echo '<div class="entity section">';
381
+ echo $entity;
382
+ echo '</div>';
383
+ }
384
+ }
385
+ else
386
+ echo $value['content'];
387
+ } else {
388
+ for ($i = 0; $i < count($value['callbacks']); $i++) {
389
+ echo '<div class="section">';
390
+ call_user_func($value['callbacks'][$i], $value['args'][$i]);
391
+ echo '</div>';
392
+ }
393
+ }
394
+ echo '</div>';
395
+ }
396
+ echo '</div>';
397
+ }
398
+
399
+ echo '</div>';
400
+ }
401
+
402
+ public static function privacy_content($page = '') {
403
+
404
+ global $wp_settings_fields;
405
+
406
+ if (!isset($wp_settings_fields) ||
407
+ !isset($wp_settings_fields[$page]) ||
408
+ !isset($wp_settings_fields[$page]['bpm-privacy']))
409
+ return;
410
+
411
+ echo '<div class="large-12">';
412
+ foreach ($wp_settings_fields[$page]['bpm-privacy'] as $key => $value) {
413
+ echo '<div class="row section" id="' . $key . '">';
414
+ echo '<div class="columns large-2">' . $value['title'] . '</div>';
415
+ echo '<div class="columns large-5">';
416
+ if($key != "bpm-privacy-enabled")
417
+ call_user_func($value['callback'], array_merge_recursive($value['args'], array('class' => array("privacy-driven-disable"))));
418
+ else
419
+ call_user_func($value['callback'], $value['args']);
420
+ echo '</div>';
421
+ echo '</div>';
422
+ }
423
+ echo '</div>';
424
+ }
425
+
426
+ public static function misc_content($page = '') {
427
+
428
+ global $wp_settings_sections, $wp_settings_fields;
429
+
430
+ if (!isset($wp_settings_fields) ||
431
+ !isset($wp_settings_fields[$page]) ||
432
+ !isset($wp_settings_fields[$page]['bpm-activity-upload']) ||
433
+ !isset($wp_settings_fields[$page]['bpm-media-lightbox']) ||
434
+ !isset($wp_settings_fields[$page]['bpm-media-fine']) ||
435
+ !isset($wp_settings_fields[$page]['bpm-miscellaneous']) )
436
+ return;
437
+
438
+ $sections = array("bpm-activity-upload","bpm-media-lightbox","bpm-media-fine","bpm-miscellaneous");
439
+
440
+ echo '<div class="large-12">';
441
+ foreach ($sections as $section) {
442
+ echo '<h3>' . $wp_settings_sections[$page][$section]['title'] . '</h3>';
443
+ foreach ($wp_settings_fields[$page][$section] as $value) { ?>
444
+ <div class="row section">
445
+ <div class="columns large-2"> <?php echo $value['title']; ?> </div>
446
+ <div class="columns large-4">
447
+ <?php call_user_func($value['callback'], $value['args']); ?>
448
+ </div>
449
+ </div>
450
+ <?php }
451
+ echo '<div class="clearfix">&nbsp;</div>';
452
+ }
453
+ echo '</div>';
454
+ }
455
+
456
+ public static function rtForm_settings_tabs_content($page, $sub_tabs) {
457
+
458
+ global $wp_settings_sections, $wp_settings_fields;
459
+
460
+ if (!isset($wp_settings_sections) || !isset($wp_settings_sections[$page]))
461
+ return;
462
+
463
+ foreach ($sub_tabs as $tab) {
464
+ echo '<div id="' . substr($tab['href'], 1) . '">';
465
+ call_user_func($tab['callback'], $page);
466
+ echo '</div>';
467
+ }
468
+
469
+ // echo "<pre>";
470
+ // print_r($wp_settings_sections);
471
+ // echo "<br>---------------------------------------------------------------------------<br><br>";
472
+ // print_r($wp_settings_fields);
473
+ // echo "</pre>";
474
+
475
+ // echo '<div class="small-11 small-centered columns">';
476
+ // foreach ( (array) $wp_settings_sections[$page] as $section ) {
477
+ // if ( $section['title'] )
478
+ // echo "<div><h3>{$section['title']}</h3>";
479
+ //
480
+ // if ( $section['callback'] )
481
+ // call_user_func( $section['callback'], $section );
482
+ //
483
+ // if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) )
484
+ // continue;
485
+ // echo '<div class="row small-11 small-centered columns">';
486
+ // self::rtForm_do_settings_fields( $page, $section['id'] );
487
+ // echo '</div></div>';
488
+ // }
489
+ // echo '</div>';
490
+ }
491
+
492
+ public static function rtForm_do_settings_fields($page, $section) {
493
+ global $wp_settings_fields;
494
+
495
+ if (!isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]))
496
+ return;
497
+
498
+ foreach ((array) $wp_settings_fields[$page][$section] as $field) {
499
+ echo '<div class="row">';
500
+ echo '<div class="large-11 columns">';
501
+
502
+ if (isset($field['args']['label_for']) && !empty($field['args']['label_for']))
503
+ call_user_func($field['callback'], array_merge($field['args'], array('label' => $field['args']['label_for'])));
504
+ else if (isset($field['title']) && !empty($field['title']))
505
+ call_user_func($field['callback'], array_merge($field['args'], array('label' => $field['title'])));
506
+ else
507
+ call_user_func($field['callback'], $field['args']);
508
+ echo '</div>';
509
+ echo '</div>';
510
+ }
511
+ }
512
+ }
513
+ ?>
app/assets/css/admin.css CHANGED
@@ -1,134 +1,83 @@
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;}
43
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.addons{background-position-y:-34px;}
44
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.support{background-position-y:-64px;}
45
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.update-database{background-position-y:-94px;}
46
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.ffmpeg{background-position-y:-154px;}
47
- .wrap.bp-media-admin .bp-media-settings-tabs a.nav-tab.kaltura{background-position-y:-184px;}
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{
54
- background:url('../img/admin-menu.png') 0 -32px no-repeat;
55
}
56
57
- #rt-donate-button, .rt-link img{vertical-align: middle;}
58
- #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings div.wp-menu-image{
59
- background-position: 0 -32px;
60
}
61
- #adminmenu .menu-icon-generic.wp-has-current-submenu.toplevel_page_bp-media-settings div.wp-menu-image,
62
- #adminmenu .menu-icon-generic.toplevel_page_bp-media-settings:hover div.wp-menu-image{
63
- background-position-y:0;
64
}
65
66
- #bp-media-addons-list_metabox {background: #ffffff}
67
- .products ul:after, ul.products:after {clear: both;content: "";display: block;}
68
- .products ul, ul.products {clear: both;list-style: none outside none;margin: 0 0 14px;padding: 0;}
69
- .bp-media-addon {margin: 0;}
70
- .bp-media-addon.first { }
71
- .bp-media-addon {margin: 20px 10px 30px;padding: 5px;position: relative;border: 1px solid #ccc;}
72
- .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;}
73
- .bp-media-addon a {text-decoration: none;}
74
- .bp-media-addon a img, div.product div.images img {box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);}
75
- .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}
76
77
- .bp-media-addon .price, .bp-media-addon .price .amount, .bp-media-addon .price ins {color: #85AD74;font-size: 25px;font-weight: bold;}
78
- .bp-media-addon .price {line-height: 1.4em;color: #85AD74;display: block;font-weight: normal;margin-bottom: 0.5em;}
79
- .coming-soon { background: url("../img/coming-soon.png"); z-index: 5; position:absolute;height:191px; opacity:0.9;}
80
- .coming-soon.coming-soon-l { background-position: 0 0; width:250px; top:-12px; left:-18px;}
81
- .coming-soon.coming-soon-r { background-position: 347px 0; width:174px; bottom:-14px; right:-12px;}
82
- .coming-soon.coming-soon-r:hover{background-position: 175px 0;}
83
84
- .bp-media-addon .product_footer{margin: 20px 0 0;overflow: hidden;}
85
- .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)}
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}
94
- #wpadminbar .bp-media-settings-menu:hover .ab-icon{background-position: -8px -41px}
95
96
- /* BuddyPress media admin support form styling */
97
- .bp-media-updated, .bp-media-error{border-radius: 3px; padding: 0 7px; margin: 5px 0 15px; border: 1px solid}
98
- .bp-media-updated p, .bp-media-error p{margin: 0.5em 0;padding: 2px;}
99
- .bp-media-updated{background-color: #FFFFE0;border-color: #E6DB55;}
100
- .bp-media-error{background-color: #FFEBE8;border-color: #CC0000;}
101
- .bp-media-form li{margin-bottom: 10px}
102
- .bp-media-form .bp-media-label{display: inline-block;margin-right: 10px;width: 150px;vertical-align: top; }
103
- .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;}
104
- .bp-media-form .bp-media-checkbox{margin-right: 10px; margin-left: 160px}
105
- .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;}
106
- .bp-media-form .bp-media-select{margin: 0;max-width: 400px;}
107
- .bp-media-support-attachment label{float: left}
108
- .bp-media-support-attachment .more-attachment{margin-left: 160px; margin-top: 10px}
109
- .bp-media-support-attachment .more-attachment:first-child{margin-top: 0px}
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;}
117
- .rt-update{background-color: #FFEAA6;border-color:#E1CA82;}
118
- img.bp-media-donation-image{display:block;margin: 10px auto;}
119
- #donate form{text-align: center;}
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
+ /*------ custom CSS ------*/
2
+ /* line 5, ../sass/admin.scss */
3
+ .clearfix {
4
+ overflow: hidden;
5
+ *zoom: 1;
6
}
7
8
+ /* line 9, ../sass/admin.scss */
9
+ .pull-right {
10
+ float: right;
11
}
12
+
13
+ /* line 13, ../sass/admin.scss */
14
+ .pull-left {
15
+ float: left;
16
}
17
18
+ /* line 17, ../sass/admin.scss */
19
+ .inline {
20
+ display: inline;
21
+ }
22
23
+ /* line 21, ../sass/admin.scss */
24
+ .entity {
25
+ min-height: 25px !important;
26
+ }
27
28
+ /* line 25, ../sass/admin.scss */
29
+ .section {
30
+ margin-top: 5px !important;
31
+ margin-bottom: 5px !important;
32
+ }
33
34
+ /* line 32, ../sass/admin.scss */
35
+ .rt-table div.rt-header {
36
+ border-bottom-color: #F3F3F3;
37
+ border-bottom-width: 1px;
38
+ border-bottom-style: solid;
39
+ margin-bottom: 5px !important;
40
+ padding-bottom: 5px !important;
41
+ }
42
+ /* line 39, ../sass/admin.scss */
43
+ .rt-table div.rt-header h4 {
44
+ margin: 0;
45
+ }
46
+ /* line 44, ../sass/admin.scss */
47
+ .rt-table div.row {
48
+ margin: 2px;
49
+ padding: 2px;
50
+ }
51
+ /* line 48, ../sass/admin.scss */
52
+ .rt-table div.row.rt-odd {
53
+ background-color: #F3F3F3;
54
+ }
55
+ /* line 52, ../sass/admin.scss */
56
+ .rt-table div.row.rt-even {
57
+ background-color: #FFFFFF;
58
+ }
59
60
+ /* line 58, ../sass/admin.scss */
61
+ abbr {
62
+ border-bottom: dotted 1px;
63
+ }
64
65
+ /* line 62, ../sass/admin.scss */
66
+ .rt-description {
67
+ color: #666666;
68
+ font-style: italic;
69
}
70
71
+ /* line 67, ../sass/admin.scss */
72
+ .bpm-wp-button {
73
+ height: 27px !important;
74
+ }
75
+ /* line 71, ../sass/admin.scss */
76
+ .bpm-wp-button .bpm-wp-icon {
77
+ background-image: url(../img/wpmini-grey.png);
78
+ width: 20px;
79
+ height: 24px;
80
+ font-size: 14px;
81
+ background-repeat: no-repeat;
82
+ padding: 0 6px;
83
}
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
+