You are here

public function PanelizerEntityFile::hook_form_alter in File Entity (fieldable files) 7.2

Same name and namespace in other branches
  1. 7.3 plugins/entity/PanelizerEntityFile.class.php \PanelizerEntityFile::hook_form_alter()

Implements a delegated hook_form_alter.

We want to add Panelizer settings for the bundle to the file type form.

File

plugins/entity/PanelizerEntityFile.class.php, line 106
Class for the Panelizer file entity plugin.

Class

PanelizerEntityFile
Panelizer Entity file plugin class.

Code

public function hook_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'file_entity_file_type_form') {
    if (isset($form['#file_type'])) {
      $bundle = $form['#file_type']->type;
      $this
        ->add_bundle_setting_form($form, $form_state, $bundle, array(
        'machine_name',
      ));
    }
  }
}