You are here

function ctools_export_ui_entity_embed::edit_form in Entity Embed 7.2

Same name and namespace in other branches
  1. 7.3 plugins/export_ui/ctools_export_ui_entity_embed.class.php \ctools_export_ui_entity_embed::edit_form()
  2. 7 plugins/export_ui/ctools_export_ui_entity_embed.class.php \ctools_export_ui_entity_embed::edit_form()

Provide the actual editing form.

Overrides ctools_export_ui::edit_form

File

plugins/export_ui/ctools_export_ui_entity_embed.class.php, line 15
Definition of ctools_export_ui_entity_embed.class.php.

Class

ctools_export_ui_entity_embed
Export UI for entity_embed buttons.

Code

function edit_form(&$form, &$form_state) {
  parent::edit_form($form, $form_state);
  $preset = $form_state['item'];

  // Determine the currently selected entity type.
  $selected = isset($form_state['values']['entity_type']) ? $form_state['values']['entity_type'] : $preset->entity_type;

  // Disable form submission if an entity type has not been selected.
  if (empty($selected)) {
    $form['buttons']['submit']['#disabled'] = TRUE;
  }

  // Wrap the submit button in markup to allow it to be targeted with JS.
  $form['buttons']['submit']['#prefix'] = '<span id="save-button">';
  $form['buttons']['submit']['#suffix'] = '</span>';
}