You are here

function rules_admin_menu in Rules 7.2

Same name and namespace in other branches
  1. 6 rules_admin/rules_admin.module \rules_admin_menu()

Implements hook_menu().

File

rules_admin/rules_admin.module, line 11
Rules Admin User Interface.

Code

function rules_admin_menu() {

  // Reaction rules UI menu entries.
  $reaction_path = 'admin/config/workflow/rules/reaction';
  $items = rules_ui()
    ->config_menu($reaction_path);
  $items[$reaction_path] = array(
    'title' => 'Rules',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items[$reaction_path . '/add'] = array(
    'title' => 'Add new rule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_admin_add_reaction_rule',
      $reaction_path,
    ),
    'access arguments' => array(
      'administer rules',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'rules_admin.inc',
    'weight' => 0,
  );
  $items[$reaction_path . '/import'] = array(
    'title' => 'Import rule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_ui_import_form',
      $reaction_path,
    ),
    'access arguments' => array(
      'administer rules',
    ),
    'file' => 'ui/ui.forms.inc',
    'file path' => drupal_get_path('module', 'rules'),
    'type' => MENU_LOCAL_ACTION,
  );

  // Components UI menu entries.
  $component_path = 'admin/config/workflow/rules/components';
  $items += rules_ui()
    ->config_menu($component_path);
  $items[$component_path] = array(
    'title' => 'Components',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_admin_components_overview',
      $component_path,
    ),
    'access arguments' => array(
      'administer rules',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'rules_admin.inc',
    'weight' => 0,
  );
  $items[$component_path . '/add'] = array(
    'title' => 'Add new component',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_admin_add_component',
      $component_path,
    ),
    'access arguments' => array(
      'administer rules',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'rules_admin.inc',
    'weight' => 0,
  );
  $items[$component_path . '/import'] = array(
    'title' => 'Import component',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_ui_import_form',
      $component_path,
    ),
    'access arguments' => array(
      'administer rules',
    ),
    'file' => 'ui/ui.forms.inc',
    'file path' => drupal_get_path('module', 'rules'),
    'type' => MENU_LOCAL_ACTION,
  );

  // Some general rules admin menu items.
  $items['admin/config/workflow/rules'] = array(
    'title' => 'Rules',
    'position' => 'right',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_admin_reaction_overview',
      $reaction_path,
    ),
    'description' => 'Manage reaction rules and rule components.',
    'access arguments' => array(
      'administer rules',
    ),
    'file' => 'rules_admin.inc',
  );
  $items['admin/config/workflow/rules/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_admin_settings',
    ),
    'access arguments' => array(
      'administer rules',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'rules_admin.inc',
    'weight' => 1,
  );
  $items['admin/config/workflow/rules/settings/basic'] = array(
    'title' => 'Basic',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/workflow/rules/settings/advanced'] = array(
    'title' => 'Advanced',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_admin_settings_advanced',
    ),
    'access arguments' => array(
      'administer rules',
    ),
    'file' => 'rules_admin.inc',
  );
  return $items;
}