catch-scroll-progress-bar-admin-display.php
5 months ago
dashboard-display.php
5 months ago
footer.php
5 months ago
sidebar.php
5 months ago
dashboard-display.php
199 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'])) { ?> |
| 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 | <?php // Use nonce for verification. |
| 31 | wp_nonce_field(CATCH_SCROLL_PROGRESS_BAR_BASENAME, 'catch_progress_bar_nonce'); |
| 32 | ?> |
| 33 | <div id="progress_main"> |
| 34 | <form method="post" action="options.php"> |
| 35 | <?php settings_fields('catch-scroll-progress-bar-group'); ?> |
| 36 | <?php |
| 37 | $defaults = catch_progress_bar_default_options(); |
| 38 | $settings = catch_progress_bar_get_options(); |
| 39 | ?> |
| 40 | <div class="option-container"> |
| 41 | <table class="form-table" bgcolor="white"> |
| 42 | <tbody> |
| 43 | <tr> |
| 44 | <th> |
| 45 | <label><?php echo esc_html__('Progress Bar Position', 'catch-scroll-progress-bar'); ?></label> |
| 46 | </th> |
| 47 | <td> |
| 48 | <select name="catch_progress_bar_options[progress_bar_position]" id="catch_progress_bar_options[progress_bar_position]"> |
| 49 | <?php |
| 50 | $progress_bar_position = catch_progress_bar_position(); |
| 51 | foreach ($progress_bar_position as $k => $value) { |
| 52 | echo '<option value="' . esc_attr($k) . '"' . selected($settings['progress_bar_position'], $k, false) . '>' . esc_html($value) . '</option>'; |
| 53 | } |
| 54 | ?> |
| 55 | </select> |
| 56 | <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e('let you to decide the progress bar position.', 'catch-scroll-progress-bar'); ?>"></span> |
| 57 | </td> |
| 58 | </tr> |
| 59 | <tr> |
| 60 | <th> |
| 61 | <label><?php esc_html_e('Background Color', 'catch-scroll-progress-bar'); ?></label> |
| 62 | </th> |
| 63 | <td> |
| 64 | <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']); ?>" /> |
| 65 | </td> |
| 66 | </tr> |
| 67 | |
| 68 | |
| 69 | <tr> |
| 70 | <th> |
| 71 | <label><?php esc_html_e('Foreground Color', 'catch-scroll-progress-bar'); ?></label> |
| 72 | </th> |
| 73 | <td> |
| 74 | <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']); ?>" /> |
| 75 | </td> |
| 76 | </tr> |
| 77 | <tr> |
| 78 | <th> |
| 79 | <label><?php esc_html_e('Background Opacity', 'catch-scroll-progress-bar'); ?></label> |
| 80 | </th> |
| 81 | <td> |
| 82 | <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']); ?>" /> |
| 83 | <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> |
| 84 | </td> |
| 85 | </tr> |
| 86 | <tr> |
| 87 | <th> |
| 88 | <label><?php esc_html_e('Foreground Opacity', 'catch-scroll-progress-bar'); ?></label> |
| 89 | </th> |
| 90 | <td> |
| 91 | <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']); ?>" /> |
| 92 | <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> |
| 93 | </td> |
| 94 | </tr> |
| 95 | |
| 96 | <tr> |
| 97 | <th> |
| 98 | <label><?php esc_html_e('Progress Bar Height', 'catch-scroll-progress-bar'); ?></label> |
| 99 | </th> |
| 100 | <td> |
| 101 | <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']); ?>" /> |
| 102 | <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> |
| 103 | </td> |
| 104 | </tr> |
| 105 | <tr> |
| 106 | <th> |
| 107 | <label><?php esc_html_e('Border Radius', 'catch-scroll-progress-bar'); ?></label> |
| 108 | </th> |
| 109 | <td> |
| 110 | <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']); ?>" /> |
| 111 | <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> |
| 112 | </td> |
| 113 | </tr> |
| 114 | |
| 115 | |
| 116 | <tr> |
| 117 | <th> |
| 118 | <?php echo esc_html__('Select the Template Condition to progress bar', 'catch-scroll-progress-bar'); ?> |
| 119 | </th> |
| 120 | <td> |
| 121 | <p class="description">Template condition...</p> |
| 122 | <div> |
| 123 | <input type="checkbox" id="catch_progress_bar_options[home]" name="catch_progress_bar_options[home]" value="1" |
| 124 | <?php echo checked(isset($settings['home']) ? $settings['home'] : '', true, false); ?> /> |
| 125 | <label for="catch_progress_bar_options[home]">Front page/Home Page </label> |
| 126 | </div> |
| 127 | |
| 128 | <div> |
| 129 | <input type="checkbox" id="catch_progress_bar_options[blog]" name="catch_progress_bar_options[blog]" value="1" |
| 130 | <?php echo checked(isset($settings['blog']) ? $settings['blog'] : '', true, false); ?> /> |
| 131 | <label for="catch_progress_bar_options[blog]">Blog Page</label> |
| 132 | </div> |
| 133 | |
| 134 | <div> |
| 135 | <input type="checkbox" id="catch_progress_bar_options[archive]" name="catch_progress_bar_options[archive]" value="1" |
| 136 | <?php echo checked(isset($settings['archive']) ? $settings['archive'] : '', true, false); ?> /> |
| 137 | <label for="catch_progress_bar_options[archive]">Archives and Categories <p class="description">Select post type to apply progress bar</p></label> |
| 138 | </div> |
| 139 | |
| 140 | <div> |
| 141 | <input type="checkbox" id="catch_progress_bar_options[single]" name="catch_progress_bar_options[single]" value="1" |
| 142 | <?php echo checked(isset($settings['single']) ? $settings['single'] : '', true, false); ?> /> |
| 143 | <label for="catch_progress_bar_options[single]">Single page/post<p class="description">Select post type to apply progress bar</p></label> |
| 144 | </div> |
| 145 | </td> |
| 146 | </tr> |
| 147 | <tr> |
| 148 | <th> |
| 149 | <?php echo esc_html__('Select the Post type to apply progress bar', 'catch-scroll-progress-bar'); ?> |
| 150 | </th> |
| 151 | <td> |
| 152 | <p class="description">Select post type to apply progress bar</p> |
| 153 | |
| 154 | <div> |
| 155 | <?php |
| 156 | $optionNamePostType = ''; |
| 157 | if (isset($settings['field_posttypes'])) { |
| 158 | $optionPostTypes = $settings['field_posttypes']; |
| 159 | $post_types = get_post_types(array('public' => true), 'objects'); |
| 160 | foreach ($post_types as $type => $obj) { |
| 161 | |
| 162 | if (isset($optionPostTypes[$obj->name])) : $optionNamePostType = $optionPostTypes[$obj->name]; |
| 163 | else : $optionNamePostType = ''; |
| 164 | endif; |
| 165 | ?> |
| 166 | <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); ?>]" |
| 167 | <?php echo checked(isset($optionNamePostType) ? $optionNamePostType : '', true, false); ?> value='1' /> <?php echo esc_html($obj->labels->name); ?></p> |
| 168 | <?php |
| 169 | } |
| 170 | } else { |
| 171 | $post_types = get_post_types(array('public' => true), 'objects'); |
| 172 | foreach ($post_types as $type => $obj) { |
| 173 | ?> |
| 174 | <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> |
| 175 | <?php |
| 176 | } |
| 177 | } ?> |
| 178 | |
| 179 | </div> |
| 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--> |