2
// $Id: views_plugin_row_node_view.inc,v 1.3 2009/04/08 20:54:58 merlinofchaos Exp $
5
* Contains the node view row style plugin.
9
* Plugin which performs a node_view on the resulting object.
11
* Most of the code on this object is in the theme function.
13
class views_plugin_row_node_view extends views_plugin_row {
14
// Basic properties that let the row style follow relationships.
15
var $base_table = 'node';
16
var $base_field = 'nid';
18
function init(&$view, &$display, $options = NULL) {
19
parent::init($view, $display, $options);
20
// Handle existing views with the deprecated 'teaser' option.
21
if (isset($this->options['teaser'])) {
22
$this->options['build_mode'] = $this->options['teaser'] ? 'teaser' : 'full';
26
function option_definition() {
27
$options = parent::option_definition();
29
$options['build_mode'] = array('default' => 'teaser');
30
$options['links'] = array('default' => TRUE);
31
$options['comments'] = array('default' => FALSE);
36
function options_form(&$form, &$form_state) {
37
parent::options_form($form, $form_state);
39
// CCK holds the registry of available build modes, but can hardly
40
// push them as options for the node row style, so we break the normal
41
// rule of not directly relying on non-core modules.
42
if ($modes = module_invoke('content', 'build_modes')) {
44
foreach ($modes as $key => $value) {
45
if (isset($value['views style']) && $value['views style']) {
46
$options[$key] = $value['title'];
52
'teaser' => t('Teaser'),
53
'full' => t('Full node')
56
$form['build_mode'] = array(
58
'#options' => $options,
59
'#title' => t('Build mode'),
60
'#default_value' => $this->options['build_mode'],
62
$form['links'] = array(
63
'#type' => 'checkbox',
64
'#title' => t('Display links'),
65
'#default_value' => $this->options['links'],
67
$form['comments'] = array(
68
'#type' => 'checkbox',
69
'#title' => t('Display node comments'),
70
'#default_value' => $this->options['comments'],