You are here

function theme_ctools_stylizer_preview_form in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/stylizer.inc \theme_ctools_stylizer_preview_form()

Theme the stylizer preview form.

1 theme call to theme_ctools_stylizer_preview_form()
ctools_stylizer_edit_style_form_default in includes/stylizer.inc
The default stylizer style editing form.

File

includes/stylizer.inc, line 1050
Create customized CSS and images from palettes created by user input.

Code

function theme_ctools_stylizer_preview_form($form) {
  $plugin = $form['#form_state']['plugin'];
  $settings = $form['#form_state']['settings'];
  if (!empty($form['#form_state']['settings']['old_settings'])) {
    ctools_stylizer_cleanup_style($plugin, $form['#form_state']['settings']['old_settings']);
  }
  $preview = '';
  if (!empty($plugin['preview'])) {
    $preview = $plugin['preview'];
  }
  else {
    $base_types = ctools_get_style_base_types();
    if (!empty($base_types[$plugin['module']][$plugin['type']]['preview'])) {
      $preview = $base_types[$plugin['module']][$plugin['type']]['preview'];
    }
  }
  if (!empty($preview) && function_exists($preview)) {
    $output = '<fieldset id="preview"><legend>' . t('Preview') . '</legend>';
    $output .= $preview($plugin, $settings);
    $output .= drupal_render($form);
    $output .= '</fieldset>';
    return $output;
  }
}