Represents one entry in an account's saved menu customisation (menu.json), matched by id to a menu item an app contributed. This lets the account override or hide an app's menu item, or add a brand new one of its own. A menu configuration is a flat list of these entries; MenuConfig.find looks one up by id while the menu tree is being built. An entry whose id does not match an existing item, together with parentId, instead describes a brand new item added under an existing one - see custom(). Visibility is controlled by hidden, visible, orgTypeHidden and orgTypeVisible, whose exact meaning depends on whether the account's menu configuration is version 1 or version 2 - see MenuManager for how each is interpreted.
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| cssClass | String | CSS class that overrides the target item's own icon class, when set. |
| custom | Boolean | Whether this entry is a wholly new item added by the account, rather than a customisation of an item an app already contributes. Prefer custom() for a null-safe read of the same flag. |
| hidden | String | Raw visibility rule for the target item: the string 'true' hides it for everyone, the string 'anon' shows it only to signed out visitors, a comma-separated list of group names shows it only to members of one of those groups, and blank or 'false' leaves it visible to everyone. Prefer hidden(), anon() or visible() to interpret this value rather than comparing it directly. |
| href | String | Link that overrides the target item's own href, when set. |
| id | String | Id of the menu item this entry customises, matched against the id of an item already in the built menu tree. |
| ordering | Integer | Position override for the target item, with lower numbers sorting first among siblings. |
| orgTypeHidden | String | Comma-separated organisation types that hide the item, when the current user's account is one of them. Only interpreted when the account's menu configuration is version 2. |
| orgTypeVisible | String | Comma-separated organisation types this entry restricts visibility to. Only interpreted when the account's menu configuration is version 2, where a set value shows the item only when the current user's account is one of the listed types. |
| parentId | String | Id of the parent item this entry is added under, when it describes a brand new custom item rather than a customisation of an existing one. Only meaningful when custom() is true. |
| text | String | Label text that overrides the target item's own label, when set. |
| visible | String | Comma-separated group names this entry restricts visibility to. Only interpreted when the account's menu configuration is version 2, where a set value shows the item only to members of one of the listed groups. |
Methods
getId() · getParentId() · getText() · getHref() · getOrdering() · getCustom() · getVisible() · getOrgTypeHidden() · hasOrgTypeHidden() · getOrgTypeVisible() · hasOrgTypeVisible() · getHidden() · custom() · hidden() · visible() · anon() · getCssClass()
getId()
Returns: String
Id of the menu item this entry customises, matched against the id of an item already in the built menu tree.
getParentId()
Returns: String
Id of the parent item this entry is added under, when it describes a brand new custom item rather than a customisation of an existing one. Only meaningful when custom() is true.
getText()
Returns: String
Label text that overrides the target item's own label, when set.
getHref()
Returns: String
Link that overrides the target item's own href, when set.
getOrdering()
Returns: Integer
Position override for the target item, with lower numbers sorting first among siblings.
getCustom()
Returns: Boolean
Whether this entry is a wholly new item added by the account, rather than a customisation of an item an app already contributes. Prefer custom() for a null-safe read of the same flag.
getVisible()
Returns: String
Comma-separated group names this entry restricts visibility to. Only interpreted when the account's menu configuration is version 2, where a set value shows the item only to members of one of the listed groups.
getOrgTypeHidden()
Returns: String
Comma-separated organisation types that hide the item, when the current user's account is one of them. Only interpreted when the account's menu configuration is version 2.
hasOrgTypeHidden()
Returns: boolean
Whether an organisation-type hiding rule is set.
getOrgTypeVisible()
Returns: String
Comma-separated organisation types this entry restricts visibility to. Only interpreted when the account's menu configuration is version 2, where a set value shows the item only when the current user's account is one of the listed types.
hasOrgTypeVisible()
Returns: boolean
Whether an organisation-type visibility rule is set.
getHidden()
Returns: String
Raw visibility rule for the target item: the string 'true' hides it for everyone, the string 'anon' shows it only to signed out visitors, a comma-separated list of group names shows it only to members of one of those groups, and blank or 'false' leaves it visible to everyone. Prefer hidden(), anon() or visible() to interpret this value rather than comparing it directly.
custom()
Returns: boolean
Null-safe read of whether this entry adds a wholly new item rather than customising one an app already contributes.
hidden()
Returns: boolean
Whether the raw hidden rule marks the item hidden for everyone.
visible()
Returns: boolean
Whether the raw hidden rule leaves the item visible to everyone, ie it does not encode a group restriction or the anon-only rule.
anon()
Returns: boolean
Whether the raw hidden rule marks this item visible only to signed out visitors. For historical reasons the value used for this is the literal string 'anon', not a flag naming who the item is hidden from.
getCssClass()
Returns: String
CSS class that overrides the target item's own icon class, when set.