Project

General

Profile

Paste
Download (1.68 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / themes / bootstrap / templates / menu / menu-tree.func.php @ 1f623f01

1
<?php
2
/**
3
 * @file
4
 * Stub file for bootstrap_menu_tree() and suggestion(s).
5
 */
6

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

    
26
/**
27
 * Bootstrap theme wrapper function for the primary menu links.
28
 */
29
function bootstrap_menu_tree__primary(&$variables) {
30
  return '<ul class="menu nav navbar-nav">' . $variables['tree'] . '</ul>';
31
}
32

    
33
/**
34
 * Bootstrap theme wrapper function for the secondary menu links.
35
 */
36
function bootstrap_menu_tree__secondary(&$variables) {
37
  return '<ul class="menu nav navbar-nav secondary">' . $variables['tree'] . '</ul>';
38
}
39

    
40
/**
41
 * Overrides theme_menu_tree() for book module.
42
 */
43
function bootstrap_menu_tree__book_toc(&$variables) {
44
  $output = '<div class="book-toc btn-group pull-right">';
45
  $output .= '  <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">';
46
  $output .= t('!icon Outline !caret', array(
47
    '!icon' => _bootstrap_icon('list'),
48
    '!caret' => '<span class="caret"></span>',
49
  ));
50
  $output .= '</button>';
51
  $output .= '<ul class="dropdown-menu" role="menu">' . $variables['tree'] . '</ul>';
52
  $output .= '</div>';
53
  return $output;
54
}
55

    
56
/**
57
 * Overrides theme_menu_tree() for book module.
58
 */
59
function bootstrap_menu_tree__book_toc__sub_menu(&$variables) {
60
  return '<ul class="dropdown-menu" role="menu">' . $variables['tree'] . '</ul>';
61
}