You are here

function panopoly_magic_form_ctools_stylizer_edit_style_form_default_alter in Panopoly Magic 7

Implementation of hook_form_FORM_ID_alter().

Provide customizations for the ctools stylizer edit form.

File

./panopoly_magic.module, line 1426

Code

function panopoly_magic_form_ctools_stylizer_edit_style_form_default_alter(&$form, &$form_state, $form_id) {

  // If Auto-submit is enabled.
  if (variable_get('panopoly_magic_live_preview', 1)) {

    // Customize the settings preview button.
    $form['top box']['preview']['submit']['#attributes'] = array(
      // Keeping 'widget-preview-button' class for backcompat with 3rd party themes.
      'class' => array(
        'panopoly-magic-preview-button',
        'widget-preview-button',
        'ctools-use-ajax',
        'ctools-auto-submit-click',
      ),
    );

    // Autosubmit the form.
    ctools_add_js('auto-submit');
    $form['#attributes']['class'][] = 'ctools-auto-submit-full-form';
    $form['top box']['preview']['#theme'] = 'panopoly_magic_stylizer_preview_form';
  }

  // Change the Weight Around
  $form['top box']['preview']['#weight'] = -50;
}