Go to the documentation of this file.00001 <?php
00015 class views_plugin_row_fields extends views_plugin_row {
00016 function option_definition() {
00017 $options = parent::option_definition();
00018
00019 $options['inline'] = array('default' => array());
00020 $options['separator'] = array('default' => '');
00021 $options['hide_empty'] = array('default' => FALSE);
00022 $options['default_field_elements'] = array('default' => TRUE);
00023 return $options;
00024 }
00025
00029 function options_form(&$form, &$form_state) {
00030 parent::options_form($form, $form_state);
00031 $options = $this->display->handler->get_field_labels();
00032
00033 if (empty($this->options['inline'])) {
00034 $this->options['inline'] = array();
00035 }
00036
00037 $form['default_field_elements'] = array(
00038 '#type' => 'checkbox',
00039 '#title' => t('Provide default field wrapper elements'),
00040 '#default_value' => $this->options['default_field_elements'],
00041 '#description' => t('If not checked, fields that are not configured to customize their HTML elements will get no wrappers at all for their field, label and field + label wrappers. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
00042 );
00043
00044 $form['inline'] = array(
00045 '#type' => 'checkboxes',
00046 '#title' => t('Inline fields'),
00047 '#options' => $options,
00048 '#default_value' => $this->options['inline'],
00049 '#description' => t('Inline fields will be displayed next to each other rather than one after another. Note that some fields will ignore this if they are block elements, particularly body fields and other formatted HTML.'),
00050 '#dependency' => array(
00051 'edit-row-options-default-field-elements' => array(1),
00052 ),
00053 '#prefix' => '<div id="edit-row-options-inline-wrapper"><div>',
00054 '#suffix' => '</div></div>',
00055
00056 );
00057
00058 $form['separator'] = array(
00059 '#title' => t('Separator'),
00060 '#type' => 'textfield',
00061 '#size' => 10,
00062 '#default_value' => isset($this->options['separator']) ? $this->options['separator'] : '',
00063 '#description' => t('The separator may be placed between inline fields to keep them from squishing up next to each other. You can use HTML in this field.'),
00064 );
00065
00066 $form['hide_empty'] = array(
00067 '#type' => 'checkbox',
00068 '#title' => t('Hide empty fields'),
00069 '#default_value' => $this->options['hide_empty'],
00070 '#description' => t('Do not display fields, labels or markup for fields that are empty.'),
00071 );
00072
00073 }
00074
00079 function options_submit(&$form, &$form_state) {
00080 $form_state['values']['row_options']['inline'] = array_filter($form_state['values']['row_options']['inline']);
00081 }
00082 }