@@ -132,7 +132,7 @@ public function load($params, $enabled)
132132
133133 // In recovery mode, load the preset inside a special root node.
134134 $ this ->root = new AdministratorMenuItem (['level ' => 0 ]);
135- $ heading = new AdministratorMenuItem (['title ' => 'MOD_MENU_RECOVERY_MENU_ROOT ' , 'type ' => 'heading ' ]);
135+ $ heading = new AdministratorMenuItem (['title ' => 'MOD_MENU_RECOVERY_MENU_ROOT ' , 'type ' => 'heading ' , ' class ' => ' class:fa fa-notes-medical ' ]);
136136 $ this ->root ->addChild ($ heading );
137137
138138 MenusHelper::loadPreset ('default ' , true , $ heading );
@@ -293,7 +293,7 @@ protected function preprocess($parent)
293293 continue ;
294294 }
295295
296- if (substr ($ item ->link , 0 , 8 ) === 'special: ' ) {
296+ if (! empty ( $ item -> link ) && substr ($ item ->link , 0 , 8 ) === 'special: ' ) {
297297 $ special = substr ($ item ->link , 8 );
298298
299299 if ($ special === 'language-forum ' ) {
@@ -311,12 +311,10 @@ protected function preprocess($parent)
311311 * processing. It is needed for links from menu items of third party extensions link to Joomla! core
312312 * components like com_categories, com_fields...
313313 */
314- if ($ option = $ uri ->getVar ('option ' )) {
315- $ item ->element = $ option ;
316- }
314+ $ item ->element = !empty ($ uri ->getVar ('option ' )) ? $ uri ->getVar ('option ' ) : '' ;
317315
318316 // Exclude item if is not enabled
319- if ($ item ->element && !ComponentHelper::isEnabled ($ item ->element )) {
317+ if ($ item ->element !== '' && !ComponentHelper::isEnabled ($ item ->element )) {
320318 $ parent ->removeChild ($ item );
321319 continue ;
322320 }
@@ -413,7 +411,7 @@ protected function preprocess($parent)
413411 }
414412
415413 // Exclude if link is invalid
416- if (\is_null ($ item ->link ) || !\in_array ($ item ->type , ['separator ' , 'heading ' , 'container ' ]) && trim ($ item ->link ) === '' ) {
414+ if (! isset ($ item ->link ) || !\in_array ($ item ->type , ['separator ' , 'heading ' , 'container ' ]) && trim ($ item ->link ) === '' ) {
417415 $ parent ->removeChild ($ item );
418416 continue ;
419417 }
@@ -460,7 +458,7 @@ protected function preprocess($parent)
460458 }
461459
462460 // Ok we passed everything, load language at last only
463- if ($ item ->element ) {
461+ if (! empty ( $ item ->element ) ) {
464462 $ language ->load ($ item ->element . '.sys ' , JPATH_ADMINISTRATOR ) ||
465463 $ language ->load ($ item ->element . '.sys ' , JPATH_ADMINISTRATOR . '/components/ ' . $ item ->element );
466464 }
@@ -492,7 +490,7 @@ protected function preprocess($parent)
492490 */
493491 public function getIconClass ($ node )
494492 {
495- $ identifier = $ node ->class ;
493+ $ identifier = ! empty ( $ node ->class ) ? $ node -> class : '' ;
496494
497495 // Top level is special
498496 if (trim ($ identifier ) == '' ) {
@@ -518,7 +516,7 @@ public function getIconClass($node)
518516 }
519517
520518 /**
521- * Create unique identifier
519+ * Increase the counter and return the new value
522520 *
523521 * @return string
524522 *
0 commit comments