You are here

function messaging_template_menu in Messaging 6.4

Same name and namespace in other branches
  1. 6.3 messaging_template/messaging_template.module \messaging_template_menu()

Implementation of hook_menu()

File

messaging_template/messaging_template.module, line 43
Drupal Messaging Framework - Messaging template

Code

function messaging_template_menu() {
  $items['admin/messaging/template'] = array(
    'title' => 'Message templates',
    'description' => 'Configuration of message templates',
    'page callback' => 'messaging_template_admin_template',
    'access callback' => 'messaging_template_access',
    'file' => 'messaging_template.admin.inc',
  );
  $default = language_default();
  $items['admin/messaging/template/edit/%messaging_template'] = array(
    'title' => 'Message templates',
    'page callback' => 'messaging_template_admin_template_edit',
    'page arguments' => array(
      4,
      $default->language,
    ),
    'type' => MENU_CALLBACK,
    'access callback' => 'messaging_template_access',
    'file' => 'messaging_template.admin.inc',
  );
  foreach (messaging_template_language_list() as $langcode => $name) {
    $items['admin/messaging/template/edit/%messaging_template/' . $langcode] = array(
      'title' => check_plain($name),
      'page callback' => 'messaging_template_admin_template_edit',
      'page arguments' => array(
        4,
        5,
      ),
      // Default language will be the default tab
      'type' => $default->language == $langcode ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
      'access callback' => 'messaging_template_access',
      'file' => 'messaging_template.admin.inc',
    );
  }
  return $items;
}