PluginProbe
Social Share Buttons / 1.16
Social Share Buttons v1.16
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
share-button / admin / page_editor.php

page_editor.php in Social Share Buttons 1.16, at admin/page_editor.php

135 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MBSocial;
3 defined('ABSPATH') or die('No direct access permitted');
4
5 use MaxButtons\maxButton as maxButton;
6 use MaxButtons\maxBlocks as maxBlocks;
7
8 $button = new maxButton(); // this loads the maxblocks template files
9
10
11 $title = (Install::isPro()) ? __('Wordpress Share Buttons PRO', 'mbsocial') : __('WordPress Share Buttons','mbsocial');
12 $header = array(
13 'title' => $title,
14 );
15
16 $mainclass = 'maxbuttons-social-editor';
17 $admin = mbSocial()->admin();
18 $admin->header($header);
19
20
21 $collection_ids = collections::getCollections();
22 $number_of_collections = count($collection_ids);
23
24 $the_collection_id = isset($_GET['social_id']) ? intval($_GET['social_id']) : false;
25
26 if ($the_collection_id === false && $number_of_collections > 0 )
27 {
28 $the_collection_id = $collection_ids[0]; // load the first one
29 }
30 else {
31 $collection_id = 0;
32 }
33 ?>
34
35 <form class='mb-ajax-form' data-action='save-share'>
36
37
38 <?php if($number_of_collections > 0) : ?>
39 <div class='help-side collection_switcher'>
40 <h3>Your Social Groups</h3>
41 <?php //
42
43 echo '<div class="item heading"><span>' . __('name', 'mbsocial') . '</span><span>' . __('no buttons', 'mbsocial') . '</span><span>' . __('shortcode', 'mbsocial') . '</span></div>';
44
45 foreach($collection_ids as $id) {
46 $collection = new collection($id);
47 $genBlock = $collection->getBlock('generalBlock');
48 $name = $genBlock->getValue('name');
49 $nwBlock = $collection->getBlock('networkBlock');
50
51 $networks_number = count($nwBlock->getValue('network_active')); // )
52
53 $name = ( strlen($name) > 0) ? $name : '#' . $id;
54 $active = ($id == $the_collection_id) ? 'active' : '';
55
56
57
58 if ( Install::isPRO() )
59 {
60 $link = '<a href="' . add_query_arg('social_id', $id) . '"><span>' . $name . '</span>';
61 $linkend = '</a>';
62 }
63 else {
64 $link = '<span>' . $name . '</span>';
65 $linkend = '';
66 }
67 echo '<div class="item ' . $active . '">';
68 echo $link;
69 echo '<span> [' . $networks_number . ' buttons] </span>';
70 echo '<span> [maxsocial id="' . $id . '"] </span>';
71 echo $linkend;
72 echo '</div>';
73
74 }
75
76 if ( Install::isPRO() )
77 {
78 $link = '<a href="' . add_query_arg('social_id', 0) . '" title="' . __('Add', 'mbsocial') . '"> <span class="plus">+</span> ' . __('Add', 'mbsocial') . '</a>';
79 }
80 else {
81 $link = '<a><span class="plus">+</span> ' . __('Add', 'mbsocial') . '</a>';
82 }
83
84 echo '<span class="item new">' . $link . '</span>';
85
86
87 if (! Install::isPro() )
88 { ?>
89 <div class='forpro overlay'><div><?php echo $admin->getProMessage(); ?></div></div>
90 <?php } ?>
91 </div>
92 <?php endif; ?>
93
94 <?php if ($the_collection_id > 0):
95 $collection_id = $the_collection_id;
96 ?>
97
98 <div class='mb-message shortcode'>
99 <?php printf(__('Shortcode for manual use: [maxsocial id="%s"]','mbsocial'), $collection_id); ?>
100 </div>
101 <?php endif; ?>
102
103 <input type='hidden' name="collection_id" value="<?php echo $collection_id ?>" />
104 <input type='hidden' name="form_post" value="true" />
105
106 <div class="form-actions ">
107 <button type="button" class="button-primary button-save mb-ajax-submit" data-action='save_collection'><?php _e('Save', 'mbsocial') ?></button>
108 <?php if ($collection_id > 0 && Install::isPro()): ?>
109 <button type='button' class='button remove maxmodal' data-modal='modal_remove'><?php _e('Delete', 'mbsocial'); ?></button>
110 <?php endif; ?>
111 </div>
112
113
114 <?php include('share_editor.php'); ?>
115
116
117 <div class="form-actions">
118 <button type="button" class="button-primary button-save mb-ajax-submit" data-action='save_collection'><?php _e('Save', 'mbsocial') ?></button>
119 </div>
120
121 <div id='modal_remove' class='maxmodal-data'>
122 <div class='title'><?php _e('Delete Social Group', 'mbsocial'); ?></div>
123 <span class="content"><p><?php _e("You are about to permanently remove this Social Group. Are you sure?", "mbsocial"); ?></p></span>
124 <div class='controls'>
125 <button type="button" class='button-primary mb-ajax-action' data-action='remove-collection' data-param='<?php echo $collection_id ?>'>
126 <?php _e('Yes','mbsocial'); ?></button>
127
128 <a class="modal_close button-primary"><?php _e("No", "mbsocial"); ?></a>
129
130 </div>
131
132 </div> <!-- modal -->
133 <?php $admin->footer(); ?>
134 </form>
135