@@ -138,7 +138,7 @@ function outputItem($item) {
138138 /**
139139 * Outputs the markup for a single item.
140140 * @param item : query row for a single nav item.
141- * @returns output : string composed of HTML to be rendered
141+ * @return output : string composed of HTML to be rendered
142142 */
143143
144144 $ output = '' ;
@@ -186,20 +186,32 @@ function renderDropdown($subItems) {
186186 /**
187187 * Takes subitems and returns markup.
188188 * @param subItems : Query result containing nav items
189- * @returns output : string composed of HTML to be rendered
189+ * @return output : string composed of HTML to be rendered
190190 */
191191
192192 $ output = $ this ->_dropdown_open ;
193193
194194 foreach ($ subItems ->result () as $ item ) {
195+ $ subOutput = $ this ->_item_open ;
196+ $ classes = '' ;
195197
196198 // Check if current page and open item
197199 if ($ this ->isCurrentPage ($ item ->ItemLink )) {
198- $ output .= $ this ->_item_open_active ;
199- } else {
200- $ output .= $ this ->_item_open ;
200+ $ classes .= $ this ->_item_open_active_class . ' ' ;
201201 }
202202
203+ if (!is_null ($ subItems ) && count ($ subItems ->result ()) > 0 ){
204+ // See if we have dropdown
205+ $ classes .= $ this ->_item_open_dropdown_class . ' ' ;
206+ }
207+
208+ if (!strcmp ($ classes ,'' ) == 0 ) {
209+ // If classes to add them append to open tag
210+ $ subOutput = str_replace ('> ' ,' class=" ' . $ classes . '"> ' ,$ subOutput );
211+ }
212+
213+ $ output .= $ subOutput ;
214+
203215 // Output link
204216 $ output .= $ this ->bindAnchor ($ item ->ItemLink , $ item ->ItemHumanName );
205217
@@ -217,7 +229,7 @@ public function generateNav_fromName($menu_name)
217229 /**
218230 * Resolves a menu name to ID then returns the menu output.
219231 * @param menu_name : string identifier of the menu as in CI-Nav-Menus
220- * @returns output : string composed of HTML to be rendered.
232+ * @return output : string composed of HTML to be rendered.
221233 */
222234 $ menu_id = $ this ->CI ->nav ->getMenuID ($ menu_name );
223235 return $ this ->generateNav_fromID ($ menu_id );
@@ -228,7 +240,7 @@ public function generateNav_fromID($menu_id) {
228240 * Generates output for menu from a menu ID as specified in
229241 * CI-Nav-Menus.
230242 * @param menu_id : int ID of the menu to be generate
231- * @returns output : string composed of HTML to be rendered.
243+ * @return output : string composed of HTML to be rendered.
232244 */
233245
234246 // Open Container
@@ -253,7 +265,7 @@ public function generateNav_fromID($menu_id) {
253265 public function generateRoleBasedNav () {
254266 /**
255267 * Outputs navigation selectively based on user authentication
256- * @returns HTML markup for navigation
268+ * @return HTML markup for navigation
257269 */
258270
259271 if (!$ this ->CI ->ion_auth ->logged_in ()){
0 commit comments