You are here

function panopoly_widgets_fieldable_panel_pane_pre_render in Panopoly Widgets 7

Implement the "Content Settings" fieldset in a pre-render. This fixes issues with image caused by initially doing this in a form_alter.

See also

http://drupal.org/node/1567704

1 string reference to 'panopoly_widgets_fieldable_panel_pane_pre_render'
panopoly_widgets_form_alter in ./panopoly_widgets.module
Implementation of hook_form_alter()

File

./panopoly_widgets.module, line 356

Code

function panopoly_widgets_fieldable_panel_pane_pre_render($element) {

  // Add a content settings fieldset.
  $element['content_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content Settings'),
    '#weight' => 1,
  );

  // Add any remaining fields to the content settings fieldset.
  foreach ($element as $key => $value) {
    if (substr($key, 0, 6) == 'field_' || $key == 'body') {
      $element['content_settings'][$key] = $value;
      unset($element[$key]);
    }
  }
  return $element;
}