Dropdown Menu Widget - Version 0.4.3

Version Description

  • New grayscale theme.
  • Template tag shailan_dropdown_menu() is available now. See usage for more info.
  • Template tag options added.
Download this release

Release Info

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

Code changes from version 0.4.2 to 0.4.3

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.5
6
  Tested up to: 2.8.6
7
- Stable tag: 0.4.2
8
 
9
  This widget adds a beatiful, CSS only dropdown menu of pages OR categories of your blog.
10
 
@@ -30,6 +30,11 @@ This widget is intented for *wide header widget areas*, not regular sidebars. Yo
30
 
31
  == Changelog ==
32
 
 
 
 
 
 
33
  = 0.4.2 =
34
  * Fixed XHTML error on link tags.
35
  * Fixed Inline Style error on categories dropdown menu.
4
  Tags: css, dropdown, menu, widget, pages, categories
5
  Requires at least: 2.5
6
  Tested up to: 2.8.6
7
+ Stable tag: 0.4.3
8
 
9
  This widget adds a beatiful, CSS only dropdown menu of pages OR categories of your blog.
10
 
30
 
31
  == Changelog ==
32
 
33
+ = 0.4.3 =
34
+ * New grayscale theme.
35
+ * Template tag shailan_dropdown_menu() is available now. See usage for more info.
36
+ * Template tag options added.
37
+
38
  = 0.4.2 =
39
  * Fixed XHTML error on link tags.
40
  * Fixed Inline Style error on categories dropdown menu.
shailan.DropDownMenu.php CHANGED
@@ -3,12 +3,12 @@
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: 0.4.2
7
  Author: Matt Say
8
  Author URI: http://shailan.com
9
  */
10
 
11
- define('SHAILAN_DM_VERSION','0.4.2');
12
  define('SHAILAN_DM_TITLE', 'Dropdown Menu');
13
  define('SHAILAN_DM_FOLDER', 'dropdown-menu-widget');
14
 
@@ -22,7 +22,7 @@ class shailan_DropdownWidget extends WP_Widget {
22
  $this->WP_Widget('dropdown-menu', __('Dropdown Menu'), $widget_ops);
23
  $this->alt_option_name = 'widget_dropdown_menu';
24
 
25
- if ( is_active_widget(false, false, $this->id_base) )
26
  add_action( 'wp_head', array(&$this, 'styles') );
27
  }
28
 
@@ -35,18 +35,40 @@ class shailan_DropdownWidget extends WP_Widget {
35
 
36
  function getOptionsPage(){
37
  // Option names
38
- $theme_name = 'theme';
 
 
 
 
 
 
39
 
40
- // Read options
41
- $theme = get_option($theme_name);
42
 
 
 
43
 
 
 
 
 
 
44
 
45
  if(wp_verify_nonce($_POST['_wpnonce'])){ // Form submitted. Save settings.
46
 
47
- $theme = $_POST[$theme_name]; //get_option('theme');
48
 
49
- update_option('theme', $theme);
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  ?>
52
  <div class="updated"><p><strong><?php _e('Options saved.', 'shailanDropdownMenu_domain'); ?></strong></p></div>
@@ -58,6 +80,7 @@ class shailan_DropdownWidget extends WP_Widget {
58
  'None'=>'NONE',
59
  'Simple White'=>'simple',
60
  'Wordpress Default'=>'wpdefault',
 
61
  'Flickr theme'=>'flickr.com/default',
62
  'Nvidia theme'=>'nvidia.com/default.advanced',
63
  'Adobe theme'=>'adobe.com/default.advanced',
@@ -77,8 +100,8 @@ class shailan_DropdownWidget extends WP_Widget {
77
 
78
  <table class="form-table">
79
  <tr valign="top">
80
- <th scope="row"><label for="theme"><?php _e('Dropdown menu theme') ?></label></th>
81
- <td><select name="theme" id="theme">
82
 
83
  <?php foreach($themes as $name=>$path){
84
  $selected = ($theme == $path ? 'selected' : '');
@@ -87,9 +110,33 @@ class shailan_DropdownWidget extends WP_Widget {
87
 
88
  </select><span class="description"><?php _e('You can choose a theme for your dropdown menu here.') ?></span></td>
89
  </tr>
90
-
91
  </table>
92
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  <p>NOTE : Onscreen theme edit will be available soon. Be sure to check <a href="http://shailan.com">shailan.com</a> regularly for updates.</p>
94
  </div>
95
  <p class="submit">
@@ -211,4 +258,22 @@ class shailan_DropdownWidget extends WP_Widget {
211
 
212
  // register widget
213
  add_action('widgets_init', create_function('', 'return register_widget("shailan_DropdownWidget");'));
214
- add_action('admin_menu', array('shailan_DropdownWidget', 'adminMenu'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 0.4.3
7
  Author: Matt Say
8
  Author URI: http://shailan.com
9
  */
10
 
11
+ define('SHAILAN_DM_VERSION','0.4.3');
12
  define('SHAILAN_DM_TITLE', 'Dropdown Menu');
13
  define('SHAILAN_DM_FOLDER', 'dropdown-menu-widget');
14
 
22
  $this->WP_Widget('dropdown-menu', __('Dropdown Menu'), $widget_ops);
23
  $this->alt_option_name = 'widget_dropdown_menu';
24
 
25
+ // if ( is_active_widget(false, false, $this->id_base) ) disabled for the_widget support.
26
  add_action( 'wp_head', array(&$this, 'styles') );
27
  }
28
 
35
 
36
  function getOptionsPage(){
37
  // Option names
38
+ $theme_tag = 'theme';
39
+
40
+ $type_tag = 'shailan_dm_type';
41
+ $exclude_tag = 'shailan_dm_exclude';
42
+ $inline_style_tag = 'shailan_dm_style';
43
+ $login_tag = 'shailan_dm_login';
44
+ $admin_tag = 'shailan_dm_admin';
45
 
 
 
46
 
47
+ // Read options
48
+ $theme = get_option($theme_tag);
49
 
50
+ $type = get_option($type_tag);
51
+ $exclude = get_option($exclude_tag);
52
+ $inline_style = get_option($inline_style_tag);
53
+ $login = (bool) get_option($login_tag);
54
+ $admin = (bool) get_option($admin_tag);
55
 
56
  if(wp_verify_nonce($_POST['_wpnonce'])){ // Form submitted. Save settings.
57
 
58
+ $theme = $_POST[$theme_tag]; //get_option('theme');
59
 
60
+ $type = $_POST[$type_tag];
61
+ $exclude = $_POST[$exclude_tag];
62
+ $inline_style = $_POST[$inline_style_tag];
63
+ $login = (bool) $_POST[$login_tag];
64
+ $admin = (bool) $_POST[$admin_tag];
65
+
66
+ update_option($theme_tag, $theme);
67
+ update_option($type_tag, $type);
68
+ update_option($exclude_tag, $exclude);
69
+ update_option($inline_style_tag, $inline_style);
70
+ update_option($login_tag, $login);
71
+ update_option($admin_tag, $admin);
72
 
73
  ?>
74
  <div class="updated"><p><strong><?php _e('Options saved.', 'shailanDropdownMenu_domain'); ?></strong></p></div>
80
  'None'=>'NONE',
81
  'Simple White'=>'simple',
82
  'Wordpress Default'=>'wpdefault',
83
+ 'Grayscale'=>'grayscale',
84
  'Flickr theme'=>'flickr.com/default',
85
  'Nvidia theme'=>'nvidia.com/default.advanced',
86
  'Adobe theme'=>'adobe.com/default.advanced',
100
 
101
  <table class="form-table">
102
  <tr valign="top">
103
+ <th scope="row"><label for="<?php echo $theme_tag; ?>"><?php _e('Dropdown menu theme') ?></label></th>
104
+ <td><select name="<?php echo $theme_tag; ?>" id="theme">
105
 
106
  <?php foreach($themes as $name=>$path){
107
  $selected = ($theme == $path ? 'selected' : '');
110
 
111
  </select><span class="description"><?php _e('You can choose a theme for your dropdown menu here.') ?></span></td>
112
  </tr>
 
113
  </table>
114
+
115
+ <h2>Template tag options</h2>
116
+ <p>You can use following template tag in your themes to display the dropdown menu. <br />
117
+ <blockquote><code>&lt;?php if(function_exists('shailan_dropdown_menu'){ shailan_dropdown_menu(); } ?&gt;</code></blockquote>
118
+ Here you can set template tag options:
119
+ </p>
120
+
121
+ <p><label for="<?php echo $title_tag; ?>"><?php _e('Title (won\'t be shown):'); ?> <input class="widefat" id="<?php echo $title_tag; ?>" name="<?php echo $title_tag; ?>" type="text" value="<?php echo $title; ?>" /></label></p>
122
+
123
+ <p><?php _e('Type:'); ?> <label for="Pages"><input type="radio" id="Pages" name="<?php echo $type_tag; ?>" value="Pages" <?php if($type=='Pages'){ echo 'checked="checked"'; } ?> /> <?php _e('Pages'); ?></label> <label for="Categories"><input type="radio" id="Categories" name="<?php echo $type_tag; ?>" value="Categories" <?php if($type=='Categories'){ echo 'checked="checked"'; } ?>/> <?php _e('Categories'); ?></label></p>
124
+
125
+ <p><label for="<?php echo $exclude_tag; ?>"><?php _e('Exclude:'); ?> <input class="widefat" id="<?php echo $exclude_tag; ?>" name="<?php echo $exclude_tag; ?>" type="text" value="<?php echo $exclude; ?>" /></label><br />
126
+ <small>Page IDs, separated by commas.</small></p>
127
+
128
+ <p>
129
+ <input type="checkbox" class="checkbox" id="<?php echo $login_tag; ?>" name="<?php echo $login_tag; ?>"<?php checked( $login ); ?> />
130
+ <label for="<?php echo $login_tag; ?>"><?php _e( 'Add login/logout' ); ?></label><br />
131
+ <input type="checkbox" class="checkbox" id="<?php echo $admin_tag; ?>" name="<?php echo $admin_tag; ?>"<?php checked( $admin ); ?> />
132
+ <label for="<?php echo $admin_tag; ?>"><?php _e( 'Add Register/Site Admin' ); ?></label>
133
+ </p>
134
+
135
+ <p><label for="<?php echo $inline_style_tag; ?>"><?php _e('Inline Style:'); ?> <input class="widefat" id="<?php echo $inline_style_tag; ?>" name="<?php echo $inline_style_tag; ?>" type="text" value="<?php echo $inline_style; ?>" /></label><br />
136
+ <small>Applied to menu container &lt;div&gt;.</small></p>
137
+
138
+ <p><small>NOTE: Widgets have their own options. Those options won't affect widgets.</small></p>
139
+
140
  <p>NOTE : Onscreen theme edit will be available soon. Be sure to check <a href="http://shailan.com">shailan.com</a> regularly for updates.</p>
141
  </div>
142
  <p class="submit">
258
 
259
  // register widget
260
  add_action('widgets_init', create_function('', 'return register_widget("shailan_DropdownWidget");'));
261
+ add_action('admin_menu', array('shailan_DropdownWidget', 'adminMenu'));
262
+
263
+ function shailan_dropdown_menu(){
264
+ $type = get_option('shailan_dm_type');
265
+ $exclude = get_option('shailan_dm_exclude');
266
+ $inline_style = get_option('shailan_dm_style');
267
+ $login = (bool) get_option('shailan_dm_login');
268
+ $admin = (bool) get_option('shailan_dm_admin');
269
+
270
+ $args = array(
271
+ 'type' => $type,
272
+ 'exclude' => $exclude,
273
+ 'style' => $inline_style,
274
+ 'login' => $login,
275
+ 'admin' => $admin
276
+ );
277
+
278
+ the_widget('shailan_DropdownWidget', $args);
279
+ }
themes/grayscale.css ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @charset "UTF-8";
2
+
3
+ ul.dropdown li {
4
+ padding: 7px 20px;
5
+ border-right: 1px solid #999;
6
+ color: #333;
7
+ text-align:center;
8
+ background:#c2c2c2 url('images/default1_g.jpg') repeat-x bottom;
9
+ font-family:Arial, Helvetica, sans-serif;
10
+ font-size:1.2em;
11
+ font-weight:bold;
12
+ text-transform:uppercase;
13
+ }
14
+ ul.dropdown li.hover,
15
+ ul.dropdown li:hover {
16
+ background:#b1b1b1 url('images/default2_g.jpg') repeat-x bottom;
17
+ border-bottom:#999;
18
+ }
19
+ ul.dropdown a:link,
20
+ ul.dropdown a:visited { color: #333; text-decoration: none; display:block; }
21
+ ul.dropdown a:hover { color: #fff; }
22
+ ul.dropdown a:active { color: #fff; }
23
+ /* -- level mark -- */
24
+ ul.dropdown ul {
25
+ margin-top: 0px;
26
+ margin-left:-1px;
27
+ border-bottom:1px solid #999;
28
+ font-size:0.8em;
29
+ }
30
+ ul.dropdown ul li {
31
+ background:#c2c2c2;
32
+ text-align: left;
33
+ border-left:1px solid #999;
34
+ border-top:1px solid #999;
35
+ }
36
+
37
+ ul.dropdown li.current_page_item a, ul.dropdown li.current-cat a { color: #efefef; }
38
+
39
+ ul.dropdown li.current-cat a, ul.dropdown li.current-cat a:link { color: #efefef; }
40
+ ul.dropdown li.current-cat a:hover{ color: #efefef; }
41
+ ul.dropdown li.current-cat a:visited{ color: #efefef; }
42
+
43
+ ul.dropdown li.current_page_item a:link,ul.dropdown li.current_page_item a:visited { color: #efefef; }
44
+ ul.dropdown li.current_page_item ul a,ul.dropdown li.current_page_item ul a:visited, li.current_page_item ul a:link { color: #efefef; }
45
+ ul.dropdown li.current_page_ancestor a,ul.dropdown li.current_page_ancestor a:visited,ul.dropdown li.current_page_ancestor a:link { text-decoration:underline; }
46
+ ul.dropdown li.current_page_ancestor ul a,ul.dropdown li.current_page_ancestor ul a:visited,ul.dropdown li.current_page_ancestor ul a:link {text-decoration:none;}
47
+
48
+ .shailan_DropdownWidget{ background:#c2c2c2 url('images/default1_g.jpg') repeat-x bottom; }
themes/images/default1_g.jpg ADDED
Binary file
themes/images/default2_g.jpg ADDED
Binary file