class panelizer_plugin_row_panelizer_node_view in Panelizer 7
Same name and namespace in other branches
- 6 plugins/views/panelizer_plugin_row_panelizer_node_view.inc \panelizer_plugin_row_panelizer_node_view
- 7.3 plugins/views/panelizer_plugin_row_panelizer_node_view.inc \panelizer_plugin_row_panelizer_node_view
- 7.2 plugins/views/panelizer_plugin_row_panelizer_node_view.inc \panelizer_plugin_row_panelizer_node_view
Plugin which renders a panelizer node.
Hierarchy
- class \views_object
- class \views_plugin
- class \views_plugin_row
- class \views_plugin
Expanded class hierarchy of panelizer_plugin_row_panelizer_node_view
1 string reference to 'panelizer_plugin_row_panelizer_node_view'
- panelizer_views_plugins in plugins/
views/ panelizer.views.inc - Implementation of hook_views_plugins().
File
- plugins/
views/ panelizer_plugin_row_panelizer_node_view.inc, line 10 - Contains the panelizer node view row style plugin.
View source
class panelizer_plugin_row_panelizer_node_view extends views_plugin_row_node_view {
// Basic properties that let the row style follow relationships.
var $base_table = 'node';
var $base_field = 'nid';
function init(&$view, &$display, $options = NULL) {
parent::init($view, $display, $options);
// We need to define this here, not in hook_views_plugins() due to a bug
// in Views itself. See http://drupal.org/node/1205376 for more info.
$this->definition['theme'] = 'views_view_row_node';
}
function option_definition() {
$options = parent::option_definition();
$options['render_anything'] = array(
'default' => FALSE,
);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['render_anything'] = array(
'#type' => 'checkbox',
'#title' => t('Also display content that is not handled by panelizer'),
'#description' => t('If any content is not panelized, it will be hidden unless this is checked.'),
'#default_value' => $this->options['render_anything'],
'#weight' => -1,
);
// Force the row options from the parent plugin to depend on this checkbox.
foreach (array(
'view_mode',
'links',
'comments',
) as $element_name) {
$form[$element_name]['#dependency'] = array(
'edit-row-options-render-anything' => array(
1,
),
);
}
}
function render($row) {
$node = node_load($row->nid);
if (empty($node)) {
return;
}
ctools_include('node', 'panelizer');
$info = panelizer_render_node($node);
if (empty($info)) {
if (!empty($this->options['render_anything'])) {
return parent::render($row);
}
}
else {
return $info['content'];
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
panelizer_plugin_row_panelizer_node_view:: |
property |
Overrides views_plugin_row_node_view:: |
||
panelizer_plugin_row_panelizer_node_view:: |
property |
Basic properties that let the row style follow relationships. Overrides views_plugin_row_node_view:: |
||
panelizer_plugin_row_panelizer_node_view:: |
function |
Overrides views_plugin_row_node_view:: |
||
panelizer_plugin_row_panelizer_node_view:: |
function |
Provide a form for setting options. Overrides views_plugin_row_node_view:: |
||
panelizer_plugin_row_panelizer_node_view:: |
function |
Information about options for all kinds of purposes will be held here. Overrides views_plugin_row_node_view:: |
||
panelizer_plugin_row_panelizer_node_view:: |
function |
Render a row object. This usually passes through to a theme template
of some form, but not always. Overrides views_plugin_row_node_view:: |
||
views_object:: |
public | property | Handler's definition. | |
views_object:: |
public | property | Except for displays, options for the object will be held here. | 1 |
views_object:: |
function | Collect this handler's option definition and alter them, ready for use. | ||
views_object:: |
public | function | Views handlers use a special construct function. | 4 |
views_object:: |
public | function | Destructor. | 2 |
views_object:: |
public | function | 1 | |
views_object:: |
public | function | ||
views_object:: |
public | function | Always exports the option, regardless of the default value. | |
views_object:: |
public | function | Set default options on this object. | 1 |
views_object:: |
public | function | Set default options. | |
views_object:: |
public | function | Let the handler know what its full definition is. | |
views_object:: |
public | function | Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. | |
views_object:: |
public | function | Unpack a single option definition. | |
views_object:: |
public | function | Unpacks each handler to store translatable texts. | |
views_object:: |
public | function | ||
views_plugin:: |
public | property | The current used views display. | |
views_plugin:: |
public | property | The plugin name of this plugin, for example table or full. | |
views_plugin:: |
public | property | The plugin type of this plugin, for example style or query. | |
views_plugin:: |
public | property |
The top object of a view. Overrides views_object:: |
1 |
views_plugin:: |
public | function | Provide a list of additional theme functions for the theme info page. | |
views_plugin:: |
public | function | Return the human readable name of the display. | |
views_plugin:: |
public | function | Provide a full list of possible theme templates used by this style. | |
views_plugin:: |
public | function | Validate that the plugin is correct and can be saved. | 3 |
views_plugin_row:: |
public | function |
Perform any necessary changes to the form values prior to storage.
There is no need for this function to actually store the data. Overrides views_plugin:: |
1 |
views_plugin_row:: |
public | function |
Validate the options form. Overrides views_plugin:: |
|
views_plugin_row:: |
public | function |
Add anything to the query that we might need to. Overrides views_plugin:: |
|
views_plugin_row:: |
public | function | ||
views_plugin_row_node_view:: |
public | property | Stores the nodes loaded with pre_render. | |
views_plugin_row_node_view:: |
public | function | Return the main options, which are shown in the summary title. | |
views_plugin_row_node_view:: |
public | function |
Allow the style to do stuff before each row is rendered. Overrides views_plugin_row:: |
|
views_plugin_row_node_view:: |
public | function |
Returns the summary of the settings in the display. Overrides views_plugin:: |