public function EntityformUIController::hook_menu in Entityform 7
Same name and namespace in other branches
- 7.2 entityform.admin.inc \EntityformUIController::hook_menu()
Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.
Overrides EntityDefaultUIController::hook_menu
File
- ./
entityform.admin.inc, line 21 - Entityform editing UI.
Class
- EntityformUIController
- UI controller.
Code
public function hook_menu() {
//$entityform_base_path = variable_get('entityform_base_path', $)
$items = array();
$id_count = count(explode('/', $this->path));
$front_id_count = count(explode('/', $this->entityInfo['admin ui']["front path"]));
$wildcard = isset($this->entityInfo['admin ui']['menu wildcard']) ? $this->entityInfo['admin ui']['menu wildcard'] : '%' . $this->entityType;
$items[$this->path] = array(
'title' => 'Entityforms',
'description' => 'Add edit and update entityforms.',
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array(
'access administration pages',
),
'file path' => drupal_get_path('module', 'system'),
'file' => 'system.admin.inc',
);
// Change the overview menu type for the list of entityforms.
$items[$this->path]['type'] = MENU_LOCAL_TASK;
$items['eform/submit/%entityform_empty'] = array(
'title callback' => 'entityform_page_title',
'title arguments' => array(
2,
1,
),
'page callback' => 'entityform_form_wrapper',
'page arguments' => array(
2,
'submit',
),
'access callback' => 'entityform_access',
'access arguments' => array(
'submit',
2,
),
'file' => 'entityform.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
'type' => MENU_CALLBACK,
);
$items['eform/%entityform_type/confirm'] = array(
'title callback' => 'entityform_type_page_title',
'title arguments' => array(
1,
'confirm',
),
'description' => '',
'page callback' => 'entityform_confirm_page',
'page arguments' => array(
1,
3,
),
'access callback' => 'entityform_access',
'access arguments' => array(
'confirm',
1,
),
);
$items['eform/%entityform_type/draft'] = array(
'title' => 'Form Saved',
'description' => '',
'page callback' => 'entityform_draft_page',
'page arguments' => array(
1,
),
'access callback' => TRUE,
'access arguments' => array(
'draft_save',
1,
),
);
$items['eform/%entityform_type/submissions'] = array(
'title callback' => 'entityform_type_page_title',
'title arguments' => array(
1,
'view submissions',
),
'description' => '',
'page callback' => 'entityform_submission_page',
'page arguments' => array(
1,
3,
'user',
),
'access arguments' => array(
'view own entityform',
),
);
$types = array_keys(entityform_get_types());
$controller = entity_ui_controller('entityform');
// Loading and editing entityform entities
$items['entityform/' . $wildcard] = array(
'page callback' => 'entityform_form_wrapper',
'page arguments' => array(
$id_count + 1,
),
'access callback' => 'entityform_access',
'access arguments' => array(
'edit',
$id_count + 1,
),
'weight' => 0,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'file' => 'entityform.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
);
$items['entityform/' . $wildcard . '/edit'] = array(
'title' => 'Edit',
'page callback' => 'entityform_form_wrapper',
'page arguments' => array(
1,
'edit',
),
'access callback' => 'entityform_access',
'access arguments' => array(
'edit',
1,
),
'weight' => 0,
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'file' => 'entityform.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
);
$items['entityform/' . $wildcard . '/delete'] = array(
'title' => 'Delete',
'page callback' => 'entityform_delete_form_wrapper',
'page arguments' => array(
1,
),
'access callback' => 'entityform_access',
'access arguments' => array(
'delete',
1,
),
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'weight' => 10,
'file' => 'entityform.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
);
// Menu item for viewing entityforms
$items['entityform/' . $wildcard] = array(
//'title' => 'Title',
'title callback' => 'entityform_page_title',
'title arguments' => array(
1,
),
'page callback' => 'entityform_page_view',
'page arguments' => array(
1,
),
'access callback' => 'entityform_access',
'access arguments' => array(
'view',
1,
),
'type' => MENU_CALLBACK,
);
$items['entityform/' . $wildcard . '/view'] = array(
'title' => 'View',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
return $items;
}