Changeset 599079
- Timestamp:
- 09/14/2012 08:23:49 PM (13 years ago)
- Location:
- simple-link-list-widget
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
simple-link-list-widget/trunk/readme.txt
r599076 r599079 3 3 Tags: links, list, lists, widget 4 4 Requires at least: 2.8 5 Tested up to: 3. 4.26 Stable tag: 0. 25 Tested up to: 3.0.4 6 Stable tag: 0.1 7 7 8 8 This plugin makes a widget available which allows you to add a simple link list (bulleted or numbered) to a sidebar. … … 36 36 == Changelog == 37 37 38 = 0.2 =39 * Added a Delete functionality to link items40 * Added the ability to open link in new window41 42 38 = 0.1 = 43 39 * Initial upload -
simple-link-list-widget/trunk/simple-link-list-widget.php
r599076 r599079 5 5 Author: James Bowles 6 6 Author URI: http://mesacc.edu/~jamul76751 7 Version: 0. 27 Version: 0.1.1 8 8 */ 9 9 … … 25 25 $item_links[$i] = $instance['item_link' . $i]; 26 26 $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]; 28 28 } 29 29 … … 58 58 $instance['amount'] = $new_instance['new_amount']; 59 59 } 60 $j=0; //index to skip over blank items 60 61 61 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 } 69 67 $instance['type'] = $new_instance['type']; 70 68 … … 81 79 $item_links[$i] = $instance['item_link' . $i]; 82 80 $item_classes[$i] = $instance['item_class' . $i]; 81 echo $item_targets[$i]; 83 82 $item_targets[$i] = $instance['item_target' . $i]; 84 83 } … … 89 88 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> 90 89 <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> 92 91 <ol> 93 92 <?php foreach ($items as $num => $item) : ?> … … 100 99 <label for="<?php echo $this->get_field_id('item_class' . $num); ?>">Custom Style Class:</label> 101 100 <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> 103 102 </li> 104 103 <?php endforeach; ?> … … 113 112 <label for="<?php echo $this->get_field_id('item_class' . $new_amount); ?>">Custom Style Class:</label> 114 113 <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> 116 115 </li> 117 116 </ol> … … 119 118 <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 ?>" /> 120 119 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> 123 122 124 123 <?php
Note: See TracChangeset
for help on using the changeset viewer.