You are here

public function RulesLinkUIController::hook_menu in Rules Link 7.2

Same name and namespace in other branches
  1. 7 rules_link.admin.inc \RulesLinkUIController::hook_menu()

Overrides EntityDefaultUIController::hook_menu() defaults.

Overrides EntityDefaultUIController::hook_menu

File

./rules_link.admin.inc, line 16
Generate a admin UI.

Class

RulesLinkUIController
UI controller.

Code

public function hook_menu() {
  $items = parent::hook_menu();
  $id_count = count(explode('/', $this->path));
  $wildcard = isset($this->entityInfo['admin ui']['menu wildcard']) ? $this->entityInfo['admin ui']['menu wildcard'] : '%entity_object';
  $items[$this->path]['description'] = 'Manage links that trigger rules.';
  $items[$this->path . '/manage/' . $wildcard . '/components'] = array(
    'title' => t('Configure rules'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'rules_link_component_form',
      $this->entityType,
      $id_count + 1,
    ),
    'load arguments' => array(
      $this->entityType,
    ),
    'access callback' => 'entity_access',
    'access arguments' => array(
      'update',
      $this->entityType,
      $id_count + 1,
    ),
    'file' => 'rules_link.admin.inc',
    'file path' => drupal_get_path('module', 'rules_link'),
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  return $items;
}