Changeset 1664663
- Timestamp:
- 05/25/2017 12:29:53 PM (9 years ago)
- Location:
- my-bootstrap-menu/trunk
- Files:
-
- 9 edited
-
README.md (modified) (1 diff)
-
assets/my-plugin-settings-helper/inc/my-plugin-input-forms.php (modified) (2 diffs)
-
assets/my-plugin-settings-helper/inc/my-plugin-settings-base.php (modified) (3 diffs)
-
assets/my-plugin-settings-helper/js/my-plugin-settings.js (modified) (4 diffs)
-
inc/my-bootstrap-menu-admin-settings.php (modified) (1 diff)
-
inc/my-bootstrap-menu-funcs.php (modified) (1 diff)
-
inc/nav-menu/nav-menu-markup.php (modified) (2 diffs)
-
my-bootstrap-menu.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
my-bootstrap-menu/trunk/README.md
r1657947 r1664663 106 106 ## Changelog 107 107 108 ### 1.2.0 109 **POTENTIALLY BREAKING CHANGES** 110 Changed saved menu name to be slug format. You may need to reapply settings/logos etc. 111 Added Logo 'title' and 'alt' text fields. 112 Fix for selecting a Menu/Theme from drop-down. 113 108 114 ### 1.1.2 109 115 Fix for uninstalling/deleting the plugin. -
my-bootstrap-menu/trunk/assets/my-plugin-settings-helper/inc/my-plugin-input-forms.php
r1313493 r1664663 148 148 { 149 149 $settings_node->class .= ' unique_id'; 150 return self::build_input_select($option_settings_db_name, $settings_value, $settings_node); 151 } 152 153 private static function build_input_select($option_settings_db_name, $settings_value, My_Plugin_Settings_Node $settings_node) 150 $slugify = true; 151 return self::build_input_select($option_settings_db_name, $settings_value, $settings_node, $slugify); 152 } 153 154 private static function build_input_select($option_settings_db_name, $settings_value, My_Plugin_Settings_Node $settings_node, $slugify=false) 154 155 { 155 156 $id = $settings_node->id; … … 165 166 166 167 foreach ($select_options as $description_key => $select_value) { 167 $selected = ($settings_value == $select_value) ? 'selected' : ''; 168 $select_value = sanitize_text_field($select_value); 168 if($slugify){ 169 $select_value = sanitize_title($select_value); 170 } else { 171 $select_value = sanitize_text_field($select_value); 172 } 173 $selected = ($settings_value == $select_value) ? "selected='selected'" : ''; 169 174 $description_key = (is_string($description_key)) ? $description_key : $select_value; 170 175 -
my-bootstrap-menu/trunk/assets/my-plugin-settings-helper/inc/my-plugin-settings-base.php
r1313493 r1664663 151 151 private static function format_unique_id($unique_id) 152 152 { 153 return strtolower(preg_replace("/[^a-zA-Z0-9]+/", '_', html_entity_decode((string)$unique_id))); 153 return sanitize_title($unique_id); 154 //return strtolower(preg_replace("/[^a-zA-Z0-9]+/", '_', html_entity_decode((string)$unique_id))); 154 155 } 155 156 … … 221 222 if ($display_error) { 222 223 $this->add_admin_notice('load_settings', 223 'No saved options available',224 My_Plugin_Notice_Type::Update);224 'No saved options available', 225 My_Plugin_Notice_Type::Update); 225 226 } 226 227 return false; … … 233 234 if ($display_error) { 234 235 $this->add_admin_notice('load_settings', 235 "Saved version of settings out of date [current version: {$current_plugin_version} min required: {$this->min_plugin_version}]",236 My_Plugin_Notice_Type::Error);236 "Saved version of settings out of date [current version: {$current_plugin_version} min required: {$this->min_plugin_version}]", 237 My_Plugin_Notice_Type::Error); 237 238 } 238 239 return false; -
my-bootstrap-menu/trunk/assets/my-plugin-settings-helper/js/my-plugin-settings.js
r1451039 r1664663 43 43 previous_uniqueid = this.value; 44 44 }).change(function(event) { 45 //Set the url parameter for the unique id and reload the page 46 var unique_id = $(this).val(); 47 unique_id = unique_id.replace(/[^a-zA-Z0-9]+/g, '_').toLowerCase(); 48 //Set the value back as either - page gets reloaded and the unique is set, or user stays and the value is the original. 49 $(this).val(previous_uniqueid); 50 //Change the url and reload the page if user selects ok... 51 add_param_to_url('unique_id', unique_id); 52 }); 45 //Set the url parameter for the unique id and reload the page 46 var unique_id = $(this).val(); 47 // This parsing should be done on input. i.e. sanitize_title() 48 // unique_id = unique_id.replace(/[^a-zA-Z0-9]+/g, '_').toLowerCase(); 49 //Set the value back as either - page gets reloaded and the unique is set, or user stays and the value is the original. 50 $(this).val(previous_uniqueid); 51 //Change the url and reload the page if user selects ok... 52 add_param_to_url('unique_id', unique_id); 53 }); 53 54 54 55 /** … … 58 59 $('.my_plugin_input') 59 60 .change(function(e){ 60 if(!$(':focus').hasClass('unique_id')) {61 if(!$(':focus').hasClass('unique_id')) { 61 62 values_changed = true; 62 63 } … … 125 126 */ 126 127 function getKeyValue(key) { 127 if(supports_html5_storage()) {128 if(supports_html5_storage()) { 128 129 return localStorage[getDatastoreKey(key)]; 129 130 } else { … … 141 142 function saveKeyValue(key, value){ 142 143 if(supports_html5_storage()) { 143 localStorage[getDatastoreKey(key)] = value;144 localStorage[getDatastoreKey(key)] = value; 144 145 } else { 145 146 document.cookie = getDatastoreKey(key) + '=' + value; -
my-bootstrap-menu/trunk/inc/my-bootstrap-menu-admin-settings.php
r1313493 r1664663 119 119 My_Plugin_Settings_Node::withValues('logo_height', 'Enter logo height', 30, $this::section_logo, My_Plugin_Settings_Input_Type::Text, 'Enter the height in px (or auto)'), 120 120 My_Plugin_Settings_Node::withValues('logo_width', 'Enter logo width', 'auto', $this::section_logo, My_Plugin_Settings_Input_Type::Text, 'Enter the width in px (or auto)'), 121 My_Plugin_Settings_Node::withValues('logo_title', 'Enter logo title', '', $this::section_logo, My_Plugin_Settings_Input_Type::Text, 'Enter logo title if required'), 122 My_Plugin_Settings_Node::withValues('logo_alt_text', 'Enter logo alt text', '', $this::section_logo, My_Plugin_Settings_Input_Type::Text, 'Enter logo alt text if required'), 121 123 122 124 //section_title -
my-bootstrap-menu/trunk/inc/my-bootstrap-menu-funcs.php
r1313493 r1664663 58 58 //List all menus 59 59 $menus_and_themes = self::list_all_menu_names(); 60 if (!$menus_and_themes) 60 if (!$menus_and_themes) //If no menus return False 61 61 return $menus_and_themes; 62 62 -
my-bootstrap-menu/trunk/inc/nav-menu/nav-menu-markup.php
r1313493 r1664663 12 12 /** 13 13 * Class My_Bootstrap_Menu_Nav_Menu_Markup 14 * 14 * 15 15 */ 16 16 namespace My_Bootstrap_Menu_Plugin_Namespace { … … 203 203 } 204 204 205 $height = ($this->settings->logo_height != '') ? "height='{$this->settings->logo_height}'" : ""; 206 $width = ($this->settings->logo_width != '') ? "width='{$this->settings->logo_width}'" : ""; 205 $title = ($this->settings->logo_title != '') ? " title='{$this->settings->logo_title}'" : ""; 206 $alt_text = ($this->settings->logo_alt_text != '') ? " alt='{$this->settings->logo_alt_text}'" : ""; 207 $height = ($this->settings->logo_height != '') ? " height='{$this->settings->logo_height}'" : ""; 208 $width = ($this->settings->logo_width != '') ? " width='{$this->settings->logo_width}'" : ""; 207 209 208 210 $html .= "<a class='navbar-brand {$additional_class} {$this->get_navbar_title_and_logo_class()}' href='{$this->home_url}'> 209 211 <img src='{$logo_url}' 210 title='{$this->home_url}' 212 {$title} 213 {$alt_text} 211 214 {$height} 212 215 {$width}> -
my-bootstrap-menu/trunk/my-bootstrap-menu.php
r1657947 r1664663 4 4 * Plugin URI: https://github.com/mcldev/my-bootstrap-menu 5 5 * Description: Boostraps a menu using flexible and easy to use settings. Fully customizable for advanced users. 6 * Version: 1. 1.26 * Version: 1.2.0 7 7 * Author: Michael Carder 8 8 * Author URI: http://www.michaelcarder.com -
my-bootstrap-menu/trunk/readme.txt
r1657947 r1664663 100 100 == Changelog == 101 101 102 = 1.2.0 = 103 **POTENTIALLY BREAKING CHANGES** 104 Changed saved menu name to be slug format. You may need to reapply settings/logos etc. 105 Added Logo 'title' and 'alt' text fields. 106 Fix for selecting a Menu/Theme from drop-down. 107 102 108 = 1.1.2 = 103 109 Fix for uninstalling/deleting the plugin.
Note: See TracChangeset
for help on using the changeset viewer.