You are here

menutree.module in MenuTree 6

Same filename and directory in other branches
  1. 5 menutree.module

This module provides a simple "site map" tree based on the menu system rather than on taxonomies.

@author Larry Garfield

File

menutree.module
View source
<?php

/**
 * @file
 * This module provides a simple "site map" tree based on the menu system rather
 * than on taxonomies.
 *
 * @author Larry Garfield
 *
 */

/**
 * Page title handling option constant definitions.
 */

/**
 * Display the menu title as the page title.
 */
define('MENUTREE_TITLE_PAGE', 0x1);

/**
 * Display the menu title inline in the body of the page.
 */
define('MENUTREE_TITLE_BODY', 0x2);

/**
 * Implementation of hook_theme()
 */
function menutree_theme() {
  return array(
    'menutree_page' => array(
      'arguments' => array(
        'title' => NULL,
        'description' => NULL,
        'tree' => NULL,
      ),
      'file' => 'menutree.pages.inc',
    ),
    'menutree_tree' => array(
      'arguments' => array(
        'menu_name' => NULL,
      ),
    ),
  );
}

/**
 * Implementation of hook_perm().
 */
function menutree_perm() {
  return array(
    'view site tree',
    'administer menu tree',
  );
}

/**
 * Implementation of hook_menu().
 */
function menutree_menu() {
  $items = array();
  $items['menutree'] = array(
    'title' => 'Sitemap',
    'page callback' => 'menutree_display_page',
    'page arguments' => array(
      menu_load('primary-links'),
    ),
    'access arguments' => array(
      'view site tree',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'menutree.pages.inc',
  );
  $items['menutree/%menu'] = array(
    'title' => 'Sitemap',
    'page arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'view site tree',
    ),
    'file' => 'menutree.pages.inc',
  );
  $items['menutree/all'] = array(
    'title' => 'Sitemap',
    'page callback' => 'menutree_display_all',
    'page arguments' => array(),
    'access arguments' => array(
      'view site tree',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'menutree.pages.inc',
  );
  $items['admin/build/menutree'] = array(
    'title' => 'Menu trees',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'menutree_settings',
    ),
    'description' => 'Configure page titles and intro text for menu tree pages.',
    'access arguments' => array(
      'administer menu tree',
    ),
    'file' => 'menutree.admin.inc',
  );
  return $items;
}

Functions

Namesort descending Description
menutree_menu Implementation of hook_menu().
menutree_perm Implementation of hook_perm().
menutree_theme Implementation of hook_theme()

Constants

Namesort descending Description
MENUTREE_TITLE_BODY Display the menu title inline in the body of the page.
MENUTREE_TITLE_PAGE Display the menu title as the page title.