Advanced Sidebar Menu - Version 3.6.2

Version Description

Download this release

Release Info

Developer Mat Lipe
Plugin Icon 128x128 Advanced Sidebar Menu
Version 3.6.2
Comparing to
See all releases

Code changes from version 3.6.0 to 3.6.2

advanced-sidebar-menu.php CHANGED
@@ -4,17 +4,14 @@ Plugin Name: Advanced Sidebar Menu
4
  Plugin URI: http://lipeimagination.info/wordpress/advanced-sidebar-menu/
5
  Description: Creates dynamic menu based on child/parent relationship.
6
  Author: Mat Lipe
7
- Version: 3.6.0
8
  Author URI: http://lipeimagination.info
9
- Since: 3.1.13
10
  */
11
 
12
  #-- Bring in the functions
13
- require( 'functions.php' );
14
- $asm = new advanced_sidebar_menu_functions();
15
-
16
- //Validate the new version
17
- add_action( 'init', array( $asm, 'validate_3_3' ) );
18
 
19
 
20
  #-- Bring in the Widgets
4
  Plugin URI: http://lipeimagination.info/wordpress/advanced-sidebar-menu/
5
  Description: Creates dynamic menu based on child/parent relationship.
6
  Author: Mat Lipe
7
+ Version: 3.6.2
8
  Author URI: http://lipeimagination.info
9
+ Since: 3.6.13
10
  */
11
 
12
  #-- Bring in the functions
13
+ require( 'lib/advancedSidebarMenu.php' );
14
+ $asm = new advancedSidebarMenu();
 
 
 
15
 
16
 
17
  #-- Bring in the Widgets
functions.php → lib/advancedSidebarMenu.php RENAMED
@@ -6,13 +6,11 @@
6
  * @author Mat Lipe
7
  * @since 10.12.12
8
  */
9
-
10
-
11
-
12
- class advanced_sidebar_menu_functions{
13
- protected $bad = array(); //for 3.3 version
14
- protected $bad_file = ''; //for 3.3 version
15
-
16
 
17
 
18
  /**
@@ -37,61 +35,6 @@ class advanced_sidebar_menu_functions{
37
  }
38
 
39
 
40
-
41
- /**
42
- * Validate the views for the new structure
43
- * @since 7/16/12
44
- */
45
- function validate_3_3(){
46
- /** Note to self -- Remove this at the new version **/
47
- if ( $page_file = locate_template(array('advanced-sidebar-menu/page_list.php')) ) {
48
- $data = explode("\n", file_get_contents( $page_file )); //create array separate by new line
49
- foreach( $data as $line => $content ){
50
- $line++;
51
- if( strpos( $content, 'class="advanced-sidebar-menu widget advanced-sidebar-page">' ) ){
52
- $bad[$line] = htmlentities( $content );
53
- }
54
- if( strpos( $content, "<div class=\"widget-wrap\">" ) ){
55
- $bad[$line] = htmlentities( $content );
56
- }
57
- if( strpos( $content, "</div></div><!-- end of very-custom-menu -->" ) ){
58
-
59
- $bad[$line] = htmlentities( $content );
60
- }
61
- }
62
- if( !empty( $bad ) ){
63
- $this->bad = $bad;
64
- $this->bad_file = get_bloginfo( 'stylesheet_directory' ) . '/advanced-sidebar-menu/page_list.php';
65
- add_action( 'admin_notices', array( $this, 'notice_3_3') );
66
- }
67
- }
68
- }
69
-
70
-
71
- /**
72
- * Adds an admin notice if there are issues with the view
73
- * @since 7/16/12
74
- */
75
- function notice_3_3( ){
76
- echo '<div class="error">';
77
- echo 'To use version 3.3 of <b>Advanced Sidebar Menu</b> you must delete the following lines from <b>"' . $this->bad_file . '"</b><br>';
78
-
79
- foreach( $this->bad as $line => $content ){
80
- echo '<b>line' . $line . ': </b> '. $content . '<br>';
81
- }
82
-
83
- echo '</div>';
84
-
85
- }
86
-
87
-
88
-
89
-
90
-
91
- private $instance; //The widget instance
92
- private $top_id; //Either the top cat or page
93
- private $exclude;
94
- private $ancestors; //For the category ancestors
95
 
96
  /**
97
  * Sets the instance of this widget to this class
6
  * @author Mat Lipe
7
  * @since 10.12.12
8
  */
9
+ class advancedSidebarMenu{
10
+ private $instance; //The widget instance
11
+ private $top_id; //Either the top cat or page
12
+ private $exclude;
13
+ private $ancestors; //For the category ancestors
 
 
14
 
15
 
16
  /**
35
  }
36
 
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  /**
40
  * Sets the instance of this widget to this class
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypa
4
  Tags: menus, sidebar menu, heirchy, category menu, pages menu
5
  Requires at least: 3.1
6
  Tested up to: 3.5.1
7
- Stable tag: 3.6.0
8
  License: GPLv2
9
 
10
  Creates a widget for both page and categories that will display the current page/category and all child pages or categories.
4
  Tags: menus, sidebar menu, heirchy, category menu, pages menu
5
  Requires at least: 3.1
6
  Tested up to: 3.5.1
7
+ Stable tag: 3.6.2
8
  License: GPLv2
9
 
10
  Creates a widget for both page and categories that will display the current page/category and all child pages or categories.
widgets/category.widget.php CHANGED
@@ -128,11 +128,11 @@ class advanced_sidebar_menu_category extends WP_Widget {
128
 
129
  /**
130
  * Outputs the categories widget to the page
131
- * @since 10.12.12
132
  *
133
  */
134
  function widget($args, $instance) {
135
- global $asm;
136
  extract( $args);
137
  #-- Create a usable array of the excluded pages
138
  $exclude = explode(',', $instance['exclude']);
@@ -161,7 +161,7 @@ class advanced_sidebar_menu_category extends WP_Widget {
161
  //Bring in the Styling
162
  if( $instance['css'] == 'checked' ){
163
  echo '<style type="text/css">';
164
- include( advanced_sidebar_menu_functions::file_hyercy( 'sidebar-menu.css' ) );
165
  echo '</style>';
166
  }
167
 
128
 
129
  /**
130
  * Outputs the categories widget to the page
131
+ * @since 3.6.13
132
  *
133
  */
134
  function widget($args, $instance) {
135
+ $asm = new advancedSidebarMenu;
136
  extract( $args);
137
  #-- Create a usable array of the excluded pages
138
  $exclude = explode(',', $instance['exclude']);
161
  //Bring in the Styling
162
  if( $instance['css'] == 'checked' ){
163
  echo '<style type="text/css">';
164
+ include( $asm->file_hyercy( 'sidebar-menu.css' ) );
165
  echo '</style>';
166
  }
167
 
widgets/page.widget.php CHANGED
@@ -5,7 +5,7 @@
5
  * Creates a Widget of parent Child Pages
6
  *
7
  * @author mat lipe
8
- * @since 3.1.13
9
  * @package Advanced Sidebar Menu
10
  *
11
  */
@@ -102,10 +102,11 @@ class advanced_sidebar_menu_page extends WP_Widget {
102
  * @uses change the top parent manually with the filter 'advanced_sidebar_menu_top_parent'
103
  * @uses change the order of the 2nd level pages with 'advanced_sidebar_menu_order_by' filter
104
  *
105
- * @since 3.1.13
106
  */
107
  function widget($args, $instance) {
108
- global $wpdb, $post, $table_prefix, $asm;
 
109
 
110
  extract($args);
111
 
@@ -151,7 +152,7 @@ class advanced_sidebar_menu_page extends WP_Widget {
151
 
152
  if( $instance['css'] == 'checked' ){
153
  echo '<style type="text/css">';
154
- include( advanced_sidebar_menu_functions::file_hyercy('sidebar-menu.css' ) );
155
  echo '</style>';
156
  }
157
 
5
  * Creates a Widget of parent Child Pages
6
  *
7
  * @author mat lipe
8
+ * @since 3.6.13
9
  * @package Advanced Sidebar Menu
10
  *
11
  */
102
  * @uses change the top parent manually with the filter 'advanced_sidebar_menu_top_parent'
103
  * @uses change the order of the 2nd level pages with 'advanced_sidebar_menu_order_by' filter
104
  *
105
+ * @since 3.6.13
106
  */
107
  function widget($args, $instance) {
108
+ global $wpdb, $post, $table_prefix;
109
+ $asm = new advancedSidebarMenu;
110
 
111
  extract($args);
112
 
152
 
153
  if( $instance['css'] == 'checked' ){
154
  echo '<style type="text/css">';
155
+ include( $asm->file_hyercy('sidebar-menu.css' ) );
156
  echo '</style>';
157
  }
158