| 70 | === Processing Navigation Items === |
| 71 | |
| 72 | When navitation item instances get processed, they receive a set of status flags which then are available for the renderer: |
| 73 | |
| 74 | ||='''Flag'''=||='''Meaning'''=||='''Comments'''=|| |
| 75 | ||item.enabled||The item shall be rendered as enabled (accessible)||renderers would usually skip items with enabled=False, but could also render them greyed-out or otherwise visible but inaccessible; this flag will be altered by the return value of the check-hooks, and can be overridden by the check_enabled method of the class|| |
| 76 | ||item.selected||The target URL of the item or any of its sub-items matches the current request||this can be used for menu highlighting; if more than one subtree can be matched, only items in the first matching subtree will be marked selected|| |
| 77 | ||item.authorized||The user is permitted to access the target URL of this item||renderers would usually skip items the user is not permitted to access, but could also render the item greyed-out or otherwise visible but inaccessible|| |
| 78 | ||item.visible||Custom flag to show/hide items||will always be True unless explicitly changed by a check-hook method|| |
| 79 | |
| 80 | S3Navigation items are run through a cascade of status checks: |
| 81 | |
| 82 | ||='''Method'''=||='''Meaning''=||='''Effect'''=||='''Flag set'''=|| |
| 83 | ||check_active||Check whether the item is relevant for the current request||if this returns False, the item will be deactivated and the renderer never be called|||| |
| 84 | ||check_enabled||Check whether the item is enabled||Overrides the enabled flag if (and only if) it returns False, if it returns True, the flag remains unchanged||enabled|| |
| 85 | ||check_permission||Check whether the user is permitted to access the target URL of the item||sets flag||authorized|| |
| 86 | ||check_selected||Check whether the item matches the current request||sets flag upward in the whole subtree||selected|| |
| 87 | ||check_hook||Runs the check hook methods||if this returns False, neither check_enabled nor the renderer will be run|||| |
| 88 | |
| 89 | The default behavior of these methods is meant for menu items, which may though not fit for all types of navigation items. Where needed, the subclass should overwrite them accordingly. These methods won't take any parameter beyond {{{self}}} and are expected to return a boolean value. |
| 90 | |