1 |
85ad3d82
|
Assos Assos
|
<?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 |
|
|
} |