Projet

Général

Profil

Paste
Télécharger (2,38 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / bootstrap / templates / menu / menu-tree.func.php @ 01f36513

1
<?php
2

    
3
/**
4
 * @file
5
 * Stub file for bootstrap_menu_tree() and suggestion(s).
6
 */
7

    
8
/**
9
 * Returns HTML for a wrapper for a menu sub-tree.
10
 *
11
 * @param array $variables
12
 *   An associative array containing:
13
 *   - tree: An HTML string containing the tree's items.
14
 *
15
 * @return string
16
 *   The constructed HTML.
17
 *
18
 * @see template_preprocess_menu_tree()
19
 * @see theme_menu_tree()
20
 *
21
 * @ingroup theme_functions
22
 */
23
function bootstrap_menu_tree(array &$variables) {
24
  return '<ul class="menu nav">' . $variables['tree'] . '</ul>';
25
}
26

    
27
/**
28
 * Bootstrap theme wrapper function for the primary menu links.
29
 *
30
 * @param array $variables
31
 *   An associative array containing:
32
 *   - tree: An HTML string containing the tree's items.
33
 *
34
 * @return string
35
 *   The constructed HTML.
36
 */
37
function bootstrap_menu_tree__primary(array &$variables) {
38
  return '<ul class="menu nav navbar-nav">' . $variables['tree'] . '</ul>';
39
}
40

    
41
/**
42
 * Bootstrap theme wrapper function for the secondary menu links.
43
 *
44
 * @param array $variables
45
 *   An associative array containing:
46
 *   - tree: An HTML string containing the tree's items.
47
 *
48
 * @return string
49
 *   The constructed HTML.
50
 */
51
function bootstrap_menu_tree__secondary(array &$variables) {
52
  return '<ul class="menu nav navbar-nav secondary">' . $variables['tree'] . '</ul>';
53
}
54

    
55
/**
56
 * Overrides theme_menu_tree() for book module.
57
 *
58
 * @param array $variables
59
 *   An associative array containing:
60
 *   - tree: An HTML string containing the tree's items.
61
 *
62
 * @return string
63
 *   The constructed HTML.
64
 */
65
function bootstrap_menu_tree__book_toc(array &$variables) {
66
  $output = '<div class="book-toc btn-group pull-right">';
67
  $output .= '  <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">';
68
  $output .= t('!icon Outline !caret', array(
69
    '!icon' => _bootstrap_icon('list'),
70
    '!caret' => '<span class="caret"></span>',
71
  ));
72
  $output .= '</button>';
73
  $output .= '<ul class="dropdown-menu" role="menu">' . $variables['tree'] . '</ul>';
74
  $output .= '</div>';
75
  return $output;
76
}
77

    
78
/**
79
 * Overrides theme_menu_tree() for book module.
80
 *
81
 * @param array $variables
82
 *   An associative array containing:
83
 *   - tree: An HTML string containing the tree's items.
84
 *
85
 * @return string
86
 *   The constructed HTML.
87
 */
88
function bootstrap_menu_tree__book_toc__sub_menu(array &$variables) {
89
  return '<ul class="dropdown-menu" role="menu">' . $variables['tree'] . '</ul>';
90
}