You are here

function views_pdf_plugin_row_fields::options_submit in Views PDF 7.3

Same name and namespace in other branches
  1. 6 views_pdf_plugin_row_fields.inc \views_pdf_plugin_row_fields::options_submit()
  2. 7 views_pdf_plugin_row_fields.inc \views_pdf_plugin_row_fields::options_submit()
  3. 7.2 plugins/views_pdf_plugin_row_fields.inc \views_pdf_plugin_row_fields::options_submit()

Stores the options

Overrides views_plugin_row::options_submit

File

./views_pdf_plugin_row_fields.inc, line 356
PDF row fields plugin provides the the fields plugin for unformatted style.

Class

views_pdf_plugin_row_fields
This class contains all the functionality of the field PDF style.

Code

function options_submit(&$form, &$form_state) {
  $default = $this->display->handler
    ->get_option('default_font_style');
  foreach ($form_state['values']['row_options']['formats'] as $id => &$field) {

    // Reset to default, if the elements are equal to the default settings
    if (count(array_diff($default, $field['text']['font_style'])) == 0 && count(array_diff($field['text']['font_style'], $default)) == 0) {
      $field['text']['font_style'] = NULL;
    }
    if ($field['text']['align'] == $this->display->handler
      ->get_option('default_text_align')) {
      $field['text']['align'] = NULL;
    }
    if ($field['text']['hyphenate'] == $this->display->handler
      ->get_option('default_text_hyphenate')) {
      $field['text']['hyphenate'] = NULL;
    }

    // Check unset values (grid mode), and set defaults.
    if (!isset($field['render']['is_html'])) {
      $field['render']['is_html'] = 0;
    }

    // If use-PHP unchecked, clear PHP options.
    if (!$field['render']['use_php']) {
      $field['render']['eval_before'] = $field['render']['eval_after'] = '';
      $field['render']['bypass_eval_before'] = $field['render']['bypass_eval_after'] = FALSE;
    }
  }
}