PluginProbe
Leaflet Map / 2.11.5
Leaflet Map v2.11.5
3.4.7 3.4.6 trunk 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.11.5 2.12.0 2.13.0 2.14.0 2.15.0 2.16.0 2.16.1 2.16.2 2.17.0 2.17.1 2.17.2 2.17.3 2.18.0 2.19.0 2.19.1 All 49 releases
leaflet-map / templates / settings.php

settings.php in Leaflet Map 2.11.5, at templates/settings.php

110 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Settings View
4 *
5 * PHP Version 5.5
6 *
7 * @category Admin
8 * @author Benjamin J DeLong <ben@bozdoz.com>
9 */
10
11 $title = $plugin_data['Name'];
12 $description = __('A plugin for creating a Leaflet JS map with a shortcode. Boasts two free map tile services and three free geocoders.', 'leaflet-map');
13 $version = $plugin_data['Version'];
14 ?>
15 <div class="wrap">
16 <h1><?php echo $title; ?> <small>version: <?php echo $version; ?></small></h1>
17 <p><?php echo $description; ?></p>
18 <?php
19 if (isset($_POST['submit'])) {
20 /* copy and overwrite $post for checkboxes */
21 $form = $_POST;
22
23 foreach ($settings->options as $name => $option) {
24 if (!$option->type) continue;
25
26 /* checkboxes don't get sent if not checked */
27 if ($option->type === 'checkbox') {
28 $form[$name] = isset($_POST[ $name ]) ? 1 : 0;
29 }
30
31 $settings->set($name, stripslashes( $form[$name]));
32 }
33 ?>
34 <div class="notice notice-success is-dismissible">
35 <p><?php _e('Options Updated!', 'leaflet-map'); ?></p>
36 </div>
37 <?php
38 } elseif (isset($_POST['reset'])) {
39 $settings->reset();
40 ?>
41 <div class="notice notice-success is-dismissible">
42 <p><?php _e('Options have been reset to default values!', 'leaflet-map'); ?></p>
43 </div>
44 <?php
45 } elseif (isset($_POST['clear-geocoder-cache'])) {
46 include_once LEAFLET_MAP__PLUGIN_DIR . 'class.geocoder.php';
47 Leaflet_Geocoder::remove_caches();
48 ?>
49 <div class="notice notice-success is-dismissible">
50 <p><?php _e('Location caches have been cleared!', 'leaflet-map'); ?></p>
51 </div>
52 <?php
53 }
54 ?>
55 <div class="wrap">
56 <div class="wrap">
57 <form method="post">
58 <div class="container">
59 <h2><?php _e('Settings', 'leaflet-map'); ?></h2>
60 <hr>
61 </div>
62 <?php
63 foreach ($settings->options as $name => $option) {
64 if (!$option->type) continue;
65 ?>
66 <div class="container">
67 <label>
68 <span class="label"><?php echo $option->display_name; ?></span>
69 <span class="input-group">
70 <?php
71 $option->widget($name, $settings->get($name));
72 ?>
73 </span>
74 </label>
75
76 <?php
77 if ($option->helptext) {
78 ?>
79 <div class="helptext">
80 <p class="description"><?php echo $option->helptext; ?></p>
81 </div>
82 <?php
83 }
84 ?>
85 </div>
86 <?php
87 }
88 ?>
89 <div class="submit">
90 <input type="submit"
91 name="submit"
92 id="submit"
93 class="button button-primary"
94 value="<?php _e('Save Changes', 'leaflet-map'); ?>">
95 <input type="submit"
96 name="reset"
97 id="reset"
98 class="button button-secondary"
99 value="<?php _e('Reset to Defaults', 'leaflet-map'); ?>">
100 <input type="submit"
101 name="clear-geocoder-cache"
102 id="clear-geocoder-cache"
103 class="button button-secondary"
104 value="<?php _e('Clear Geocoder Cache', 'leaflet-map'); ?>">
105 </div>
106
107 </form>
108 </div>
109 </div>
110