You are here

function fb_instant_articles_display_layout_form in Facebook Instant Articles 7

Same name and namespace in other branches
  1. 7.2 modules/fb_instant_articles_display/includes/view_mode_layout.inc \fb_instant_articles_display_layout_form()

Includes Facebook Instant Articles Display View Mode elements.

1 call to fb_instant_articles_display_layout_form()
fb_instant_articles_display_form_alter in modules/fb_instant_articles_display/fb_instant_articles_display.module
Implements hook_form_alter().

File

modules/fb_instant_articles_display/includes/view_mode_layout.inc, line 11
View mode layout functions for Facebook Instant Articles Display.

Code

function fb_instant_articles_display_layout_form(&$form, &$form_state) {

  // Get the entity_type, bundle and view mode.
  $entity_type = $form['#entity_type'];
  $bundle_name = $form['#bundle'];
  $view_mode = $form['#view_mode'];
  $form['#export_id'] = $entity_type . '|' . $bundle_name . '|' . $view_mode;
  $layout = fb_instant_articles_display_get_node_layout_settings($bundle_name);
  $form['#fbia_layout'] = $layout;
  fb_instant_articles_display_field_ui_fields($entity_type, $bundle_name, $view_mode, $form, $form_state);

  // Attach js.
  $form['#attached']['js'][] = drupal_get_path('module', 'fb_instant_articles_display') . '/js/admin.js';

  // Add process function to add the regions.
  $form['#process'][] = 'fb_instant_articles_display_add_regions';

  // Add submit handler. Layout needs be first so
  // we can reset the type key for Field API fields.
  $submit = $form['#submit'];
  $form['#submit'] = array(
    'fb_instant_articles_display_field_ui_layouts_save',
  );
  $form['#submit'] = array_merge($form['#submit'], $submit);
}