You are here

class ConfigPagesUIController in Config Pages 7

UI controller.

Hierarchy

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

Namesort descending Modifiers Type Description Overrides
ConfigPagesUIController::addPage public function Create the markup for the add ConfigPages Entities page within the class so it can easily be extended/overriden.
ConfigPagesUIController::hook_menu 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::hook_menu
EntityDefaultUIController::$entityInfo protected property
EntityDefaultUIController::$entityType protected property
EntityDefaultUIController::$id_count protected property
EntityDefaultUIController::$overviewPagerLimit public property Defines the number of entries to show per page in overview table.
EntityDefaultUIController::applyOperation public function Applies an operation to the given entity.
EntityDefaultUIController::entityFormSubmitBuildEntity public function Entity submit builder invoked via entity_ui_form_submit_build_entity().
EntityDefaultUIController::hook_forms public function Provides definitions for implementing hook_forms().
EntityDefaultUIController::operationCount protected function Returns the operation count for calculating colspans.
EntityDefaultUIController::operationForm public function Builds the operation form.
EntityDefaultUIController::operationFormSubmit public function Operation form submit callback. 1
EntityDefaultUIController::operationFormValidate public function Operation form validation callback.
EntityDefaultUIController::overviewForm public function Builds the entity overview form.
EntityDefaultUIController::overviewFormSubmit public function Overview form submit callback.
EntityDefaultUIController::overviewFormValidate public function Overview form validation callback.
EntityDefaultUIController::overviewTable public function Generates the render array for a overview table for arbitrary entities matching the given conditions.
EntityDefaultUIController::overviewTableHeaders protected function Generates the table headers for the overview table.
EntityDefaultUIController::overviewTableRow protected function Generates the row for the passed entity and may be overridden in order to customize the rows.
EntityDefaultUIController::__construct public function