Changes between Version 6 and Version 7 of S3/S3Navigation


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

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Navigation

    v6 v7  
    6969
    7070All other keyword parameters will be stored in the item instance as they are and get passed on to the {{{layout}}} method. Keywords starting with an "_" underscore will be stored in the {{{item.attributes}}} dict, all other keywords in the {{{item.options}}} dict. It is up to the layout method to deal with those keyword parameters then.
    71 === Item Status ===
     71=== Status Flags ===
    7272
    73 S3Navigation items are run through a cascade of status checks before they get handed over to the layout method:
     73During the status check cascade, each navigation item receives a set of status flags which then are available to the layout method. It is up to the layout method whether and how each combination of flags influences the rendering of the item.
     74
     75||='''Flag'''=||='''Meaning'''=||='''Comments'''=||
     76||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||
     77||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||
     78||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||
     79||item.visible||Custom flag to show/hide items||will always be True unless explicitly changed by a check-hook method||
     80
     81=== Statuc Check Cascade ===
     82
     83All S3Navigation items are run through a cascade of status checks before they get handed over to the layout method.
     84
     85The 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.
    7486
    7587||='''Method'''=||='''Meaning'''=||='''Effect'''=||='''Flag set'''=||
     
    8092||check_hook||Runs the check hook methods||if this returns False, neither check_enabled nor the renderer will be run||||
    8193
    82 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.
    83 
    84 During the status check cascade, each navigation item receives a set of status flags which then are available for the renderer:
    85 
    86 ||='''Flag'''=||='''Meaning'''=||='''Comments'''=||
    87 ||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||
    88 ||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||
    89 ||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||
    90 ||item.visible||Custom flag to show/hide items||will always be True unless explicitly changed by a check-hook method||
    91 
    92 It is up to the layout method whether and how each combination of flags influences the rendering of the item.
    9394=== Rendering Navigation Items ===
    9495