Plugin Directory

Changeset 599079


Ignore:
Timestamp:
09/14/2012 08:23:49 PM (13 years ago)
Author:
jimmywb
Message:
 
Location:
simple-link-list-widget
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • simple-link-list-widget/trunk/readme.txt

    r599076 r599079  
    33Tags: links, list, lists, widget
    44Requires at least: 2.8
    5 Tested up to: 3.4.2
    6 Stable tag: 0.2
     5Tested up to: 3.0.4
     6Stable tag: 0.1
    77
    88This plugin makes a widget available which allows you to add a simple link list (bulleted or numbered) to a sidebar.
     
    3636== Changelog ==
    3737
    38 = 0.2 =
    39 * Added a Delete functionality to link items
    40 * Added the ability to open link in new window
    41 
    4238= 0.1 =
    4339* Initial upload
  • simple-link-list-widget/trunk/simple-link-list-widget.php

    r599076 r599079  
    55Author: James Bowles
    66Author URI: http://mesacc.edu/~jamul76751
    7 Version: 0.2
     7Version: 0.1.1
    88*/
    99
     
    2525            $item_links[$i] = $instance['item_link' . $i];
    2626            $item_classes[$i] = $instance['item_class' . $i];   
    27             $item_targets[$i] = isset($instance['item_target' . $i]) ? $instance['item_target' . $i] : false;
     27            $item_targets[$i] = $instance['item_target' . $i];
    2828        }
    2929
     
    5858            $instance['amount'] = $new_instance['new_amount'];
    5959        }
    60         $j=0; //index to skip over blank items
     60
    6161        for ($i = 1; $i <= $instance['amount']; $i++) {
    62             if(empty($new_instance['item' . $i])){ $j++; }
    63             $instance['item' . $i] = strip_tags($new_instance['item' . ($j+$i)]);
    64             $instance['item_link' . $i] = $new_instance['item_link' . ($j+$i)];
    65             $instance['item_class' . $i] = strip_tags($new_instance['item_class' . ($j+$i)]);
    66             $instance['item_target' . $i] = $new_instance['item_target' . ($j+$i)];
    67         }
    68         $instance['amount'] = $instance['amount'] - $j;
     62            $instance['item' . $i] = strip_tags($new_instance['item' . $i]);
     63            $instance['item_link' . $i] = $new_instance['item_link' . $i];
     64            $instance['item_class' . $i] = strip_tags($new_instance['item_class' . $i]);
     65            $instance['item_target' . $i] = $new_instance['item_target' . $i];
     66        }       
    6967        $instance['type'] = $new_instance['type'];
    7068       
     
    8179            $item_links[$i] = $instance['item_link' . $i];
    8280            $item_classes[$i] = $instance['item_class' . $i];
     81            echo $item_targets[$i];
    8382            $item_targets[$i] = $instance['item_target' . $i];
    8483        }
     
    8988        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
    9089        <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
    91         <p><small>Leave the Link and Custom Style Class fields blank if not desired. Click Save for additional blank fields. To remove an item simply delete the "Text:" field content.</small></p>
     90        <p><small>Leave the Link and Custom Style Class fields blank if not desired. Click Save for additional blank fields.</small></p>
    9291        <ol>
    9392        <?php foreach ($items as $num => $item) : ?>
     
    10099                <label for="<?php echo $this->get_field_id('item_class' . $num); ?>">Custom Style Class:</label>
    101100                <input class="widefat" id="<?php echo $this->get_field_id('item_class' . $num); ?>" name="<?php echo $this->get_field_name('item_class' . $num); ?>" type="text" value="<?php echo esc_attr($item_classes[$num]); ?>" />
    102                 <label for="<?php echo $this->get_field_id('item_target' . $num); ?>"><input type="checkbox" name="<?php echo $this->get_field_name('item_target' . $num); ?>" id="<?php echo $this->get_field_id('item_target' . $num); ?>" <?php checked($item_targets[$num], 'on'); ?> /> Open in new window</label>
     101                <label for="<?php echo $this->get_field_id('item_target'); ?>"><input type="checkbox" name="<?php echo $this->get_field_name('item_target'); ?>" value="_blank" id="<?php echo $this->get_field_id('item_target'); ?>" <?php checked($item_targets[$num], '_blank'); ?>></input> Open in new window</label>
    103102            </li>
    104103        <?php endforeach; ?>
     
    113112                <label for="<?php echo $this->get_field_id('item_class' . $new_amount); ?>">Custom Style Class:</label>
    114113                <input class="widefat" id="<?php echo $this->get_field_id('item_class' . $new_amount); ?>" name="<?php echo $this->get_field_name('item_class' . $new_amount); ?>" type="text" value="" />
    115                 <label for="<?php echo $this->get_field_id('item_target' . $new_amount); ?>"><input type="checkbox" name="<?php echo $this->get_field_name('item_target' . $new_amount); ?>" id="<?php echo $this->get_field_id('item_target' . $new_amount); ?>" />  Open in new window</label>
     114                <label for="<?php echo $this->get_field_id('item_target'); ?>"><input type="checkbox" name="<?php echo $this->get_field_name('item_target'); ?>" value="_blank" id="<?php echo $this->get_field_id('item_target'); ?>"></input>  Open in new window</label>
    116115            </li>
    117116        </ol>
     
    119118        <input type="hidden" id="<?php echo $this->get_field_id('new_amount'); ?>" name="<?php echo $this->get_field_name('new_amount'); ?>" value="<?php echo $new_amount ?>" />
    120119
    121         <label for="<?php echo $this->get_field_id('ordered'); ?>"><input type="radio" name="<?php echo $this->get_field_name('type'); ?>" value="ordered" id="<?php echo $this->get_field_id('ordered'); ?>" <?php checked($type, "ordered"); ?> />  Ordered</label>
    122         <label for="<?php echo $this->get_field_id('unordered'); ?>"><input type="radio" name="<?php echo $this->get_field_name('type'); ?>" value="unordered" id="<?php echo $this->get_field_id('unordered'); ?>" <?php checked($type, "unordered"); ?> /> Unordered</label>
     120        <label for="<?php echo $this->get_field_id('ordered'); ?>"><input type="radio" name="<?php echo $this->get_field_name('type'); ?>" value="ordered" id="<?php echo $this->get_field_id('ordered'); ?>" <?php checked($type, "ordered"); ?>></input>  Ordered</label>
     121        <label for="<?php echo $this->get_field_id('unordered'); ?>"><input type="radio" name="<?php echo $this->get_field_name('type'); ?>" value="unordered" id="<?php echo $this->get_field_id('unordered'); ?>" <?php checked($type, "unordered"); ?>></input> Unordered</label>
    123122
    124123<?php
Note: See TracChangeset for help on using the changeset viewer.