You are here

function mmenu_menu in Mobile sliding menu 7.2

Same name and namespace in other branches
  1. 7.3 mmenu.module \mmenu_menu()
  2. 7 mmenu.module \mmenu_menu()

Implements hook_menu().

File

./mmenu.module, line 233
Primarily Drupal hooks and global API functions to manipulate mmenus.

Code

function mmenu_menu() {
  $mmenus = mmenu_list();
  $items['admin/config/mmenu'] = array(
    'title' => 'Mobile sliding menu',
    'page callback' => 'mmenu_admin_settings',
    'access arguments' => array(
      'administer mmenu',
    ),
    'file' => 'mmenu.admin.inc',
  );
  $count = 0;
  foreach ($mmenus as $mmenu) {
    if ($count == 0) {
      $items['admin/config/mmenu']['page arguments'] = array(
        $mmenu['name'],
      );
    }
    $items['admin/config/mmenu/' . $mmenu['name']] = array(
      'title' => $mmenu['title'],
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'mmenu_admin_settings_form',
        $mmenu['name'],
      ),
      'access arguments' => array(
        'administer mmenu',
      ),
      'file' => 'mmenu.admin.inc',
      'type' => MENU_LOCAL_TASK,
      'weight' => $count++,
    );
  }
  return $items;
}