public function addItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false, $icon = false, $onclick = false)
    {
        // make sure the idSite value used is numeric (hack-y fix for #3426)
        if (isset($url['idSite']) && !is_numeric($url['idSite'])) {
            $idSites = API::getInstance()->getSitesIdWithAtLeastViewAccess();
            $url['idSite'] = reset($idSites);
        }

        $this->menuEntries[] = array(
            $menuName,
            $subMenuName,
            $url,
            $order,
            $tooltip,
            $icon,
            $onclick
        );
    }
public function addItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false, $icon = false, $onclick = false)
    {
        // make sure the idSite value used is numeric (hack-y fix for #3426)
        if (isset($url['idSite']) && !is_numeric($url['idSite'])) {
            $idSites = API::getInstance()->getSitesIdWithAtLeastViewAccess();
            $url['idSite'] = reset($idSites);
        }

        $this->menuEntries[] = array(
            $menuName,
            $subMenuName,
            $url,
            $order,
            $tooltip,
            $icon,
            $onclick
        );
    }
public function addItem ( $ menuName , $ subMenuName , $ url , $ order = 50 , $ tooltip = false , $ icon = false , $ onclick = false ) { // make sure the idSite value used is numeric (hack-y fix for #3426) if ( isset ( $ url [ 'idSite' ] ) && ! is_numeric ( $ url [ 'idSite' ] ) ) { $ idSites = API :: getInstance ( ) -> getSitesIdWithAtLeastViewAccess ( ) ; $ url [ 'idSite' ] = reset ( $ idSites ) ; } $ this -> menuEntries [ ] = array ( $ menuName , $ subMenuName , $ url , $ order , $ tooltip , $ icon , $ onclick ) ; }
Adds a new entry to the menu.

@param string $menuName The menu's category name. Can be a translation token.
@param string $subMenuName The menu item's name. Can be a translation token.
@param string|array $url The URL the admin menu entry should link to, or an array of query parameters
that can be used to build the URL.
@param int $order The order hint.
@param bool|string $tooltip An optional tooltip to display or false to display the tooltip.
@param bool|string $icon An icon classname, such as "icon-add". Only supported by admin menu
@param bool|string $onclick Will execute the on click handler instead of executing the link. Only supported by admin menu.
@since 2.7.0
@api
Adds a new entry to the menu .