class ConfigPagesUIController in Config Pages 7
UI controller.
Hierarchy
- class \EntityDefaultUIController
- class \ConfigPagesUIController
Expanded class hierarchy of ConfigPagesUIController
1 string reference to 'ConfigPagesUIController'
- config_pages_entity_info in ./
config_pages.module - Implement hook_entity_info().
File
- ./
config_pages.admin.inc, line 14 - ConfigPages editing UI.
View source
class ConfigPagesUIController 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();
// Add menu items to each different type of entity.
foreach (config_pages_get_types() as $type) {
// For default local tasks we need to create a root element + local task.
if ($type->data['menu']['type'] == MENU_DEFAULT_LOCAL_TASK) {
$parts = explode('/', $type->data['menu']['path']);
$items[$type->data['menu']['path'] . '/' . array_pop($parts)] = array(
'title' => $type->label,
'type' => $type->data['menu']['type'],
'weight' => -10,
);
// This will create actual page later.
$type->data['menu']['type'] = MENU_NORMAL_ITEM;
}
// Create base item.
$items[$type->data['menu']['path']] = array(
'title' => $type->label,
'page callback' => 'config_pages_form_wrapper',
'page arguments' => array(
$type->type,
),
'access callback' => 'config_pages_access',
'access arguments' => array(
'edit',
'edit ' . $type->type,
),
'file' => 'config_pages.admin.inc',
'file path' => drupal_get_path('module', $this->entityInfo['module']),
'type' => $type->data['menu']['type'],
);
}
return $items;
}
/**
* Create the markup for the add ConfigPages 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) == 1) {
$item = array_shift($content);
drupal_goto($item['href']);
}
return theme('config_pages_add_list', array(
'content' => $content,
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigPagesUIController:: |
public | function | Create the markup for the add ConfigPages Entities page within the class so it can easily be extended/overriden. | |
ConfigPagesUIController:: |
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 |