[ Index ]
 

Code source de Drupal 5.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/ -> menu.inc (sommaire)

(pas de description)

Poids: 1392 lignes (43 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 37 fonctions

  menu_get_menu()
  menu_get_local_tasks()
  menu_get_item()
  menu_get_root_menus()
  menu_set_location()
  menu_execute_active_handler()
  menu_get_active_item()
  menu_set_active_item()
  menu_get_active_nontask_item()
  menu_get_active_title()
  menu_get_active_help()
  menu_get_active_breadcrumb()
  menu_in_active_trail()
  menu_in_active_trail_in_submenu()
  menu_rebuild()
  theme_menu_tree()
  menu_tree()
  theme_menu_item()
  theme_menu_item_link()
  menu_item_link()
  theme_menu_local_tasks()
  menu_primary_local_tasks()
  menu_secondary_local_tasks()
  theme_menu_local_task()
  menu_primary_links()
  menu_secondary_links()
  theme_menu_links()
  _menu_get_active_trail()
  _menu_get_active_trail_in_submenu()
  _menu_sort()
  _menu_build()
  _menu_item_is_accessible()
  _menu_build_visible_tree()
  _menu_append_contextual_items()
  _menu_find_parents()
  _menu_build_local_tasks()
  _menu_site_is_offline()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

menu_get_menu()   X-Ref
Return the menu data structure.

The returned structure contains much information that is useful only
internally in the menu system. External modules are likely to need only
the ['visible'] element of the returned array. All menu items that are
accessible to the current user and not hidden will be present here, so
modules and themes can use this structure to build their own representations
of the menu.

$menu['visible'] will contain an associative array, the keys of which
are menu IDs. The values of this array are themselves associative arrays,
with the following key-value pairs defined:
- 'title' - The displayed title of the menu or menu item. It will already
have been translated by the locale system.
- 'description' - The description (link title attribute) of the menu item.
It will already have been translated by the locale system.
- 'path' - The Drupal path to the menu item. A link to a particular item
can thus be constructed with
l($item['title'], $item['path'], array('title' => $item['description'])).
- 'children' - A linear list of the menu ID's of this item's children.

Menu ID 0 is the "root" of the menu. The children of this item are the
menus themselves (they will have no associated path). Menu ID 1 will
always be one of these children; it is the default "Navigation" menu.

menu_get_local_tasks()   X-Ref
Return the local task tree.

Unlike the rest of the menu structure, the local task tree cannot be cached
nor determined too early in the page request, because the user's current
location may be changed by a menu_set_location() call, and the tasks shown
(just as the breadcrumb trail) need to reflect the changed location.

menu_get_item($mid, $path = NULL, $reset = FALSE)   X-Ref
Retrieves the menu item specified by $mid, or by $path if $mid is not given.

param: $mid
param: $path
param: $reset
return:

menu_get_root_menus()   X-Ref
Retrieves the menu ID and title of all root menus.

return:

menu_set_location($location)   X-Ref
Change the current menu location of the user.

Frequently, modules may want to make a page or node act as if it were
in the menu tree somewhere, even though it was not registered in a
hook_menu() implementation. If the administrator has rearranged the menu,
the newly set location should respect this in the breadcrumb trail and
expanded/collapsed status of menu items in the tree. This function
allows this behavior.

param: $location

menu_execute_active_handler()   X-Ref
Execute the handler associated with the active menu item.

This is called early in the page request. The active menu item is at
this point determined exclusively by the URL. The handler that is called
here may, as a side effect, change the active menu item so that later
menu functions (that display the menus and breadcrumbs, for example)
act as if the user were in a different location on the site.

menu_get_active_item()   X-Ref
Returns the ID of the active menu item.


menu_set_active_item($path = NULL)   X-Ref
Sets the path of the active menu item.


menu_get_active_nontask_item()   X-Ref
Returns the ID of the current menu item or, if the current item is a
local task, the menu item to which this task is attached.


menu_get_active_title()   X-Ref
Returns the title of the active menu item.


menu_get_active_help()   X-Ref
Returns the help associated with the active menu item.


menu_get_active_breadcrumb()   X-Ref
Returns an array of rendered menu items in the active breadcrumb trail.


menu_in_active_trail($mid)   X-Ref
Returns TRUE when the menu item is in the active trail.


menu_in_active_trail_in_submenu($mid, $pid)   X-Ref
Returns TRUE when the menu item is in the active trail within a
specific subsection of the menu tree.

param: $mid
param: $pid

menu_rebuild()   X-Ref
Populate the database representation of the menu.

This need only be called at the start of pages that modify the menu.

theme_menu_tree($pid = 1)   X-Ref
Generate the HTML for a menu tree.

param: $pid

menu_tree($pid = 1)   X-Ref
Returns a rendered menu tree.

param: $pid

theme_menu_item($mid, $children = '', $leaf = TRUE)   X-Ref
Generate the HTML output for a single menu item.

param: $mid
param: $children
param: $leaf

theme_menu_item_link($item, $link_item)   X-Ref
Generate the HTML representing a given menu item ID.

param: $item
param: $link_item

menu_item_link($mid, $theme = TRUE)   X-Ref
Returns the rendered link to a menu item.

param: $mid
param: $theme

theme_menu_local_tasks()   X-Ref
Returns the rendered local tasks. The default implementation renders
them as tabs.


menu_primary_local_tasks()   X-Ref
Returns the rendered HTML of the primary local tasks.


menu_secondary_local_tasks()   X-Ref
Returns the rendered HTML of the secondary local tasks.


theme_menu_local_task($mid, $active, $primary)   X-Ref
Generate the HTML representing a given menu item ID as a tab.

param: $mid
param: $active
param: $primary

menu_primary_links($start_level = 1, $pid = 0)   X-Ref
Returns an array containing the primary links.
Can optionally descend from the root of the Primary links menu towards the
current node for a specified number of levels and return that submenu.
Used to generate a primary/secondary menu from different levels of one menu.

param: $start_level
param: $pid
return: A nested array of links and their properties. The keys of

menu_secondary_links()   X-Ref
Returns an array containing the secondary links.
Secondary links can be either a second level of the Primary links
menu or generated from their own menu.


theme_menu_links($links)   X-Ref
Returns the themed HTML for primary and secondary links.
Note that this function is overridden by most core themes because
those themes display links in "link | link" format, not from a list.
Also note that by default links rendered with this function are
displayed with the same CSS as is used for the local tasks.
If a theme wishes to render links from a ul it is expected that
the theme will provide suitable CSS.

param: $links
return:

_menu_get_active_trail()   X-Ref
Returns an array with the menu items that lead to the current menu item.


_menu_get_active_trail_in_submenu($pid)   X-Ref
Find the active trail through a specific subsection of the menu tree.

param: $pid

_menu_sort($a, $b)   X-Ref
Comparator routine for use in sorting menu items.


_menu_build()   X-Ref
Build the menu by querying both modules and the database.


_menu_item_is_accessible($mid)   X-Ref
Determine whether the given menu item is accessible to the current user.

Use this instead of just checking the "access" property of a menu item
to properly handle items with fall-through semantics.

_menu_build_visible_tree($pid = 0)   X-Ref
Find all visible items in the menu tree, for ease in displaying to user.

Since this is only for display, we only need title, path, and children
for each item.

_menu_append_contextual_items()   X-Ref
Account for menu items that are only defined at certain paths, so will not
be cached.

We don't support the full range of menu item options for these menu items. We
don't support MENU_VISIBLE_IF_HAS_CHILDREN, and we require parent items to be
declared before their children.

_menu_find_parents(&$items)   X-Ref
Establish parent-child relationships.


_menu_build_local_tasks($pid)   X-Ref
Find all the items in the current local task tree.

Since this is only for display, we only need title, path, and children
for each item.

At the close of this function, $_menu['local tasks'] is populated with the
menu items in the local task tree.

return:

_menu_site_is_offline()   X-Ref
Returns TRUE if the site is off-line for maintenance.




Généré le : Fri Nov 30 16:20:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics