WPFront Scroll Top - Version 1.1.1

Version Description

  • Stability improvements
  • New menu structure
Download this release

Release Info

Developer syammohanm
Plugin Icon 128x128 WPFront Scroll Top
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1 to 1.1.1

classes/base/class-wpfront-base-menu.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ WPFront Plugins Base Menu
4
+ Copyright (C) 2013, WPFront.com
5
+ Website: wpfront.com
6
+ Contact: syam@wpfront.com
7
+
8
+ WPFront Plugins are 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
+ if (!class_exists('WPFront_Base_Menu')) {
25
+
26
+ class WPFront_Base_Menu {
27
+
28
+ const MENU_SLUG = 'wpfront-plugins';
29
+
30
+ private static $wpfrontBase = NULL;
31
+ private static $wpfrontBaseMenu = NULL;
32
+
33
+ function __construct($wpfrontBase) {
34
+ if (self::$wpfrontBase == NULL) {
35
+ self::$wpfrontBase = $wpfrontBase;
36
+ self::$wpfrontBaseMenu = $this;
37
+ } else {
38
+ if (version_compare($this->version(), self::$wpfrontBaseMenu->version()) > 0) {
39
+ self::$wpfrontBase = $wpfrontBase;
40
+ self::$wpfrontBaseMenu = $this;
41
+ }
42
+ }
43
+ }
44
+
45
+ protected function version() {
46
+ return '1.0';
47
+ }
48
+
49
+ protected function print_column_headers() {
50
+ echo '<tr><thead>'
51
+ . '<th class="check-column"></th>'
52
+ . '<th>' . $this->__('Name') . '</th>'
53
+ . '<th>' . $this->__('Version') . '</th>'
54
+ . '<th>' . $this->__('Rating') . '</th>'
55
+ . '<th>' . $this->__('Description') . '</th>'
56
+ . '</thead></tr>';
57
+ }
58
+
59
+ protected function print_column_footers() {
60
+ echo '<tr><thead>'
61
+ . '<th class="check-column"></th>'
62
+ . '<th>' . $this->__('Name') . '</th>'
63
+ . '<th>' . $this->__('Version') . '</th>'
64
+ . '<th>' . $this->__('Rating') . '</th>'
65
+ . '<th>' . $this->__('Description') . '</th>'
66
+ . '</thead></tr>';
67
+ }
68
+
69
+ protected function wp_star_rating($args) {
70
+ if (function_exists('wp_star_rating')) {
71
+ echo wp_star_rating($args);
72
+ return;
73
+ }
74
+
75
+ echo '<div class="star-holder" title="' . sprintf($this->__('based on %s rating(s)'), number_format_i18n($args['number'])) . '">'
76
+ . '<div class="star star-rating" style="width:' . esc_attr(str_replace(',', '.', $args['rating'])) . 'px"></div>'
77
+ . '</div>';
78
+ }
79
+
80
+ protected function create_plugin_list() {
81
+ if (isset($_GET['action'])) {
82
+ if ($_GET['action'] == 'activate') {
83
+ if (isset($_GET['plugin'])) {
84
+ activate_plugin($_GET['plugin'] . '/' . $_GET['plugin'] . '.php');
85
+ // echo '<script type="text/javascript">window.location="' . WPFront_Static::self_admin_url('admin.php?page=' . self::MENU_SLUG) . '";</script>';
86
+ // wp_die();
87
+ // return;
88
+ }
89
+ }
90
+ }
91
+
92
+ $plugins_allowedtags = array(
93
+ 'a' => array('href' => array(), 'title' => array(), 'target' => array()),
94
+ 'abbr' => array('title' => array()), 'acronym' => array('title' => array()),
95
+ 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),
96
+ 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array()
97
+ );
98
+
99
+ if (!function_exists('plugins_api'))
100
+ require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
101
+ add_thickbox();
102
+
103
+ $args = array();
104
+ $args['page'] = 1;
105
+ $args['per_page'] = 30;
106
+ $args['author'] = 'syammohanm';
107
+
108
+ $api = plugins_api('query_plugins', $args);
109
+
110
+ if (is_wp_error($api)) {
111
+ wp_die($this->__('Unable to communicate with WordPress.org'));
112
+ return;
113
+ }
114
+ ?>
115
+ <style type="text/css">
116
+ div.wpfront-container table.plugins {
117
+ margin-top: 16px;
118
+ margin-bottom: 16px;
119
+ }
120
+ div.wpfront-container table.plugins th.check-column {
121
+ width: 0px;
122
+ }
123
+ div.wpfront-container div.footer {
124
+ text-align: center;
125
+ }
126
+ </style>
127
+ <?php
128
+ echo '<div class="wrap wpfront-container">';
129
+ echo '<h2>' . $this->__('WPFront Plugins') . '</h2>';
130
+ echo '<table class="wp-list-table widefat plugins">';
131
+ $this->print_column_headers();
132
+
133
+ foreach ((array) $api->plugins as $plugin) {
134
+ if (is_object($plugin))
135
+ $plugin = (array) $plugin;
136
+
137
+ $title = wp_kses($plugin['name'], $plugins_allowedtags);
138
+ $description = strip_tags($plugin['description']);
139
+ if (strlen($description) > 400)
140
+ $description = mb_substr($description, 0, 400) . '&#8230;';
141
+ //remove any trailing entities
142
+ $description = preg_replace('/&[^;\s]{0,6}$/', '', $description);
143
+ //strip leading/trailing & multiple consecutive lines
144
+ $description = trim($description);
145
+ $description = preg_replace("|(\r?\n)+|", "\n", $description);
146
+ //\n => <br>
147
+ $description = nl2br($description);
148
+ $version = wp_kses($plugin['version'], $plugins_allowedtags);
149
+
150
+ $name = strip_tags($title . ' ' . $version);
151
+ $author = $plugin['author'];
152
+ if (!empty($plugin['author']))
153
+ $author = ' <cite>' . sprintf($this->__('By %s'), $author) . '.</cite>';
154
+
155
+ $author = wp_kses($author, $plugins_allowedtags);
156
+
157
+ $action_links = array();
158
+ $action_links[] = '<a href="' . WPFront_Static::self_admin_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] .
159
+ '&amp;TB_iframe=true&amp;width=600&amp;height=550') . '" class="thickbox" title="' .
160
+ esc_attr(sprintf($this->__('More information about %s'), $name)) . '">' . $this->__('Details') . '</a>';
161
+
162
+ $class = 'inactive';
163
+ if (current_user_can('install_plugins') || current_user_can('update_plugins')) {
164
+ $status = install_plugin_install_status($plugin);
165
+
166
+ switch ($status['status']) {
167
+ case 'install':
168
+ if ($status['url'])
169
+ $action_links[] = '<a class="install-now" href="' . $status['url'] . '" title="' . esc_attr(sprintf($this->__('Install %s'), $name)) . '">' . $this->__('Install Now') . '</a>';
170
+ $class = 'active';
171
+ break;
172
+ case 'update_available':
173
+ if ($status['url'])
174
+ $action_links[] = '<a href="' . $status['url'] . '" title="' . esc_attr(sprintf($this->__('Update to version %s'), $status['version'])) . '">' . sprintf($this->__('Update Now'), $status['version']) . '</a>';
175
+ $class = 'active update';
176
+ break;
177
+ case 'latest_installed':
178
+ case 'newer_installed':
179
+ $action_links[] = '<span title="' . esc_attr__($this->__('This plugin is already installed and is up to date')) . ' ">' . $this->__('Installed') . '</span>';
180
+ if (is_plugin_active($plugin['slug'] . '/' . $plugin['slug'] . '.php'))
181
+ $action_links[] = '<a href="' . WPFront_Static::self_admin_url('admin.php?page=' . $plugin['slug']) . '">' . $this->__('Settings') . '</a>';
182
+ else
183
+ $action_links[] = '<a href="' . WPFront_Static::self_admin_url('admin.php?page=' . self::MENU_SLUG . '&action=activate&plugin=' . $plugin['slug']) . '">' . $this->__('Activate') . '</a>';
184
+ break;
185
+ }
186
+ }
187
+ $action_links = apply_filters('plugin_install_action_links', $action_links, $plugin);
188
+ ?>
189
+ <tr class="<?php echo $class; ?>">
190
+ <th class="check-column"></th>
191
+ <td class="name column-name"><strong><?php echo $title; ?></strong>
192
+ <div class="action-links"><?php if (!empty($action_links)) echo implode(' | ', $action_links); ?></div>
193
+ </td>
194
+ <td class="vers column-version"><?php echo $version; ?></td>
195
+ <td class="vers column-rating">
196
+ <?php $this->wp_star_rating(array('rating' => $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'])); ?>
197
+ </td>
198
+ <td class="desc column-description"><?php echo $description, $author; ?></td>
199
+ </tr>
200
+ <?php
201
+ }
202
+
203
+ $this->print_column_footers();
204
+ echo '</table>';
205
+ echo '<div class="footer"><a href="http://wpfront.com/contact" target="_blank">' . $this->__('Feedback') . '</a> | <a href="http://wpfront.com" target="_blank">wpfront.com</a></div>';
206
+ echo '</div>';
207
+ }
208
+
209
+ public static function plugin_list() {
210
+ self::$wpfrontBaseMenu->create_plugin_list();
211
+ }
212
+
213
+ protected function __($key) {
214
+ return self::$wpfrontBase->__($key);
215
+ }
216
+
217
+ protected function create_admin_menu($menu_data) {
218
+ $menu_slug = self::MENU_SLUG;
219
+
220
+ global $admin_page_hooks, $submenu;
221
+ if (!isset($admin_page_hooks[$menu_slug])) {
222
+ add_menu_page($this->__('WPFront'), $this->__('WPFront'), 'manage_options', $menu_slug, null, self::$wpfrontBase->pluginURL() . 'classes/base/images/wpfront_menu.png');
223
+ add_submenu_page($menu_slug, $this->__('WPFront Plugins'), $this->__('All Plugins'), 'manage_options', $menu_slug, array('WPFront_Base_Menu', 'plugin_list'));
224
+ }
225
+
226
+ //$extra_menu = array_pop($submenu[$menu_slug]);
227
+
228
+ foreach ($menu_data as $value) {
229
+ $flag = FALSE;
230
+
231
+ foreach ($submenu[$menu_slug] as $s) {
232
+ if ($s[2] == $value['slug']) {
233
+ $flag = TRUE;
234
+ break;
235
+ }
236
+ }
237
+
238
+ if ($flag == TRUE)
239
+ continue;
240
+
241
+ $page_hook_suffix = add_submenu_page($menu_slug, $value['title'], $value['link'], 'manage_options', $value['slug'], array($value['this'], 'options_page'));
242
+
243
+ add_action('admin_print_scripts-' . $page_hook_suffix, array($value['this'], 'enqueue_options_scripts'));
244
+ add_action('admin_print_styles-' . $page_hook_suffix, array($value['this'], 'enqueue_options_styles'));
245
+ }
246
+
247
+ //usort($submenu[$menu_slug], array('WPFront_Base', 'submenu_compare'));
248
+ //$submenu[$menu_slug][] = $extra_menu;
249
+ }
250
+
251
+ public static function admin_menu($menu_data) {
252
+ self::$wpfrontBaseMenu->create_admin_menu($menu_data);
253
+ }
254
+
255
+ }
256
+
257
+ }
258
+
classes/base/class-wpfront-base.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ WPFront Plugins Base
5
+ Copyright (C) 2013, WPFront.com
6
+ Website: wpfront.com
7
+ Contact: syam@wpfront.com
8
+
9
+ WPFront Plugins are distributed under the GNU General Public License, Version 3,
10
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
+ St, Fifth Floor, Boston, MA 02110, USA
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ */
24
+
25
+ require_once("class-wpfront-static.php");
26
+ require_once("class-wpfront-base-menu.php");
27
+
28
+ if (!class_exists('WPFront_Base')) {
29
+
30
+ /**
31
+ * Plugin framework base class
32
+ *
33
+ * @author Syam Mohan <syam@wpfront.com>
34
+ * @copyright 2013 WPFront.com
35
+ */
36
+ class WPFront_Base {
37
+
38
+ private $plugin_slug;
39
+ private $options_page_slug;
40
+ protected $pluginURLRoot;
41
+ protected $pluginDIRRoot;
42
+ private static $menu_data = array();
43
+
44
+ function __construct($file, $pluginSlug, $wpfrontBaseMenu = NULL) {
45
+ $this->plugin_slug = $pluginSlug;
46
+ $this->options_page_slug = $this->plugin_slug;
47
+ if ($wpfrontBaseMenu == NULL)
48
+ $wpfrontBaseMenu = new WPFront_Base_Menu($this);
49
+
50
+ $this->pluginURLRoot = plugins_url() . '/' . $this->plugin_slug . '/';
51
+ $this->pluginDIRRoot = dirname($file) . '/../';
52
+
53
+ add_action('init', array(&$this, 'init'));
54
+ add_action('plugins_loaded', array(&$this, 'plugins_loaded_base'));
55
+
56
+ //register actions
57
+ if (is_admin()) {
58
+ add_action('admin_init', array(&$this, 'admin_init'));
59
+ add_action('admin_menu', array(&$this, 'admin_menu'));
60
+ add_filter('plugin_action_links', array(&$this, 'action_links'), 10, 2);
61
+ } else {
62
+ add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
63
+ add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
64
+ }
65
+ }
66
+
67
+ protected function add_menu($title, $link) {
68
+ self::$menu_data[] = array(
69
+ 'title' => $title,
70
+ 'link' => $link,
71
+ 'this' => $this,
72
+ 'slug' => $this->options_page_slug
73
+ );
74
+ }
75
+
76
+ public function init() {
77
+
78
+ }
79
+
80
+ public function plugins_loaded_base() {
81
+ //for localization
82
+ load_plugin_textdomain($this->plugin_slug, FALSE, $this->plugin_slug . '/languages/');
83
+
84
+ $this->plugins_loaded();
85
+ }
86
+
87
+ public function plugins_loaded() {
88
+
89
+ }
90
+
91
+ public function admin_init() {
92
+
93
+ }
94
+
95
+ public function admin_menu() {
96
+ WPFront_Base_Menu::admin_menu(self::$menu_data);
97
+ }
98
+
99
+ public static function submenu_compare($a, $b) {
100
+ return strcmp($a[0], $b[0]);
101
+ }
102
+
103
+ public function action_links($links, $file) {
104
+ if ($file == $this->plugin_slug . '/' . $this->plugin_slug . '.php') {
105
+ $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=' . $this->options_page_slug . '">' . $this->__('Settings') . '</a>';
106
+ array_unshift($links, $settings_link);
107
+ }
108
+ return $links;
109
+ }
110
+
111
+ public function enqueue_styles() {
112
+
113
+ }
114
+
115
+ public function enqueue_scripts() {
116
+
117
+ }
118
+
119
+ public function enqueue_options_styles() {
120
+
121
+ }
122
+
123
+ public function enqueue_options_scripts() {
124
+
125
+ }
126
+
127
+ //creates options page
128
+ public function options_page() {
129
+ if (!current_user_can('manage_options')) {
130
+ wp_die($this->__('You do not have sufficient permissions to access this page.'));
131
+ return;
132
+ }
133
+
134
+ include($this->pluginDIRRoot . 'templates/options-template.php');
135
+ }
136
+
137
+ protected function options_page_header($title, $optionsGroupName) {
138
+ echo '<div class="wrap">';
139
+ @screen_icon($this->options_page_slug);
140
+ echo '<h2>' . $title . '</h2>';
141
+ echo '<div id="' . $this->options_page_slug . '-options" class="inside">';
142
+ echo '<form method="post" action="options.php">';
143
+ @settings_fields($optionsGroupName);
144
+ @do_settings_sections($this->options_page_slug);
145
+
146
+ if ((isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true') || (isset($_GET['updated']) && $_GET['updated'] == 'true')) {
147
+ echo '
148
+ <div class="updated">
149
+ <p>
150
+ <strong>' . $this->__('If you have a caching plugin, clear the cache for the new settings to take effect.') . '</strong>
151
+ </p>
152
+ </div>
153
+ ';
154
+ }
155
+ }
156
+
157
+ protected function options_page_footer($settingsLink, $FAQLink, $extraLinks = NULL) {
158
+ @$this->submit_button();
159
+
160
+ if ($extraLinks != NULL) {
161
+ foreach ($extraLinks as $value) {
162
+ echo '<a href="' . $value['href'] . '" target="' . $value['target'] . '">' . $value['text'] . '</a>';
163
+ echo ' | ';
164
+ }
165
+ }
166
+
167
+ echo '
168
+ <a href="http://wpfront.com/' . $settingsLink . '" target="_blank">' . $this->__('Settings Description') . '</a>
169
+ |
170
+ <a href="http://wpfront.com/' . $FAQLink . '" target="_blank">' . $this->__('Plugin FAQ') . '</a>
171
+ |
172
+ <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Feature Request') . '</a>
173
+ |
174
+ <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Report Bug') . '</a>
175
+ |
176
+ <a href="http://wordpress.org/support/view/plugin-reviews/' . $this->plugin_slug . '" target="_blank">' . $this->__('Write Review') . '</a>
177
+ |
178
+ <a href="mailto:syam@wpfront.com">' . $this->__('Contact Me (syam@wpfront.com)') . '</a>
179
+ ';
180
+ echo '</form>';
181
+ echo '</div>';
182
+ echo '</div>';
183
+ }
184
+
185
+ //returns localized string
186
+ public function __($key) {
187
+ return __($key, $this->plugin_slug);
188
+ }
189
+
190
+ //for compatibility
191
+ public function submit_button() {
192
+ if (function_exists('submit_button')) {
193
+ submit_button();
194
+ } else {
195
+ echo '<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="' . $this->__('Save Changes') . '" /></p>';
196
+ }
197
+ }
198
+
199
+ public function pluginURL(){
200
+ return $this->pluginURLRoot;
201
+ }
202
+
203
+ public function pluginDIR(){
204
+ return $this->pluginDIRRoot;
205
+ }
206
+ }
207
+
208
+ }
209
+
classes/{class-wpfront-options-base.php → base/class-wpfront-options-base.php} RENAMED
@@ -1,12 +1,12 @@
1
  <?php
2
 
3
  /*
4
- WPFront Scroll Top Plugin
5
  Copyright (C) 2013, WPFront.com
6
  Website: wpfront.com
7
  Contact: syam@wpfront.com
8
 
9
- WPFront Scroll Top Plugin is distributed under the GNU General Public License, Version 3,
10
  June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
  St, Fifth Floor, Boston, MA 02110, USA
12
 
1
  <?php
2
 
3
  /*
4
+ WPFront Plugins Options Base
5
  Copyright (C) 2013, WPFront.com
6
  Website: wpfront.com
7
  Contact: syam@wpfront.com
8
 
9
+ WPFront Plugins are distributed under the GNU General Public License, Version 3,
10
  June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
  St, Fifth Floor, Boston, MA 02110, USA
12
 
classes/base/class-wpfront-static.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ WPFront Plugins Static Helpers
5
+ Copyright (C) 2013, WPFront.com
6
+ Website: wpfront.com
7
+ Contact: syam@wpfront.com
8
+
9
+ WPFront Plugins are distributed under the GNU General Public License, Version 3,
10
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
+ St, Fifth Floor, Boston, MA 02110, USA
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ */
24
+
25
+ if (!class_exists('WPFront_Static')) {
26
+
27
+ /**
28
+ * Plugin framework static helpers
29
+ *
30
+ * @author Syam Mohan <syam@wpfront.com>
31
+ * @copyright 2013 WPFront.com
32
+ */
33
+ class WPFront_Static {
34
+
35
+ public static function is_admin_bar_showing() {
36
+ if (function_exists('is_admin_bar_showing')) {
37
+ return is_admin_bar_showing();
38
+ }
39
+
40
+ return FALSE;
41
+ }
42
+
43
+ public static function self_admin_url($path = '', $scheme = 'admin') {
44
+ if (function_exists('self_admin_url'))
45
+ return self_admin_url($path, $scheme);
46
+
47
+ return admin_url($path, $scheme);
48
+ }
49
+
50
+ public static function doing_ajax() {
51
+ if (defined('DOING_AJAX') && DOING_AJAX) {
52
+ return TRUE;
53
+ }
54
+
55
+ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
56
+ return TRUE;
57
+ }
58
+
59
+ return FALSE;
60
+ }
61
+
62
+ }
63
+
64
+ }
classes/base/images/wpfront_menu.png ADDED
Binary file
classes/class-wpfront-scroll-top-options.php CHANGED
@@ -22,7 +22,7 @@
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
25
- require_once("class-wpfront-options-base.php");
26
 
27
  if (!class_exists('WPFront_Scroll_Top_Options')) {
28
 
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
25
+ require_once("base/class-wpfront-options-base.php");
26
 
27
  if (!class_exists('WPFront_Scroll_Top_Options')) {
28
 
classes/class-wpfront-scroll-top.php CHANGED
@@ -22,6 +22,7 @@
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
 
25
  require_once("class-wpfront-scroll-top-options.php");
26
 
27
  if (!class_exists('WPFront_Scroll_Top')) {
@@ -32,52 +33,34 @@ if (!class_exists('WPFront_Scroll_Top')) {
32
  * @author Syam Mohan <syam@wpfront.com>
33
  * @copyright 2013 WPFront.com
34
  */
35
- class WPFront_Scroll_Top {
36
 
37
  //Constants
38
- const VERSION = '1.1';
39
- const OPTIONSPAGE_SLUG = 'wpfront-scroll-top';
40
  const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
41
  const OPTION_NAME = 'wpfront-scroll-top-options';
42
  const PLUGIN_SLUG = 'wpfront-scroll-top';
43
 
44
  //Variables
45
- private $pluginURLRoot;
46
- private $pluginDIRRoot;
47
- private $iconsDIR;
48
- private $iconsURL;
49
- private $options;
50
- private $markupLoaded;
51
- private $scriptLoaded;
52
 
53
  function __construct() {
 
 
54
  $this->markupLoaded = FALSE;
55
 
56
  //Root variables
57
- $this->pluginURLRoot = plugins_url() . '/wpfront-scroll-top/';
58
- $this->pluginDIRRoot = dirname(__FILE__) . '/../';
59
  $this->iconsDIR = $this->pluginDIRRoot . 'images/icons/';
60
  $this->iconsURL = $this->pluginURLRoot . 'images/icons/';
61
 
62
- add_action('init', array(&$this, 'init'));
63
-
64
- //register actions
65
- if (is_admin()) {
66
- add_action('admin_init', array(&$this, 'admin_init'));
67
- add_action('admin_menu', array(&$this, 'admin_menu'));
68
- add_filter('plugin_action_links', array(&$this, 'action_links'), 10, 2);
69
- } else {
70
- add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
71
- add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
72
- }
73
-
74
  add_action('wp_footer', array(&$this, 'write_markup'));
75
  add_action('shutdown', array(&$this, 'write_markup'));
76
- add_action('plugins_loaded', array(&$this, 'plugins_loaded'));
77
- }
78
-
79
- public function init() {
80
 
 
81
  }
82
 
83
  //add scripts
@@ -110,58 +93,15 @@ if (!class_exists('WPFront_Scroll_Top')) {
110
  $this->enqueue_scripts();
111
  }
112
 
113
- public function admin_menu() {
114
- $page_hook_suffix = add_options_page($this->__('WPFront Scroll Top'), $this->__('Scroll Top'), 'manage_options', self::OPTIONSPAGE_SLUG, array($this, 'options_page'));
115
-
116
- //register for options page scripts and styles
117
- add_action('admin_print_scripts-' . $page_hook_suffix, array($this, 'enqueue_options_scripts'));
118
- add_action('admin_print_styles-' . $page_hook_suffix, array($this, 'enqueue_options_styles'));
119
- }
120
-
121
- //options page scripts
122
- public function enqueue_options_scripts() {
123
- //$this->enqueue_scripts();
124
- // $jsRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/js/';
125
- // wp_enqueue_script('jquery.eyecon.colorpicker', $jsRoot . 'colorpicker.js', array('jquery'), self::VERSION);
126
- // $jsRoot = $this->pluginURLRoot . 'js/';
127
- // wp_enqueue_script('wpfront-notification-bar-options', $jsRoot . 'options.js', array(), self::VERSION);
128
- }
129
-
130
  //options page styles
131
  public function enqueue_options_styles() {
132
- //$this->enqueue_styles();
133
- // $styleRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/css/';
134
- // wp_enqueue_style('jquery.eyecon.colorpicker.colorpicker', $styleRoot . 'colorpicker.css', array(), self::VERSION);
135
-
136
  $styleRoot = $this->pluginURLRoot . 'css/';
137
  wp_enqueue_style('wpfront-scroll-top-options', $styleRoot . 'options.css', array(), self::VERSION);
138
  }
139
 
140
- //creates options page
141
- public function options_page() {
142
- if (!current_user_can('manage_options')) {
143
- wp_die($this->__('You do not have sufficient permissions to access this page.'));
144
- return;
145
- }
146
-
147
- include($this->pluginDIRRoot . 'templates/options-template.php');
148
- }
149
-
150
- //add "settings" link
151
- public function action_links($links, $file) {
152
- if ($file == 'wpfront-scroll-top/wpfront-scroll-top.php') {
153
- $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/options-general.php?page=' . self::OPTIONSPAGE_SLUG . '">' . $this->__('Settings') . '</a>';
154
- array_unshift($links, $settings_link);
155
- }
156
- return $links;
157
- }
158
-
159
  public function plugins_loaded() {
160
  //load plugin options
161
  $this->options = new WPFront_Scroll_Top_Options(self::OPTION_NAME, self::PLUGIN_SLUG);
162
-
163
- //for localization
164
- load_plugin_textdomain(self::PLUGIN_SLUG, FALSE, $this->pluginDIRRoot . 'languages/');
165
  }
166
 
167
  //writes the html and script for the bar
@@ -174,14 +114,10 @@ if (!class_exists('WPFront_Scroll_Top')) {
174
  return;
175
  }
176
 
177
- if (defined('DOING_AJAX') && DOING_AJAX) {
178
  return;
179
  }
180
 
181
- if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
182
- return;
183
- }
184
-
185
  if ($this->enabled()) {
186
  include($this->pluginDIRRoot . 'templates/scroll-top-template.php');
187
 
@@ -204,20 +140,6 @@ if (!class_exists('WPFront_Scroll_Top')) {
204
  $this->markupLoaded = TRUE;
205
  }
206
 
207
- //returns localized string
208
- public function __($key) {
209
- return __($key, self::PLUGIN_SLUG);
210
- }
211
-
212
- //for compatibility
213
- private function submit_button() {
214
- if (function_exists('submit_button')) {
215
- submit_button();
216
- } else {
217
- echo '<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="' . $this->__('Save Changes') . '" /></p>';
218
- }
219
- }
220
-
221
  private function enabled() {
222
  return $this->options->enabled();
223
  }
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
25
+ require_once("base/class-wpfront-base.php");
26
  require_once("class-wpfront-scroll-top-options.php");
27
 
28
  if (!class_exists('WPFront_Scroll_Top')) {
33
  * @author Syam Mohan <syam@wpfront.com>
34
  * @copyright 2013 WPFront.com
35
  */
36
+ class WPFront_Scroll_Top extends WPFront_Base {
37
 
38
  //Constants
39
+ const VERSION = '1.1.1';
 
40
  const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
41
  const OPTION_NAME = 'wpfront-scroll-top-options';
42
  const PLUGIN_SLUG = 'wpfront-scroll-top';
43
 
44
  //Variables
45
+ protected $iconsDIR;
46
+ protected $iconsURL;
47
+ protected $options;
48
+ protected $markupLoaded;
49
+ protected $scriptLoaded;
 
 
50
 
51
  function __construct() {
52
+ parent::__construct(__FILE__, self::PLUGIN_SLUG);
53
+
54
  $this->markupLoaded = FALSE;
55
 
56
  //Root variables
 
 
57
  $this->iconsDIR = $this->pluginDIRRoot . 'images/icons/';
58
  $this->iconsURL = $this->pluginURLRoot . 'images/icons/';
59
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  add_action('wp_footer', array(&$this, 'write_markup'));
61
  add_action('shutdown', array(&$this, 'write_markup'));
 
 
 
 
62
 
63
+ $this->add_menu($this->__('WPFront Scroll Top'), $this->__('Scroll Top'));
64
  }
65
 
66
  //add scripts
93
  $this->enqueue_scripts();
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  //options page styles
97
  public function enqueue_options_styles() {
 
 
 
 
98
  $styleRoot = $this->pluginURLRoot . 'css/';
99
  wp_enqueue_style('wpfront-scroll-top-options', $styleRoot . 'options.css', array(), self::VERSION);
100
  }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  public function plugins_loaded() {
103
  //load plugin options
104
  $this->options = new WPFront_Scroll_Top_Options(self::OPTION_NAME, self::PLUGIN_SLUG);
 
 
 
105
  }
106
 
107
  //writes the html and script for the bar
114
  return;
115
  }
116
 
117
+ if (WPFront_Static::doing_ajax()) {
118
  return;
119
  }
120
 
 
 
 
 
121
  if ($this->enabled()) {
122
  include($this->pluginDIRRoot . 'templates/scroll-top-template.php');
123
 
140
  $this->markupLoaded = TRUE;
141
  }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  private function enabled() {
144
  return $this->options->enabled();
145
  }
languages/wpfront-scroll-top.mo CHANGED
Binary file
languages/wpfront-scroll-top.po CHANGED
@@ -1,21 +1,156 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
- "POT-Creation-Date: 2014-01-15 10:08-0700\n"
5
- "PO-Revision-Date: 2014-01-15 10:08-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.1\n"
13
  "X-Poedit-Basepath: .\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e\n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  #: ../classes/class-wpfront-scroll-top-options.php:41
20
  msgid "Enabled"
21
  msgstr "Enabled"
@@ -53,7 +188,7 @@ msgid "Small Window Max Width"
53
  msgstr "Small Window Max Width"
54
 
55
  #: ../classes/class-wpfront-scroll-top-options.php:53
56
- #: ../templates/options-template.php:143
57
  msgid "Location"
58
  msgstr "Location"
59
 
@@ -65,130 +200,86 @@ msgstr "Margin X"
65
  msgid "Margin Y"
66
  msgstr "Margin Y"
67
 
68
- #: ../classes/class-wpfront-scroll-top.php:114
69
  msgid "WPFront Scroll Top"
70
  msgstr "WPFront Scroll Top"
71
 
72
- #: ../classes/class-wpfront-scroll-top.php:114
73
  msgid "Scroll Top"
74
  msgstr "Scroll Top"
75
 
76
- #: ../classes/class-wpfront-scroll-top.php:143
77
- msgid "You do not have sufficient permissions to access this page."
78
- msgstr "You do not have sufficient permissions to access this page."
79
-
80
- #: ../classes/class-wpfront-scroll-top.php:153
81
- msgid "Settings"
82
- msgstr "Settings"
83
-
84
- #: ../classes/class-wpfront-scroll-top.php:217
85
- msgid "Save Changes"
86
- msgstr "Save Changes"
87
-
88
- #: ../templates/options-template.php:34
89
  msgid "WPFront Scroll Top Settings"
90
  msgstr "WPFront Scroll Top Settings"
91
 
92
- #: ../templates/options-template.php:44
93
- msgid ""
94
- "If you have a caching plugin, clear the cache for the new settings to take "
95
- "effect."
96
- msgstr ""
97
- "If you have a caching plugin, clear the cache for the new settings to take "
98
- "effect."
99
-
100
- #: ../templates/options-template.php:49
101
  msgid "Display"
102
  msgstr "Display"
103
 
104
- #: ../templates/options-template.php:65
105
  msgid "[Number of pixels to be scrolled before the button appears.]"
106
  msgstr "[Number of pixels to be scrolled before the button appears.]"
107
 
108
- #: ../templates/options-template.php:70
109
  msgid "Button Size"
110
  msgstr "Button Size"
111
 
112
- #: ../templates/options-template.php:76
113
  msgid "[Set 0px to auto fit.]"
114
  msgstr "[Set 0px to auto fit.]"
115
 
116
- #: ../templates/options-template.php:94
117
  msgid "[Button fade duration in milliseconds.]"
118
  msgstr "[Button fade duration in milliseconds.]"
119
 
120
- #: ../templates/options-template.php:103
121
  msgid "[Window scroll duration in milliseconds.]"
122
  msgstr "[Window scroll duration in milliseconds.]"
123
 
124
- #: ../templates/options-template.php:112
125
  msgid "[Button will be hidden on small devices when the width matches.]"
126
  msgstr "[Button will be hidden on small devices when the width matches.]"
127
 
128
- #: ../templates/options-template.php:121
129
  msgid "[Button will be hidden on devices with lesser or equal width.]"
130
  msgstr "[Button will be hidden on devices with lesser or equal width.]"
131
 
132
- #: ../templates/options-template.php:130
133
  msgid "[Button will be hidden on broswer window when the width matches.]"
134
  msgstr "[Button will be hidden on broswer window when the width matches.]"
135
 
136
- #: ../templates/options-template.php:139
137
  msgid "[Button will be hidden on browser window with lesser or equal width.]"
138
  msgstr "[Button will be hidden on browser window with lesser or equal width.]"
139
 
140
- #: ../templates/options-template.php:151
141
  msgid "Bottom Right"
142
  msgstr "Bottom Right"
143
 
144
- #: ../templates/options-template.php:152
145
  msgid "Bottom Left"
146
  msgstr "Bottom Left"
147
 
148
- #: ../templates/options-template.php:153
149
  msgid "Top Right"
150
  msgstr "Top Right"
151
 
152
- #: ../templates/options-template.php:154
153
  msgid "Top Left"
154
  msgstr "Top Left"
155
 
156
- #: ../templates/options-template.php:164 ../templates/options-template.php:173
157
  msgid "[Negative value allowed.]"
158
  msgstr "[Negative value allowed.]"
159
 
160
- #: ../templates/options-template.php:177
161
  msgid "Image"
162
  msgstr "Image"
163
 
164
- #: ../templates/options-template.php:193
165
  msgid "Custom URL"
166
  msgstr "Custom URL"
167
 
168
- #: ../templates/options-template.php:200
169
- msgid "Settings Description"
170
- msgstr "Settings Description"
171
-
172
- #: ../templates/options-template.php:202
173
- msgid "Plugin FAQ"
174
- msgstr "Plugin FAQ"
175
-
176
- #: ../templates/options-template.php:204
177
- msgid "Feature Request"
178
- msgstr "Feature Request"
179
-
180
- #: ../templates/options-template.php:206
181
- msgid "Report Bug"
182
- msgstr "Report Bug"
183
-
184
- #: ../templates/options-template.php:208
185
- msgid "Write Review"
186
- msgstr "Write Review"
187
-
188
- #: ../templates/options-template.php:210
189
- msgid "Contact Me (syam@wpfront.com)"
190
- msgstr "Contact Me (syam@wpfront.com)"
191
-
192
  #~ msgid "Bar Height"
193
  #~ msgstr "Bar Height"
194
 
@@ -343,9 +434,6 @@ msgstr "Contact Me (syam@wpfront.com)"
343
  #~ msgid "Button Color"
344
  #~ msgstr "Button Color"
345
 
346
- #~ msgid "Plugin Ideas"
347
- #~ msgstr "Plugin Ideas"
348
-
349
  #~ msgid "Animate Display"
350
  #~ msgstr "Animate Display"
351
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
+ "POT-Creation-Date: 2014-02-24 16:43-0700\n"
5
+ "PO-Revision-Date: 2014-02-24 16:43-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.4\n"
13
  "X-Poedit-Basepath: .\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e\n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
+ #: ../classes/base/class-wpfront-base-menu.php:52
20
+ #: ../classes/base/class-wpfront-base-menu.php:62
21
+ msgid "Name"
22
+ msgstr "Name"
23
+
24
+ #: ../classes/base/class-wpfront-base-menu.php:53
25
+ #: ../classes/base/class-wpfront-base-menu.php:63
26
+ msgid "Version"
27
+ msgstr "Version"
28
+
29
+ #: ../classes/base/class-wpfront-base-menu.php:54
30
+ #: ../classes/base/class-wpfront-base-menu.php:64
31
+ msgid "Rating"
32
+ msgstr "Rating"
33
+
34
+ #: ../classes/base/class-wpfront-base-menu.php:55
35
+ #: ../classes/base/class-wpfront-base-menu.php:65
36
+ msgid "Description"
37
+ msgstr "Description"
38
+
39
+ #: ../classes/base/class-wpfront-base-menu.php:75
40
+ #, php-format
41
+ msgid "based on %s rating(s)"
42
+ msgstr "based on %s rating(s)"
43
+
44
+ #: ../classes/base/class-wpfront-base-menu.php:111
45
+ msgid "Unable to communicate with WordPress.org"
46
+ msgstr "Unable to communicate with WordPress.org"
47
+
48
+ #: ../classes/base/class-wpfront-base-menu.php:129
49
+ #: ../classes/base/class-wpfront-base-menu.php:223
50
+ msgid "WPFront Plugins"
51
+ msgstr "WPFront Plugins"
52
+
53
+ #: ../classes/base/class-wpfront-base-menu.php:153
54
+ #, php-format
55
+ msgid "By %s"
56
+ msgstr "By %s"
57
+
58
+ #: ../classes/base/class-wpfront-base-menu.php:160
59
+ #, php-format
60
+ msgid "More information about %s"
61
+ msgstr "More information about %s"
62
+
63
+ #: ../classes/base/class-wpfront-base-menu.php:160
64
+ msgid "Details"
65
+ msgstr "Details"
66
+
67
+ #: ../classes/base/class-wpfront-base-menu.php:169
68
+ #, php-format
69
+ msgid "Install %s"
70
+ msgstr "Install %s"
71
+
72
+ #: ../classes/base/class-wpfront-base-menu.php:169
73
+ msgid "Install Now"
74
+ msgstr "Install Now"
75
+
76
+ #: ../classes/base/class-wpfront-base-menu.php:174
77
+ #, php-format
78
+ msgid "Update to version %s"
79
+ msgstr "Update to version %s"
80
+
81
+ #: ../classes/base/class-wpfront-base-menu.php:174
82
+ msgid "Update Now"
83
+ msgstr "Update Now"
84
+
85
+ #: ../classes/base/class-wpfront-base-menu.php:179
86
+ msgid "This plugin is already installed and is up to date"
87
+ msgstr "This plugin is already installed and is up to date"
88
+
89
+ #: ../classes/base/class-wpfront-base-menu.php:179
90
+ msgid "Installed"
91
+ msgstr "Installed"
92
+
93
+ #: ../classes/base/class-wpfront-base-menu.php:181
94
+ #: ../classes/base/class-wpfront-base.php:105
95
+ msgid "Settings"
96
+ msgstr "Settings"
97
+
98
+ #: ../classes/base/class-wpfront-base-menu.php:183
99
+ msgid "Activate"
100
+ msgstr "Activate"
101
+
102
+ #: ../classes/base/class-wpfront-base-menu.php:205
103
+ msgid "Feedback"
104
+ msgstr "Feedback"
105
+
106
+ #: ../classes/base/class-wpfront-base-menu.php:222
107
+ msgid "WPFront"
108
+ msgstr "WPFront"
109
+
110
+ #: ../classes/base/class-wpfront-base-menu.php:223
111
+ msgid "All Plugins"
112
+ msgstr "All Plugins"
113
+
114
+ #: ../classes/base/class-wpfront-base.php:130
115
+ msgid "You do not have sufficient permissions to access this page."
116
+ msgstr "You do not have sufficient permissions to access this page."
117
+
118
+ #: ../classes/base/class-wpfront-base.php:150
119
+ msgid ""
120
+ "If you have a caching plugin, clear the cache for the new settings to take "
121
+ "effect."
122
+ msgstr ""
123
+ "If you have a caching plugin, clear the cache for the new settings to take "
124
+ "effect."
125
+
126
+ #: ../classes/base/class-wpfront-base.php:168
127
+ msgid "Settings Description"
128
+ msgstr "Settings Description"
129
+
130
+ #: ../classes/base/class-wpfront-base.php:170
131
+ msgid "Plugin FAQ"
132
+ msgstr "Plugin FAQ"
133
+
134
+ #: ../classes/base/class-wpfront-base.php:172
135
+ msgid "Feature Request"
136
+ msgstr "Feature Request"
137
+
138
+ #: ../classes/base/class-wpfront-base.php:174
139
+ msgid "Report Bug"
140
+ msgstr "Report Bug"
141
+
142
+ #: ../classes/base/class-wpfront-base.php:176
143
+ msgid "Write Review"
144
+ msgstr "Write Review"
145
+
146
+ #: ../classes/base/class-wpfront-base.php:178
147
+ msgid "Contact Me (syam@wpfront.com)"
148
+ msgstr "Contact Me (syam@wpfront.com)"
149
+
150
+ #: ../classes/base/class-wpfront-base.php:195
151
+ msgid "Save Changes"
152
+ msgstr "Save Changes"
153
+
154
  #: ../classes/class-wpfront-scroll-top-options.php:41
155
  msgid "Enabled"
156
  msgstr "Enabled"
188
  msgstr "Small Window Max Width"
189
 
190
  #: ../classes/class-wpfront-scroll-top-options.php:53
191
+ #: ../templates/options-template.php:129
192
  msgid "Location"
193
  msgstr "Location"
194
 
200
  msgid "Margin Y"
201
  msgstr "Margin Y"
202
 
203
+ #: ../classes/class-wpfront-scroll-top.php:63
204
  msgid "WPFront Scroll Top"
205
  msgstr "WPFront Scroll Top"
206
 
207
+ #: ../classes/class-wpfront-scroll-top.php:63
208
  msgid "Scroll Top"
209
  msgstr "Scroll Top"
210
 
211
+ #: ../templates/options-template.php:32
 
 
 
 
 
 
 
 
 
 
 
 
212
  msgid "WPFront Scroll Top Settings"
213
  msgstr "WPFront Scroll Top Settings"
214
 
215
+ #: ../templates/options-template.php:34
 
 
 
 
 
 
 
 
216
  msgid "Display"
217
  msgstr "Display"
218
 
219
+ #: ../templates/options-template.php:50
220
  msgid "[Number of pixels to be scrolled before the button appears.]"
221
  msgstr "[Number of pixels to be scrolled before the button appears.]"
222
 
223
+ #: ../templates/options-template.php:55
224
  msgid "Button Size"
225
  msgstr "Button Size"
226
 
227
+ #: ../templates/options-template.php:61
228
  msgid "[Set 0px to auto fit.]"
229
  msgstr "[Set 0px to auto fit.]"
230
 
231
+ #: ../templates/options-template.php:79
232
  msgid "[Button fade duration in milliseconds.]"
233
  msgstr "[Button fade duration in milliseconds.]"
234
 
235
+ #: ../templates/options-template.php:88
236
  msgid "[Window scroll duration in milliseconds.]"
237
  msgstr "[Window scroll duration in milliseconds.]"
238
 
239
+ #: ../templates/options-template.php:97
240
  msgid "[Button will be hidden on small devices when the width matches.]"
241
  msgstr "[Button will be hidden on small devices when the width matches.]"
242
 
243
+ #: ../templates/options-template.php:106
244
  msgid "[Button will be hidden on devices with lesser or equal width.]"
245
  msgstr "[Button will be hidden on devices with lesser or equal width.]"
246
 
247
+ #: ../templates/options-template.php:115
248
  msgid "[Button will be hidden on broswer window when the width matches.]"
249
  msgstr "[Button will be hidden on broswer window when the width matches.]"
250
 
251
+ #: ../templates/options-template.php:124
252
  msgid "[Button will be hidden on browser window with lesser or equal width.]"
253
  msgstr "[Button will be hidden on browser window with lesser or equal width.]"
254
 
255
+ #: ../templates/options-template.php:137
256
  msgid "Bottom Right"
257
  msgstr "Bottom Right"
258
 
259
+ #: ../templates/options-template.php:138
260
  msgid "Bottom Left"
261
  msgstr "Bottom Left"
262
 
263
+ #: ../templates/options-template.php:139
264
  msgid "Top Right"
265
  msgstr "Top Right"
266
 
267
+ #: ../templates/options-template.php:140
268
  msgid "Top Left"
269
  msgstr "Top Left"
270
 
271
+ #: ../templates/options-template.php:150 ../templates/options-template.php:159
272
  msgid "[Negative value allowed.]"
273
  msgstr "[Negative value allowed.]"
274
 
275
+ #: ../templates/options-template.php:164
276
  msgid "Image"
277
  msgstr "Image"
278
 
279
+ #: ../templates/options-template.php:180
280
  msgid "Custom URL"
281
  msgstr "Custom URL"
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  #~ msgid "Bar Height"
284
  #~ msgstr "Bar Height"
285
 
434
  #~ msgid "Button Color"
435
  #~ msgstr "Button Color"
436
 
 
 
 
437
  #~ msgid "Animate Display"
438
  #~ msgstr "Animate Display"
439
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpfront.com/donate/
4
  Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
5
  Requires at least: 3.0
6
  Tested up to: 3.8
7
- Stable tag: 1.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -43,6 +43,10 @@ No one has asked anything yet.
43
 
44
  == Changelog ==
45
 
 
 
 
 
46
  = 1.1 =
47
  * New option to hide on mobile devices
48
  * Fixed conflicts with other plugins
@@ -55,6 +59,9 @@ No one has asked anything yet.
55
 
56
  == Upgrade Notice ==
57
 
 
 
 
58
  = 1.1 =
59
  * New option to hide on mobile devices
60
  * Fixed conflicts with other plugins
4
  Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
5
  Requires at least: 3.0
6
  Tested up to: 3.8
7
+ Stable tag: 1.1.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
43
 
44
  == Changelog ==
45
 
46
+ = 1.1.1 =
47
+ * Stability improvements
48
+ * New menu structure
49
+
50
  = 1.1 =
51
  * New option to hide on mobile devices
52
  * Fixed conflicts with other plugins
59
 
60
  == Upgrade Notice ==
61
 
62
+ = 1.1.1 =
63
+ * Improved stability
64
+
65
  = 1.1 =
66
  * New option to hide on mobile devices
67
  * Fixed conflicts with other plugins
templates/options-template.php CHANGED
@@ -29,186 +29,158 @@
29
  */
30
  ?>
31
 
32
- <div class="wrap">
33
- <?php screen_icon(WPFront_Scroll_Top::OPTIONSPAGE_SLUG); ?>
34
- <h2><?php echo $this->__('WPFront Scroll Top Settings'); ?></h2>
35
 
36
- <div id="wpfront-scroll-top-options" class="inside">
37
- <form method="post" action="options.php">
38
- <?php @settings_fields(WPFront_Scroll_Top::OPTIONS_GROUP_NAME); ?>
39
- <?php @do_settings_sections(WPFront_Scroll_Top::OPTIONSPAGE_SLUG); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
- <?php if ((isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true') || (isset($_GET['updated']) && $_GET['updated'] == 'true')) { ?>
42
- <div class="updated">
43
- <p>
44
- <strong><?php echo $this->__('If you have a caching plugin, clear the cache for the new settings to take effect.'); ?></strong>
45
- </p>
46
- </div>
47
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- <h3><?php echo $this->__('Display'); ?></h3>
50
- <table class="form-table">
51
- <tr>
52
- <th scope="row">
53
- <?php echo $this->options->enabled_label(); ?>
54
- </th>
55
- <td>
56
- <input type="checkbox" name="<?php echo $this->options->enabled_name(); ?>" <?php echo $this->options->enabled() ? 'checked' : ''; ?> />
57
- </td>
58
- </tr>
59
- <tr>
60
- <th scope="row">
61
- <?php echo $this->options->scroll_offset_label(); ?>
62
- </th>
63
- <td>
64
- <input class="pixels" name="<?php echo $this->options->scroll_offset_name(); ?>" value="<?php echo $this->options->scroll_offset(); ?>" />px
65
- <span class="description"><?php echo $this->__('[Number of pixels to be scrolled before the button appears.]'); ?></span>
66
- </td>
67
- </tr>
68
- <tr>
69
- <th scope="row">
70
- <?php echo $this->__('Button Size'); ?>
71
- </th>
72
- <td>
73
- <input class="pixels" name="<?php echo $this->options->button_width_name(); ?>" value="<?php echo $this->options->button_width(); ?>" />px
74
- X
75
- <input class="pixels" name="<?php echo $this->options->button_height_name(); ?>" value="<?php echo $this->options->button_height(); ?>" />px
76
- <span class="description"><?php echo $this->__('[Set 0px to auto fit.]'); ?></span>
 
 
 
 
 
 
77
 
78
- </td>
79
- </tr>
80
- <tr>
81
- <th scope="row">
82
- <?php echo $this->options->button_opacity_label(); ?>
83
- </th>
84
- <td>
85
- <input class="seconds" name="<?php echo $this->options->button_opacity_name(); ?>" value="<?php echo $this->options->button_opacity(); ?>" />%
86
- </td>
87
- </tr>
88
- <tr>
89
- <th scope="row">
90
- <?php echo $this->options->button_fade_duration_label(); ?>
91
- </th>
92
- <td>
93
- <input class="seconds" name="<?php echo $this->options->button_fade_duration_name(); ?>" value="<?php echo $this->options->button_fade_duration(); ?>" />ms
94
- <span class="description"><?php echo $this->__('[Button fade duration in milliseconds.]'); ?></span>
95
- </td>
96
- </tr>
97
- <tr>
98
- <th scope="row">
99
- <?php echo $this->options->scroll_duration_label(); ?>
100
- </th>
101
- <td>
102
- <input class="seconds" name="<?php echo $this->options->scroll_duration_name(); ?>" value="<?php echo $this->options->scroll_duration(); ?>" />ms
103
- <span class="description"><?php echo $this->__('[Window scroll duration in milliseconds.]'); ?></span>
104
- </td>
105
- </tr>
106
- <tr>
107
- <th scope="row">
108
- <?php echo $this->options->hide_small_device_label(); ?>
109
- </th>
110
- <td>
111
- <input type="checkbox" name="<?php echo $this->options->hide_small_device_name(); ?>" <?php echo $this->options->hide_small_device() ? "checked" : ""; ?> />
112
- <span class="description"><?php echo $this->__('[Button will be hidden on small devices when the width matches.]'); ?></span>
113
- </td>
114
- </tr>
115
- <tr>
116
- <th scope="row">
117
- <?php echo $this->options->small_device_width_label(); ?>
118
- </th>
119
- <td>
120
- <input class="pixels" name="<?php echo $this->options->small_device_width_name(); ?>" value="<?php echo $this->options->small_device_width(); ?>" />px
121
- <span class="description"><?php echo $this->__('[Button will be hidden on devices with lesser or equal width.]'); ?></span>
122
- </td>
123
- </tr>
124
- <tr>
125
- <th scope="row">
126
- <?php echo $this->options->hide_small_window_label(); ?>
127
- </th>
128
- <td>
129
- <input type="checkbox" name="<?php echo $this->options->hide_small_window_name(); ?>" <?php echo $this->options->hide_small_window() ? "checked" : ""; ?> />
130
- <span class="description"><?php echo $this->__('[Button will be hidden on broswer window when the width matches.]'); ?></span>
131
- </td>
132
- </tr>
133
- <tr>
134
- <th scope="row">
135
- <?php echo $this->options->small_window_width_label(); ?>
136
- </th>
137
- <td>
138
- <input class="pixels" name="<?php echo $this->options->small_window_width_name(); ?>" value="<?php echo $this->options->small_window_width(); ?>" />px
139
- <span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
140
- </td>
141
- </tr>
142
- </table>
143
- <h3><?php echo $this->__('Location'); ?></h3>
144
- <table class="form-table">
145
- <tr>
146
- <th scope="row">
147
- <?php echo $this->options->location_label(); ?>
148
- </th>
149
- <td>
150
- <select name="<?php echo $this->options->location_name(); ?>">
151
- <option value="1" <?php echo $this->options->location() == 1 ? 'selected' : ''; ?> ><?php echo $this->__('Bottom Right'); ?></option>
152
- <option value="2" <?php echo $this->options->location() == 2 ? 'selected' : ''; ?> ><?php echo $this->__('Bottom Left'); ?></option>
153
- <option value="3" <?php echo $this->options->location() == 3 ? 'selected' : ''; ?> ><?php echo $this->__('Top Right'); ?></option>
154
- <option value="4" <?php echo $this->options->location() == 4 ? 'selected' : ''; ?> ><?php echo $this->__('Top Left'); ?></option>
155
- </select>
156
- </td>
157
- </tr>
158
- <tr>
159
- <th scope="row">
160
- <?php echo $this->options->marginX_label(); ?>
161
- </th>
162
- <td>
163
- <input class="pixels" name="<?php echo $this->options->marginX_name(); ?>" value="<?php echo $this->options->marginX(); ?>" />px
164
- <span class="description"><?php echo $this->__('[Negative value allowed.]'); ?></span>
165
- </td>
166
- </tr>
167
- <tr>
168
- <th scope="row">
169
- <?php echo $this->options->marginY_label(); ?>
170
- </th>
171
- <td>
172
- <input class="pixels" name="<?php echo $this->options->marginY_name(); ?>" value="<?php echo $this->options->marginY(); ?>" />px
173
- <span class="description"><?php echo $this->__('[Negative value allowed.]'); ?></span>
174
- </td>
175
- </tr>
176
- </table>
177
- <h3><?php echo $this->__('Image'); ?></h3>
178
- <div class="icons-container">
179
- <?php
180
- $files = scandir($this->iconsDIR);
181
- foreach ($files as $file) {
182
- if ($file == '.' || $file == '..')
183
- continue;
184
- echo '<div ' . ($this->options->image() == $file ? 'class="selected"' : '') . '>';
185
- echo '<input id="' . $file . '" name="' . $this->options->image_name() . '" type="radio" value="' . $file . '" ' . ($this->options->image() == $file ? 'checked' : '') . ' />';
186
- echo '<label for="' . $file . '"><img src="' . $this->iconsURL . $file . '"/></label>';
187
- echo '</div>';
188
- }
189
- ?>
190
- </div>
191
- <div>
192
- <input id="custom" name="<?php echo $this->options->image_name(); ?>" type="radio" value="custom" <?php echo ($this->options->image() == 'custom' ? 'checked' : ''); ?> />
193
- <label for="custom"><?php echo $this->__('Custom URL'); ?>
194
- <input class="customImage" name="<?php echo $this->options->custom_url_name(); ?>" value="<?php echo $this->options->custom_url(); ?>"/>
195
- </label>
196
- </div>
197
 
198
- <?php @$this->submit_button(); ?>
199
-
200
- <a href="http://wpfront.com/scroll-top-plugin-settings/" target="_blank"><?php echo $this->__('Settings Description'); ?></a>
201
- |
202
- <a href="http://wpfront.com/scroll-top-plugin-faq/" target="_blank"><?php echo $this->__('Plugin FAQ'); ?></a>
203
- |
204
- <a href="http://wpfront.com/contact/" target="_blank"><?php echo $this->__('Feature Request'); ?></a>
205
- |
206
- <a href="http://wpfront.com/contact/" target="_blank"><?php echo $this->__('Report Bug'); ?></a>
207
- |
208
- <a href="http://wordpress.org/support/view/plugin-reviews/wpfront-scroll-top" target="_blank"><?php echo $this->__('Write Review'); ?></a>
209
- |
210
- <a href="mailto:syam@wpfront.com"><?php echo $this->__('Contact Me (syam@wpfront.com)'); ?></a>
211
-
212
- </form>
213
- </div>
214
- </script>
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->hide_small_device_label(); ?>
94
+ </th>
95
+ <td>
96
+ <input type="checkbox" name="<?php echo $this->options->hide_small_device_name(); ?>" <?php echo $this->options->hide_small_device() ? "checked" : ""; ?> />
97
+ <span class="description"><?php echo $this->__('[Button will be hidden on small devices when the width matches.]'); ?></span>
98
+ </td>
99
+ </tr>
100
+ <tr>
101
+ <th scope="row">
102
+ <?php echo $this->options->small_device_width_label(); ?>
103
+ </th>
104
+ <td>
105
+ <input class="pixels" name="<?php echo $this->options->small_device_width_name(); ?>" value="<?php echo $this->options->small_device_width(); ?>" />px
106
+ <span class="description"><?php echo $this->__('[Button will be hidden on devices with lesser or equal width.]'); ?></span>
107
+ </td>
108
+ </tr>
109
+ <tr>
110
+ <th scope="row">
111
+ <?php echo $this->options->hide_small_window_label(); ?>
112
+ </th>
113
+ <td>
114
+ <input type="checkbox" name="<?php echo $this->options->hide_small_window_name(); ?>" <?php echo $this->options->hide_small_window() ? "checked" : ""; ?> />
115
+ <span class="description"><?php echo $this->__('[Button will be hidden on broswer window when the width matches.]'); ?></span>
116
+ </td>
117
+ </tr>
118
+ <tr>
119
+ <th scope="row">
120
+ <?php echo $this->options->small_window_width_label(); ?>
121
+ </th>
122
+ <td>
123
+ <input class="pixels" name="<?php echo $this->options->small_window_width_name(); ?>" value="<?php echo $this->options->small_window_width(); ?>" />px
124
+ <span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
125
+ </td>
126
+ </tr>
127
+ </table>
128
 
129
+ <h3><?php echo $this->__('Location'); ?></h3>
130
+ <table class="form-table">
131
+ <tr>
132
+ <th scope="row">
133
+ <?php echo $this->options->location_label(); ?>
134
+ </th>
135
+ <td>
136
+ <select name="<?php echo $this->options->location_name(); ?>">
137
+ <option value="1" <?php echo $this->options->location() == 1 ? 'selected' : ''; ?> ><?php echo $this->__('Bottom Right'); ?></option>
138
+ <option value="2" <?php echo $this->options->location() == 2 ? 'selected' : ''; ?> ><?php echo $this->__('Bottom Left'); ?></option>
139
+ <option value="3" <?php echo $this->options->location() == 3 ? 'selected' : ''; ?> ><?php echo $this->__('Top Right'); ?></option>
140
+ <option value="4" <?php echo $this->options->location() == 4 ? 'selected' : ''; ?> ><?php echo $this->__('Top Left'); ?></option>
141
+ </select>
142
+ </td>
143
+ </tr>
144
+ <tr>
145
+ <th scope="row">
146
+ <?php echo $this->options->marginX_label(); ?>
147
+ </th>
148
+ <td>
149
+ <input class="pixels" name="<?php echo $this->options->marginX_name(); ?>" value="<?php echo $this->options->marginX(); ?>" />px
150
+ <span class="description"><?php echo $this->__('[Negative value allowed.]'); ?></span>
151
+ </td>
152
+ </tr>
153
+ <tr>
154
+ <th scope="row">
155
+ <?php echo $this->options->marginY_label(); ?>
156
+ </th>
157
+ <td>
158
+ <input class="pixels" name="<?php echo $this->options->marginY_name(); ?>" value="<?php echo $this->options->marginY(); ?>" />px
159
+ <span class="description"><?php echo $this->__('[Negative value allowed.]'); ?></span>
160
+ </td>
161
+ </tr>
162
+ </table>
163
 
164
+ <h3><?php echo $this->__('Image'); ?></h3>
165
+ <div class="icons-container">
166
+ <?php
167
+ $files = scandir($this->iconsDIR);
168
+ foreach ($files as $file) {
169
+ if ($file == '.' || $file == '..')
170
+ continue;
171
+ echo '<div ' . ($this->options->image() == $file ? 'class="selected"' : '') . '>';
172
+ echo '<input id="' . $file . '" name="' . $this->options->image_name() . '" type="radio" value="' . $file . '" ' . ($this->options->image() == $file ? 'checked' : '') . ' />';
173
+ echo '<label for="' . $file . '"><img src="' . $this->iconsURL . $file . '"/></label>';
174
+ echo '</div>';
175
+ }
176
+ ?>
177
+ </div>
178
+ <div>
179
+ <input id="custom" name="<?php echo $this->options->image_name(); ?>" type="radio" value="custom" <?php echo ($this->options->image() == 'custom' ? 'checked' : ''); ?> />
180
+ <label for="custom"><?php echo $this->__('Custom URL'); ?>
181
+ <input class="customImage" name="<?php echo $this->options->custom_url_name(); ?>" value="<?php echo $this->options->custom_url(); ?>"/>
182
+ </label>
183
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
+ <?php @$this->options_page_footer('scroll-top-plugin-settings/', 'scroll-top-plugin-faq/'); ?>
186
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wpfront-scroll-top.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WPFront Scroll Top
4
  * Plugin URI: http://wpfront.com/scroll-top-plugin/
5
  * Description: Allows the visitor to easily scroll back to the top of the page.
6
- * Version: 1.1
7
  * Author: Syam Mohan
8
  * Author URI: http://wpfront.com
9
  * License: GPL v3
3
  * Plugin Name: WPFront Scroll Top
4
  * Plugin URI: http://wpfront.com/scroll-top-plugin/
5
  * Description: Allows the visitor to easily scroll back to the top of the page.
6
+ * Version: 1.1.1
7
  * Author: Syam Mohan
8
  * Author URI: http://wpfront.com
9
  * License: GPL v3