Révision 582db59d
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/includes/menu.inc | ||
---|---|---|
229 | 229 |
define('MENU_FOUND', 1); |
230 | 230 |
|
231 | 231 |
/** |
232 |
* Internal menu status code -- Menu item was not found. |
|
232 |
* Menu status code -- Not found. |
|
233 |
* |
|
234 |
* This can be used as the return value from a page callback, although it is |
|
235 |
* preferable to use a load function to accomplish this; see the hook_menu() |
|
236 |
* documentation for details. |
|
233 | 237 |
*/ |
234 | 238 |
define('MENU_NOT_FOUND', 2); |
235 | 239 |
|
236 | 240 |
/** |
237 |
* Internal menu status code -- Menu item access is denied. |
|
241 |
* Menu status code -- Access denied. |
|
242 |
* |
|
243 |
* This can be used as the return value from a page callback, although it is |
|
244 |
* preferable to use an access callback to accomplish this; see the hook_menu() |
|
245 |
* documentation for details. |
|
238 | 246 |
*/ |
239 | 247 |
define('MENU_ACCESS_DENIED', 3); |
240 | 248 |
|
... | ... | |
431 | 439 |
* |
432 | 440 |
* @param $path |
433 | 441 |
* The path; for example, 'node/5'. The function will find the corresponding |
434 |
* node/% item and return that. |
|
442 |
* node/% item and return that. Defaults to the current path.
|
|
435 | 443 |
* @param $router_item |
436 | 444 |
* Internal use only. |
437 | 445 |
* |
... | ... | |
2613 | 2621 |
*/ |
2614 | 2622 |
function menu_get_active_title() { |
2615 | 2623 |
$active_trail = menu_get_active_trail(); |
2624 |
$local_task_title = NULL; |
|
2616 | 2625 |
|
2617 | 2626 |
foreach (array_reverse($active_trail) as $item) { |
2618 |
if (!(bool) ($item['type'] & MENU_IS_LOCAL_TASK)) { |
|
2619 |
return $item['title']; |
|
2627 |
// Local task titles are displayed as tabs and therefore should not be |
|
2628 |
// repeated as the page title. However, if the local task appears in a |
|
2629 |
// top-level menu, it is no longer a "local task" anymore (the front page |
|
2630 |
// of the site does not have tabs) so it is better to use the local task |
|
2631 |
// title in that case than to fall back on the front page link in the |
|
2632 |
// active trail (which is usually "Home" and would not make sense in this |
|
2633 |
// context). |
|
2634 |
if ((bool) ($item['type'] & MENU_IS_LOCAL_TASK)) { |
|
2635 |
// A local task title is being skipped; track it in case it needs to be |
|
2636 |
// used later. |
|
2637 |
$local_task_title = $item['title']; |
|
2638 |
} |
|
2639 |
else { |
|
2640 |
// This is not a local task, so use it for the page title (unless the |
|
2641 |
// conditions described above are met). |
|
2642 |
if (isset($local_task_title) && isset($item['href']) && $item['href'] == '<front>') { |
|
2643 |
return $local_task_title; |
|
2644 |
} |
|
2645 |
else { |
|
2646 |
return $item['title']; |
|
2647 |
} |
|
2620 | 2648 |
} |
2621 | 2649 |
} |
2622 | 2650 |
} |
Formats disponibles : Unified diff
Update Drupal core to version 7.40