PluginProbe
Social Share Buttons / 1.7
Social Share Buttons v1.7
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.7, at admin/page_editor.php

126 lines 3.8 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 //if (Install::isPro()):
43
44 foreach($collection_ids as $id) {
45 $collection = new collection($id);
46 $genBlock = $collection->getBlock('generalBlock');
47 $name = $genBlock->getValue('name');
48 $nwBlock = $collection->getBlock('networkBlock');
49
50 $networks_number = count($nwBlock->getValue('network_active')); // )
51
52 $name = ( strlen($name) > 0) ? $name : '#' . $id;
53 $active = ($id == $the_collection_id) ? 'active' : '';
54
55 if ( Install::isPRO() )
56 $link = '<span><a href="' . add_query_arg('social_id', $id) . '">' . $name . '</a></span>';
57 else {
58 $link = '<span>' . $name . '</span>';
59 }
60 echo '<div class="item ' . $active . '">';
61 echo $link;
62 echo '<span> [' . $networks_number . ' buttons] </span>';
63 echo '<span> [maxsocial id="' . $id . '"] </span>';
64 echo '</div>';
65
66 }
67
68 if ( Install::isPRO() )
69 {
70 $link = '<a href="' . add_query_arg('social_id', 0) . '" title="' . __('Add', 'mbsocial') . '"> <span class="plus">+</span> ' . __('Add', 'mbsocial') . '</a>';
71 }
72 else {
73 $link = '<a><span class="plus">+</span> ' . __('Add', 'mbsocial') . '</a>';
74 }
75
76 echo '<span class="item new">' . $link . '</span>';
77
78
79 if (! Install::isPro() )
80 { ?>
81 <div class='forpro overlay'><div><?php echo $admin->getProMessage(); ?></div></div>
82 <?php } ?>
83 </div>
84 <?php endif; ?>
85
86 <?php if ($the_collection_id > 0):
87 $collection_id = $the_collection_id;
88 ?>
89
90 <div class='mb-message shortcode'>
91 <?php printf(__('Shortcode for manual use: [maxsocial id="%s"]','mbsocial'), $collection_id); ?>
92 </div>
93 <?php endif; ?>
94
95 <input type='hidden' name="collection_id" value="<?php echo $collection_id ?>" />
96
97 <div class="form-actions ">
98 <button type="button" class="button-primary button-save mb-ajax-submit" data-action='save_collection'><?php _e('Save', 'mbsocial') ?></button>
99 <?php if ($collection_id > 0 && Install::isPro()): ?>
100 <button type='button' class='button remove maxmodal' data-modal='modal_remove'><?php _e('Delete', 'mbsocial'); ?></button>
101 <?php endif; ?>
102 </div>
103
104
105 <?php include('share_editor.php'); ?>
106
107
108 <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 </div>
111
112 <div id='modal_remove' class='maxmodal-data'>
113 <div class='title'><?php _e('Delete Social Group', 'mbsocial'); ?></div>
114 <span class="content"><p><?php _e("You are about to permanently remove this Social Group. Are you sure?", "mbsocial"); ?></p></span>
115 <div class='controls'>
116 <button type="button" class='button-primary mb-ajax-action' data-action='remove-collection' data-param='<?php echo $collection_id ?>'>
117 <?php _e('Yes','mbsocial'); ?></button>
118
119 <a class="modal_close button-primary"><?php _e("No", "mbsocial"); ?></a>
120
121 </div>
122
123 </div> <!-- modal -->
124 <?php $admin->footer(); ?>
125 </form>
126