Changeset 994248
- Timestamp:
- 09/21/2014 03:30:19 PM (12 years ago)
- Location:
- pmzez-page-loader/trunk
- Files:
-
- 1 added
- 1 edited
-
js/color-picker.js (added)
-
myfunction.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pmzez-page-loader/trunk/myfunction.php
r925535 r994248 2 2 /** 3 3 * @package pmzez-page-loader 4 * @version 1. 04 * @version 1.1 5 5 */ 6 6 /* 7 7 Plugin Name: PmZez-Page-Loader 8 8 Plugin URI: http://www.pmzez.com/plugins/pmzez-page-loader 9 Description: Slim progress bars for Ajax'y applications. Inspired by Google, YouTube, and Medium. 10 Version: 1. 09 Description: Slim progress bars for Ajax'y applications. Inspired by Google, YouTube, and Medium. Go to ***"Settings >> PmZez Page Loader"*** -on the bottom and you can change loader color. 10 Version: 1.1 11 11 Author: Rashedul Islam Sagor 12 12 Author URI: http://www.pmzez.com 13 13 */ 14 15 14 16 15 /*Plugin Path*/ … … 41 40 add_action('wp_footer', 'pmzez_lazy_loader_active_js_install'); 42 41 43 ?> 42 //Option Panel Start 43 add_action('admin_menu', 'pmzez_lazy_loader_option_menu'); 44 function pmzez_lazy_loader_option_menu(){ 45 add_options_page('Pmzez Color Loader Settings Option', 'PmZez Page Loader', 'manage_options', 'pmzez-page-loader.php', 'pmzez_page_loader_options_framwork'); 46 } 47 48 //Default Value 49 $pmzez_lazy_loader_options = array( 50 'all_color' => '#29d' 51 ); 52 53 54 //Add Color Picker 55 add_action( 'admin_enqueue_scripts', 'wptuts_add_color_picker' ); 56 function wptuts_add_color_picker( $hook ) { 57 58 if( is_admin() ) { 59 60 // Add the color picker css file 61 wp_enqueue_style( 'wp-color-picker' ); 62 63 // Include our custom jQuery file with WordPress Color Picker dependency 64 wp_enqueue_script( 'custom-script-handle', plugins_url( '/js/color-picker.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); 65 } 66 } 67 68 69 if ( is_admin() ) : 70 71 function pmzez_lazy_loader_register_settings(){ 72 register_setting('pmzez_p_options', 'pmzez_lazy_loader_options', 'pmzez_lazy_loader_validate_options'); 73 } 74 add_action('admin_init', 'pmzez_lazy_loader_register_settings'); 75 76 77 78 //Generate Options Page 79 function pmzez_page_loader_options_framwork(){ 80 global $pmzez_lazy_loader_options; 81 82 83 if ( !isset($_REQUEST['updated']) ) 84 $_REQUEST['updated'] = false; 85 ?> 86 87 <div class="warp"> 88 <h2>Pmzez Color Loader Settings Option</h2> 89 <?php if (false !== $_REQUEST['updated']) : ?> 90 <div class="updated fade"><p><strong><?php _e('Options Saved'); ?></strong></p></div> 91 <?php endif; ?> 92 93 <form method="POST" action="options.php"> 94 95 <?php $settings = get_option('pmzez_lazy_loader_options', $pmzez_lazy_loader_options); ?> 96 <?php settings_fields('pmzez_p_options'); ?> 97 98 <table class="form-table"> 99 <tr valign="top"> 100 <th scope="row"><label for="all_color">Color Change Option</label></th> 101 <td> 102 <input id="all_color" type="text" name="pmzez_lazy_loader_options[all_color]" value="<?php echo stripslashes($settings['all_color']); ?>" class="color-field" /> 103 <p class="des">Insert color CODE(#cc0000) or color NAME(red)</p> 104 </td> 105 </tr> 106 </table> 107 <p class="submit"><input type="submit" class="button-primary" value="Save" /></p> 108 109 </form> 110 </div> 111 <?php } ?> 112 113 <?php 114 function pmzez_lazy_loader_validate_options($input){ 115 global $pmzez_lazy_loader_options; 116 $settings = get_option('pmzez_lazy_loader_options', $pmzez_lazy_loader_options); 117 118 119 $input['all_color'] = wp_filter_post_kses($input['all_color']); 120 121 return $input; 122 123 } 124 125 126 ?> 127 128 <?php endif; ?> 129 130 131 132 <!--Data Received--> 133 <?php 134 function pmzez_lazy_loader_color_over_ride(){ 135 136 global $pmzez_lazy_loader_options; $pmzez_color_settings = get_option('pmzez_lazy_loader_options', $pmzez_lazy_loader_options); 137 138 ?> 139 <style type="text/css"> 140 #nprogress .bar { 141 background: <?php echo $pmzez_color_settings['all_color']; ?>!important; 142 } 143 #nprogress .peg { 144 box-shadow: 0 0 10px <?php echo $pmzez_color_settings['all_color']; ?>, 0 0 5px <?php echo $pmzez_color_settings['all_color']; ?>!important; 145 } 146 #nprogress .spinner-icon { 147 border-top-color: <?php echo $pmzez_color_settings['all_color']; ?>!important; 148 border-left-color: <?php echo $pmzez_color_settings['all_color']; ?>!important; 149 } 150 </style> 151 <?php 152 } 153 add_action('wp_footer', 'pmzez_lazy_loader_color_over_ride'); ?> 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
Note: See TracChangeset
for help on using the changeset viewer.