You are here

function customfilter_menu in Custom filter 7

Same name and namespace in other branches
  1. 5 customfilter.module \customfilter_menu()
  2. 6 customfilter.module \customfilter_menu()
  3. 7.2 customfilter.module \customfilter_menu()

Implements hook_menu().

This function set which action we do on a path

Return value

array An array with the paths we want and what to do on it

File

./customfilter.module, line 188
Allows the users with the right permission to define custom filters.

Code

function customfilter_menu() {
  $access = array(
    'administer customfilter',
  );
  $items = array();
  $items['admin/config/content/customfilter'] = array(
    'title' => 'Custom filters',
    'description' => 'Allow the users to define custom filters.',
    'page callback' => 'customfilter_settings',
    'access arguments' => $access,
  );
  $items['admin/config/content/customfilter/list'] = array(
    'title' => 'Filters',
    'access arguments' => $access,
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items['admin/config/content/customfilter/add'] = array(
    'title' => 'Add filter',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_filter_add',
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/content/customfilter/tools'] = array(
    'title' => 'Tools',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_export_form',
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/content/customfilter/tools/export'] = array(
    'title' => 'Export',
    'access arguments' => $access,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/content/customfilter/tools/import'] = array(
    'title' => 'Import',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_import_form',
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/content/customfilter/%'] = array(
    'title' => 'Rules',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_rules_form',
      4,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/customfilter/%/list'] = array(
    'title' => 'List rules',
    'access arguments' => $access,
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items['admin/config/content/customfilter/%/edit'] = array(
    'title' => 'Edit filter',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_filter_edit',
      4,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/customfilter/%/delete'] = array(
    'title' => 'Delete filter',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_filter_delete',
      4,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
    'weight' => 2,
  );
  $items['admin/config/content/customfilter/%/add'] = array(
    'title' => 'Add rule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_rule_edit',
      'add',
      4,
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  $items['admin/config/content/customfilter/%/%'] = array(
    'title' => 'Edit rule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_rule_edit',
      'edit',
      4,
      5,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/customfilter/%/%/edit'] = array(
    'title' => 'Edit rule',
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
    'weight' => -1,
  );
  $items['admin/config/content/customfilter/%/%/delete'] = array(
    'title' => 'Delete rule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_rule_delete',
      5,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/customfilter/%/%/add'] = array(
    'title' => 'Add subrule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'customfilter_rule_edit',
      'add',
      4,
      5,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  return $items;
}