catch-scroll-progress-bar-admin-display.php
4 years ago
dashboard-display.php
4 years ago
footer.php
4 years ago
sidebar.php
4 years ago
dashboard-display.php
194 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Provide a admin area view for the plugin |
| 5 | * |
| 6 | * This file is used to markup the admin-facing aspects of the plugin. |
| 7 | * |
| 8 | * @link https://catchplugins.com/plugins |
| 9 | * @since 1.0.0 |
| 10 | * |
| 11 | * @package Catch_Scroll_Progress_Bar |
| 12 | * @subpackage Catch_Scroll_Progress_Bar/admin/partials |
| 13 | */ |
| 14 | ?> |
| 15 | |
| 16 | <div id="catch-progress-menu"> |
| 17 | <div class="content-wrapper"> |
| 18 | <div class="header"> |
| 19 | <h2><?php esc_html_e( 'Settings', 'catch-scroll-progress-bar' ); ?></h2> |
| 20 | </div> <!-- .Header --> |
| 21 | <div class="content"> |
| 22 | <?php if( isset($_GET['settings-updated']) ) { ?> |
| 23 | <div id="message" class="notice updated fade"> |
| 24 | <p><strong><?php esc_html_e( 'Plugin Options Saved.', 'catch-scroll-progress-bar' ) ?></strong></p> |
| 25 | </div> |
| 26 | <?php } ?> |
| 27 | <?php // Use nonce for verification. |
| 28 | wp_nonce_field( basename( __FILE__ ), 'catch_progress_bar_nonce' ); |
| 29 | ?> |
| 30 | <div id="progress_main"> |
| 31 | <form method="post" action="options.php"> |
| 32 | <?php settings_fields( 'catch-scroll-progress-bar-group' ); ?> |
| 33 | <?php |
| 34 | $defaults =catch_progress_bar_default_options(); |
| 35 | $settings = catch_progress_bar_get_options(); |
| 36 | ?> |
| 37 | <div class="option-container"> |
| 38 | <table class="form-table" bgcolor="white"> |
| 39 | <tbody> |
| 40 | <tr> |
| 41 | <th> |
| 42 | <label><?php echo esc_html__( 'Progress Bar Position', 'catch-scroll-progress-bar' ); ?></label> |
| 43 | </th> |
| 44 | <td> |
| 45 | <select name="catch_progress_bar_options[progress_bar_position]" id="catch_progress_bar_options[progress_bar_position]"> |
| 46 | <?php |
| 47 | $progress_bar_position = catch_progress_bar_position(); |
| 48 | foreach ( $progress_bar_position as $k => $value) { |
| 49 | echo '<option value="' . $k . '"' . selected( $settings['progress_bar_position'], $k, false ) . '>' . $value . '</option>'; |
| 50 | } |
| 51 | ?> |
| 52 | </select> |
| 53 | <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e( 'let you to decide the progress bar position.', 'catch-scroll-progress-bar' ); ?>"></span> |
| 54 | </td> |
| 55 | </tr> |
| 56 | <tr> |
| 57 | <th> |
| 58 | <label><?php esc_html_e( 'Background Color', 'catch-scroll-progress-bar' ); ?></label> |
| 59 | </th> |
| 60 | <td> |
| 61 | <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'] ); ?>"/> |
| 62 | </td> |
| 63 | </tr> |
| 64 | |
| 65 | |
| 66 | <tr> |
| 67 | <th> |
| 68 | <label><?php esc_html_e( 'Foreground Color', 'catch-scroll-progress-bar' ); ?></label> |
| 69 | </th> |
| 70 | <td> |
| 71 | <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'] ); ?>"/> |
| 72 | </td> |
| 73 | </tr> |
| 74 | <tr> |
| 75 | <th> |
| 76 | <label><?php esc_html_e( 'Background Opacity', 'catch-scroll-progress-bar' ); ?></label> |
| 77 | </th> |
| 78 | <td> |
| 79 | <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'] ); ?>"/> |
| 80 | <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> |
| 81 | </td> |
| 82 | </tr> |
| 83 | <tr> |
| 84 | <th> |
| 85 | <label><?php esc_html_e( 'Foreground Opacity', 'catch-scroll-progress-bar' ); ?></label> |
| 86 | </th> |
| 87 | <td> |
| 88 | <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'] ); ?>"/> |
| 89 | <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> |
| 90 | </td> |
| 91 | </tr> |
| 92 | |
| 93 | <tr> |
| 94 | <th> |
| 95 | <label><?php esc_html_e( 'Progress Bar Height', 'catch-scroll-progress-bar' ); ?></label> |
| 96 | </th> |
| 97 | <td> |
| 98 | <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'] ); ?>"/> |
| 99 | <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> |
| 100 | </td> |
| 101 | </tr> |
| 102 | <tr> |
| 103 | <th> |
| 104 | <label><?php esc_html_e( 'Boder Radius', 'catch-scroll-progress-bar' ); ?></label> |
| 105 | </th> |
| 106 | <td> |
| 107 | <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'] ); ?>"/> |
| 108 | <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> |
| 109 | </td> |
| 110 | </tr> |
| 111 | |
| 112 | |
| 113 | <tr> |
| 114 | <th> |
| 115 | <?php echo esc_html__('Select the Template Condition to progress bar'); ?> |
| 116 | </th> |
| 117 | <td> |
| 118 | <p class="description">Template condition...</p> |
| 119 | <div> |
| 120 | <input type="checkbox" id="catch_progress_bar_options[home]" name="catch_progress_bar_options[home]" value="1" |
| 121 | <?php echo checked( isset($settings['home']) ? $settings['home'] : '' , true, false ); ?> /> |
| 122 | <label for="catch_progress_bar_options[home]">Front page/Home Page </label> |
| 123 | </div> |
| 124 | |
| 125 | <div> |
| 126 | <input type="checkbox" id="catch_progress_bar_options[blog]" name="catch_progress_bar_options[blog]" value="1" |
| 127 | <?php echo checked( isset($settings['blog']) ? $settings['blog'] : '' , true, false ); ?> /> |
| 128 | <label for="catch_progress_bar_options[blog]">Blog Page</label> |
| 129 | </div> |
| 130 | |
| 131 | <div> |
| 132 | <input type="checkbox" id="catch_progress_bar_options[archive]" name="catch_progress_bar_options[archive]" value="1" |
| 133 | <?php echo checked( isset($settings['archive']) ? $settings['archive'] : '' , true, false ); ?> /> |
| 134 | <label for="catch_progress_bar_options[archive]">Archives and Categories <p class="description">Select post type to apply progress bar</p></label> |
| 135 | </div> |
| 136 | |
| 137 | <div> |
| 138 | <input type="checkbox" id="catch_progress_bar_options[single]" name="catch_progress_bar_options[single]" value="1" |
| 139 | <?php echo checked( isset($settings['single']) ? $settings['single'] : '' , true, false ); ?> /> |
| 140 | <label for="catch_progress_bar_options[single]">Single page/post<p class="description">Select post type to apply progress bar</p></label> |
| 141 | </div> |
| 142 | </td> |
| 143 | </tr> |
| 144 | <tr> |
| 145 | <th> |
| 146 | <?php echo esc_html__('Select the Post type to apply progress bar'); ?> |
| 147 | </th> |
| 148 | <td> |
| 149 | <p class="description">Select post type to apply progress bar</p> |
| 150 | |
| 151 | <div> |
| 152 | <?php |
| 153 | $optionNamePostType = ''; |
| 154 | if (isset($settings['field_posttypes'])) { |
| 155 | $optionPostTypes = $settings['field_posttypes']; |
| 156 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
| 157 | foreach ( $post_types as $type => $obj ) { |
| 158 | if (isset($optionPostTypes[$obj->name])) : $optionNamePostType = $optionPostTypes[$obj->name]; else : $optionNamePostType = ''; endif; |
| 159 | ?> |
| 160 | <p><input type='checkbox' name='catch_progress_bar_options[field_posttypes][<?php echo $obj->name; ?>]' id="catch_progress_bar_options[field_posttypes][<?php echo $obj->name; ?>]" |
| 161 | <?php echo checked( isset($optionNamePostType) ? $optionNamePostType : '' , true, false ); ?> value='1' /> <?php echo $obj->labels->name; ?></p> |
| 162 | <?php |
| 163 | } |
| 164 | } else { |
| 165 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
| 166 | foreach ( $post_types as $type => $obj ) { |
| 167 | ?> |
| 168 | <p><input type='checkbox' name='catch_progress_bar_options[field_posttypes][<?php echo $obj->name; ?>]' value='1' /> <?php echo $obj->labels->name; ?></p> |
| 169 | <?php |
| 170 | } |
| 171 | } ?> |
| 172 | |
| 173 | </div> |
| 174 | |
| 175 | <tr> |
| 176 | <th scope="row"><?php esc_html_e( 'Reset Options', 'catch-scroll-progress-bar' ); ?></th> |
| 177 | <td> |
| 178 | <?php |
| 179 | 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' ); |
| 180 | ?> |
| 181 | <span class="dashicons dashicons-info tooltip" title="<?php esc_html_e( 'Caution: Reset all settings to default.', 'catch-scroll-progress-bar' ); ?>"></span> |
| 182 | </td> |
| 183 | </tr> |
| 184 | |
| 185 | </tbody> |
| 186 | </table> |
| 187 | <?php submit_button( esc_html__( 'Save Changes', 'catch-scroll-progress-bar' ) ); ?> |
| 188 | </div><!-- .option-container --> |
| 189 | </form> |
| 190 | </div><!-- progress_main --> |
| 191 | </div><!-- .content --> |
| 192 | </div><!-- .content-wrapper --> |
| 193 | </div><!---catch--progress--> |
| 194 |