You are here

function custom_formatters_menu in Custom Formatters 6

Same name and namespace in other branches
  1. 7.2 custom_formatters.module \custom_formatters_menu()

Implements hook_menu().

File

./custom_formatters.module, line 111
Contains core functions for the Custom Formatters module.

Code

function custom_formatters_menu() {
  $items = array();

  // Formatters overview.
  $items['admin/build/formatters'] = array(
    'title' => 'Formatters',
    'description' => 'Manage custom formatter templates.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_overview',
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
  );
  $items['admin/build/formatters/list'] = array(
    'title' => 'List',
    'description' => 'Manage custom formatter templates.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );

  // Add new formatter.
  $items['admin/build/formatters/add'] = array(
    'title' => 'Add new formatter',
    'description' => 'Add a custom formatter.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_formatter_form',
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_LOCAL_TASK,
  );

  // Edit formatter.
  $items['admin/build/formatters/edit/%custom_formatters_name'] = array(
    'title callback' => 'custom_formatters_formatter_title_callback',
    'title arguments' => array(
      'Edit formatter: !name',
      4,
    ),
    'description' => 'Edit a custom formatter.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_formatter_form',
      4,
      'edit',
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );

  // Delete formatter.
  $items['admin/build/formatters/delete/%custom_formatters_name'] = array(
    'title callback' => 'custom_formatters_formatter_title_callback',
    'title arguments' => array(
      'Delete formatter: !name',
      4,
    ),
    'description' => 'Delete a custom formatter.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_formatter_delete_form',
      4,
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );

  // Clone formatter.
  $items['admin/build/formatters/clone/%custom_formatters_name'] = array(
    'title callback' => 'custom_formatters_formatter_title_callback',
    'title arguments' => array(
      'Clone formatter: !name',
      4,
    ),
    'description' => 'Clone a custom formatter.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_formatter_form',
      4,
      'clone',
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );

  // Export formatter.
  $items['admin/build/formatters/export/%custom_formatters_name'] = array(
    'title callback' => 'custom_formatters_formatter_title_callback',
    'title arguments' => array(
      'Export formatter: !name',
      4,
    ),
    'description' => 'Export a custom formatter.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_formatter_export_form',
      4,
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/build/formatters/download/%'] = array(
    'title' => 'Download module',
    'description' => 'Download exported custom formatter(s).',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'custom_formatters_formatter_export_tar',
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );

  // Convert 'basic' formatter.
  $items['admin/build/formatters/convert/%custom_formatters_name'] = array(
    'title callback' => 'custom_formatters_formatter_title_callback',
    'title arguments' => array(
      'Convert formatter: !name',
      4,
    ),
    'description' => 'Convert a custom formatter.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_formatter_convert_form',
      4,
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );

  // Toggle formatters status.
  $items['admin/build/formatters/status/%custom_formatters_name'] = array(
    'title callback' => 'custom_formatters_formatter_title_callback',
    'title arguments' => array(
      '!status formatter: !name',
      4,
    ),
    'description' => 'Toggle a custom formatters status.',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_formatter_status_form',
      4,
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );

  // Formatter settings.
  $items['admin/build/formatters/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'custom_formatters_settings_form',
    ),
    'access arguments' => array(
      'administer custom formatters',
    ),
    'file' => 'custom_formatters.admin.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['js/formatters/autocomplete'] = array(
    'title' => 'Formatters autocomplete',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'custom_formatters_autocomplete',
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['js/formatters/tokens'] = array(
    'title' => 'Formatters tokens',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'custom_formatters_token_tree',
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['js/formatters/preview'] = array(
    'title' => 'Formatters preview',
    'file' => 'custom_formatters.admin.inc',
    'page callback' => 'custom_formatters_preview',
    'access arguments' => array(
      'administer custom formatters',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}