/** * Create a menu item, sets the condition to have it displayed and inserts it into the application's main menu * @param string $sMenuId Unique identifier of the menu (used to identify the menu for bookmarking, and for getting the labels from the dictionary) * @param integer $iParentIndex ID of the parent menu, pass -1 for top level (group) items * @param float $fRank Number used to order the list, any number will do, but for a given level (i.e same parent) all menus are sorted based on this value * @param string $sEnableClass Name of class of object * @param mixed $iActionCode UR_ACTION_READ, UR_ACTION_MODIFY, UR_ACTION_DELETE, UR_ACTION_BULKREAD, UR_ACTION_BULKMODIFY or UR_ACTION_BULKDELETE * @param integer $iAllowedResults Expected "rights" for the action: either UR_ALLOWED_YES, UR_ALLOWED_NO, UR_ALLOWED_DEPENDS or a mix of them... * @param string $sEnableStimulus The user can see this menu if she/he has enough rights to apply this stimulus * @return MenuNode */ public function __construct($sMenuId, $iParentIndex = -1, $fRank = 0, $sEnableClass = null, $iActionCode = null, $iAllowedResults = UR_ALLOWED_YES, $sEnableStimulus = null) { $this->sMenuId = $sMenuId; $this->aReflectionProperties = array(); if (strlen($sEnableClass) > 0) { $this->aReflectionProperties['enable_class'] = $sEnableClass; $this->aReflectionProperties['enable_action'] = $iActionCode; $this->aReflectionProperties['enable_permission'] = $iAllowedResults; $this->aReflectionProperties['enable_stimulus'] = $sEnableStimulus; } $this->m_aEnableClasses = array($sEnableClass); $this->m_aEnableActions = array($iActionCode); $this->m_aEnableActionResults = array($iAllowedResults); $this->m_aEnableStimuli = array($sEnableStimulus); $this->index = ApplicationMenu::InsertMenu($this, $iParentIndex, $fRank); }