You are here

mmenu.api.php in Mobile sliding menu 7

Same filename and directory in other branches
  1. 8 mmenu.api.php
  2. 7.3 mmenu.api.php
  3. 7.2 mmenu.api.php

Hooks provided by mmenu module.

File

mmenu.api.php
View source
<?php

/**
 * @file
 * Hooks provided by mmenu module.
 */

/**
 * Allows modules to add more mmenus.
 */
function hook_mmenu() {
  $module_path = drupal_get_path('module', 'mmenu');
  return array(
    'mmenu_left' => array(
      'enabled' => TRUE,
      'name' => 'mmenu_left',
      'title' => t('Left menu'),
      'blocks' => array(
        array(
          'title' => t('Main menu'),
          'module' => 'system',
          'delta' => 'main-menu',
          'collapsed' => FALSE,
          'wrap' => FALSE,
        ),
        array(
          'title' => t('Management'),
          'module' => 'system',
          'delta' => 'management',
          'collapsed' => FALSE,
          'wrap' => FALSE,
          'menu_parameters' => array(
            'min_depth' => 2,
          ),
        ),
      ),
      'options' => array(
        'position' => 'left',
        'classes' => 'mm-light',
      ),
      'configurations' => array(),
      // Adds your own CSS or JS handlers if you want.
      'custom' => array(
        'css' => array(
          $module_path . '/examples/css/mmenu_example.custom.css',
        ),
        'js' => array(
          $module_path . '/examples/js/mmenu_example.custom.js',
        ),
      ),
    ),
  );
}

/**
 * Allows modules to alter mmenu settings.
 */
function hook_mmenu_alter(&$mmenus) {
  $mmenus['mmenu_left']['enabled'] = FALSE;
}

/**
 * Allows modules to add more mmenu classes.
 */
function hook_mmenu_class() {
  $module_path = drupal_get_path('module', 'mmenu');
  return array(
    'mm-basic' => array(
      'name' => 'mm-basic',
      'title' => t('mm-basic'),
      'css' => array(
        $module_path . '/classes/mm-basic/css/mm-basic.css',
      ),
    ),
  );
}

/**
 * Allows modules to alter mmenu class settings.
 */
function hook_mmenu_class_alter(&$classes) {
  $module_path = drupal_get_path('module', 'mmenu');
  $classes['mm-basic']['css'] = array(
    $module_path . '/classes/mm-basic/css/custom.css',
  );
}

/**
 * Allows modules to add more mmenu effects.
 */
function hook_mmenu_effect() {
  $module_path = drupal_get_path('module', 'mmenu');
  return array(
    'mm-slide' => array(
      'name' => 'mm-slide',
      'title' => t('mm-slide'),
      'css' => array(
        $module_path . '/effects/mm-slide/css/mm-slide.css',
      ),
    ),
  );
}

/**
 * Allows modules to alter mmenu effect settings.
 */
function hook_mmenu_effect_alter(&$effects) {
  $module_path = drupal_get_path('module', 'mmenu');
  $classes['mm-slide']['css'] = array(
    $module_path . '/effects/mm-slide/css/custom.css',
  );
}

Functions

Namesort descending Description
hook_mmenu Allows modules to add more mmenus.
hook_mmenu_alter Allows modules to alter mmenu settings.
hook_mmenu_class Allows modules to add more mmenu classes.
hook_mmenu_class_alter Allows modules to alter mmenu class settings.
hook_mmenu_effect Allows modules to add more mmenu effects.
hook_mmenu_effect_alter Allows modules to alter mmenu effect settings.