PluginProbe
MaxButtons – Create buttons / 7.13
MaxButtons – Create buttons v7.13
6.23 6.24 6.25 6.26 6.26.1 6.27 6.28 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.1.1 7.1.2 7.1.3 7.10 7.11 7.13 7.13.1 7.13.2 7.13.3 All 100 releases
maxbuttons / includes / maxbuttons-settings.php

maxbuttons-settings.php in MaxButtons – Create buttons 7.13, at includes/maxbuttons-settings.php

246 lines 11.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MaxButtons;
3 defined('ABSPATH') or die('No direct access permitted');
4
5 // settings for this page are registered in register_setting ( main class )
6
7 $button = MB()->getClass('button'); // To load maxfield templates
8
9
10
11 ?>
12 <?php
13 $admin = MB()->getClass('admin');
14 $page_title = __("Settings","maxbuttons");
15 $admin->get_header(array("tabs_active" => true, "title" => $page_title) );
16 ?>
17
18 <div class="mb_tab"> <!-- first tab --->
19 <div class="title">
20 <span class="dashicons dashicons-list-view"></span>
21 <span class='title'><?php _e('Settings', 'maxbuttons') ?></span>
22 </div>
23 <div class="option-container">
24 <div class="title"><?php _e('Settings','maxbuttons'); ?></div>
25 <div class="inside">
26
27 <form method="post" action="options.php">
28 <div class="option-design">
29
30 <?php settings_fields( 'maxbuttons_settings' ); ?>
31 <label><?php _e('MaxButtons User Level for editing buttons', 'maxbuttons') ?></label>
32 <div class="input">
33 <select name="maxbuttons_user_level">
34 <?php $maxbuttons_user_level = get_option('maxbuttons_user_level'); ?>
35 <option value="edit_posts" <?php if($maxbuttons_user_level === 'edit_posts') { echo 'selected="selected"'; } ?>>Contributor</option>
36 <option value="edit_published_posts" <?php if($maxbuttons_user_level === 'edit_published_posts') { echo 'selected="selected"'; } ?>>Author</option>
37 <option value="manage_categories" <?php if($maxbuttons_user_level === 'manage_categories') { echo 'selected="selected"'; } ?>>Editor</option>
38 <option value="manage_options" <?php if($maxbuttons_user_level === 'manage_options') { echo 'selected="selected"'; } ?>>Administrator</option>
39 </select>
40 <br />
41 <?php printf( __('For more details on user roles and permissions, click %s here%s.','maxbuttons'),
42 '<a target="_blank" href="https://codex.wordpress.org/Roles_and_Capabilities">',
43 "</a>");
44 ?>
45
46 </div>
47
48 <div class="clear"></div>
49 </div><!-- option-design -->
50
51 <div class="option-design">
52 <?php
53 $option_noshow = get_option('maxbuttons_noshowtinymce');
54
55 $nomce = new maxField('switch');
56 $nomce->label = __('Hide "add button" in post editor toolbar', 'maxbuttons');
57 $nomce->name = 'maxbuttons_noshowtinymce';
58 $nomce->id = $nomce->name;
59 $nomce->value = '1';
60 $nomce->checked = checked($option_noshow, 1, false);
61 $nomce->output ('start','end');
62 ?>
63
64 </div>
65
66 <?php
67 $option_minify = get_option("maxbuttons_minify", 1);
68 $option_description_hide = get_option('maxbuttons_hidedescription',0);
69 $option_borderbox = get_option('maxbuttons_borderbox', 0);
70
71 ?>
72 <div class="option-design">
73 <?php
74 $minify = new maxField('switch');
75 $minify->note = __('Recommended, only turn off in case of issues. You will have to clear your cache after changing this setting', 'maxbuttons') ;
76 $minify->label = __('Minify Button CSS', 'maxbuttons');
77 $minify->name = 'maxbuttons_minify';
78 $minify->id = $minify->name;
79 $minify->value = '1';
80 $minify->checked = checked($option_minify, 1, false);
81 $minify->output ('start','end');
82 ?>
83 </div>
84
85 <div class="option-design">
86 <?php
87 $desc = new maxField('switch');
88 $desc->label = __('Hide description field', 'maxbuttons');
89 $desc->name = 'maxbuttons_hidedescription';
90 $desc->id = $desc->name;
91 $desc->value = '1';
92 $desc->checked = checked($option_description_hide, 1, false);
93 $desc->output ('start','end');
94 ?>
95 </div>
96
97 <div class='option-design'>
98 <?php
99 $bbox = new maxField('switch');
100 $bbox->label = __('Preview in Border Box mode','maxbuttons');
101 $bbox->note = __('A lot of modern themes render their templates as "border box". If you notice that padding
102 and borders looks differently on the site compared to preview, try to turn this option on', 'maxbuttons');
103 $bbox->name = 'maxbuttons_borderbox';
104 $bbox->id = $bbox->name;
105 $bbox->value = '1';
106 $bbox->checked = checked($option_borderbox, 1, false);
107 $bbox->output('start','end');
108 ?>
109 </div>
110
111 <div class='option-design'>
112 <?php
113 /* $option_forcefa = get_option('maxbuttons_forcefa');
114
115 $fa = new maxField('switch');
116 $fa->label = __('FontAwesome conflict mode', 'maxbuttons');
117 $fa->note = __('If other plugins are conflicting with FontAwesome, tries to force plugin version.');
118 $fa->name = 'maxbuttons_forcefa';
119 $fa->id = $fa->name;
120 $fa->value = '1';
121 $fa->checked = checked($option_forcefa, 1, false);
122 $fa->output('start','end'); */
123
124 $prot = new maxField('text');
125 $prot->id = 'maxbuttons_protocol';
126 $prot->name = $prot->id;
127 $prot->value = get_option('maxbuttons_protocol');
128 $prot->label = __('Additional allowed link protocols', 'maxbuttons');
129 $prot->note = __('Separate multiple protocols with comma', 'maxbuttons');
130 $prot->help = __('You can add link formats not regarded as "safe" by WordPress. Use this if links are removed or lose their protocol ( xx:// ). For instance: "file,sms,skype" .', 'maxbuttons');
131
132 $prot->output('start', 'end');
133 ?>
134 </div>
135
136
137 <?php do_action("maxbuttons_settings_end"); ?>
138 <?php submit_button(); ?>
139 </form>
140 </div>
141 </div>
142
143
144 <form method="POST">
145 <input type="hidden" name="reset_cache" value="true" />
146 <div class="option-container">
147 <div class="title"><?php _e("Clear button cache","maxbuttons"); ?></div>
148 <div class="inside">
149 <p><?php _e("Maxbuttons caches the style output allowing for lightning fast display of your buttons. In the event
150 this cache needs to be flushed and rebuilt you can reset the cache here.","maxbuttons"); ?></p>
151 <?php submit_button(__("Reset Cache", "maxbuttons") ); ?>
152 </div>
153 </div>
154 </form>
155
156 </div> <!-- /first tab --->
157 <div class="mb_tab"><!-- advanced tab -->
158 <div class="title">
159 <span class="dashicons dashicons-list-view"></span>
160 <span class='title'><?php _e('Advanced', 'maxbuttons') ?></span>
161 </div>
162
163 <form method="POST">
164 <div class="option-container">
165
166 <input type="hidden" name="remigrate" value="true" />
167 <div class="title"><?php _e("Retry Database migration","maxbuttons"); ?></div>
168 <div class="inside"><p><?php _e("In case the upgrade functionality failed to move your old buttons from MaxButtons before version 3, you can do so here manually. <strong>Attention</strong> The new database table (maxbuttonsv3) *must* be empty, and the old database table *must* contain buttons otherwise this will not run. Run this <strong>at your own risk</strong> - it is strongly advised to make a backup before doing so.", "maxbuttons"); ?></p>
169 <?php submit_button(__("Remigrate", "maxbuttons") ); ?>
170 </div>
171
172
173 </div>
174 </form>
175
176 <div class="option-container">
177 <div class="title"><?php _e('UTF8 Table Fix', 'maxbuttons') ?></div>
178 <div class="inside">
179 <div class="option-design" >
180 <h3 class="alert"><?php _e('WARNING: We strongly recommend backing up your database before altering the charset of the MaxButtons table in your WordPress database.', 'maxbuttons') ?></h3>
181
182 <h3><?php _e('The button below should help fix the "foreign character issue" some people experience when using MaxButtons. If you use foreign characters in your buttons and after saving see ????, use this button.', 'maxbuttons') ?></h3>
183
184 <form action="" method="POST">
185 <input type="submit" name="alter_charset" class="button-primary" value="<?php _e('Change MaxButtons Table To UTF8', 'maxbuttons') ?>" /> <?php echo $view->response; ?>
186 </form>
187
188
189 <div class="clear"></div>
190 </div>
191 </div>
192 </div>
193
194 <?php if (isset($_GET["show_replace"])): ?>
195 <form method="POST">
196 <div class="option-container">
197 <?php
198 $button = MB()->getClass('button');
199 $button->set(0);
200 $data = $button->get();
201
202 $allfields = array();
203
204 foreach($data as $block => $fields)
205 {
206 if ( is_array($fields) )
207 $allfields = array_merge($allfields, array_keys($fields));
208
209 }
210 $allfields = array_combine($allfields, $allfields);
211
212 wp_nonce_field( 'mb_bulk_edit','bulk_edit' );
213 ?>
214
215 <input type="hidden" name="replace" value="true" />
216 <div class="title"> <?php _e("Bulk edit","maxbuttons"); ?></div>
217
218 <div class="inside" >
219 <p><strong><?php _e("Using Bulk editor MAY and probably WILL destroy your buttons. In case you wish to prevent this - please BACKUP all your buttons before proceeding!","maxbuttons"); ?></strong></p>
220
221 <div class="option"><label><?php _e("Field", "maxbuttons"); ?> </label> <?php echo maxUtils::selectify("replace_field", $allfields, 'url'); ?></div>
222
223 <div class="option"><label><?php _e("Search","maxbuttons"); ?> </label> <input type="text" name="search" value=""></div>
224 <div class="option"><label><?php _e("Replace","maxbuttons"); ?> </label> <input type="text" name="replace" value=""></div>
225
226
227 <p style="color: #ff0000"> <?php _e("I understand that this may destroy all my buttons", "maxbuttons"); ?></p>
228
229 <p><?php _e("", "maxbuttons"); ?></p>
230 <?php submit_button(__("Replace", "maxbuttons") ); ?>
231 </div>
232 </div>
233 </form>
234
235 <?php else: ?>
236 <a href="<?php echo add_query_arg('show_replace',true); ?>"><?php _e("I need to bulk edit something","maxbuttons"); ?></a>
237 <?php endif; ?>
238
239 </div>
240 </div> <!-- advanced tab -->
241 <div class="ad-wrap">
242 <?php do_action("mb-display-ads"); ?>
243 </div>
244
245 <?php $admin->get_footer(); ?>
246