Mercurial > hg > rr-repo
comparison sites/all/modules/entityreference/views/entityreference_plugin_row_fields.inc @ 4:ce11bbd8f642
added modules
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Thu, 19 Sep 2013 10:38:44 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:b28be78d8160 | 4:ce11bbd8f642 |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * @file | |
5 * Handler for entityreference_plugin_row_fields. | |
6 */ | |
7 class entityreference_plugin_row_fields extends views_plugin_row_fields { | |
8 | |
9 function option_definition() { | |
10 $options = parent::option_definition(); | |
11 | |
12 $options['separator'] = array('default' => '-'); | |
13 | |
14 return $options; | |
15 } | |
16 | |
17 /** | |
18 * Provide a form for setting options. | |
19 */ | |
20 function options_form(&$form, &$form_state) { | |
21 parent::options_form($form, $form_state); | |
22 | |
23 // Expand the description of the 'Inline field' checkboxes. | |
24 $form['inline']['#description'] .= '<br />' . t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." ); | |
25 } | |
26 | |
27 function pre_render($row) { | |
28 // Force all fields to be inline by default. | |
29 if (empty($this->options['inline'])) { | |
30 $fields = $this->view->get_items('field', $this->display->id); | |
31 $this->options['inline'] = drupal_map_assoc(array_keys($fields)); | |
32 } | |
33 | |
34 return parent::pre_render($row); | |
35 } | |
36 } |