Home | Trees | Indices | Help |
|
---|
|
object --+ | S3NavigationItem
Base class and API for navigation items. Navigation items are GUI elements to navigate the application, typically represented as hyperlinks. Besides form elements, navigation items are most common type of GUI controls. This base class can be used to implement both nagivation items and navigation item containers (e.g. menus), each as subclasses. Subclasses should implement the layout() method to render the item as HTML (ideally using the web2py helpers). There is no default layout, items will not be rendered at all unless the subclass implements a layout method or the particular instance receives a renderer as parameter. Additionally, subclasses should implement the check_*() methods: Method: Checks whether: check_active this item belongs to the requested page check_enabled this item is enabled check_permission the user is permitted to access this item check_selected the item has been selected to request the page check_active is the first check run, and the only method that actually deactivates the item completely, whereas the other methods just set flags for the renderer. All of these methods must return True or False for the respective condition. There are default check_*() methods in this base class which support a menu-alike behavior of the item - which may though not fit for all navigation elements. For more details, see the S3Navigation wiki page: http://eden.sahanafoundation.org/wiki/S3/S3Navigation
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Static Methods | |||
|
Properties | |
Inherited from |
Method Details |
Constructor
|
Check whether the current theme has a custom layout for this class, and if so, store it in current.layouts
|
Clone this item and its components |
Check whether this item belongs to the requested page (request). If this check returns False, then the item will be deactivated entirely, i.e. no further checks will be run and the renderer will never be called.
|
Check whether this item is enabled. This check does not directly disable the item, but rather sets the enabled-flag in the item which can then be used by the renderer. This function is called as the very last action immediately before rendering the item. If it returns True, then the enabled-flag of the item remains unchanged, otherwise it gets set to False (False-override). |
Check whether the user is permitted to access this item. This check does not directly disable the item, but rather sets the authorized-flag in the item which can then be used by the renderer. |
Check whether this item is in the selected path (i.e. whether it is or contains the item used to trigger the request). This check doesn't change the processing of the item, but rather sets the selected-flag which can then be used by the renderer If this is a top-level item, then this check sets the selected-flags for the whole selected path down to the leaf item that has triggered the request. Note that this doesn't currently reset selected-flags, so this check can be performed only once per subtree and request. If it would be really neccessary to perform this check more than once, then it should be easy to implement a reset_flags method.
|
Run hooked-in checks |
Check whether a tag is present in any item of the subtree |
Find all items within the tree with the specified tag
|
Enable items
|
Disable items
|
Select an item. If given a tag, this selects the first matching descendant (depth-first search), otherwise selects this item. Propagates the selection up the path to the root item (including the root item)
|
De-select this item and all its descendants |
Alter the renderer for a tagged subset of items in the subtree.
|
Get a Python-attribute of this item instance, falls back to the same attribute in the parent item if not set in this instance, used to inherit attributes to components
|
Match this item against request (uses GET vars)
Note: currently ignores numerical arguments in the request, which is though subject to change (in order to support numerical arguments in the item) |
Get the matching branch item for request
|
String representation of this item
|
Return the target URL for this item, doesn't check permissions
|
Return the target URL for this item if accessible by the current user, otherwise False
|
Perform the checks and render this item.
|
Render the components of this item and return the results as list |
Invokes the renderer and serializes the output for the web2py template parser, returns a string to be written to the response body, uses the xml() method of the renderer output, if present. |
Set a parent for this item, base method for tree construction
|
Append a component
|
Insert a component item at position i
|
Extend this item with a list of components
|
Convenience shortcut for extend
|
Append component items to this item
|
Get the component item at position i
|
Overwrite the component item at position i with item
|
Return the component at index i and remove it from the list
|
Get the top level item of this navigation tree |
Get the full path to this item (=a list of items from the root item down to this item). |
Get all components with these flags
|
Get the first component item with these flags
|
Get the first component item with these flags
|
The total number of components of this item |
To be used instead of __len__ to determine the boolean value if this item, should always return True for instances |
Get the index of a component item within the component list
|
Get the position of this item within the parent's component list, reverse method for index() |
Check whether this is the first item within the parent's components list with these flags
|
Check whether this is the last item within the parent's components list with these flags
|
Get the preceding siblings within the parent's component list |
Get the following siblings within the parent's component list |
Get the previous item in the parent's component list with these flags
|
Get the next item in the parent's component list with these flags
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Mar 15 08:51:50 2019 | http://epydoc.sourceforge.net |