Plugin Directory

Changeset 1664663


Ignore:
Timestamp:
05/25/2017 12:29:53 PM (9 years ago)
Author:
codetoolbox
Message:

POTENTIALLY BREAKING CHANGES
Changed saved menu name to be slug format. You may need to reapply settings/logos etc.
Added Logo 'title' and 'alt' text fields.
Fix for selecting a Menu/Theme from drop-down.

Location:
my-bootstrap-menu/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • my-bootstrap-menu/trunk/README.md

    r1657947 r1664663  
    106106## Changelog
    107107
     108### 1.2.0
     109**POTENTIALLY BREAKING CHANGES**
     110Changed saved menu name to be slug format. You may need to reapply settings/logos etc.
     111Added Logo 'title' and 'alt' text fields.
     112Fix for selecting a Menu/Theme from drop-down.
     113
    108114### 1.1.2
    109115Fix for uninstalling/deleting the plugin.
  • my-bootstrap-menu/trunk/assets/my-plugin-settings-helper/inc/my-plugin-input-forms.php

    r1313493 r1664663  
    148148        {
    149149            $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)
    154155        {
    155156            $id = $settings_node->id;
     
    165166
    166167            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'" : '';
    169174                $description_key = (is_string($description_key)) ? $description_key : $select_value;
    170175
  • my-bootstrap-menu/trunk/assets/my-plugin-settings-helper/inc/my-plugin-settings-base.php

    r1313493 r1664663  
    151151        private static function format_unique_id($unique_id)
    152152        {
    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)));
    154155        }
    155156
     
    221222                if ($display_error) {
    222223                    $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);
    225226                }
    226227                return false;
     
    233234                    if ($display_error) {
    234235                        $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);
    237238                    }
    238239                    return false;
  • my-bootstrap-menu/trunk/assets/my-plugin-settings-helper/js/my-plugin-settings.js

    r1451039 r1664663  
    4343            previous_uniqueid = this.value;
    4444        }).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    });
    5354
    5455    /**
     
    5859    $('.my_plugin_input')
    5960        .change(function(e){
    60            if(!$(':focus').hasClass('unique_id')) {
     61            if(!$(':focus').hasClass('unique_id')) {
    6162                values_changed = true;
    6263            }
     
    125126     */
    126127    function getKeyValue(key) {
    127        if(supports_html5_storage()) {
     128        if(supports_html5_storage()) {
    128129            return localStorage[getDatastoreKey(key)];
    129130        } else {
     
    141142    function saveKeyValue(key, value){
    142143        if(supports_html5_storage()) {
    143            localStorage[getDatastoreKey(key)] = value;
     144            localStorage[getDatastoreKey(key)] = value;
    144145        } else {
    145146            document.cookie = getDatastoreKey(key) + '=' + value;
  • my-bootstrap-menu/trunk/inc/my-bootstrap-menu-admin-settings.php

    r1313493 r1664663  
    119119                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)'),
    120120                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'),
    121123
    122124                //section_title
  • my-bootstrap-menu/trunk/inc/my-bootstrap-menu-funcs.php

    r1313493 r1664663  
    5858            //List all menus
    5959            $menus_and_themes = self::list_all_menu_names();
    60             if (!$menus_and_themes)
     60            if (!$menus_and_themes) //If no menus return False
    6161                return $menus_and_themes;
    6262
  • my-bootstrap-menu/trunk/inc/nav-menu/nav-menu-markup.php

    r1313493 r1664663  
    1212/**
    1313 * Class My_Bootstrap_Menu_Nav_Menu_Markup
    14  * 
     14 *
    1515 */
    1616namespace My_Bootstrap_Menu_Plugin_Namespace {
     
    203203                }
    204204
    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}'" : "";
    207209
    208210                $html .= "<a class='navbar-brand {$additional_class} {$this->get_navbar_title_and_logo_class()}' href='{$this->home_url}'>
    209211                            <img src='{$logo_url}'
    210                                title='{$this->home_url}'
     212                               {$title}
     213                               {$alt_text}
    211214                               {$height}
    212215                               {$width}>
  • my-bootstrap-menu/trunk/my-bootstrap-menu.php

    r1657947 r1664663  
    44 * Plugin URI: https://github.com/mcldev/my-bootstrap-menu
    55 * Description: Boostraps a menu using flexible and easy to use settings. Fully customizable for advanced users.
    6  * Version: 1.1.2
     6 * Version: 1.2.0
    77 * Author: Michael Carder
    88 * Author URI: http://www.michaelcarder.com
  • my-bootstrap-menu/trunk/readme.txt

    r1657947 r1664663  
    100100== Changelog ==
    101101
     102= 1.2.0 =
     103**POTENTIALLY BREAKING CHANGES**
     104Changed saved menu name to be slug format. You may need to reapply settings/logos etc.
     105Added Logo 'title' and 'alt' text fields.
     106Fix for selecting a Menu/Theme from drop-down.
     107
    102108= 1.1.2 =
    103109Fix for uninstalling/deleting the plugin.
Note: See TracChangeset for help on using the changeset viewer.