PluginProbe ʕ •ᴥ•ʔ
WPFront Scroll Top / 1.3
WPFront Scroll Top v1.3
1.5 1.6 1.6.1 1.6.2 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1 2.1.1 2.2 3.0.0 3.0.1 trunk 1.0 1.0.1 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5
wpfront-scroll-top / templates / options-template.php
wpfront-scroll-top / templates Last commit date
options-template.php 12 years ago scroll-top-template.php 12 years ago
options-template.php
367 lines
1 <?php
2 /*
3 WPFront Scroll Top Plugin
4 Copyright (C) 2013, WPFront.com
5 Website: wpfront.com
6 Contact: syam@wpfront.com
7
8 WPFront Scroll Top Plugin is distributed under the GNU General Public License, Version 3,
9 June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
10 St, Fifth Floor, Boston, MA 02110, USA
11
12 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 */
23
24 /**
25 * Template for WPFront Scroll Top Options
26 *
27 * @author Syam Mohan <syam@wpfront.com>
28 * @copyright 2013 WPFront.com
29 */
30 ?>
31
32 <?php @$this->options_page_header($this->__('WPFront Scroll Top Settings'), WPFront_Scroll_Top::OPTIONS_GROUP_NAME); ?>
33
34 <h3><?php echo $this->__('Display'); ?></h3>
35 <table class="form-table">
36 <tr>
37 <th scope="row">
38 <?php echo $this->options->enabled_label(); ?>
39 </th>
40 <td>
41 <input type="checkbox" name="<?php echo $this->options->enabled_name(); ?>" <?php echo $this->options->enabled() ? 'checked' : ''; ?> />
42 </td>
43 </tr>
44 <tr>
45 <th scope="row">
46 <?php echo $this->options->scroll_offset_label(); ?>
47 </th>
48 <td>
49 <input class="pixels" name="<?php echo $this->options->scroll_offset_name(); ?>" value="<?php echo $this->options->scroll_offset(); ?>" />px
50 <span class="description"><?php echo $this->__('[Number of pixels to be scrolled before the button appears.]'); ?></span>
51 </td>
52 </tr>
53 <tr>
54 <th scope="row">
55 <?php echo $this->__('Button Size'); ?>
56 </th>
57 <td>
58 <input class="pixels" name="<?php echo $this->options->button_width_name(); ?>" value="<?php echo $this->options->button_width(); ?>" />px
59 X
60 <input class="pixels" name="<?php echo $this->options->button_height_name(); ?>" value="<?php echo $this->options->button_height(); ?>" />px
61 <span class="description"><?php echo $this->__('[Set 0px to auto fit.]'); ?></span>
62
63 </td>
64 </tr>
65 <tr>
66 <th scope="row">
67 <?php echo $this->options->button_opacity_label(); ?>
68 </th>
69 <td>
70 <input class="seconds" name="<?php echo $this->options->button_opacity_name(); ?>" value="<?php echo $this->options->button_opacity(); ?>" />%
71 </td>
72 </tr>
73 <tr>
74 <th scope="row">
75 <?php echo $this->options->button_fade_duration_label(); ?>
76 </th>
77 <td>
78 <input class="seconds" name="<?php echo $this->options->button_fade_duration_name(); ?>" value="<?php echo $this->options->button_fade_duration(); ?>" />ms
79 <span class="description"><?php echo $this->__('[Button fade duration in milliseconds.]'); ?></span>
80 </td>
81 </tr>
82 <tr>
83 <th scope="row">
84 <?php echo $this->options->scroll_duration_label(); ?>
85 </th>
86 <td>
87 <input class="seconds" name="<?php echo $this->options->scroll_duration_name(); ?>" value="<?php echo $this->options->scroll_duration(); ?>" />ms
88 <span class="description"><?php echo $this->__('[Window scroll duration in milliseconds.]'); ?></span>
89 </td>
90 </tr>
91 <tr>
92 <th scope="row">
93 <?php echo $this->options->auto_hide_label(); ?>
94 </th>
95 <td>
96 <input type="checkbox" name="<?php echo $this->options->auto_hide_name(); ?>" <?php echo $this->options->auto_hide() ? "checked" : ""; ?> />
97 </td>
98 </tr>
99 <tr>
100 <th scope="row">
101 <?php echo $this->options->auto_hide_after_label(); ?>
102 </th>
103 <td>
104 <input class="seconds" name="<?php echo $this->options->auto_hide_after_name(); ?>" value="<?php echo $this->options->auto_hide_after(); ?>" />sec
105 <span class="description"><?php echo $this->__('[Button will be auto hidden after this duration in seconds, if enabled.]'); ?></span>
106 </td>
107 </tr>
108 <tr>
109 <th scope="row">
110 <?php echo $this->options->hide_small_device_label(); ?>
111 </th>
112 <td>
113 <input type="checkbox" name="<?php echo $this->options->hide_small_device_name(); ?>" <?php echo $this->options->hide_small_device() ? "checked" : ""; ?> />
114 <span class="description"><?php echo $this->__('[Button will be hidden on small devices when the width matches.]'); ?></span>
115 </td>
116 </tr>
117 <tr>
118 <th scope="row">
119 <?php echo $this->options->small_device_width_label(); ?>
120 </th>
121 <td>
122 <input class="pixels" name="<?php echo $this->options->small_device_width_name(); ?>" value="<?php echo $this->options->small_device_width(); ?>" />px
123 <span class="description"><?php echo $this->__('[Button will be hidden on devices with lesser or equal width.]'); ?></span>
124 </td>
125 </tr>
126 <tr>
127 <th scope="row">
128 <?php echo $this->options->hide_small_window_label(); ?>
129 </th>
130 <td>
131 <input type="checkbox" name="<?php echo $this->options->hide_small_window_name(); ?>" <?php echo $this->options->hide_small_window() ? "checked" : ""; ?> />
132 <span class="description"><?php echo $this->__('[Button will be hidden on broswer window when the width matches.]'); ?></span>
133 </td>
134 </tr>
135 <tr>
136 <th scope="row">
137 <?php echo $this->options->small_window_width_label(); ?>
138 </th>
139 <td>
140 <input class="pixels" name="<?php echo $this->options->small_window_width_name(); ?>" value="<?php echo $this->options->small_window_width(); ?>" />px
141 <span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
142 </td>
143 </tr>
144 <tr>
145 <th scope="row">
146 <?php echo $this->options->hide_wpadmin_label(); ?>
147 </th>
148 <td>
149 <input type="checkbox" name="<?php echo $this->options->hide_wpadmin_name(); ?>" <?php echo $this->options->hide_wpadmin() ? "checked" : ""; ?> />
150 <span class="description"><?php echo $this->__('[Button will be hidden on \'wp-admin\'.]'); ?></span>
151 </td>
152 </tr>
153 <tr>
154 <th scope="row">
155 <?php echo $this->options->hide_iframe_label(); ?>
156 </th>
157 <td>
158 <input type="checkbox" name="<?php echo $this->options->hide_iframe_name(); ?>" <?php echo $this->options->hide_iframe() ? "checked" : ""; ?> />
159 <span class="description"><?php echo $this->__('[Button will be hidden on iframes, usually inside popups.]'); ?></span>
160 </td>
161 </tr>
162 <tr>
163 <th scope="row">
164 <?php echo $this->options->button_style_label(); ?>
165 </th>
166 <td>
167 <div>
168 <label><input type="radio" name="<?php echo $this->options->button_style_name(); ?>" value="image" <?php echo $this->options->button_style() == 'image' ? 'checked' : ''; ?> /> <?php echo $this->__('Image'); ?></label>
169 <br />
170 <label><input type="radio" name="<?php echo $this->options->button_style_name(); ?>" value="text" <?php echo $this->options->button_style() == 'text' ? 'checked' : ''; ?> /> <?php echo $this->__('Text'); ?></label>
171 </div>
172 </td>
173 </tr>
174 </table>
175
176 <h3><?php echo $this->__('Text Button'); ?></h3>
177 <table class="form-table">
178 <tr>
179 <th scope="row">
180 <?php echo $this->options->text_button_text_label(); ?>
181 </th>
182 <td>
183 <input name="<?php echo $this->options->text_button_text_name(); ?>" value="<?php echo $this->options->text_button_text(); ?>" />
184 </td>
185 </tr>
186 <tr>
187 <th scope="row">
188 <?php echo $this->options->text_button_text_color_label(); ?>
189 </th>
190 <td>
191 <div class="color-selector-div">
192 <div class="color-selector" color="<?php echo $this->options->text_button_text_color(); ?>"></div>&#160;<span><?php echo $this->options->text_button_text_color(); ?></span>
193 <input type="hidden" name="<?php echo $this->options->text_button_text_color_name(); ?>" value="<?php echo $this->options->text_button_text_color(); ?>" />
194 </div>
195 </td>
196 </tr>
197 <tr>
198 <th scope="row">
199 <?php echo $this->options->text_button_background_color_label(); ?>
200 </th>
201 <td>
202 <div class="color-selector-div">
203 <div class="color-selector" color="<?php echo $this->options->text_button_background_color(); ?>"></div>&#160;<span><?php echo $this->options->text_button_background_color(); ?></span>
204 <input type="hidden" name="<?php echo $this->options->text_button_background_color_name(); ?>" value="<?php echo $this->options->text_button_background_color(); ?>" />
205 </div>
206 </td>
207 </tr>
208 <tr>
209 <th scope="row">
210 <?php echo $this->options->text_button_css_label(); ?>
211 </th>
212 <td>
213 <textarea name="<?php echo $this->options->text_button_css_name(); ?>" rows="5" cols="50"><?php echo $this->options->text_button_css(); ?></textarea>
214 </td>
215 </tr>
216 </table>
217
218 <h3><?php echo $this->__('Location'); ?></h3>
219 <table class="form-table">
220 <tr>
221 <th scope="row">
222 <?php echo $this->options->location_label(); ?>
223 </th>
224 <td>
225 <select name="<?php echo $this->options->location_name(); ?>">
226 <option value="1" <?php echo $this->options->location() == 1 ? 'selected' : ''; ?> ><?php echo $this->__('Bottom Right'); ?></option>
227 <option value="2" <?php echo $this->options->location() == 2 ? 'selected' : ''; ?> ><?php echo $this->__('Bottom Left'); ?></option>
228 <option value="3" <?php echo $this->options->location() == 3 ? 'selected' : ''; ?> ><?php echo $this->__('Top Right'); ?></option>
229 <option value="4" <?php echo $this->options->location() == 4 ? 'selected' : ''; ?> ><?php echo $this->__('Top Left'); ?></option>
230 </select>
231 </td>
232 </tr>
233 <tr>
234 <th scope="row">
235 <?php echo $this->options->marginX_label(); ?>
236 </th>
237 <td>
238 <input class="pixels" name="<?php echo $this->options->marginX_name(); ?>" value="<?php echo $this->options->marginX(); ?>" />px
239 <span class="description"><?php echo $this->__('[Negative value allowed.]'); ?></span>
240 </td>
241 </tr>
242 <tr>
243 <th scope="row">
244 <?php echo $this->options->marginY_label(); ?>
245 </th>
246 <td>
247 <input class="pixels" name="<?php echo $this->options->marginY_name(); ?>" value="<?php echo $this->options->marginY(); ?>" />px
248 <span class="description"><?php echo $this->__('[Negative value allowed.]'); ?></span>
249 </td>
250 </tr>
251 </table>
252
253 <h3><?php echo $this->__('Filter'); ?></h3>
254 <table class="form-table">
255 <tr>
256 <th scope="row">
257 <?php echo $this->options->display_pages_label(); ?>
258 </th>
259 <td>
260 <label>
261 <input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="1" <?php echo $this->options->display_pages() == 1 ? 'checked' : ''; ?> />
262 <span><?php echo $this->__('All pages.'); ?></span>
263 </label>
264 <br />
265 <label>
266 <input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="2" <?php echo $this->options->display_pages() == 2 ? 'checked' : ''; ?> />
267 <span><?php echo $this->__('Include in following pages'); ?></span>
268 </label>
269 <div class="pages-selection">
270 <input type="hidden" name="<?php echo $this->options->include_pages_name(); ?>" value="<?php echo $this->options->include_pages(); ?>" />
271 <?php
272 $objects = $this->get_filter_objects();
273 foreach ($objects as $key => $value) {
274 ?>
275 <div class="page-div">
276 <label>
277 <input type="checkbox" value="<?php echo $key; ?>" <?php echo strpos($this->options->include_pages(), $key) === FALSE ? '' : 'checked'; ?> />
278 <?php echo $value; ?>
279 </label>
280 </div>
281 <?php
282 }
283 ?>
284 </div>
285 <label>
286 <input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="3" <?php echo $this->options->display_pages() == 3 ? 'checked' : ''; ?> />
287 <span><?php echo $this->__('Exclude in following pages'); ?></span>
288 </label>
289 <div class="pages-selection">
290 <input type="hidden" name="<?php echo $this->options->exclude_pages_name(); ?>" value="<?php echo $this->options->exclude_pages(); ?>" />
291 <?php
292 $objects = $this->get_filter_objects();
293 foreach ($objects as $key => $value) {
294 ?>
295 <div class="page-div">
296 <label>
297 <input type="checkbox" value="<?php echo $key; ?>" <?php echo strpos($this->options->exclude_pages(), $key) === FALSE ? '' : 'checked'; ?> />
298 <?php echo $value; ?>
299 </label>
300 </div>
301 <?php
302 }
303 ?>
304 </div>
305 </td>
306 </tr>
307 </table>
308
309 <h3><?php echo $this->__('Image'); ?></h3>
310 <div class="icons-container">
311 <?php
312 $files = scandir($this->iconsDIR);
313 foreach ($files as $file) {
314 if ($file == '.' || $file == '..')
315 continue;
316 echo '<div ' . ($this->options->image() == $file ? 'class="selected"' : '') . '>';
317 echo '<input id="' . $file . '" name="' . $this->options->image_name() . '" type="radio" value="' . $file . '" ' . ($this->options->image() == $file ? 'checked' : '') . ' />';
318 echo '<label for="' . $file . '"><img src="' . $this->iconsURL . $file . '"/></label>';
319 echo '</div>';
320 }
321 ?>
322 </div>
323 <div>
324 <input id="custom" name="<?php echo $this->options->image_name(); ?>" type="radio" value="custom" <?php echo ($this->options->image() == 'custom' ? 'checked' : ''); ?> />
325 <label for="custom"><?php echo $this->__('Custom URL'); ?>
326 <input class="customImage" name="<?php echo $this->options->custom_url_name(); ?>" value="<?php echo $this->options->custom_url(); ?>"/>
327 </label>
328 </div>
329
330 <?php @$this->options_page_footer('scroll-top-plugin-settings/', 'scroll-top-plugin-faq/'); ?>
331
332 <script type="text/javascript">
333 (function($) {
334 function setColorPicker(div) {
335 div.ColorPicker({
336 color: div.attr('color'),
337 onShow: function(colpkr) {
338 $(colpkr).fadeIn(500);
339 return false;
340 }, onHide: function(colpkr) {
341 $(colpkr).fadeOut(500);
342 return false;
343 },
344 onChange: function(hsb, hex, rgb) {
345 div.css('backgroundColor', '#' + hex);
346 div.next().text('#' + hex).next().val('#' + hex);
347 }
348 }).css('backgroundColor', div.attr('color'));
349 }
350
351 $('#wpfront-scroll-top-options').find(".color-selector").each(function(i, e) {
352 setColorPicker($(e));
353 });
354
355 $('#wpfront-scroll-top-options .pages-selection input[type="checkbox"]').change(function() {
356 var values = [];
357 var div = $(this).parent().parent().parent();
358 div.find('input:checked').each(function(i, e) {
359 values.push($(e).val());
360 });
361 div.children(":first").val(values.join());
362 });
363
364 })(jQuery);
365 </script>
366
367