. * * @file * @ingroup Skins */ namespace Skins\Chameleon\Components; use Sanitizer; use Skins\Chameleon\Menu\MenuFactory; /** * Class Menu * * @author Stephan Gambke * @since 1.0 * @ingroup Skins */ class Menu extends Component { /** * Builds the HTML code for this component * * @return String the HTML code */ public function getHtml() { if ( $this->getDomElement() === null ) { return ''; } $menu = $this->getMenu(); $menu->setMenuItemFormatter( function ( $href, $text, $depth, $subitems ) { $href = Sanitizer::cleanUrl( $href ); $text = htmlspecialchars( $text ); if ( $depth === 1 && !empty( $subitems ) ) { return "