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 -95 1.301.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,119 +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 -}
23 +if (count($collection_ids) == 0)
24 + $collection_ids = array(0);
33 25
34 -$url = mbSocial()->get_page_url();
26 +
35 27 ?>
36 28
37 -<form class='mb-ajax-form save-on-key' data-action='save-share'>
29 +<?php foreach ($collection_ids as $collection_id): ?>
38 30
39 -
40 -<?php if($number_of_collections > 0) : ?>
41 -<div class='help-side collection_switcher'>
42 - <h3><?php _e('Your Social Groups','mbsocial'); ?></h3>
43 - <?php
44 -
45 - echo '<div class="item heading"><span>' . __('name', 'mbsocial') . '</span><span>' . __('no buttons', 'mbsocial') . '</span><span>' . __('shortcode', 'mbsocial') . '</span></div>';
46 -
47 - foreach($collection_ids as $id) {
48 - $collection = new collection($id);
49 - $genBlock = $collection->getBlock('generalBlock');
50 - $name = $genBlock->getValue('name');
51 - $nwBlock = $collection->getBlock('networkBlock');
52 -
53 - $networks_number = count($nwBlock->getValue('network_active')); // )
54 -
55 - $name = ( strlen($name) > 0) ? $name : '#' . $id;
56 - $active = ($id == $the_collection_id) ? 'active' : '';
57 -
58 -
59 -
60 - if ( Install::isPRO() )
61 - {
62 - $link = '<a href="' . esc_url(add_query_arg('social_id', $id, $url)) . '"><span>' . $name . '</span>';
63 - $linkend = '</a>';
64 - }
65 - else {
66 - $link = '<span>' . $name . '</span>';
67 - $linkend = '';
68 - }
69 - echo '<div class="item ' . $active . '">';
70 - echo $link;
71 - echo '<span> [' . $networks_number . ' buttons] </span>';
72 - echo '<span> [maxsocial id="' . $id . '"] </span>';
73 - echo $linkend;
74 - echo '</div>';
75 -
76 - }
77 -
78 - if ( Install::isPRO() )
79 - {
80 - $link = '<a href="' . esc_url(add_query_arg('social_id', 0, $url)) . '" title="' . __('Add', 'mbsocial') . '"> <span class="plus">+</span> ' . __('Add', 'mbsocial') . '</a>';
81 - }
82 - else {
83 - $link = '<a><span class="plus">+</span> ' . __('Add', 'mbsocial') . '</a>';
84 - }
85 -
86 - echo '<span class="item new">' . $link . '</span>';
87 -
88 -
89 - if (! Install::isPro() )
90 - { ?>
91 - <div class='forpro overlay'><div><?php echo $admin->getProMessage(); ?></div></div>
92 - <?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); ?>
93 34 </div>
94 35 <?php endif; ?>
95 36
96 - <?php if ($the_collection_id > 0):
97 - $collection_id = $the_collection_id;
98 - ?>
37 +<form class='mb-ajax-form' data-action='save-share'>
38 + <input type='hidden' name="collection_id" value="<?php echo $collection_id ?>" />
99 39
100 - <div class='mb-message shortcode'>
101 - <?php printf(__('Shortcode for manual use: [maxsocial id="%s"]','mbsocial'), $collection_id); ?>
102 - </div>
103 - <?php endif; ?>
104 40
105 - <input type='hidden' name="collection_id" value="<?php echo $collection_id ?>" />
106 - <input type='hidden' name="form_post" value="true" />
107 -
108 41 <div class="form-actions ">
109 - <button type="button" class="button-primary button-save mb-ajax-submit" data-action='save_collection'><?php _e('Save', 'mbsocial') ?></button>
110 - <?php if ($collection_id > 0 && Install::isPro()): ?>
111 - <button type='button' class='button remove maxmodal' data-modal='modal_remove'><?php _e('Delete', 'mbsocial'); ?></button>
112 - <?php endif; ?>
42 + <button type="button" class="button-primary button-save mb-ajax-submit" data-action='save_collection'><?php _e('Save', 'maxbuttons') ?></button>
113 43 </div>
114 44
45 + <?php include('share_editor.php'); ?>
115 46
116 - <?php include('share_editor.php'); ?>
47 + <?php //$admin->output_defined_fields(); ?>
117 48
118 49
50 +
119 51 <div class="form-actions">
120 - <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>
121 53 </div>
122 -
123 - <div id='modal_remove' class='maxmodal-data'>
124 - <div class='title'><?php _e('Delete Social Group', 'mbsocial'); ?></div>
125 - <span class="content"><p><?php _e("You are about to permanently remove this Social Group. Are you sure?", "mbsocial"); ?></p></span>
126 - <div class='controls'>
127 - <button type="button" class='button-primary mb-ajax-action' data-action='remove-collection' data-param='<?php echo $collection_id ?>'>
128 - <?php _e('Yes','mbsocial'); ?></button>
129 -
130 - <a class="modal_close button-primary"><?php _e("No", "mbsocial"); ?></a>
131 -
132 - </div>
133 -
134 - </div> <!-- modal -->
135 54 <?php $admin->footer(); ?>
136 55 </form>
56 +<?php endforeach; ?>