Projet

Général

Profil

Paste
Télécharger (1,83 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / dhtml_menu / dhtml_menu.module @ bad4e148

1
<?php
2

    
3

    
4
/**
5
 * @file dhtml_menu.module
6
 * Initialization and various hook implementations.
7
 */
8

    
9
require_once 'dhtml_menu.theme.inc';
10

    
11
/**
12
 * Implementation of hook_help().
13
 */
14
function dhtml_menu_help($path) {
15
  switch ($path) {
16
    case 'admin/config/user-interface/dhtml_menu':
17
      $text = '<p>' . t('DHTML Menu adds dynamic functionality to the menus of your site. Ordinarily, reaching the child elements below an item requires you to visit its page. With this module enabled, clicking on an item with child elements will expand it without leaving the page, saving you the time of waiting for the page to load.') . '</p>';
18
      $text .= '<p>' . t('<strong>Note:</strong> Links that gain a dynamic Javascript effect naturally stop working as normal links. Since you will still need to visit a page that has sub-items (like the <a href="@url">main administration page</a>), this module provides several different options for static and dynamic navigation to coexist.', array('@url' => url('admin'))) . '</p>';
19
      return $text;
20
  }
21
}
22

    
23
/**
24
 * Implementation of hook_init().
25
 * Adds CSS, Javascript and settings to the page.
26
 */
27
function dhtml_menu_init() {
28
  drupal_add_css(drupal_get_path('module', 'dhtml_menu') . '/dhtml_menu.css');
29
  drupal_add_js(drupal_get_path('module', 'dhtml_menu') . '/dhtml_menu.js');
30
  drupal_add_js(array('dhtmlMenu' => variable_get('dhtml_menu_settings')), 'setting');
31
}
32

    
33
/**
34
 * Implementation of hook_menu().
35
 * Adds a settings page.
36
 */
37
function dhtml_menu_menu() {
38
  $menu['admin/config/user-interface/dhtml_menu'] = array(
39
    'title' => 'DHTML Menu',
40
    'description' => 'Configure the behavior of DHTML Menu.',
41
    'page callback' => 'drupal_get_form',
42
    'page arguments' => array('dhtml_menu_settings'),
43
    'access arguments' => array('administer site configuration'),
44
    'file' => 'dhtml_menu.admin.inc',
45
  );
46
  return $menu;
47
}
48