You are here

function sms_user_menu in SMS Framework 5

Same name and namespace in other branches
  1. 6.2 modules/sms_user/sms_user.module \sms_user_menu()
  2. 6 modules/sms_user/sms_user.module \sms_user_menu()
  3. 7 modules/sms_user/sms_user.module \sms_user_menu()

Implementation of hook_menu().

File

modules/sms_user/sms_user.module, line 42
Provides integration between the SMS Framework and Drupal users.

Code

function sms_user_menu($may_cache) {
  global $user;
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/smsframework/sms_user',
      'title' => t('SMS User'),
      'description' => t('Edit options for SMS and user integration.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'sms_user_admin_settings',
      ),
      'access' => user_access('administer sms_user'),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  else {
    if (arg(0) == 'user' && is_numeric(arg(1))) {
      $items[] = array(
        'path' => 'user/' . arg(1) . '/mobile',
        'title' => t('Mobile settings'),
        'callback' => 'sms_user_settings',
        'callback arguments' => array(
          'sms_user_form',
        ),
        'access' => user_access('administer users') || $user->uid == arg(1),
        'type' => MENU_LOCAL_TASK,
      );
    }
  }
  return $items;
}