You are here

public function EntityformTypeUIController::hook_menu in Entityform 7

Same name and namespace in other branches
  1. 7.2 entityform_type.admin.inc \EntityformTypeUIController::hook_menu()

Overrides hook_menu() defaults.

Overrides EntityDefaultUIController::hook_menu

File

./entityform_type.admin.inc, line 16
Entityform type editing UI.

Class

EntityformTypeUIController
UI controller.

Code

public function hook_menu() {
  $items = parent::hook_menu();
  $items[$this->path]['description'] = 'Manage entityform entity types, including adding and removing fields and the display of fields.';
  $items[$this->path]['type'] = MENU_NORMAL_ITEM;
  $items[$this->path . '/manage/%entity_object/edit']['context'] = MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE;
  $rule_types = _entityform_get_rule_types();
  foreach ($rule_types as $rule_type) {

    // Add the menu items for the various Rules forms.
    $controller = new RulesUIController();
    $rule_path = $this->path . "/{$rule_type}_rules";
    $items += $controller
      ->config_menu($rule_path);
    $items[$rule_path] = array(
      'title' => drupal_ucfirst($rule_type) . ' Rules',
      'description' => '',
      'page callback' => 'entityform_type_rules_list',
      'page arguments' => array(
        $rule_type,
      ),
      'access arguments' => array(
        'administer entityform types',
      ),
      'file path' => drupal_get_path('module', 'entityform'),
      'file' => 'entityform_type.admin.inc',
      'type' => MENU_LOCAL_TASK,
    );
    $items["{$rule_path}/add"] = array(
      'title' => "Add a {$rule_type} rule",
      'description' => "Adds an additional {$rule_type} rule configuration.",
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        "entityform_add_{$rule_type}_rule_form",
        $rule_path,
      ),
      'access arguments' => array(
        'administer entityform types',
      ),
      'file path' => drupal_get_path('module', 'rules_admin'),
      'file' => 'rules_admin.inc',
      'type' => MENU_LOCAL_ACTION,
    );
  }
  return $items;
}