FML/Script/Features/Menu.php
public function addElement(MenuElement $menuElement, $isStartElement = false)
    {
        if (!in_array($menuElement, $this->elements, true)) {
            array_push($this->elements, $menuElement);
            if ($isStartElement) {
                // new start element
                $this->setStartElement($menuElement);
            } else {
                // additional element - set invisible
                $menuElement->getControl()
                            ->setVisible(false);
            }
        }
        return $this;
    }
public function addElement(MenuElement $menuElement, $isStartElement = false)
    {
        if (!in_array($menuElement, $this->elements, true)) {
            array_push($this->elements, $menuElement);
            if ($isStartElement) {
                // new start element
                $this->setStartElement($menuElement);
            } else {
                // additional element - set invisible
                $menuElement->getControl()
                            ->setVisible(false);
            }
        }
        return $this;
    }
public function addElement ( MenuElement $ menuElement , $ isStartElement = false ) { if ( ! in_array ( $ menuElement , $ this -> elements , true ) ) { array_push ( $ this -> elements , $ menuElement ) ; if ( $ isStartElement ) { // new start element $ this -> setStartElement ( $ menuElement ) ; } else { // additional element - set invisible $ menuElement -> getControl ( ) -> setVisible ( false ) ; } } return $ this ; }
Add a Menu Element

@api
@param MenuElement $menuElement    Menu Element
@param bool        $isStartElement (optional) Whether the Menu should start with this Element
@return static
Add a Menu Element