public function ContentTypeGroupUIController::hook_menu in Content type groups 7.2
Overrides hook_menu() defaults.
Overrides EntityDefaultUIController::hook_menu
File
- ./
content_type_groups.controller.inc, line 15 - Contains controllers and entity hooks for the content_type_group entity.
Class
- ContentTypeGroupUIController
- UI controller for Content Type Group.
Code
public function hook_menu() {
$items = parent::hook_menu();
$wildcard = '%content_type_group';
// List of all CTGs
$items[$this->path] = array(
'title' => 'Content type groups',
'description' => 'Manage content type groups',
'page callback' => 'content_type_groups_admin',
'file' => 'content_type_groups.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
'access arguments' => array(
'administer content types',
),
// This permission is good enough for now. Does it really need a separate permission, honestly?
'type' => MENU_LOCAL_ACTION,
);
// Add new CTG
$items[$this->path . '/add'] = array(
'title' => 'Add content type group',
'description' => 'Add a new content type group',
'page callback' => 'content_type_groups_admin_add_page',
'file' => 'content_type_groups.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
'type' => MENU_LOCAL_ACTION,
'access arguments' => array(
'administer content types',
),
);
// Edit existing CTG
$items[$this->path . '/' . $wildcard . '/edit'] = array(
'title' => 'Edit content type group',
'description' => 'Edit an existing content type group',
'load arguments' => array(
TRUE,
),
'page callback' => 'entity_ui_get_form',
'page arguments' => array(
'content_type_group',
4,
),
'file' => 'content_type_groups.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
'access arguments' => array(
'administer content types',
),
);
// Delete existing CTG
$items[$this->path . '/' . $wildcard . '/delete'] = array(
'title' => 'Delete content type group',
'description' => 'Delete an existing content type group',
'load arguments' => array(
TRUE,
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'content_type_group_form_delete_confirm',
4,
),
'file' => 'content_type_groups.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
'access arguments' => array(
'administer content types',
),
);
return $items;
}