src/Mouf/MoufUtils.php
public static function registerChooseInstanceMenuItem($instanceName, $label, $url, $type, $parentMenuItemName = 'moufSubMenu', $priority = 50) {
		$moufManager = MoufManager::getMoufManager();
	
		if ($moufManager->instanceExists($instanceName)) {
			return;
		}
	
		$moufManager->declareComponent($instanceName, 'Mouf\\Menu\\ChooseInstanceMenuItem', true);
		$moufManager->setParameterViaSetter($instanceName, 'setLabel', $label);
		$moufManager->setParameterViaSetter($instanceName, 'setUrl', $url);
		$moufManager->setParameterViaSetter($instanceName, 'setType', $type);
		$moufManager->setParameterViaSetter($instanceName, 'setPriority', $priority);
		
		$parentMenuItem = MoufManager::getMoufManager()->getInstance($parentMenuItemName);
		/* @var $parentMenuItem MenuItem */
		$parentMenuItem->addMenuItem(MoufManager::getMoufManager()->getInstance($instanceName));
	}
public static function registerChooseInstanceMenuItem($instanceName, $label, $url, $type, $parentMenuItemName = 'moufSubMenu', $priority = 50) {
		$moufManager = MoufManager::getMoufManager();
	
		if ($moufManager->instanceExists($instanceName)) {
			return;
		}
	
		$moufManager->declareComponent($instanceName, 'Mouf\\Menu\\ChooseInstanceMenuItem', true);
		$moufManager->setParameterViaSetter($instanceName, 'setLabel', $label);
		$moufManager->setParameterViaSetter($instanceName, 'setUrl', $url);
		$moufManager->setParameterViaSetter($instanceName, 'setType', $type);
		$moufManager->setParameterViaSetter($instanceName, 'setPriority', $priority);
		
		$parentMenuItem = MoufManager::getMoufManager()->getInstance($parentMenuItemName);
		/* @var $parentMenuItem MenuItem */
		$parentMenuItem->addMenuItem(MoufManager::getMoufManager()->getInstance($instanceName));
	}
public static function registerChooseInstanceMenuItem ( $ instanceName , $ label , $ url , $ type , $ parentMenuItemName = 'moufSubMenu' , $ priority = 50 ) { $ moufManager = MoufManager :: getMoufManager ( ) ; if ( $ moufManager -> instanceExists ( $ instanceName ) ) { return ; } $ moufManager -> declareComponent ( $ instanceName , 'Mouf\\Menu\\ChooseInstanceMenuItem' , true ) ; $ moufManager -> setParameterViaSetter ( $ instanceName , 'setLabel' , $ label ) ; $ moufManager -> setParameterViaSetter ( $ instanceName , 'setUrl' , $ url ) ; $ moufManager -> setParameterViaSetter ( $ instanceName , 'setType' , $ type ) ; $ moufManager -> setParameterViaSetter ( $ instanceName , 'setPriority' , $ priority ) ; $ parentMenuItem = MoufManager :: getMoufManager ( ) -> getInstance ( $ parentMenuItemName ) ; /* @var $parentMenuItem MenuItem */ $ parentMenuItem -> addMenuItem ( MoufManager :: getMoufManager ( ) -> getInstance ( $ instanceName ) ) ; }
Registers a new menuItem instance to be displayed in Mouf main menu that triggers
a popup to choose an instance.

@param string $instanceName
@param string $label
@param string $url
@param string $type
@param string $parentMenuItemName The parent menu item instance name. 'mainMenu' is the main menu item, and 'moufSubMenu' is the 'Mouf' menu
@param float $priority The position of the menu
Registers a new menuItem instance to be displayed in Mouf main menu that triggers a popup to choose an instance .