You are here

public function BootstrapTourStepInlineEntityFormController::entityForm in Bootstrap Tour 7.2

Overrides EntityInlineEntityFormController::entityForm().

Overrides EntityInlineEntityFormController::entityForm

File

includes/bootstrap_tour.controller.inc, line 157
Defines the inline entity form controller for BootstrapTourStep entities.

Class

BootstrapTourStepInlineEntityFormController
Class BootstrapTourStepInlineEntityFormController

Code

public function entityForm($entity_form, &$form_state) {
  $step = $entity_form['#entity'];
  $entity_form['path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path'),
    '#description' => t('Upon which path should this step be displayed? If subsequent steps will use the same path as previous step(s), you can leave this blank. Enter <front> for the front page.'),
    '#default_value' => !empty($step->path) ? $step->path : '',
  );
  $entity_form['selector'] = array(
    '#type' => 'textfield',
    '#title' => t('CSS Selector'),
    '#size' => 50,
    '#maxlength' => 255,
    '#default_value' => !empty($step->selector) ? $step->selector : '',
  );
  $entity_form['placement'] = array(
    '#type' => 'select',
    '#title' => t('Placement'),
    '#options' => array(
      'top' => t('Top'),
      'bottom' => t('Bottom'),
      'left' => t('Left'),
      'right' => t('Right'),
    ),
    '#default_value' => !empty($step->placement) ? $step->placement : '',
  );
  $entity_form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Popup Title'),
    '#required' => TRUE,
    '#default_value' => !empty($step->title) ? $step->title : '',
  );
  $entity_form['content'] = array(
    '#type' => 'text_format',
    '#base_type' => 'textarea',
    '#title' => t('Popup Content'),
    '#format' => !empty($step->content_text_format) ? $step->content_text_format : NULL,
    '#default_value' => !empty($step->content) ? $step->content : '',
  );
  $langcode = entity_language('bootstrap_tour_step', $step);
  field_attach_form('bootstrap_tour_step', $step, $entity_form, $form_state, $langcode);
  return $entity_form;
}