Dropdown Menu Widget - Version 1.3.8

Version Description

  • Added option for displaying title attributes. You may now turn title display on from the Settings page.
Download this release

Release Info

Developer mattsay
Plugin Icon wp plugin Dropdown Menu Widget
Version 1.3.8
Comparing to
See all releases

Code changes from version 1.3.7 to 1.3.8

Files changed (3) hide show
  1. readme.txt +4 -1
  2. shailan-multi-dropdown.php +39 -21
  3. shailan.DropDownMenu.php +59 -25
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://shailan.com/donate
4
  Tags: css, dropdown, menu, widget, pages, categories
5
  Requires at least: 2.8
6
  Tested up to: 2.9.2
7
- Stable tag: 1.3.7
8
 
9
  This widget adds a beatiful vertical/horizontal CSS only dropdown menu of pages OR categories of your blog.
10
 
@@ -48,6 +48,9 @@ You can submit errors and bugs using the [online form](http://shailan.com/contac
48
 
49
  == Changelog ==
50
 
 
 
 
51
  = 1.3.7 =
52
  * Removed unnecessary extrude line from Dropdown Multi widget.
53
 
4
  Tags: css, dropdown, menu, widget, pages, categories
5
  Requires at least: 2.8
6
  Tested up to: 2.9.2
7
+ Stable tag: 1.3.8
8
 
9
  This widget adds a beatiful vertical/horizontal CSS only dropdown menu of pages OR categories of your blog.
10
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.3.8 =
52
+ * Added option for displaying title attributes. You may now turn title display on from the Settings page.
53
+
54
  = 1.3.7 =
55
  * Removed unnecessary extrude line from Dropdown Multi widget.
56
 
shailan-multi-dropdown.php CHANGED
@@ -32,12 +32,14 @@ class shailan_MultiDropDown extends WP_Widget {
32
 
33
  $orientation = ($vertical ? 'dropdown-vertical' : 'dropdown-horizontal');
34
 
 
 
 
35
  ?>
36
  <?php echo $before_widget; ?>
37
 
38
  <div id="shailan-dropdown-wrapper-<?php echo $this->number; ?>" style="<?php echo $inline_style; ?>">
39
- <div
40
- <?php
41
  switch($align){
42
  case 'right':
43
  echo ' align="right"';
@@ -51,8 +53,7 @@ class shailan_MultiDropDown extends WP_Widget {
51
 
52
  }
53
 
54
- ?>
55
- >
56
  <table cellpadding="0" cellspacing="0">
57
  <tr><td>
58
  <ul class="dropdown <?php echo $orientation; ?>">
@@ -64,27 +65,44 @@ class shailan_MultiDropDown extends WP_Widget {
64
 
65
  <?php if($include_pages){ ?>
66
 
67
- <?php
68
- $page_walker = new shailan_PageWalker();
69
- wp_list_pages(array(
70
- 'walker'=>$page_walker,
71
- 'sort_column'=>'menu_order',
72
- 'depth'=>'4',
73
- 'title_li'=>'',
74
- 'exclude'=>$exclude
75
- )); ?>
 
 
 
 
 
 
 
 
76
 
77
  <?php }; if($include_categories){ ?>
78
 
79
  <?php
80
- $cat_walker = new shailan_CategoryWalker();
81
- wp_list_categories(array(
82
- 'walker'=>$cat_walker,
83
- 'order_by'=>'name',
84
- 'depth'=>'4',
85
- 'title_li'=>'',
86
- 'exclude'=>$exclude
87
- )); ?>
 
 
 
 
 
 
 
 
 
88
 
89
  <?php }; ?>
90
 
32
 
33
  $orientation = ($vertical ? 'dropdown-vertical' : 'dropdown-horizontal');
34
 
35
+ $custom_walkers = (bool) get_option('shailan_dm_customwalkers');
36
+ $custom_walkers = !$custom_walkers;
37
+
38
  ?>
39
  <?php echo $before_widget; ?>
40
 
41
  <div id="shailan-dropdown-wrapper-<?php echo $this->number; ?>" style="<?php echo $inline_style; ?>">
42
+ <div <?php
 
43
  switch($align){
44
  case 'right':
45
  echo ' align="right"';
53
 
54
  }
55
 
56
+ ?>>
 
57
  <table cellpadding="0" cellspacing="0">
58
  <tr><td>
59
  <ul class="dropdown <?php echo $orientation; ?>">
65
 
66
  <?php if($include_pages){ ?>
67
 
68
+ <?php if($custom_walkers){
69
+ $page_walker = new shailan_PageWalker();
70
+ wp_list_pages(array(
71
+ 'walker'=>$page_walker,
72
+ 'sort_column'=>'menu_order',
73
+ 'depth'=>'4',
74
+ 'title_li'=>'',
75
+ 'exclude'=>$exclude
76
+ ));
77
+ } else {
78
+ wp_list_pages(array(
79
+ 'sort_column'=>'menu_order',
80
+ 'depth'=>'4',
81
+ 'title_li'=>'',
82
+ 'exclude'=>$exclude
83
+ ));
84
+ } ?>
85
 
86
  <?php }; if($include_categories){ ?>
87
 
88
  <?php
89
+ if($custom_walkers){
90
+ $cat_walker = new shailan_CategoryWalker();
91
+ wp_list_categories(array(
92
+ 'walker'=>$cat_walker,
93
+ 'order_by'=>'name',
94
+ 'depth'=>'4',
95
+ 'title_li'=>'',
96
+ 'exclude'=>$exclude
97
+ ));
98
+ } else {
99
+ wp_list_categories(array(
100
+ 'order_by'=>'name',
101
+ 'depth'=>'4',
102
+ 'title_li'=>'',
103
+ 'exclude'=>$exclude
104
+ ));
105
+ } ?>
106
 
107
  <?php }; ?>
108
 
shailan.DropDownMenu.php CHANGED
@@ -3,13 +3,13 @@
3
  Plugin Name: Shailan Dropdown Menu Widget
4
  Plugin URI: http://shailan.com/wordpress/plugins/dropdown-menu
5
  Description: A multi widget to generate drop-down menus from your pages and categories. This widget is best used in <a href="http://shailan.com">Shailan.com</a> themes. You can find more widgets, plugins and themes at <a href="http://shailan.com">shailan.com</a>.
6
- Version: 1.3.7
7
  Author: Matt Say
8
  Author URI: http://shailan.com
9
  Text Domain: shailan-dropdown-menu
10
  */
11
 
12
- define('SHAILAN_DM_VERSION','1.3.7');
13
  define('SHAILAN_DM_TITLE', 'Dropdown Menu');
14
  define('SHAILAN_DM_FOLDER', 'dropdown-menu-widget');
15
 
@@ -48,6 +48,7 @@ class shailan_DropdownWidget extends WP_Widget {
48
  $admin_tag = 'shailan_dm_admin';
49
  $vertical_tag = 'shailan_dm_vertical';
50
  $width_tag = 'shailan_dm_width';
 
51
 
52
  // Read options
53
  $theme = get_option($theme_tag);
@@ -60,11 +61,13 @@ class shailan_DropdownWidget extends WP_Widget {
60
  $admin = (bool) get_option($admin_tag);
61
  $vertical = (bool) get_option($vertical_tag);
62
  $width = (int) get_option($width_tag);
 
63
 
64
  if(wp_verify_nonce($_POST['_wpnonce'])){ // Form submitted. Save settings.
65
 
66
  $theme = $_POST[$theme_tag]; //get_option('theme');
67
 
 
68
  $type = $_POST[$type_tag];
69
  $exclude = $_POST[$exclude_tag];
70
  $inline_style = $_POST[$inline_style_tag];
@@ -73,6 +76,7 @@ class shailan_DropdownWidget extends WP_Widget {
73
  $admin = (bool) $_POST[$admin_tag];
74
  $vertical = (bool) $_POST[$vertical_tag];
75
  $width = (int) $_POST[$width];
 
76
 
77
  update_option($theme_tag, $theme);
78
  update_option($type_tag, $type);
@@ -83,6 +87,7 @@ class shailan_DropdownWidget extends WP_Widget {
83
  update_option($admin_tag, $admin);
84
  update_option($vertical_tag, $vertical);
85
  update_option($width_tag, $width);
 
86
 
87
  ?>
88
  <div class="updated"><p><strong><?php _e('Options saved.', 'shailan-dropdown-menu'); ?></strong></p></div>
@@ -139,6 +144,15 @@ Please support if you like this plugin:
139
 
140
  </select> <span class="description"><?php _e('You can choose a theme for your dropdown menu here.', 'shailan-dropdown-menu'); ?></span></td>
141
  </tr>
 
 
 
 
 
 
 
 
 
142
  </table>
143
 
144
  <fieldset width="400">
@@ -202,6 +216,8 @@ Please support if you like this plugin:
202
 
203
  $orientation = ($vertical ? 'dropdown-vertical' : 'dropdown-horizontal');
204
 
 
 
205
  ?>
206
  <?php echo $before_widget; ?>
207
  <?php /*if ( $title )
@@ -209,9 +225,7 @@ Please support if you like this plugin:
209
  ?>
210
 
211
  <div id="shailan-dropdown-wrapper-<?php echo $this->number; ?>" style="<?php echo $inline_style; ?>">
212
- <div
213
- <?php
214
- switch($align){
215
  case 'right':
216
  echo ' align="right"';
217
  break;
@@ -222,10 +236,7 @@ Please support if you like this plugin:
222
  case 'left':
223
  default:
224
 
225
- }
226
-
227
- ?>
228
- >
229
  <table cellpadding="0" cellspacing="0">
230
  <tr><td>
231
  <ul class="dropdown <?php echo $orientation; ?>">
@@ -238,26 +249,49 @@ Please support if you like this plugin:
238
  <?php if($type == 'Pages'){ ?>
239
 
240
  <?php
241
- $page_walker = new shailan_PageWalker();
242
- wp_list_pages(array(
243
- 'walker'=>$page_walker,
244
- 'sort_column'=>'menu_order',
245
- 'depth'=>'4',
246
- 'title_li'=>'',
247
- 'exclude'=>$exclude
248
- )); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
 
250
  <?php } else { ?>
251
 
252
  <?php
253
- $cat_walker = new shailan_CategoryWalker();
254
- wp_list_categories(array(
255
- 'walker'=>$cat_walker,
256
- 'order_by'=>'name',
257
- 'depth'=>'4',
258
- 'title_li'=>'',
259
- 'exclude'=>$exclude
260
- )); ?>
 
 
 
 
 
 
 
 
 
261
 
262
  <?php } ?>
263
 
3
  Plugin Name: Shailan Dropdown Menu Widget
4
  Plugin URI: http://shailan.com/wordpress/plugins/dropdown-menu
5
  Description: A multi widget to generate drop-down menus from your pages and categories. This widget is best used in <a href="http://shailan.com">Shailan.com</a> themes. You can find more widgets, plugins and themes at <a href="http://shailan.com">shailan.com</a>.
6
+ Version: 1.3.8
7
  Author: Matt Say
8
  Author URI: http://shailan.com
9
  Text Domain: shailan-dropdown-menu
10
  */
11
 
12
+ define('SHAILAN_DM_VERSION','1.3.8');
13
  define('SHAILAN_DM_TITLE', 'Dropdown Menu');
14
  define('SHAILAN_DM_FOLDER', 'dropdown-menu-widget');
15
 
48
  $admin_tag = 'shailan_dm_admin';
49
  $vertical_tag = 'shailan_dm_vertical';
50
  $width_tag = 'shailan_dm_width';
51
+ $custom_walkers_tag = 'shailan_dm_customwalkers';
52
 
53
  // Read options
54
  $theme = get_option($theme_tag);
61
  $admin = (bool) get_option($admin_tag);
62
  $vertical = (bool) get_option($vertical_tag);
63
  $width = (int) get_option($width_tag);
64
+ $custom_walkers = (bool) get_option($custom_walkers_tag);
65
 
66
  if(wp_verify_nonce($_POST['_wpnonce'])){ // Form submitted. Save settings.
67
 
68
  $theme = $_POST[$theme_tag]; //get_option('theme');
69
 
70
+
71
  $type = $_POST[$type_tag];
72
  $exclude = $_POST[$exclude_tag];
73
  $inline_style = $_POST[$inline_style_tag];
76
  $admin = (bool) $_POST[$admin_tag];
77
  $vertical = (bool) $_POST[$vertical_tag];
78
  $width = (int) $_POST[$width];
79
+ $custom_walkers = (bool) $_POST[$custom_walkers_tag];
80
 
81
  update_option($theme_tag, $theme);
82
  update_option($type_tag, $type);
87
  update_option($admin_tag, $admin);
88
  update_option($vertical_tag, $vertical);
89
  update_option($width_tag, $width);
90
+ update_option($custom_walkers_tag, $custom_walkers);
91
 
92
  ?>
93
  <div class="updated"><p><strong><?php _e('Options saved.', 'shailan-dropdown-menu'); ?></strong></p></div>
144
 
145
  </select> <span class="description"><?php _e('You can choose a theme for your dropdown menu here.', 'shailan-dropdown-menu'); ?></span></td>
146
  </tr>
147
+
148
+ <tr valign="top">
149
+ <th scope="row"><label for="<?php echo $custom_walkers_tag; ?>"><?php _e('Display title attributes', 'shailan-dropdown-menu') ?></label></th>
150
+ <td>
151
+
152
+ <input type="checkbox" class="checkbox" id="<?php echo $custom_walkers_tag; ?>" name="<?php echo $custom_walkers_tag; ?>"<?php checked( $custom_walkers ); ?> />
153
+
154
+ <span class="description"><?php _e('If checked menu will display title attributes.', 'shailan-dropdown-menu'); ?></span></td>
155
+ </tr>
156
  </table>
157
 
158
  <fieldset width="400">
216
 
217
  $orientation = ($vertical ? 'dropdown-vertical' : 'dropdown-horizontal');
218
 
219
+ $custom_walkers = (bool) get_option('shailan_dm_customwalkers');
220
+
221
  ?>
222
  <?php echo $before_widget; ?>
223
  <?php /*if ( $title )
225
  ?>
226
 
227
  <div id="shailan-dropdown-wrapper-<?php echo $this->number; ?>" style="<?php echo $inline_style; ?>">
228
+ <div <?php switch($align){
 
 
229
  case 'right':
230
  echo ' align="right"';
231
  break;
236
  case 'left':
237
  default:
238
 
239
+ }; ?>>
 
 
 
240
  <table cellpadding="0" cellspacing="0">
241
  <tr><td>
242
  <ul class="dropdown <?php echo $orientation; ?>">
249
  <?php if($type == 'Pages'){ ?>
250
 
251
  <?php
252
+ if($custom_walkers){
253
+ echo "<!-- custom walkers ON -->";
254
+
255
+ $page_walker = new shailan_PageWalker();
256
+ wp_list_pages(array(
257
+ 'walker'=>$page_walker,
258
+ 'sort_column'=>'menu_order',
259
+ 'depth'=>'4',
260
+ 'title_li'=>'',
261
+ 'exclude'=>$exclude
262
+ ));
263
+ } else {
264
+
265
+ echo "<!-- custom walkers OFF -->";
266
+
267
+ wp_list_pages(array(
268
+ 'sort_column'=>'menu_order',
269
+ 'depth'=>'4',
270
+ 'title_li'=>'',
271
+ 'exclude'=>$exclude
272
+ ));
273
+ } ?>
274
 
275
  <?php } else { ?>
276
 
277
  <?php
278
+ if($custom_walkers){
279
+ $cat_walker = new shailan_CategoryWalker();
280
+ wp_list_categories(array(
281
+ 'walker'=>$cat_walker,
282
+ 'order_by'=>'name',
283
+ 'depth'=>'4',
284
+ 'title_li'=>'',
285
+ 'exclude'=>$exclude
286
+ ));
287
+ } else {
288
+ wp_list_categories(array(
289
+ 'order_by'=>'name',
290
+ 'depth'=>'4',
291
+ 'title_li'=>'',
292
+ 'exclude'=>$exclude
293
+ ));
294
+ } ?>
295
 
296
  <?php } ?>
297