Skip to content
Snippets Groups Projects
Commit 9965220a authored by Bojan Živanović's avatar Bojan Živanović Committed by Tim Plunkett
Browse files

Issue #1760396 by bojanz: Clean up PrerenderList.

parent 93cbe5c4
No related branches found
No related tags found
No related merge requests found
......@@ -69,30 +69,6 @@ function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
}
/**
* Render the field.
*
* This function is deprecated, but left in for older systems that have not
* yet or won't update their prerender list fields. If a render_item method
* exists, this will not get used by advanced_render.
*/
function render($values) {
$field = $this->get_value($values);
if (!empty($this->items[$field])) {
if ($this->options['type'] == 'separator') {
return implode($this->sanitize_value($this->options['separator']), $this->items[$field]);
}
else {
return theme('item_list',
array(
'items' => $this->items[$field],
'title' => NULL,
'type' => $this->options['type']
));
}
}
}
/**
* Render all items in this field together.
*
......@@ -126,8 +102,7 @@ function render_items($items) {
* should also be in this array.
*/
function get_items($values) {
// Only the parent get_value returns a single field.
$field = parent::get_value($values);
$field = $this->get_value($values);
if (!empty($this->items[$field])) {
return $this->items[$field];
}
......@@ -135,28 +110,6 @@ function get_items($values) {
return array();
}
/**
* Get the value that's supposed to be rendered.
*
* @param $values
* An object containing all retrieved values.
* @param $field
* Optional name of the field where the value is stored.
* @param $raw
* Use the raw data and not the data defined in pre_render
*/
function get_value($values, $field = NULL, $raw = FALSE) {
if ($raw) {
return parent::get_value($values, $field);
}
$item = $this->get_items($values);
$item = (array) $item;
if (isset($field) && isset($item[$field])) {
return $item[$field];
}
return $item;
}
/**
* Determine if advanced rendering is allowed.
*
......
......@@ -37,7 +37,7 @@ function pre_render(&$values) {
$this->items = array();
foreach ($values as $result) {
$uids[] = $this->get_value($result, NULL, TRUE);
$uids[] = $this->get_value($result);
}
if ($uids) {
......
......@@ -37,7 +37,7 @@ function pre_render(&$values) {
$this->items = array();
foreach ($values as $result) {
$uids[] = $this->get_value($result, NULL, TRUE);
$uids[] = $this->get_value($result);
}
if ($uids) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment