You are here

class EntityformTypeUIController in Entityform 7

Same name and namespace in other branches
  1. 7.2 entityform_type.admin.inc \EntityformTypeUIController

UI controller.

Hierarchy

Expanded class hierarchy of EntityformTypeUIController

1 string reference to 'EntityformTypeUIController'
entityform_entity_info in ./entityform.module
Implement hook_entity_info().

File

./entityform_type.admin.inc, line 11
Entityform type editing UI.

View source
class EntityformTypeUIController extends EntityDefaultUIController {

  /**
   * Overrides hook_menu() defaults.
   */
  public function hook_menu() {
    $items = parent::hook_menu();
    $items[$this->path]['description'] = 'Manage entityform entity types, including adding and removing fields and the display of fields.';
    $items[$this->path]['type'] = MENU_NORMAL_ITEM;
    $items[$this->path . '/manage/%entity_object/edit']['context'] = MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE;
    $rule_types = _entityform_get_rule_types();
    foreach ($rule_types as $rule_type) {

      // Add the menu items for the various Rules forms.
      $controller = new RulesUIController();
      $rule_path = $this->path . "/{$rule_type}_rules";
      $items += $controller
        ->config_menu($rule_path);
      $items[$rule_path] = array(
        'title' => drupal_ucfirst($rule_type) . ' Rules',
        'description' => '',
        'page callback' => 'entityform_type_rules_list',
        'page arguments' => array(
          $rule_type,
        ),
        'access arguments' => array(
          'administer entityform types',
        ),
        'file path' => drupal_get_path('module', 'entityform'),
        'file' => 'entityform_type.admin.inc',
        'type' => MENU_LOCAL_TASK,
      );
      $items["{$rule_path}/add"] = array(
        'title' => "Add a {$rule_type} rule",
        'description' => "Adds an additional {$rule_type} rule configuration.",
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
          "entityform_add_{$rule_type}_rule_form",
          $rule_path,
        ),
        'access arguments' => array(
          'administer entityform types',
        ),
        'file path' => drupal_get_path('module', 'rules_admin'),
        'file' => 'rules_admin.inc',
        'type' => MENU_LOCAL_ACTION,
      );
    }
    return $items;
  }
  protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {
    $row = parent::overviewTableRow($conditions, $id, $entity, $additional_cols);
    $row[] = l(t('Submissions'), $this->path . '/manage/' . $id . '/submissions');
    $row[] = l(t('Submit Link'), entity_ui_controller('entityform')
      ->submit_path($id));
    return $row;
  }
  public function overviewTable($conditions = array()) {
    $render = parent::overviewTable($conditions);
    $render['#header'][] = t('Submissions');
    $render['#header'][] = t('Submit Link');
    return $render;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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::overviewTableHeaders protected function Generates the table headers for the overview table.
EntityDefaultUIController::__construct public function
EntityformTypeUIController::hook_menu public function Overrides hook_menu() defaults. Overrides EntityDefaultUIController::hook_menu
EntityformTypeUIController::overviewTable public function Generates the render array for a overview table for arbitrary entities matching the given conditions. Overrides EntityDefaultUIController::overviewTable
EntityformTypeUIController::overviewTableRow protected function Generates the row for the passed entity and may be overridden in order to customize the rows. Overrides EntityDefaultUIController::overviewTableRow