Changes between Version 2 and Version 3 of S3/S3Navigation


Ignore:
Timestamp:
03/05/12 12:45:47 (13 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Navigation

    v2 v3  
    6868All other keyword parameters will be stored in the item instance and passed on to the {{{layout}}} method - keywords starting with an "_" underscore will be stored in {{{item.attributes}}}, all other keywords in {{{item.options}}} (it is up to the layout method to deal with those then).
    6969
     70=== Processing Navigation Items ===
     71
     72When 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
     80S3Navigation 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
     89The 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
    7091=== Rendering Navigation Items ===
    7192