You are here

function message_subscribe_ui_menu in Message Subscribe 7

Implements hook_menu().

File

message_subscribe_ui/message_subscribe_ui.module, line 12

Code

function message_subscribe_ui_menu() {
  $items = array();
  $items['user/%user/message-subscribe'] = array(
    'title' => 'Subscriptions',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'message_subscribe_ui_tab',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'message_subscribe_ui_tab_access',
    'access arguments' => array(
      1,
    ),
  );
  foreach (array_keys(message_subscribe_flag_get_flags()) as $flag_name) {

    // Find the currect view name from a set variable, defaults according to the
    // flag's entity type, e.g. 'user' defaults to 'subscribe_user'.
    $items['user/%user/message-subscribe/' . $flag_name] = array(
      'title callback' => 'message_subscribe_ui_tab_title',
      'title arguments' => array(
        1,
        $flag_name,
      ),
      'page callback' => 'message_subscribe_ui_tab',
      'page arguments' => array(
        1,
        $flag_name,
      ),
      'access callback' => 'message_subscribe_ui_tab_access',
      'access arguments' => array(
        1,
        $flag_name,
      ),
      'type' => MENU_LOCAL_TASK,
    );
  }
  return $items;
}