Plugin Directory

Changeset 566842


Ignore:
Timestamp:
07/03/2012 10:41:09 AM (14 years ago)
Author:
tailoredweb
Message:

Fix TinyMCE icon, and allow for un-associative arrays in select & radio inputs.

Location:
tailored-tools/tags/1.3.3
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tailored-tools/tags/1.3.3/lib/class.forms.php

    r566366 r566842  
    410410   
    411411    function draw_select($key, $q) {
     412        // Is this an associative array?
     413        $is_assoc = array_keys($q['options']) !== range(0, count($q['options']) - 1);
     414        // Draw Element
    412415        echo '<p'.$q['class'].'><label><span>'.$q['label'].'</span>'."\n";
    413416        echo "\t".'<select name="'.$key.'" id="'.$key.'" class="txt">'."\n";
    414417        foreach ($q['options'] as $val => $opt) {
     418            if (!$is_assoc) $val = $opt;
    415419            $sel = ($_POST[$key] == $val) ? ' selected="selected"' : '';
    416420            echo "\t\t".'<option value="'.$val.'"'.$sel.'>'.$opt.'</option>'."\n";
     
    424428        $name = ($q['type'] == 'checkbox') ? $key.'[]' : $key;
    425429        if ($q['label'])    $q['label'] = '<span class="label">'.$q['label'].'</span>';
     430        // Is this an associative array?
     431        $is_assoc = array_keys($q['options']) !== range(0, count($q['options']) - 1);
    426432        // Draw Element
    427433        echo '<p'.$q['class'].'>'.$q['label']."\n";
    428434        foreach ($q['options'] as $val => $opt) {
     435            if (!$is_assoc) $val = $opt;
    429436            $sel = ($_POST[$key] == $val || @in_array($val, $_POST[$key])) ? ' checked="checked"' : '';
    430437            echo "\t".'<label><input type="'.$q['type'].'" name="'.$name.'" value="'.$val.'"'.$sel.' /> '.$opt.'</label>'."\n";
  • tailored-tools/tags/1.3.3/readme.txt

    r566366 r566842  
    44Requires at least:  3.0
    55Tested up to:       3.4.1
    6 Stable tag:         1.3.2
     6Stable tag:         1.3.3
    77
    88Contains some helper classes to help you build custom forms.
  • tailored-tools/tags/1.3.3/resource/tinymce.js.php

    r566366 r566842  
    2626                var c = cm.createSplitButton('TailoredTools', {
    2727                    title : 'Tailored Tools',
    28                     image : '<?php echo $TailoredTinyMCE->plugin_url; ?>mce-icon.gif',
     28                    image : '<?php echo $TailoredTinyMCE->plugin_url; ?>resource/mce-icon.gif',
    2929                    onclick : function() {
    3030                        c.showMenu();
  • tailored-tools/tags/1.3.3/tools.php

    r566366 r566842  
    33Plugin Name:    Tailored Tools
    44Description:    Adds some functionality to WordPress that you'll need.
    5 Version:        1.3.2
     5Version:        1.3.3
    66Author:         Tailored Web Services
    77Author URI:     http://www.tailored.com.au
Note: See TracChangeset for help on using the changeset viewer.