PluginProbe ʕ •ᴥ•ʔ
Catch Scroll Progress Bar / trunk
Catch Scroll Progress Bar vtrunk
trunk 1.0.0 1.1 1.2 1.3 1.4 1.5 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 2.0 2.1 2.2
catch-scroll-progress-bar / admin / partials / dashboard-display.php
catch-scroll-progress-bar / admin / partials Last commit date
catch-scroll-progress-bar-admin-display.php 3 months ago dashboard-display.php 3 months ago footer.php 6 months ago sidebar.php 6 months ago
dashboard-display.php
200 lines
1 <?php
2
3 // Exit if accessed directly
4 if (! defined('ABSPATH')) exit;
5
6 /**
7 * Provide a admin area view for the plugin
8 *
9 * This file is used to markup the admin-facing aspects of the plugin.
10 *
11 * @link https://catchplugins.com/plugins
12 * @since 1.0.0
13 *
14 * @package Catch_Scroll_Progress_Bar
15 * @subpackage Catch_Scroll_Progress_Bar/admin/partials
16 */
17 ?>
18
19 <div id="catch-progress-menu">
20 <div class="content-wrapper">
21 <div class="header">
22 <h2><?php esc_html_e('Settings', 'catch-scroll-progress-bar'); ?></h2>
23 </div> <!-- .Header -->
24 <div class="content">
25 <?php if (isset($_GET['settings-updated'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
26 <div id="message" class="notice updated fade">
27 <p><strong><?php esc_html_e('Plugin Options Saved.', 'catch-scroll-progress-bar') ?></strong></p>
28 </div>
29 <?php } ?>
30 <div id="progress_main">
31 <form method="post" action="options.php">
32 <?php settings_fields('catch-scroll-progress-bar-group'); ?>
33 <?php
34 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template partial; variables are local to this included file, not injected into the true global scope.
35 $defaults = catch_progress_bar_default_options();
36 $settings = catch_progress_bar_get_options();
37 ?>
38 <div class="option-container">
39 <table class="form-table" bgcolor="white">
40 <tbody>
41 <tr>
42 <th>
43 <label><?php echo esc_html__('Progress Bar Position', 'catch-scroll-progress-bar'); ?></label>
44 </th>
45 <td>
46 <select name="catch_progress_bar_options[progress_bar_position]" id="catch_progress_bar_options[progress_bar_position]">
47 <?php
48 $progress_bar_position = catch_progress_bar_position();
49 foreach ($progress_bar_position as $k => $value) {
50 echo '<option value="' . esc_attr($k) . '"' . selected($settings['progress_bar_position'], $k, false) . '>' . esc_html($value) . '</option>';
51 }
52 ?>
53 </select>
54 <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e('let you to decide the progress bar position.', 'catch-scroll-progress-bar'); ?>"></span>
55 </td>
56 </tr>
57 <tr>
58 <th>
59 <label><?php esc_html_e('Background Color', 'catch-scroll-progress-bar'); ?></label>
60 </th>
61 <td>
62 <input type="text" name="catch_progress_bar_options[background_color]" id="background-color" class="color-picker" data-alpha="true" value="<?php echo esc_attr($settings['background_color']); ?>" />
63 </td>
64 </tr>
65
66
67 <tr>
68 <th>
69 <label><?php esc_html_e('Foreground Color', 'catch-scroll-progress-bar'); ?></label>
70 </th>
71 <td>
72 <input type="text" name="catch_progress_bar_options[foreground_color]" id="foreground-color" class="color-picker" data-alpha="true" value="<?php echo esc_attr($settings['foreground_color']); ?>" />
73 </td>
74 </tr>
75 <tr>
76 <th>
77 <label><?php esc_html_e('Background Opacity', 'catch-scroll-progress-bar'); ?></label>
78 </th>
79 <td>
80 <input type="number" min="0" max="1" step="0.1" name="catch_progress_bar_options[background_opacity]" id="background-opacity" class="background-opacity" data-alpha="true" value="<?php echo esc_attr($settings['background_opacity']); ?>" />
81 <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e('Background Opacity helps you to set the transparency-level, 1 is not transparent at all where as 0 is completely transparent.', 'catch-scroll-progress-bar'); ?>"></span>
82 </td>
83 </tr>
84 <tr>
85 <th>
86 <label><?php esc_html_e('Foreground Opacity', 'catch-scroll-progress-bar'); ?></label>
87 </th>
88 <td>
89 <input type="number" min="0" max="1" step="0.1" name="catch_progress_bar_options[foreground_opacity]" id="foreground-opacity" class="foreground-opacity" data-alpha="true" value="<?php echo esc_attr($settings['foreground_opacity']); ?>" />
90 <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e('Foreground Opacity helps you to set the transparency-level, 1 is not transparent at all where as 0 is completely transparent.', 'catch-scroll-progress-bar'); ?>"></span>
91 </td>
92 </tr>
93
94 <tr>
95 <th>
96 <label><?php esc_html_e('Progress Bar Height', 'catch-scroll-progress-bar'); ?></label>
97 </th>
98 <td>
99 <input type="number" min="0" max="100" step="1" name="catch_progress_bar_options[bar_height]" id="bar-height" class="bar_height" data-alpha="true" value="<?php echo esc_attr($settings['bar_height']); ?>" />
100 <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e('This will let you to set the height of the progress bar', 'catch-scroll-progress-bar'); ?>"></span>
101 </td>
102 </tr>
103 <tr>
104 <th>
105 <label><?php esc_html_e('Border Radius', 'catch-scroll-progress-bar'); ?></label>
106 </th>
107 <td>
108 <input type="number" min="0" max="100" step="1" name="catch_progress_bar_options[radius]" id="bar-height" class="bar_height" data-alpha="true" value="<?php echo esc_attr($settings['radius']); ?>" />
109 <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e('This will let you to set the border radius of the progress bar', 'catch-scroll-progress-bar'); ?>"></span>
110 </td>
111 </tr>
112
113
114 <tr>
115 <th>
116 <?php echo esc_html__('Select the Template Condition to progress bar', 'catch-scroll-progress-bar'); ?>
117 </th>
118 <td>
119 <p class="description">Template condition...</p>
120 <div>
121 <input type="checkbox" id="catch_progress_bar_options[home]" name="catch_progress_bar_options[home]" value="1"
122 <?php echo checked(isset($settings['home']) ? $settings['home'] : '', true, false); ?> />
123 <label for="catch_progress_bar_options[home]">Front page/Home Page </label>
124 </div>
125
126 <div>
127 <input type="checkbox" id="catch_progress_bar_options[blog]" name="catch_progress_bar_options[blog]" value="1"
128 <?php echo checked(isset($settings['blog']) ? $settings['blog'] : '', true, false); ?> />
129 <label for="catch_progress_bar_options[blog]">Blog Page</label>
130 </div>
131
132 <div>
133 <input type="checkbox" id="catch_progress_bar_options[archive]" name="catch_progress_bar_options[archive]" value="1"
134 <?php echo checked(isset($settings['archive']) ? $settings['archive'] : '', true, false); ?> />
135 <label for="catch_progress_bar_options[archive]">Archives and Categories <p class="description">Select post type to apply progress bar</p></label>
136 </div>
137
138 <div>
139 <input type="checkbox" id="catch_progress_bar_options[single]" name="catch_progress_bar_options[single]" value="1"
140 <?php echo checked(isset($settings['single']) ? $settings['single'] : '', true, false); ?> />
141 <label for="catch_progress_bar_options[single]">Single page/post<p class="description">Select post type to apply progress bar</p></label>
142 </div>
143 </td>
144 </tr>
145 <tr>
146 <th>
147 <?php echo esc_html__('Select the Post type to apply progress bar', 'catch-scroll-progress-bar'); ?>
148 </th>
149 <td>
150 <p class="description">Select post type to apply progress bar</p>
151
152 <div>
153 <?php
154 $optionNamePostType = '';
155 if (isset($settings['field_posttypes'])) {
156 $optionPostTypes = $settings['field_posttypes'];
157 $post_types = get_post_types(array('public' => true), 'objects');
158 foreach ($post_types as $type => $obj) {
159
160 if (isset($optionPostTypes[$obj->name])) : $optionNamePostType = $optionPostTypes[$obj->name];
161 else : $optionNamePostType = '';
162 endif;
163 ?>
164 <p><input type='checkbox' name='catch_progress_bar_options[field_posttypes][<?php echo esc_attr($obj->name); ?>]' id="catch_progress_bar_options[field_posttypes][<?php echo esc_attr($obj->name); ?>]"
165 <?php echo checked(isset($optionNamePostType) ? $optionNamePostType : '', true, false); ?> value='1' /> <?php echo esc_html($obj->labels->name); ?></p>
166 <?php
167 }
168 } else {
169 $post_types = get_post_types(array('public' => true), 'objects');
170 foreach ($post_types as $type => $obj) {
171 ?>
172 <p><input type='checkbox' name='catch_progress_bar_options[field_posttypes][<?php echo esc_attr($obj->name); ?>]' value='1' /> <?php echo esc_html($obj->labels->name); ?></p>
173 <?php
174 }
175 } ?>
176
177 </div><!-- post-type checkboxes -->
178 </td>
179 </tr>
180
181 <tr>
182 <th scope="row"><?php esc_html_e('Reset Options', 'catch-scroll-progress-bar'); ?></th>
183 <td>
184 <?php
185 echo '<input name="catch_progress_bar_options[reset]" id="catch_progress_bar_options[reset]" type="checkbox" value="1" class="catch_progress_bar_options[reset]" />' . esc_html__('Check to reset', 'catch-scroll-progress-bar');
186 ?>
187 <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e('Caution: Reset all settings to default.', 'catch-scroll-progress-bar'); ?>"></span>
188 </td>
189 </tr>
190
191 </tbody>
192 </table>
193 <?php submit_button(esc_html__('Save Changes', 'catch-scroll-progress-bar')); ?>
194 </div><!-- .option-container -->
195 </form>
196 </div><!-- progress_main -->
197 </div><!-- .content -->
198 </div><!-- .content-wrapper -->
199 </div><!---catch--progress-->
200 <?php // phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound ?>