diff --git a/plugins/views/views_php_handler_field.inc b/plugins/views/views_php_handler_field.inc index 9164d9a..58b619f 100644 --- a/plugins/views/views_php_handler_field.inc +++ b/plugins/views/views_php_handler_field.inc @@ -198,6 +198,20 @@ class views_php_handler_field extends views_handler_field { * Implements views_handler_field#pre_render(). */ function pre_render(&$values) { + // Ecexute value PHP code. + if (!empty($this->options['php_value'])) { + $function = create_function('$view, $handler, &$static, $row, $data', $this->options['php_value'] . ';'); + ob_start(); + foreach ($this->view->result as $i => &$row) { + $normalized_row = new stdClass; + foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) { + $normalized_row->$field = isset($row->{$handler->field_alias}) ? $row->{$handler->field_alias} : NULL; + } + $row->{$this->field_alias} = $function($this->view, $this, $this->php_static_variable, $normalized_row, $row); + } + ob_end_clean(); + } + if (!empty($this->options['php_output'])) { $this->php_output_lamda_function = create_function('$view, $handler, &$static, $row, $data, $value', ' ?>' . $this->options['php_output'] . '