c.l.w._.NavigationMenu(MenuBase) : class documentation

Part of canonical.launchpad.webapp View In Hierarchy

Implements interfaces: canonical.launchpad.webapp.interfaces.INavigationMenu

Base class for navigation menus.
Method iterlinks See INavigationMenu.
Method _is_current_url Determines if <link_url> is the current URL.
Method _is_menulink_for_view Return True if the menu-link is for the current view.

Inherited from MenuBase:

Method __init__ Undocumented
Method initialize Override this in subclasses to do initialization.
Method _buildLink Undocumented
Method _get_link Undocumented
Method _rootUrlForSite Return the root URL for the given site.

Inherited from UserAttributeCache (via MenuBase):

Method account Undocumented
Method user The logged-in Person, or None if there is no one logged in.
Method isBetaUser Return True if the user is in the beta testers team.
def iterlinks(self, request_url=None):
See INavigationMenu.

Menus may be associated with content objects and their views. The state of a menu's links depends upon the request_url (or the URL of the request) and whether the current view's menu is the link's menu.

def _is_current_url(self, request_url, link_url):
Determines if <link_url> is the current URL.

There are two cases to consider: 1) If the link target doesn't have query parameters, the request URL must be the same link (ignoring query parameters). 2) If the link target has query parameters, the request url must be a prefix of it to be the current url.

def _is_menulink_for_view(self, link, view):
Return True if the menu-link is for the current view.

A link is considered to be selected when the view provides link's menu interface.

ParameterslinkAn ILink in the menu. It has a menu attribute that may have an INavigationMenu assigned.
Unknown Field: viewThe view being tested.
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.