class CaseTrackerProjectUIController in Case Tracker 7.2
UI controller.
Hierarchy
- class \EntityDefaultUIController
Expanded class hierarchy of CaseTrackerProjectUIController
1 string reference to 'CaseTrackerProjectUIController'
File
- includes/
controller/ ui/ CaseTrackerProjectUIController.inc, line 6
View source
class CaseTrackerProjectUIController extends EntityDefaultUIController {
/**
* Overrides hook_menu() defaults. Main reason for doing this is that
* parent class hook_menu() is optimized for entity type administration.
*/
public function hook_menu() {
$items = array();
$wildcard = isset($this->entityInfo['admin ui']['menu wildcard']) ? $this->entityInfo['admin ui']['menu wildcard'] : '%' . $this->entityType;
$operations_path = 'projects';
// Change the add page menu to multiple types of entities
$items[$operations_path . '/add'] = array(
'title' => t('Add a project'),
'description' => t('Add a new project'),
'page callback' => 'casetracker_project_add_page',
'access callback' => 'casetracker_project_access',
'access arguments' => array(
'edit',
),
'type' => MENU_NORMAL_ITEM,
'weight' => 20,
'file' => 'casetracker_project.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
);
// Add menu items to add each different type of entity.
foreach (casetracker_project_get_types() as $type) {
$items[$operations_path . '/add/' . $type->type] = array(
'title' => t('Add @bundle', array(
'@bundle' => $type->label,
)),
'page callback' => 'casetracker_project_form_wrapper',
'page arguments' => array(
casetracker_project_create(array(
'type' => $type->type,
)),
),
'access callback' => 'casetracker_project_access',
'access arguments' => array(
'edit',
'edit ' . $type->type,
),
'file' => 'casetracker_project.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
);
}
$project_path = 'project';
$items[$project_path . '/' . $wildcard . '/edit'] = array(
'title' => t('Edit'),
'page callback' => 'casetracker_project_form_wrapper',
'page arguments' => array(
1,
),
'access callback' => 'casetracker_project_access',
'access arguments' => array(
'edit',
1,
),
'type' => MENU_LOCAL_TASK,
'weight' => 0,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
);
$items[$project_path . '/' . $wildcard . '/delete'] = array(
'title' => t('Delete'),
'page callback' => 'casetracker_project_delete_form_wrapper',
'page arguments' => array(
1,
),
'access callback' => 'casetracker_project_access',
'access arguments' => array(
'edit',
1,
),
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_INLINE,
'weight' => 10,
'file' => 'casetracker_project.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
);
// Menu item for viewing casetracker_projects
$items[$project_path . '/' . $wildcard] = array(
'page callback' => 'casetracker_project_page_view',
'page arguments' => array(
1,
),
'access callback' => 'casetracker_project_access',
'access arguments' => array(
'view',
1,
),
);
$items[$project_path . '/' . $wildcard . '/view'] = array(
'title' => t('View'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
return $items;
}
/**
* Create the markup for the add CaseTrackerProject Entities page within the class
* so it can easily be extended/overriden.
*/
public function addPage() {
$item = menu_get_item();
$content = system_admin_menu_block($item);
if (count($content) == 0) {
drupal_set_message(t('There isn\'t any Project Type configured. To setup now, go to the <a href="@link">@link_text</a>.', array(
'@link' => base_path() . 'admin/structure/casetracker/project-types',
'@link_text' => 'administrative page',
)), 'error');
}
if (count($content) == 1) {
$item = array_shift($content);
drupal_goto($item['href']);
}
return theme('casetracker_project_add_list', array(
'content' => $content,
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CaseTrackerProjectUIController:: |
public | function | Create the markup for the add CaseTrackerProject Entities page within the class so it can easily be extended/overriden. | |
CaseTrackerProjectUIController:: |
public | function |
Overrides hook_menu() defaults. Main reason for doing this is that
parent class hook_menu() is optimized for entity type administration. Overrides EntityDefaultUIController:: |
|
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
public | property | Defines the number of entries to show per page in overview table. | |
EntityDefaultUIController:: |
public | function | Applies an operation to the given entity. | |
EntityDefaultUIController:: |
public | function | Entity submit builder invoked via entity_ui_form_submit_build_entity(). | |
EntityDefaultUIController:: |
public | function | Provides definitions for implementing hook_forms(). | |
EntityDefaultUIController:: |
protected | function | Returns the operation count for calculating colspans. | |
EntityDefaultUIController:: |
public | function | Builds the operation form. | |
EntityDefaultUIController:: |
public | function | Operation form submit callback. | 1 |
EntityDefaultUIController:: |
public | function | Operation form validation callback. | |
EntityDefaultUIController:: |
public | function | Builds the entity overview form. | |
EntityDefaultUIController:: |
public | function | Overview form submit callback. | |
EntityDefaultUIController:: |
public | function | Overview form validation callback. | |
EntityDefaultUIController:: |
public | function | Generates the render array for a overview table for arbitrary entities matching the given conditions. | |
EntityDefaultUIController:: |
protected | function | Generates the table headers for the overview table. | |
EntityDefaultUIController:: |
protected | function | Generates the row for the passed entity and may be overridden in order to customize the rows. | |
EntityDefaultUIController:: |
public | function |