PluginProbe
Social Share Buttons / 1.2
Social Share Buttons v1.2
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
← All changes | admin/page_editor.php +15 -93 1.171.2 View file →
@@ -2,9 +2,8 @@
2 2 namespace MBSocial;
3 3 defined('ABSPATH') or die('No direct access permitted');
4 4
5 5 use MaxButtons\maxButton as maxButton;
6 -use MaxButtons\maxBlocks as maxBlocks;
7 6
8 7 $button = new maxButton(); // this loads the maxblocks template files
9 8
10 9
@@ -18,117 +17,40 @@
18 17 $admin->header($header);
19 18
20 19
21 20 $collection_ids = collections::getCollections();
22 -$number_of_collections = count($collection_ids);
23 21
24 -$the_collection_id = isset($_GET['social_id']) ? intval($_GET['social_id']) : false;
25 22
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 -?>
23 +if (count($collection_ids) == 0)
24 + $collection_ids = array(0);
34 25
35 -<form class='mb-ajax-form' data-action='save-share'>
36 26
27 +?>
37 28
38 -<?php if($number_of_collections > 0) : ?>
39 -<div class='help-side collection_switcher'>
40 - <h3>Your Social Groups</h3>
41 - <?php //
29 +<?php foreach ($collection_ids as $collection_id): ?>
42 30
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 } ?>
31 +<?php if ($collection_id > 0): ?>
32 +<div class='mb-message shortcode'>
33 + <?php printf(__('Shortcode for manual use: [maxsocial id="%s"]','mbsocial'), $collection_id); ?>
91 34 </div>
92 35 <?php endif; ?>
93 36
94 - <?php if ($the_collection_id > 0):
95 - $collection_id = $the_collection_id;
96 - ?>
37 +<form class='mb-ajax-form' data-action='save-share'>
38 + <input type='hidden' name="collection_id" value="<?php echo $collection_id ?>" />
97 39
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 40
103 - <input type='hidden' name="collection_id" value="<?php echo $collection_id ?>" />
104 - <input type='hidden' name="form_post" value="true" />
105 -
106 41 <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; ?>
42 + <button type="button" class="button-primary button-save mb-ajax-submit" data-action='save_collection'><?php _e('Save', 'maxbuttons') ?></button>
111 43 </div>
112 44
45 + <?php include('share_editor.php'); ?>
113 46
114 - <?php include('share_editor.php'); ?>
47 + <?php //$admin->output_defined_fields(); ?>
115 48
116 49
50 +
117 51 <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>
52 + <button type="button" class="button-primary button-save mb-ajax-submit" data-action='save_collection'><?php _e('Save', 'maxbuttons') ?></button>
119 53 </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 54 <?php $admin->footer(); ?>
134 55 </form>
56 +<?php endforeach; ?>