views_plugin_display_attachment Class Reference
[Views' display plugins]

Inheritance diagram for views_plugin_display_attachment:

views_plugin_display views_plugin views_object List of all members.

Detailed Description

The plugin that handles an attachment display.

Attachment displays are secondary displays that are 'attached' to a primary display. Effectively they are a simple way to get multiple views within the same view. They can share some information.

Definition at line 17 of file views_plugin_display_attachment.inc.

Public Member Functions

 option_definition ()
 Information about options for all kinds of purposes will be held here.
 execute ()
 When used externally, this is how a view gets run and returns data in the format required.
 attachment_positions ($position=NULL)
 options_summary (&$categories, &$options)
 Provide the summary for attachment options in the views UI.
 options_form (&$form, &$form_state)
 Provide the default form for setting options.
 options_submit (&$form, &$form_state)
 Perform any necessary changes to the form values prior to storage.
 attach_to ($display_id)
 Attach to another view.
 uses_exposed ()
 Attachment displays only use exposed widgets if they are set to inherit the exposed filter settings of their parent display.
 displays_exposed ()
 If an attachment is set to inherit the exposed filter settings from its parent display, then don't render and display a second set of exposed filter widgets.
 use_pager ()
 Does the display have a pager enabled?
 render_pager ()
 Does the display render the pager if it has it enabled?
 init (&$view, &$display, $options=NULL)
 init (&$view, &$display)
 Init will be called after construct, when the plugin is attached to a view and a display.
 destroy ()
 is_default_display ()
 Determine if this display is the 'default' display which contains fallback settings.
 use_ajax ()
 Does the display use AJAX?
 use_more ()
 Does the display have a more link enabled?
 use_more_always ()
 Should the enabled display more link be shown when no more items?
 use_more_text ()
 Does the display have custom link text?
 accept_attachments ()
 Can this display accept attachments?
 defaultable_sections ($section=NULL)
 Static member function to list which sections are defaultable and what items each section contains.
 _set_option_defaults (&$storage, $options, $level=0)
 Set default options.
 has_path ()
 Check to see if the display has a 'path' field.
 uses_link_display ()
 Check to see if the display has some need to link to another display.
 get_link_display ()
 Check to see which display to use when creating links within a view using this display.
 get_path ()
 Return the base path to use for this display.
 uses_breadcrumb ()
 Check to see if the display needs a breadcrumb.
 is_defaulted ($option)
 Determine if a given option is set to use the default display or the current display.
 get_option ($option)
 Intelligently get an option either from this display or from the default display, if directed to do so.
 uses_fields ()
 Determine if the display's style uses fields.
 get_plugin ($type= 'style', $name=NULL)
 Get the display or row plugin, if it exists.
 get_access_plugin ($name=NULL)
 Get the access plugin.
 get_cache_plugin ($name=NULL)
 Get the cache plugin.
get_handler ($type, $id)
 Get the handler object for a single handler.
 get_handlers ($type)
 Get a full array of handlers for $type.
 set_option ($option, $value)
 Intelligently set an option either from this display or from the default display, if directed to do so.
 override_option ($option, $value)
 Set an option and force it to be an override.
 option_link ($text, $section, $class= '', $title= '')
 Because forms may be split up into sections, this provides an easy URL to exactly the right section.
 format_themes ($themes)
 Format a list of theme templates for output by the theme info helper.
 options_validate (&$form, &$form_state)
 Validate the options form.
 add_override_button (&$form, &$form_state, $section)
 Add an override button for a given section, allowing the user to change whether this info is stored on the default display or on the current display.
 options_override ($form, &$form_state)
 If override/revert was clicked, perform the proper toggle.
 set_override ($section, $new_state=NULL)
 Flip the override setting for the given section.
 query ()
 Inject anything into the query that the display handler needs.
 render_filters ()
 Not all display plugins will support filtering.
 render_more_link ()
 Render the 'more' link.
 render_textarea ($area)
 Render a text area, using the proper format.
 render_header ()
 Render the header of the view.
 render_footer ()
 Render the footer of the view.
 render_empty ()
 Render the empty text of the view.
 hook_block ($op= 'list', $delta=0, $edit=array())
 If this display creates a block, implement one of these.
 hook_menu ()
 If this display creates a page with a menu item, implement it here.
 render ()
 Render this display.
 access ($account=NULL)
 Determine if the user has access to this display of the view.
 pre_execute ()
 Set up any variables on the view prior to execution.
 preview ()
 Fully render the display for the purposes of a live preview or some other AJAXy reason.
 get_style_type ()
 Displays can require a certain type of style plugin.
 validate ()
 Make sure the display and all associated handlers are valid.
 is_identifier_unique ($id, $identifier)
 Check if the provided identifier is unique.
 get_special_blocks ()
 Provide the block system with any exposed widget blocks for this display.
 view_special_blocks ($type)
 Render any special blocks provided for this display.
 theme_functions ()
 Provide a full list of possible theme templates used by this style.
 additional_theme_functions ()
 Provide a list of additional theme functions for the theme information page.
 construct ()
 Views handlers use a special construct function so that we can more easily construct them with variable arguments.
 options ()
 Set default options on this object.
 set_default_options ()
 Set default options.
 unpack_options (&$storage, $options, $definition=NULL)
 Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
 set_definition ($definition)
 Let the handler know what its full definition is.

Public Attributes

 $handlers = array()
 $options = array()
 Except for displays, options for the object will be held here.


Member Function Documentation

views_plugin_display::_set_option_defaults ( &$  storage,
options,
level = 0 
) [inherited]

Set default options.

Displays put their options in a different place than everything else; also displays spread their options out. We don't want to set defaults for items that are normally defaulted elsewhere.

Reimplemented from views_object.

Definition at line 221 of file views_plugin_display.inc.

References views_object::$options, and views_plugin_display::is_default_display().

00221                                                                  {
00222     foreach ($options as $option => $definition) {
00223       // If defaulted to elsewhere and we're not the default display, skip.
00224       if ($level == 0 && !$this->is_default_display() && !empty($options['defaults']['default'][$option])) {
00225         continue;
00226       }
00227 
00228       if (isset($definition['contains']) && is_array($definition['contains'])) {
00229         $storage[$option] = array();
00230         $this->_set_option_defaults($storage[$option], $definition['contains'], $level++);
00231       }
00232       else {
00233         $storage[$option] = isset($definition['default']) ? $definition['default'] : NULL;
00234       }
00235     }
00236   }

views_plugin_display::accept_attachments (  )  [inherited]

Can this display accept attachments?

Definition at line 162 of file views_plugin_display.inc.

00162                                 {
00163     return !empty($this->definition['accept attachments']);
00164   }

views_plugin_display::access ( account = NULL  )  [inherited]

Determine if the user has access to this display of the view.

Definition at line 1765 of file views_plugin_display.inc.

References views_plugin_display::get_access_plugin().

Referenced by attach_to(), views_plugin_display::defaultable_sections(), views_plugin_display_page::execute_hook_menu(), views_plugin_display::get_access_plugin(), views_plugin_display::option_definition(), views_plugin_display_page::options_form(), views_plugin_display::options_form(), views_plugin_display::options_submit(), and views_plugin_display::options_summary().

01765                                    {
01766     if (!isset($account)) {
01767       global $user;
01768       $account = $user;
01769     }
01770 
01771     // Full override.
01772     if (user_access('access all views', $account)) {
01773       return TRUE;
01774     }
01775 
01776     $plugin = $this->get_access_plugin();
01777     if ($plugin) {
01778       return $plugin->access($account);
01779     }
01780 
01781     // fallback to all access if no plugin.
01782     return TRUE;
01783   }

views_plugin_display::add_override_button ( &$  form,
&$  form_state,
section 
) [inherited]

Add an override button for a given section, allowing the user to change whether this info is stored on the default display or on the current display.

Definition at line 1589 of file views_plugin_display.inc.

References views_plugin_display::is_default_display(), views_plugin_display::is_defaulted(), and views_ui_edit_display_form_override().

Referenced by views_plugin_display::options_form().

01589                                                                {
01590     if ($this->is_default_display()) {
01591       return;
01592     }
01593 
01594     $form['override'] = array(
01595       '#prefix' => '<div class="views-override clear-block">',
01596       '#suffix' => '</div>',
01597     );
01598     if ($this->is_defaulted($section)) {
01599       $form['override']['button'] = array(
01600         '#type' => 'submit',
01601         '#value' => t('Override'),
01602         '#submit' => array('views_ui_edit_display_form_override'),
01603       );
01604       $form['override']['markup'] = array(
01605         '#prefix' => '<div class="description">',
01606         '#value' => theme('advanced_help_topic', 'views', 'overrides') . t('Status: using default values.'),
01607         '#suffix' => '</div>',
01608       );
01609 
01610       $form_state['update_name'] = t('Update default display');
01611     }
01612     else {
01613       $form['override']['button'] = array(
01614         '#type' => 'submit',
01615         '#value' => t('Use default'),
01616         '#submit' => array('views_ui_edit_display_form_override'),
01617       );
01618       $form['override']['markup'] = array(
01619         '#prefix' => '<div class="description">',
01620         '#value' => theme('advanced_help_topic', 'views', 'overrides') . t('Status: using overridden values.'),
01621         '#suffix' => '</div>',
01622       );
01623 
01624       $form_state['update_name'] = NULL;
01625     }
01626   }

views_plugin::additional_theme_functions (  )  [inherited]

Provide a list of additional theme functions for the theme information page.

Definition at line 386 of file plugins.inc.

Referenced by views_plugin_display::options_form().

00386                                         {
00387     $funcs = array();
00388     if (!empty($this->definition['additional themes'])) {
00389       foreach ($this->definition['additional themes'] as $theme => $type) {
00390         $funcs[] = views_theme_functions($theme, $this->view, $this->display);
00391       }
00392     }
00393     return $funcs;
00394   }

views_plugin_display_attachment::attach_to ( display_id  ) 

Attach to another view.

Reimplemented from views_plugin_display.

Definition at line 207 of file views_plugin_display_attachment.inc.

References $display_id, views_plugin_display::access(), and views_plugin_display::get_option().

00207                                   {
00208     $displays = $this->get_option('displays');
00209 
00210     if (empty($displays[$display_id])) {
00211       return;
00212     }
00213 
00214     if (!$this->access()) {
00215       return;
00216     }
00217 
00218     // Get a fresh view because our current one has a lot of stuff on it because it's
00219     // already been executed.
00220     $view = $this->view->clone_view();
00221     $view->original_args = $view->args;
00222 
00223     $args = $this->get_option('inherit_arguments') ? $this->view->args : array();
00224     $view->set_arguments($args);
00225     $view->set_display($this->display->id);
00226     if ($this->get_option('inherit_pager')) {
00227       $view->display_handler->use_pager = $this->view->display[$display_id]->handler->use_pager();
00228       $view->display_handler->set_option('pager_element', $this->view->display[$display_id]->handler->get_option('pager_element'));
00229     }
00230 
00231     // because of this, it is very very important that displays that can accept
00232     // attachments not also be attachments, or this could explode messily.
00233     $attachment = $view->execute_display($this->display->id, $args);
00234 
00235     switch ($this->get_option('attachment_position')) {
00236       case 'before':
00237         $this->view->attachment_before .= $attachment;
00238         break;
00239       case 'after':
00240         $this->view->attachment_after .= $attachment;
00241         break;
00242       case 'both':
00243         $this->view->attachment_before .= $attachment;
00244         $this->view->attachment_after .= $attachment;
00245         break;
00246     }
00247 
00248     $view->destroy();
00249   }

views_object::construct (  )  [inherited]

Views handlers use a special construct function so that we can more easily construct them with variable arguments.

Reimplemented in views_handler_argument, views_handler_argument_formula, views_handler_field, views_handler_field_markup, views_handler_filter_boolean_operator, views_handler_filter_in_operator, views_handler_sort_formula, views_handler_field_aggregator_category, views_handler_field_aggregator_title_link, views_handler_field_comment_link, views_handler_field_comment_link_edit, views_handler_field_comment_node_link, views_handler_field_node_new_comments, views_handler_field_filter_format_name, views_handler_argument_locale_group, views_handler_argument_locale_language, views_handler_field_locale_link_edit, views_handler_argument_node_created_fulldate, views_handler_argument_node_created_year, views_handler_argument_node_created_year_month, views_handler_argument_node_created_month, views_handler_argument_node_created_day, views_handler_argument_node_created_week, views_handler_argument_node_language, views_handler_argument_node_type, views_handler_field_node, views_handler_field_node_link, views_handler_field_node_link_delete, views_handler_field_node_link_edit, views_handler_field_node_revision_link_delete, views_handler_field_node_revision_link_revert, views_handler_field_taxonomy, views_handler_argument_node_language, views_handler_field_node_translation_link, views_handler_field_upload_fid, views_handler_filter_upload_fid, views_handler_field_user_link, views_handler_field_user_picture, views_handler_field_user_roles, and views_handler_filter_user_current.

Definition at line 40 of file base.inc.

References views_object::set_default_options().

00040 { $this->set_default_options(); }

views_plugin_display::defaultable_sections ( section = NULL  )  [inherited]

Static member function to list which sections are defaultable and what items each section contains.

Reimplemented in views_plugin_display_feed.

Definition at line 175 of file views_plugin_display.inc.

References views_plugin_display::access(), views_plugin_display::use_ajax(), views_plugin_display::use_more(), views_plugin_display::use_more_always(), views_plugin_display::use_more_text(), and views_plugin_display::use_pager().

Referenced by views_plugin_display::options_form(), and views_plugin_display::set_override().

00175                                                  {
00176     $sections = array(
00177       'access' => array('access'),
00178       'cache' => array('cache'),
00179       'title' => array('title'),
00180       'header' => array('header', 'header_format', 'header_empty'),
00181       'footer' => array('footer', 'footer_format', 'footer_empty'),
00182       'empty' => array('empty', 'empty_format'),
00183       'use_ajax' => array('use_ajax'),
00184       'items_per_page' => array('items_per_page', 'offset', 'use_pager', 'pager_element'),
00185       'use_pager' => array('items_per_page', 'offset', 'use_pager', 'pager_element'),
00186       'use_more' => array('use_more', 'use_more_always', 'use_more_text'),
00187       'link_display' => array('link_display'),
00188       'distinct' => array('distinct'),
00189       'exposed_block' => array('exposed_block'),
00190 
00191       // Force these to cascade properly.
00192       'style_plugin' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),
00193       'style_options' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),
00194       'row_plugin' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),
00195       'row_options' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),
00196 
00197       // These guys are special
00198       'relationships' => array('relationships'),
00199       'fields' => array('fields'),
00200       'sorts' => array('sorts'),
00201       'arguments' => array('arguments'),
00202       'filters' => array('filters'),
00203     );
00204     if ($section) {
00205       if (!empty($sections[$section])) {
00206         return $sections[$section];
00207       }
00208     }
00209     else {
00210       return $sections;
00211     }
00212   }

views_plugin_display_attachment::displays_exposed (  ) 

If an attachment is set to inherit the exposed filter settings from its parent display, then don't render and display a second set of exposed filter widgets.

Reimplemented from views_plugin_display.

Definition at line 268 of file views_plugin_display_attachment.inc.

References views_object::options().

00268                               {
00269     return $this->options['inherit_exposed_filters'] ? FALSE : TRUE;
00270   }

views_plugin_display_attachment::execute (  ) 

When used externally, this is how a view gets run and returns data in the format required.

The base class cannot be executed.

Reimplemented from views_plugin_display.

Definition at line 31 of file views_plugin_display_attachment.inc.

00031                      {
00032     return $this->view->render($this->display->id);
00033   }

views_plugin_display::format_themes ( themes  )  [inherited]

Format a list of theme templates for output by the theme info helper.

Definition at line 1383 of file views_plugin_display.inc.

Referenced by views_plugin_display::options_form().

01383                                   {
01384     $registry = theme_get_registry();
01385 
01386     // Run through the theme engine variables, if necessary
01387     global $theme_engine;
01388     $extension = '.tpl.php';
01389     if (isset($theme_engine)) {
01390       $extension_function = $theme_engine . '_extension';
01391       if (function_exists($extension_function)) {
01392         $extension = $extension_function();
01393       }
01394     }
01395 
01396     $output = '';
01397     $picked = FALSE;
01398     foreach ($themes as $theme) {
01399       $template = strtr($theme, '_', '-') . $extension;
01400       if (!$picked && !empty($registry[$theme])) {
01401         $template_path = isset($registry[$theme]['path']) ? $registry[$theme]['path'] . '/' : './';
01402         if (file_exists($template_path . $template)) {
01403           $hint = t('File found in folder @template-path', array('@template-path' => $template_path));
01404           $template = '<strong title="'. $hint .'">' . $template . '</strong>';
01405         }
01406         else {
01407           $template = '<strong class="error">' . $template . ' ' . t('(File not found, in folder @template-path)', array('@template-path' => $template_path)) . '</strong>';
01408         }
01409         $picked = TRUE;
01410       }
01411       $fixed[] = $template;
01412     }
01413 
01414     return implode(', ', array_reverse($fixed));
01415   }

views_plugin_display::get_access_plugin ( name = NULL  )  [inherited]

Get the access plugin.

Definition at line 514 of file views_plugin_display.inc.

References $name, views_plugin_display::access(), and views_plugin_display::get_option().

Referenced by views_plugin_display::access(), views_plugin_display_page::execute_hook_menu(), views_plugin_display::options_form(), views_plugin_display::options_summary(), and views_plugin_display::options_validate().

00514                                            {
00515     if (!$name) {
00516       $access = $this->get_option('access');
00517       $name = $access['type'];
00518     }
00519 
00520     $plugin = views_get_plugin('access', $name);
00521     if ($plugin) {
00522       $plugin->init($this->view, $this->display);
00523       return $plugin;
00524     }
00525   }

views_plugin_display::get_cache_plugin ( name = NULL  )  [inherited]

Get the cache plugin.

Definition at line 530 of file views_plugin_display.inc.

References $name, and views_plugin_display::get_option().

Referenced by views_plugin_display::options_form(), views_plugin_display::options_submit(), views_plugin_display::options_summary(), and views_plugin_display::options_validate().

00530                                           {
00531     if (!$name) {
00532       $cache = $this->get_option('cache');
00533       $name = $cache['type'];
00534     }
00535 
00536     $plugin = views_get_plugin('cache', $name);
00537     if ($plugin) {
00538       $plugin->init($this->view, $this->display);
00539       return $plugin;
00540     }
00541   }

& views_plugin_display::get_handler ( type,
id 
) [inherited]

Get the handler object for a single handler.

Definition at line 546 of file views_plugin_display.inc.

References views_plugin_display::get_handlers().

00546                                     {
00547     if (!isset($this->handlers[$type])) {
00548       $this->get_handlers($type);
00549     }
00550 
00551     if (isset($this->handlers[$type][$id])) {
00552       return $this->handlers[$type][$id];
00553     }
00554 
00555     // So we can return a reference.
00556     $null = NULL;
00557     return $null;
00558   }

views_plugin_display::get_handlers ( type  )  [inherited]

Get a full array of handlers for $type.

This caches them.

Definition at line 563 of file views_plugin_display.inc.

References views_plugin_display::get_option(), and views_object_types().

Referenced by views_plugin_display::get_handler(), views_plugin_display::is_identifier_unique(), views_plugin_display::options_form(), and views_plugin_display::validate().

00563                                {
00564     if (!isset($this->handlers[$type])) {
00565       $this->handlers[$type] = array();
00566       $types = views_object_types();
00567       $plural = $types[$type]['plural'];
00568       foreach ($this->get_option($plural) as $id => $info) {
00569         $handler = views_get_handler($info['table'], $info['field'], $type);
00570         if ($handler) {
00571           $handler->init($this->view, $info);
00572           $this->handlers[$type][$id] = &$handler;
00573         }
00574 
00575         // Prevent reference problems.
00576         unset($handler);
00577       }
00578     }
00579 
00580     return $this->handlers[$type];
00581   }

views_plugin_display::get_link_display (  )  [inherited]

Check to see which display to use when creating links within a view using this display.

Definition at line 420 of file views_plugin_display.inc.

References $display_id, and views_plugin_display::get_option().

Referenced by views_plugin_display::get_path(), views_plugin_display::options_form(), and views_plugin_display::options_summary().

00420                               {
00421     $display_id = $this->get_option('link_display');
00422     // If unknown, pick the first one.
00423     if (empty($display_id) || empty($this->view->display[$display_id])) {
00424       foreach ($this->view->display as $display_id => $display) {
00425         if (!empty($display->handler) && $display->handler->has_path()) {
00426           return $display_id;
00427         }
00428       }
00429     }
00430     else {
00431       return $display_id;
00432     }
00433     // fall-through returns NULL
00434   }

views_plugin_display::get_option ( option  )  [inherited]

Intelligently get an option either from this display or from the default display, if directed to do so.

Definition at line 475 of file views_plugin_display.inc.

References views_plugin_display::is_defaulted(), and views_object::options().

Referenced by views_plugin_display_feed::attach_to(), attach_to(), views_plugin_display_block::execute_hook_block(), views_plugin_display_page::execute_hook_menu(), views_plugin_display::get_access_plugin(), views_plugin_display::get_cache_plugin(), views_plugin_display_block::get_cache_type(), views_plugin_display::get_handlers(), views_plugin_display::get_link_display(), views_plugin_display::get_path(), views_plugin_display::get_plugin(), views_plugin_display_page::options_form(), views_plugin_display_feed::options_form(), options_form(), views_plugin_display::options_form(), views_plugin_display::options_submit(), views_plugin_display_page::options_summary(), views_plugin_display_feed::options_summary(), views_plugin_display_block::options_summary(), options_summary(), views_plugin_display::options_summary(), views_plugin_display_page::options_validate(), views_plugin_display::pre_execute(), views_plugin_display::query(), render_pager(), views_plugin_display::render_textarea(), views_plugin_display::set_override(), views_plugin_display::use_ajax(), views_plugin_display::use_more(), views_plugin_display::use_more_always(), views_plugin_display::use_more_text(), views_plugin_display::use_pager(), views_plugin_display_page::validate(), and views_plugin_display::validate().

00475                                {
00476     if ($this->is_defaulted($option)) {
00477       return $this->default_display->get_option($option);
00478     }
00479 
00480     if (array_key_exists($option, $this->options)) {
00481       return $this->options[$option];
00482     }
00483   }

views_plugin_display::get_path (  )  [inherited]

Return the base path to use for this display.

This can be overridden for displays that do strange things with the path.

Definition at line 442 of file views_plugin_display.inc.

References $display_id, views_plugin_display::get_link_display(), views_plugin_display::get_option(), and views_plugin_display::has_path().

Referenced by views_plugin_display_feed::attach_to(), and views_plugin_display::render_more_link().

00442                       {
00443     if ($this->has_path()) {
00444       return $this->get_option('path');
00445     }
00446 
00447     $display_id = $this->get_link_display();
00448     if ($display_id && !empty($this->view->display[$display_id]) && is_object($this->view->display[$display_id]->handler)) {
00449       return $this->view->display[$display_id]->handler->get_path();
00450     }
00451   }

views_plugin_display::get_plugin ( type = 'style',
name = NULL 
) [inherited]

Get the display or row plugin, if it exists.

Definition at line 498 of file views_plugin_display.inc.

References $name, views_object::$options, and views_plugin_display::get_option().

Referenced by views_plugin_display_feed::attach_to(), views_plugin_display::options_form(), views_plugin_display::options_submit(), views_plugin_display::options_validate(), views_plugin_display::uses_fields(), and views_plugin_display::validate().

00498                                                      {
00499     if (!$name) {
00500       $name = $this->get_option($type . '_plugin');
00501     }
00502 
00503     $plugin = views_get_plugin($type, $name);
00504     if ($plugin) {
00505       $options = $this->get_option($type . '_options');
00506       $plugin->init($this->view, $this->display, $options);
00507       return $plugin;
00508     }
00509   }

views_plugin_display::get_special_blocks (  )  [inherited]

Provide the block system with any exposed widget blocks for this display.

Definition at line 1892 of file views_plugin_display.inc.

01892                                 {
01893     $delta = '-exp-' . $this->view->name . '-' . $this->display->id;
01894     $desc = t('Exposed form: @view-@display_id', array('@view' => $this->view->name, '@display_id' => $this->display->id));
01895 
01896     return array(
01897       $delta => array(
01898         'info' => $desc,
01899       )
01900     );
01901   }

views_plugin_display::get_style_type (  )  [inherited]

Displays can require a certain type of style plugin.

By default, they will be 'normal'.

Reimplemented in views_plugin_display_feed.

Definition at line 1820 of file views_plugin_display.inc.

Referenced by views_plugin_display::options_form().

01820 { return 'normal'; }

views_plugin_display::has_path (  )  [inherited]

Check to see if the display has a 'path' field.

This is a pure function and not just a setting on the definition because some displays (such as a panel pane) may have a path based upon configuration.

By default, displays do not have a path.

Reimplemented in views_plugin_display_page.

Definition at line 405 of file views_plugin_display.inc.

Referenced by views_plugin_display::get_path(), views_plugin_display::uses_link_display(), and views_plugin_display::validate().

00405 { return FALSE; }

views_plugin_display::hook_block ( op = 'list',
delta = 0,
edit = array() 
) [inherited]

If this display creates a block, implement one of these.

Definition at line 1748 of file views_plugin_display.inc.

01748 { return array(); }

views_plugin_display::hook_menu (  )  [inherited]

If this display creates a page with a menu item, implement it here.

Definition at line 1753 of file views_plugin_display.inc.

01753 { return array(); }

views_plugin::init ( &$  view,
&$  display 
) [inherited]

Init will be called after construct, when the plugin is attached to a view and a display.

Reimplemented in views_plugin_access, and views_plugin_cache.

Definition at line 351 of file plugins.inc.

00351                                    {
00352     $this->view = &$view;
00353     $this->display = &$display;
00354   }

views_plugin_display::is_default_display (  )  [inherited]

Determine if this display is the 'default' display which contains fallback settings.

Reimplemented in views_plugin_display_default.

Definition at line 66 of file views_plugin_display.inc.

Referenced by views_plugin_display::_set_option_defaults(), views_plugin_display::add_override_button(), views_plugin_display::init(), views_plugin_display::is_defaulted(), and views_plugin_display::option_definition().

00066 { return FALSE; }

views_plugin_display::is_defaulted ( option  )  [inherited]

Determine if a given option is set to use the default display or the current display.

Returns:
TRUE for the default display

Definition at line 467 of file views_plugin_display.inc.

References views_plugin_display::is_default_display(), and views_object::options().

Referenced by views_plugin_display::add_override_button(), views_plugin_display::get_option(), and views_plugin_display::set_option().

00467                                  {
00468     return !$this->is_default_display() && !empty($this->default_display) && !empty($this->options['defaults'][$option]);
00469   }

views_plugin_display::is_identifier_unique ( id,
identifier 
) [inherited]

Check if the provided identifier is unique.

Definition at line 1876 of file views_plugin_display.inc.

References views_plugin_display::get_handlers(), views_object::options(), and views_object_types().

01876                                                   {
01877     foreach (views_object_types() as $type => $info) {
01878       foreach ($this->get_handlers($type) as $key => $handler) {
01879         if ($handler->can_expose() && $handler->is_exposed()) {
01880           if ($id != $key && $identifier == $handler->options['expose']['identifier']) {
01881             return FALSE;
01882           }
01883         }
01884       }
01885     }
01886     return TRUE;
01887   }

views_plugin_display_attachment::option_definition (  ) 

Information about options for all kinds of purposes will be held here.

 'option_name' => array(
  - 'default' => default value,
  - 'translatable' => TRUE/FALSE (wrap in t() on export if true),
  - 'contains' => array of items this contains, with its own defaults, etc.
      If contains is set, the default will be ignored and assumed to
      be array()

  ),
Each option may have any of the following functions:

Reimplemented from views_plugin_display.

Definition at line 18 of file views_plugin_display_attachment.inc.

References views_object::$options, and render_pager().

00018                                 {
00019     $options = parent::option_definition();
00020 
00021     $options['attachment_position'] = array('default' => 'before');
00022     $options['inherit_arguments'] = array('default' => TRUE);
00023     $options['inherit_exposed_filters'] = array('default' => FALSE);
00024     $options['inherit_pager'] = array('default' => FALSE);
00025     $options['render_pager'] = array('default' => TRUE);
00026     $options['displays'] = array('default' => array());
00027 
00028     return $options;
00029   }

views_plugin_display::option_link ( text,
section,
class = '',
title = '' 
) [inherited]

Because forms may be split up into sections, this provides an easy URL to exactly the right section.

Don't override this.

Definition at line 611 of file views_plugin_display.inc.

References $class, and $title.

Referenced by views_plugin_display::options_form().

00611                                                                   {
00612     if (!empty($class)) {
00613       $text = '<span>' . $text . '</span>';
00614     }
00615 
00616     if (!trim($text)) {
00617       $text = t('Broken field');
00618     }
00619 
00620     if (empty($title)) {
00621       $title = $text;
00622     }
00623 
00624     return l($text, 'admin/build/views/nojs/display/' . $this->view->name . '/' . $this->display->id . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title), 'html' => TRUE));
00625   }

views_object::options (  )  [inherited]

Set default options on this object.

Called by the constructor in a complex chain to deal with backward compatibility.

Definition at line 46 of file base.inc.

Referenced by views_handler_filter_term_node_tid::accept_exposed_input(), views_handler_filter_numeric::accept_exposed_input(), views_handler_filter_in_operator::accept_exposed_input(), views_handler_filter_date::accept_exposed_input(), views_handler_filter::accept_exposed_input(), views_plugin_access_role::access(), views_plugin_access_perm::access(), views_handler_field_term_node_tid::add_self_tokens(), views_handler_filter_history_user_timestamp::admin_summary(), views_handler_sort::admin_summary(), views_handler_filter_string::admin_summary(), views_handler_filter_numeric::admin_summary(), views_handler_filter_in_operator::admin_summary(), views_handler_filter_boolean_operator::admin_summary(), views_plugin_argument_default_php::argument_form(), views_plugin_argument_default::argument_form(), views_plugin_argument_default_user::argument_form(), views_plugin_style_table::build_sort(), views_plugin_style_table::build_sort_post(), views_plugin_cache_time::cache_expire(), views_handler_filter_string::case_transform(), views_handler_argument_string::case_transform(), views_handler_field::construct(), views_handler_argument::default_action(), views_handler_argument_date::default_argument_form(), views_handler_argument::default_argument_form(), views_handler_argument::default_summary(), displays_exposed(), views_handler_field_term_node_tid::document_self_tokens(), views_handler_filter::expose_form_left(), views_handler_filter_term_node_tid::expose_form_right(), views_handler_filter_in_operator::expose_form_right(), views_handler_filter::expose_form_right(), views_handler_filter_in_operator::expose_options(), views_handler_filter_boolean_operator::expose_options(), views_handler_filter::expose_options(), views_handler_filter::expose_validate(), views_handler_filter_search::exposed_form(), views_handler_filter::exposed_form(), views_handler_filter::exposed_info(), views_handler_filter::exposed_translate(), views_handler_filter_user_name::exposed_validate(), views_handler_filter_term_node_tid::exposed_validate(), views_handler_filter_search::exposed_validate(), views_handler_filter_date::exposed_validate(), views_handler_filter_term_node_tid_depth::extra_options_form(), views_handler_filter_term_node_tid::extra_options_form(), views_plugin_access_role::get_access_callback(), views_plugin_access_perm::get_access_callback(), views_handler_argument_date::get_default_argument(), views_handler_argument::get_default_argument(), views_handler_argument_string::get_formula(), views_plugin_display::get_option(), views_handler_filter_profile_selection::get_value_options(), views_handler_filter_in_operator::get_value_options(), views_handler_argument::has_default_argument(), views_plugin_style::init(), views_plugin_row::init(), views_plugin_display::init(), views_plugin_cache::init(), views_plugin_access::init(), views_handler_field_user_name::init(), views_handler_field_user::init(), views_plugin_row_node_view::init(), views_handler_field_history_user_timestamp::init(), views_handler_field_node_new_comments::init(), views_handler_field_comment::init(), views_handler::init(), views_handler_filter::init(), views_handler_field::init(), views_plugin_display::is_defaulted(), views_handler::is_exposed(), views_plugin_display::is_identifier_unique(), views_handler_argument::is_wildcard(), views_handler_relationship::label(), views_handler_field::label(), views_handler_argument::needs_style_plugin(), views_handler_filter_numeric::op_between(), views_handler_filter_float::op_between(), views_handler_filter_date::op_between(), views_handler_filter_string::op_contains(), views_handler_filter_string::op_empty(), views_handler_filter_numeric::op_empty(), views_handler_filter_in_operator::op_empty(), views_handler_filter_string::op_ends(), views_handler_filter_string::op_equal(), views_handler_filter_string::op_not(), views_handler_filter_string::op_not_ends(), views_handler_filter_string::op_not_starts(), views_handler_filter_numeric::op_simple(), views_handler_filter_in_operator::op_simple(), views_handler_filter_float::op_simple(), views_handler_filter_date::op_simple(), views_handler_filter_string::op_starts(), views_handler_filter_string::op_word(), views_handler_filter_node_tnid::operator_form(), views_handler_filter_search::operator_form(), views_handler_filter::operator_form(), views_plugin_style_table::options_form(), views_plugin_style_summary_unformatted::options_form(), views_plugin_style_summary_jump_menu::options_form(), views_plugin_style_summary::options_form(), views_plugin_style_rss::options_form(), views_plugin_style_list::options_form(), views_plugin_style_jump_menu::options_form(), views_plugin_style_grid::options_form(), views_plugin_style::options_form(), views_plugin_row_fields::options_form(), views_plugin_row::options_form(), views_plugin_display_page::options_form(), views_plugin_display_feed::options_form(), views_plugin_display_block::options_form(), options_form(), views_plugin_display::options_form(), views_plugin_cache_time::options_form(), views_plugin_access_role::options_form(), views_plugin_access_perm::options_form(), views_handler_field_user_name::options_form(), views_handler_field_user_mail::options_form(), views_handler_field_user_link::options_form(), views_handler_field_is_online::options_form(), views_handler_field_upload_fid::options_form(), views_handler_field_upload_description::options_form(), views_handler_relationship_translation::options_form(), views_handler_relationship_node_term_data::options_form(), views_handler_field_term_node_tid::options_form(), views_handler_field_taxonomy::options_form(), views_handler_argument_term_node_tid_depth::options_form(), views_handler_argument_term_node_tid::options_form(), views_handler_field_file::options_form(), views_handler_field_accesslog_path::options_form(), views_plugin_row_search_view::options_form(), views_handler_field_search_score::options_form(), views_handler_field_profile_date::options_form(), views_plugin_row_node_view::options_form(), views_plugin_row_node_rss::options_form(), views_handler_field_node_link::options_form(), views_handler_field_node::options_form(), views_handler_field_history_user_timestamp::options_form(), views_handler_field_locale_link_edit::options_form(), views_handler_field_contact_link::options_form(), views_plugin_row_comment_view::options_form(), views_handler_field_comment_username::options_form(), views_handler_field_comment_node_link::options_form(), views_handler_field_comment_link::options_form(), views_plugin_row_aggregator_rss::options_form(), views_handler_field_aggregator_title_link::options_form(), views_handler_field_aggregator_category::options_form(), views_handler_sort_date::options_form(), views_handler_sort::options_form(), views_handler_relationship::options_form(), views_handler_filter_string::options_form(), views_handler_field_url::options_form(), views_handler_field_prerender_list::options_form(), views_handler_field_numeric::options_form(), views_handler_field_date::options_form(), views_handler_field_counter::options_form(), views_handler_field_boolean::options_form(), views_handler_field_file_size::options_form(), views_handler_field::options_form(), views_handler_argument_string::options_form(), views_handler_argument_numeric::options_form(), views_handler_argument_null::options_form(), views_handler_argument_many_to_one::options_form(), views_handler_argument::options_form(), views_plugin_display::options_submit(), views_handler_filter::options_submit(), views_plugin_display::options_summary(), views_handler_filter_date::options_validate(), views_handler_filter::options_validate(), views_handler_argument_term_node_tid_depth_modifier::pre_query(), views_handler_field_upload_description::pre_render(), views_handler_field_term_node_tid::pre_render(), views_plugin_style_summary::query(), views_plugin_row::query(), views_handler_filter_user_current::query(), views_handler_filter_upload_fid::query(), views_handler_relationship_translation::query(), views_handler_filter_node_tnid_child::query(), views_handler_filter_node_tnid::query(), views_handler_relationship_node_term_data::query(), views_handler_filter_term_node_tid_depth::query(), views_handler_argument_term_node_tid_depth::query(), views_handler_sort_search_score::query(), views_handler_filter_search::query(), views_handler_field_search_score::query(), views_handler_filter_node_status::query(), views_handler_filter_history_user_timestamp::query(), views_handler_sort_ncs_last_updated::query(), views_handler_sort_ncs_last_comment_name::query(), views_handler_sort_comment_thread::query(), views_handler_filter_comment_user_uid::query(), views_handler_sort_random::query(), views_handler_sort_formula::query(), views_handler_sort_date::query(), views_handler_sort::query(), views_handler_relationship::query(), views_handler_filter_boolean_operator_string::query(), views_handler_filter_boolean_operator::query(), views_handler_filter::query(), views_handler_argument_string::query(), views_handler_argument_numeric::query(), views_handler_argument_many_to_one::query(), views_handler_filter_in_operator::reduce_value_options(), views_plugin_style_summary_jump_menu::render(), views_plugin_style_summary::render(), views_plugin_style_rss::render(), views_plugin_style_jump_menu::render(), views_plugin_style::render(), views_plugin_row::render(), views_handler_field_user_mail::render(), views_handler_field_user_link_edit::render(), views_handler_field_user_link_delete::render(), views_handler_field_user_link::render(), views_handler_field_accesslog_path::render(), views_plugin_row_search_view::render(), views_handler_field_profile_date::render(), views_handler_field_node_link::render(), views_handler_field_locale_link_edit::render(), views_plugin_row_comment_rss::render(), views_handler_field_ncs_last_comment_name::render(), views_handler_field_comment_link_reply::render(), views_handler_field_comment_link_delete::render(), views_handler_field_comment_link::render(), views_plugin_row_aggregator_rss::render(), views_handler_field_counter::render(), views_handler_field_file_size::render(), views_handler_field_user_name::render_link(), views_handler_field_user_language::render_link(), views_handler_field_user::render_link(), views_handler_field_upload_description::render_link(), views_handler_field_taxonomy::render_link(), views_handler_field_file::render_link(), views_handler_field_node::render_link(), views_handler_field_comment_username::render_link(), views_handler_field_comment::render_link(), views_handler_field_aggregator_category::render_link(), views_handler_argument_term_node_tid_depth::set_breadcrumb(), views_handler_argument_term_node_tid::set_breadcrumb(), views_object::set_default_options(), views_plugin_display::set_option(), views_plugin_display::set_override(), views_handler::set_relationship(), views_handler_filter::show_expose_button(), views_handler_filter::show_expose_form(), views_handler_filter::store_exposed_input(), views_handler_argument_string::summary_argument(), views_handler_argument_string::summary_query(), views_handler_argument_many_to_one::summary_query(), views_plugin_cache_time::summary_title(), views_plugin_access_role::summary_title(), views_plugin_access_perm::summary_title(), views_handler_argument_string::title(), views_handler_argument_numeric::title(), views_handler_argument_many_to_one::title(), views_handler_argument::uses_breadcrumb(), uses_exposed(), views_plugin_display::validate(), views_handler_argument_null::validate_argument_basic(), views_handler_argument::validate_fail(), views_plugin_argument_validate_php::validate_form(), views_plugin_argument_validate_user::validate_form(), views_plugin_argument_validate_taxonomy_term::validate_form(), views_plugin_argument_validate_node::validate_form(), views_handler_filter_term_node_tid::validate_term_strings(), views_handler_filter_user_name::value_form(), views_handler_filter_term_node_tid::value_form(), views_handler_filter_history_user_timestamp::value_form(), views_handler_filter_string::value_form(), views_handler_filter_numeric::value_form(), views_handler_filter_in_operator::value_form(), views_handler_filter_equality::value_form(), views_handler_filter_date::value_form(), views_handler_filter_boolean_operator::value_form(), views_handler_filter_in_operator::value_submit(), views_handler_filter_user_name::value_validate(), views_handler_filter_term_node_tid::value_validate(), views_handler_filter_boolean_operator::value_validate(), and views_handler_argument::wildcard_title().

00046 { }

views_plugin_display_attachment::options_form ( &$  form,
&$  form_state 
)

Provide the default form for setting options.

Reimplemented from views_plugin_display.

Definition at line 117 of file views_plugin_display_attachment.inc.

References $display_id, attachment_positions(), views_plugin_display::get_option(), views_object::options(), views_plugin_display::render(), and render_pager().

00117                                               {
00118     // It is very important to call the parent function here:
00119     parent::options_form($form, $form_state);
00120 
00121     switch ($form_state['section']) {
00122       case 'inherit_arguments':
00123         $form['#title'] .= t('Inherit arguments');
00124         $form['inherit_arguments'] = array(
00125           '#type' => 'checkbox',
00126           '#title' => t('Inherit'),
00127           '#description' => t('Should this display inherit its arguments from the parent display to which it is attached?'),
00128           '#default_value' => $this->get_option('inherit_arguments'),
00129         );
00130         break;
00131       case 'inherit_exposed_filters':
00132         $form['#title'] .= t('Inherit exposed filters');
00133         $form['inherit_exposed_filters'] = array(
00134           '#type' => 'checkbox',
00135           '#title' => t('Inherit'),
00136           '#description' => t('Should this display inherit its exposed filter values from the parent display to which it is attached?'),
00137           '#default_value' => $this->get_option('inherit_exposed_filters'),
00138         );
00139         break;
00140       case 'inherit_pager':
00141         $form['#title'] .= t('Inherit pager');
00142         $form['inherit_pager'] = array(
00143           '#type' => 'checkbox',
00144           '#title' => t('Inherit'),
00145           '#description' => t('Should this display inherit its paging values from the parent display to which it is attached? Note that this will provide unexpected results if the number of items to display do not match.'),
00146           '#default_value' => $this->get_option('inherit_pager'),
00147         );
00148         break;
00149       case 'render_pager':
00150         $form['#title'] .= t('Render pager');
00151         $form['render_pager'] = array(
00152           '#type' => 'checkbox',
00153           '#title' => t('Render'),
00154           '#description' => t('Should this display render the pager values? If not it can inherit from the parent...'),
00155           '#default_value' => $this->get_option('render_pager'),
00156         );
00157         break;
00158       case 'attachment_position':
00159         $form['#title'] .= t('Position');
00160         $form['attachment_position'] = array(
00161           '#type' => 'radios',
00162           '#description' => t('Attach before or after the parent display?'),
00163           '#options' => $this->attachment_positions(),
00164           '#default_value' => $this->get_option('attachment_position'),
00165         );
00166         break;
00167       case 'displays':
00168         $form['#title'] .= t('Attach to');
00169         $displays = array();
00170         foreach ($this->view->display as $display_id => $display) {
00171           if (!empty($display->handler) && $display->handler->accept_attachments()) {
00172             $displays[$display_id] = $display->display_title;
00173           }
00174         }
00175         $form['displays'] = array(
00176           '#type' => 'checkboxes',
00177           '#description' => t('Select which display or displays this should attach to.'),
00178           '#options' => $displays,
00179           '#default_value' => $this->get_option('displays'),
00180         );
00181         break;
00182     }
00183   }

views_plugin_display::options_override ( form,
&$  form_state 
) [inherited]

If override/revert was clicked, perform the proper toggle.

Definition at line 1631 of file views_plugin_display.inc.

References views_plugin_display::set_override().

01631                                                  {
01632     $this->set_override($form_state['section']);
01633   }

views_plugin_display_attachment::options_submit ( &$  form,
&$  form_state 
)

Perform any necessary changes to the form values prior to storage.

There is no need for this function to actually store the data.

Reimplemented from views_plugin_display.

Definition at line 189 of file views_plugin_display_attachment.inc.

References render_pager(), and views_plugin_display::set_option().

00189                                                 {
00190     // It is very important to call the parent function here:
00191     parent::options_submit($form, $form_state);
00192     switch ($form_state['section']) {
00193       case 'inherit_arguments':
00194       case 'inherit_pager':
00195       case 'render_pager':
00196       case 'inherit_exposed_filters':
00197       case 'attachment_position':
00198       case 'displays':
00199         $this->set_option($form_state['section'], $form_state['values'][$form_state['section']]);
00200         break;
00201     }
00202   }

views_plugin_display_attachment::options_summary ( &$  categories,
&$  options 
)

Provide the summary for attachment options in the views UI.

This output is returned as an array.

Reimplemented from views_plugin_display.

Definition at line 54 of file views_plugin_display_attachment.inc.

References views_object::$options, attachment_positions(), views_plugin_display::get_option(), and render_pager().

00054                                                     {
00055     // It is very important to call the parent function here:
00056     parent::options_summary($categories, $options);
00057 
00058     $categories['attachment'] = array(
00059       'title' => t('Attachment settings'),
00060     );
00061 
00062     $options['inherit_arguments'] = array(
00063       'category' => 'attachment',
00064       'title' => t('Inherit arguments'),
00065       'value' => $this->get_option('inherit_arguments') ? t('Yes') : t('No'),
00066     );
00067 
00068     $options['inherit_exposed_filters'] = array(
00069       'category' => 'attachment',
00070       'title' => t('Inherit exposed filters'),
00071       'value' => $this->get_option('inherit_exposed_filters') ? t('Yes') : t('No'),
00072     );
00073 
00074     $options['inherit_pager'] = array(
00075       'category' => 'attachment',
00076       'title' => t('Inherit pager'),
00077       'value' => $this->get_option('inherit_pager') ? t('Yes') : t('No'),
00078     );
00079 
00080     $options['render_pager'] = array(
00081       'category' => 'attachment',
00082       'title' => t('Render pager'),
00083       'value' => $this->get_option('render_pager') ? t('Yes') : t('No'),
00084     );
00085 
00086     $options['attachment_position'] = array(
00087       'category' => 'attachment',
00088       'title' => t('Position'),
00089       'value' => $this->attachment_positions($this->get_option('attachment_position')),
00090     );
00091 
00092     $displays = array_filter($this->get_option('displays'));
00093     if (count($displays) > 1) {
00094       $attach_to = t('Multiple displays');
00095     }
00096     else if (count($displays) == 1) {
00097       $display = array_shift($displays);
00098       if (!empty($this->view->display[$display])) {
00099         $attach_to = check_plain($this->view->display[$display]->display_title);
00100       }
00101     }
00102 
00103     if (!isset($attach_to)) {
00104       $attach_to = t('None');
00105     }
00106 
00107     $options['displays'] = array(
00108       'category' => 'attachment',
00109       'title' => t('Attach to'),
00110       'value' => $attach_to,
00111     );
00112   }

views_plugin_display::options_validate ( &$  form,
&$  form_state 
) [inherited]

Validate the options form.

Reimplemented from views_plugin.

Reimplemented in views_plugin_display_page.

Definition at line 1420 of file views_plugin_display.inc.

References views_plugin_display::get_access_plugin(), views_plugin_display::get_cache_plugin(), and views_plugin_display::get_plugin().

01420                                                   {
01421     switch ($form_state['section']) {
01422       case 'style_options':
01423         $style = TRUE;
01424       case 'row_options':
01425         // if row, $style will be empty.
01426         $plugin = $this->get_plugin(empty($style) ? 'row' : 'style');
01427         if ($plugin) {
01428           $plugin->options_validate($form[$form_state['section']], $form_state);
01429         }
01430         break;
01431       case 'access_options':
01432         $plugin = $this->get_access_plugin();
01433         if ($plugin) {
01434           $plugin->options_validate($form['access_options'], $form_state);
01435         }
01436         break;
01437       case 'cache_options':
01438         $plugin = $this->get_cache_plugin();
01439         if ($plugin) {
01440           $plugin->options_validate($form['cache_options'], $form_state);
01441         }
01442         break;
01443     }
01444   }

views_plugin_display::override_option ( option,
value 
) [inherited]

Set an option and force it to be an override.

Definition at line 602 of file views_plugin_display.inc.

References views_plugin_display::set_option(), and views_plugin_display::set_override().

00602                                             {
00603     $this->set_override($option, FALSE);
00604     $this->set_option($option, $value);
00605   }

views_plugin_display::pre_execute (  )  [inherited]

Set up any variables on the view prior to execution.

These are separated from execute because they are extremely common and unlikely to be overridden on an individual display.

Definition at line 1790 of file views_plugin_display.inc.

References views_plugin_display::get_option(), views_plugin_display::use_ajax(), views_plugin_display::use_more(), and views_plugin_display::use_pager().

01790                          {
01791     $this->view->set_use_ajax($this->use_ajax());
01792     // Copy pager information from the display.
01793     $this->view->set_use_pager($this->use_pager());
01794     $this->view->set_pager_element($this->get_option('pager_element'));
01795     $this->view->set_items_per_page($this->get_option('items_per_page'));
01796     $this->view->set_offset($this->get_option('offset'));
01797     if ($this->use_more()) {
01798       $this->view->get_total_rows = TRUE;
01799     }
01800   }

views_plugin_display::preview (  )  [inherited]

Fully render the display for the purposes of a live preview or some other AJAXy reason.

Reimplemented in views_plugin_display_feed.

Definition at line 1814 of file views_plugin_display.inc.

01814 { return $this->view->render(); }

views_plugin_display::query (  )  [inherited]

Inject anything into the query that the display handler needs.

Reimplemented from views_plugin.

Definition at line 1668 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::render_more_link().

01668                    {
01669     // Make the query distinct if the option was set.
01670     if ($this->get_option('distinct')) {
01671       $this->view->query->set_distinct();
01672     }
01673   }

views_plugin_display::render (  )  [inherited]

Render this display.

Reimplemented in views_plugin_display_feed.

Definition at line 1758 of file views_plugin_display.inc.

References views_plugin::theme_functions().

Referenced by options_form().

01758                     {
01759     return theme($this->theme_functions(), $this->view);
01760   }

views_plugin_display::render_empty (  )  [inherited]

Render the empty text of the view.

Definition at line 1744 of file views_plugin_display.inc.

References views_plugin_display::render_textarea().

01744 { return $this->render_textarea('empty'); }

views_plugin_display::render_filters (  )  [inherited]

Not all display plugins will support filtering.

Definition at line 1678 of file views_plugin_display.inc.

01678 { }

views_plugin_display::render_footer (  )  [inherited]

Render the footer of the view.

Definition at line 1735 of file views_plugin_display.inc.

References views_plugin_display::render_textarea().

01735                            {
01736     if (!empty($this->view->result) || $this->get_option('footer_empty')) {
01737       return $this->render_textarea('footer');
01738     }
01739   }

views_plugin_display::render_header (  )  [inherited]

Render the header of the view.

Definition at line 1726 of file views_plugin_display.inc.

References views_plugin_display::render_textarea().

01726                            {
01727     if (!empty($this->view->result) || $this->get_option('header_empty')) {
01728       return $this->render_textarea('header');
01729     }
01730   }

views_plugin_display::render_more_link (  )  [inherited]

Render the 'more' link.

Definition at line 1683 of file views_plugin_display.inc.

References views_plugin_display::get_path(), views_plugin_display::query(), views_plugin_display::use_more(), views_plugin_display::use_more_always(), and views_plugin_display::use_more_text().

01683                               {
01684     if ($this->use_more() && ($this->use_more_always() || !isset($this->view->total_rows) || $this->view->total_rows > $this->view->pager['items_per_page'])) {
01685       $path = $this->get_path();
01686       if ($path) {
01687         $path = $this->view->get_url(NULL, $path);
01688         $url_options = array();
01689         if (!empty($this->view->exposed_raw_input)) {
01690           $url_options['query'] = $this->view->exposed_raw_input;
01691         }
01692         $theme = views_theme_functions('views_more', $this->view, $this->display);
01693         $path = check_url(url($path, $url_options));
01694         return theme($theme, $path, $this->use_more_text());
01695       }
01696     }
01697   }

views_plugin_display_attachment::render_pager (  ) 

Does the display render the pager if it has it enabled?

Reimplemented from views_plugin_display.

Definition at line 276 of file views_plugin_display_attachment.inc.

References views_plugin_display::get_option(), and use_pager().

Referenced by option_definition(), options_form(), options_submit(), and options_summary().

00276                           {
00277     return !empty($this->use_pager) && $this->get_option('render_pager');
00278   }

views_plugin_display::render_textarea ( area  )  [inherited]

Render a text area, using the proper format.

Definition at line 1702 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::render_empty(), views_plugin_display::render_footer(), and views_plugin_display::render_header().

01702                                   {
01703     static $formats = array();
01704 
01705     $value = $this->get_option($area);
01706     // Check to make sure the filter format exists; if not, we don't
01707     // display anything.
01708     $format = filter_resolve_format($this->get_option($area . '_format'));
01709 
01710     if (!array_key_exists($format, $formats)) {
01711       $formats[$format] = db_result(db_query("SELECT name FROM {filter_formats} WHERE format = %d", $format));
01712     }
01713 
01714     if (!$formats[$format]) {
01715       return;
01716     }
01717 
01718     if ($value) {
01719       return check_markup($value, $format, FALSE);
01720     }
01721   }

views_object::set_default_options (  )  [inherited]

Set default options.

For backward compatibility, it sends the options array; this is a feature that will likely disappear at some point.

Definition at line 53 of file base.inc.

References views_object::_set_option_defaults(), views_object::option_definition(), and views_object::options().

Referenced by views_object::construct().

00053                                  {
00054     $this->_set_option_defaults($this->options, $this->option_definition());
00055 
00056     // Retained for complex defaults plus backward compatibility.
00057     $this->options($this->options);
00058   }

views_object::set_definition ( definition  )  [inherited]

Let the handler know what its full definition is.

Definition at line 108 of file base.inc.

00108                                        {
00109     $this->definition = $definition;
00110     if (isset($definition['field'])) {
00111       $this->real_field = $definition['field'];
00112     }
00113   }

views_plugin_display::set_option ( option,
value 
) [inherited]

Intelligently set an option either from this display or from the default display, if directed to do so.

Definition at line 587 of file views_plugin_display.inc.

References views_plugin_display::is_defaulted(), and views_object::options().

Referenced by views_plugin_display_page::options_submit(), views_plugin_display_feed::options_submit(), views_plugin_display_block::options_submit(), options_submit(), views_plugin_display::options_submit(), and views_plugin_display::override_option().

00587                                        {
00588     if ($this->is_defaulted($option)) {
00589       return $this->default_display->set_option($option, $value);
00590     }
00591 
00592     // Set this in two places: On the handler where we'll notice it
00593     // but also on the display object so it gets saved. This should
00594     // only be a temporary fix.
00595     $this->display->display_options[$option] = $value;
00596     return $this->options[$option] = $value;
00597   }

views_plugin_display::set_override ( section,
new_state = NULL 
) [inherited]

Flip the override setting for the given section.

Definition at line 1638 of file views_plugin_display.inc.

References views_object::$options, views_plugin_display::defaultable_sections(), views_plugin_display::get_option(), and views_object::options().

Referenced by views_plugin_display::options_override(), and views_plugin_display::override_option().

01638                                                      {
01639     $options = $this->defaultable_sections($section);
01640     if (!$options) {
01641       return;
01642     }
01643 
01644     if (!isset($new_state)) {
01645       $new_state = empty($this->options['defaults'][$section]);
01646     }
01647 
01648     // For each option that is part of this group, fix our settings.
01649     foreach ($options as $option) {
01650       if ($new_state) {
01651         // Revert to defaults.
01652         unset($this->options[$option]);
01653         unset($this->display->display_options[$option]);
01654       }
01655       else {
01656         // copy existing values into our display.
01657         $this->options[$option] = $this->get_option($option);
01658         $this->display->display_options[$option] = $this->options[$option];
01659       }
01660       $this->options['defaults'][$option] = $new_state;
01661       $this->display->display_options['defaults'][$option] = $new_state;
01662     }
01663   }

views_plugin::theme_functions (  )  [inherited]

Provide a full list of possible theme templates used by this style.

Definition at line 379 of file plugins.inc.

Referenced by views_plugin_display::options_form(), views_plugin_style_summary::render(), views_plugin_style_rss::render(), views_plugin_style::render(), views_plugin_row::render(), views_plugin_display::render(), views_plugin_row_search_view::render(), views_plugin_row_comment_rss::render(), and views_plugin_row_aggregator_rss::render().

00379                              {
00380     return views_theme_functions($this->definition['theme'], $this->view, $this->display);
00381   }

views_object::unpack_options ( &$  storage,
options,
definition = NULL 
) [inherited]

Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.

Definition at line 79 of file base.inc.

References views_object::$options, and views_object::option_definition().

Referenced by views_plugin_style::init(), views_plugin_row::init(), views_plugin_display::init(), and views_handler::init().

00079                                                                    {
00080     if (!is_array($options)) {
00081       return;
00082     }
00083 
00084     if (!isset($definition)) {
00085       $definition = $this->option_definition();
00086     }
00087 
00088     foreach ($options as $key => $value) {
00089       if (is_array($value)) {
00090         if (!isset($storage[$key]) || !is_array($storage[$key])) {
00091           $storage[$key] = array();
00092         }
00093 
00094         $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array());
00095       }
00096       else if (!empty($definition[$key]['translatable']) && !empty($value)) {
00097         $storage[$key] = t($value);
00098       }
00099       else {
00100         $storage[$key] = $value;
00101       }
00102     }
00103   }

views_plugin_display::use_ajax (  )  [inherited]

Does the display use AJAX?

Definition at line 105 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::defaultable_sections(), views_plugin_display::option_definition(), views_plugin_display::options_form(), views_plugin_display::options_submit(), views_plugin_display::options_summary(), views_plugin_display::pre_execute(), and views_plugin_display_block::uses_exposed().

00105                       {
00106     if (!empty($this->definition['use ajax'])) {
00107       return $this->get_option('use_ajax');
00108     }
00109     return FALSE;
00110   }

views_plugin_display::use_more (  )  [inherited]

Does the display have a more link enabled?

Definition at line 132 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::defaultable_sections(), views_plugin_display::option_definition(), views_plugin_display::options_form(), views_plugin_display::options_submit(), views_plugin_display::options_summary(), views_plugin_display::pre_execute(), and views_plugin_display::render_more_link().

00132                       {
00133     if (!empty($this->definition['use more'])) {
00134       return $this->get_option('use_more');
00135     }
00136     return FALSE;
00137   }

views_plugin_display::use_more_always (  )  [inherited]

Should the enabled display more link be shown when no more items?

Definition at line 142 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::defaultable_sections(), views_plugin_display::option_definition(), views_plugin_display::options_form(), views_plugin_display::options_submit(), and views_plugin_display::render_more_link().

00142                              {
00143     if (!empty($this->definition['use more'])) {
00144       return $this->get_option('use_more_always');
00145     }
00146     return FALSE;
00147   }

views_plugin_display::use_more_text (  )  [inherited]

Does the display have custom link text?

Definition at line 152 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::defaultable_sections(), views_plugin_display::option_definition(), views_plugin_display::options_form(), views_plugin_display::options_submit(), and views_plugin_display::render_more_link().

00152                            {
00153     if (!empty($this->definition['use more'])) {
00154       return $this->get_option('use_more_text');
00155     }
00156     return FALSE;
00157   }

views_plugin_display_attachment::use_pager (  ) 

Does the display have a pager enabled?

Reimplemented from views_plugin_display.

Definition at line 272 of file views_plugin_display_attachment.inc.

Referenced by render_pager().

00272                        {
00273     return !empty($this->use_pager);
00274   }

views_plugin_display::uses_breadcrumb (  )  [inherited]

Check to see if the display needs a breadcrumb.

By default, displays do not need breadcrumbs

Reimplemented in views_plugin_display_feed, and views_plugin_display_page.

Definition at line 458 of file views_plugin_display.inc.

00458 { return FALSE; }

views_plugin_display_attachment::uses_exposed (  ) 

Attachment displays only use exposed widgets if they are set to inherit the exposed filter settings of their parent display.

Reimplemented from views_plugin_display.

Definition at line 256 of file views_plugin_display_attachment.inc.

References views_object::options().

00256                           {
00257     if (!empty($this->options['inherit_exposed_filters']) && parent::uses_exposed()) {
00258       return TRUE;
00259     }
00260     return FALSE;
00261   }

views_plugin_display::uses_fields (  )  [inherited]

Determine if the display's style uses fields.

Definition at line 488 of file views_plugin_display.inc.

References views_plugin_display::get_plugin().

Referenced by views_plugin_display::options_form(), and views_plugin_display::validate().

00488                          {
00489     $plugin = $this->get_plugin();
00490     if ($plugin) {
00491       return $plugin->uses_fields();
00492     }
00493   }

views_plugin_display::uses_link_display (  )  [inherited]

Check to see if the display has some need to link to another display.

For the most part, displays without a path will use a link display. However, sometimes displays that have a path might also need to link to another display. This is true for feeds.

Reimplemented in views_plugin_display_feed.

Definition at line 414 of file views_plugin_display.inc.

References views_plugin_display::has_path().

Referenced by views_plugin_display::options_summary().

00414 { return !$this->has_path(); }

views_plugin_display::validate (  )  [inherited]

Make sure the display and all associated handlers are valid.

Returns:
Empty array if the display is valid; an array of error strings if it is not.

Reimplemented from views_plugin.

Reimplemented in views_plugin_display_page.

Definition at line 1828 of file views_plugin_display.inc.

References $field, views_plugin_display::get_handlers(), views_plugin_display::get_option(), views_plugin_display::get_plugin(), views_plugin_display::has_path(), views_object::options(), views_plugin_display::uses_fields(), and views_object_types().

01828                       {
01829     $errors = array();
01830     // Make sure displays that use fields HAVE fields.
01831     if ($this->uses_fields()) {
01832       $fields = FALSE;
01833       foreach ($this->get_handlers('field') as $field) {
01834         if (empty($field->options['exclude'])) {
01835           $fields = TRUE;
01836         }
01837       }
01838 
01839       if (!$fields) {
01840         $errors[] = t('Display "@display" uses fields but there are none defined for it or all are excluded.', array('@display' => $this->display->display_title));
01841       }
01842     }
01843 
01844     if ($this->has_path() && !$this->get_option('path')) {
01845       $errors[] = t('Display "@display" uses a path but the path is undefined.', array('@display' => $this->display->display_title));
01846     }
01847 
01848     // Validate style plugin
01849     $style = $this->get_plugin();
01850     if (empty($style)) {
01851       $errors[] = t('Display "@display" has an invalid style plugin.', array('@display' => $this->display->display_title));
01852     }
01853     else {
01854       $result = $style->validate();
01855       if (!empty($result) && is_array($result)) {
01856         $errors = array_merge($errors, $result);
01857       }
01858     }
01859 
01860     // Validate handlers
01861     foreach (views_object_types() as $type => $info) {
01862       foreach ($this->get_handlers($type) as $handler) {
01863         $result = $handler->validate();
01864         if (!empty($result) && is_array($result)) {
01865           $errors = array_merge($errors, $result);
01866         }
01867       }
01868     }
01869 
01870     return $errors;
01871   }

views_plugin_display::view_special_blocks ( type  )  [inherited]

Render any special blocks provided for this display.

Definition at line 1906 of file views_plugin_display.inc.

01906                                       {
01907     if ($type == '-exp') {
01908       // avoid interfering with the admin forms.
01909       if (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'views') {
01910         return;
01911       }
01912       $this->view->init_handlers();
01913       return array(
01914         'content' => $this->view->render_exposed_form(TRUE),
01915       );
01916     }
01917   }


Member Data Documentation

views_object::$options = array() [inherited]

Except for displays, options for the object will be held here.

Definition at line 16 of file base.inc.

Referenced by views_plugin_display::_set_option_defaults(), views_object::_set_option_defaults(), views_handler_filter_string::admin_summary(), views_handler_filter_numeric::admin_summary(), views_handler_argument::default_argument_form(), views_handler_filter_term_node_tid::extra_options_form(), views_plugin_display::get_plugin(), views_handler_filter_node_type::get_value_options(), views_plugin_style::init(), views_plugin_row::init(), views_plugin_display::init(), views_handler_field_upload_description::init(), views_handler_field_term_node_tid::init(), views_handler_field_file::init(), views_plugin_row_node_view::init(), views_handler_field_history_user_timestamp::init(), views_handler_field_node_new_comments::init(), views_handler_field_comment::init(), views_handler::init(), views_handler_relationship::init(), views_handler_filter_many_to_one::init(), views_handler_filter::init(), views_handler_field::init(), views_handler_argument_string::init(), views_handler_argument_many_to_one::init(), views_handler_argument::init(), views_handler_filter::operator_form(), views_handler_filter_string::operator_options(), views_handler_filter_numeric::operator_options(), views_handler_filter_in_operator::operator_options(), views_handler_filter_string::operator_values(), views_handler_filter_numeric::operator_values(), views_handler_filter_in_operator::operator_values(), views_plugin_cache_time::option_defaults(), views_plugin_access_role::option_defaults(), views_plugin_access_perm::option_defaults(), views_plugin_style_table::option_definition(), views_plugin_style_summary_unformatted::option_definition(), views_plugin_style_summary_jump_menu::option_definition(), views_plugin_style_summary::option_definition(), views_plugin_style_rss::option_definition(), views_plugin_style_list::option_definition(), views_plugin_style_jump_menu::option_definition(), views_plugin_style_grid::option_definition(), views_plugin_style::option_definition(), views_plugin_row_fields::option_definition(), views_plugin_row::option_definition(), views_plugin_display_page::option_definition(), views_plugin_display_feed::option_definition(), views_plugin_display_block::option_definition(), option_definition(), views_plugin_display::option_definition(), views_handler_field_user_name::option_definition(), views_handler_field_user_mail::option_definition(), views_handler_field_user_link::option_definition(), views_handler_field_user::option_definition(), views_handler_field_is_online::option_definition(), views_handler_field_upload_fid::option_definition(), views_handler_field_upload_description::option_definition(), views_handler_relationship_translation::option_definition(), views_handler_filter_node_tnid::option_definition(), views_handler_relationship_node_term_data::option_definition(), views_handler_filter_term_node_tid_depth::option_definition(), views_handler_filter_term_node_tid::option_definition(), views_handler_field_term_node_tid::option_definition(), views_handler_field_taxonomy::option_definition(), views_handler_argument_term_node_tid_depth::option_definition(), views_handler_argument_term_node_tid::option_definition(), views_handler_field_file::option_definition(), views_handler_field_accesslog_path::option_definition(), views_plugin_row_search_view::option_definition(), views_handler_filter_search::option_definition(), views_handler_field_search_score::option_definition(), views_plugin_row_node_view::option_definition(), views_plugin_row_node_rss::option_definition(), views_handler_field_node_link::option_definition(), views_handler_field_node::option_definition(), views_handler_field_history_user_timestamp::option_definition(), views_handler_field_locale_link_edit::option_definition(), views_handler_field_contact_link::option_definition(), views_plugin_row_comment_view::option_definition(), views_handler_field_node_new_comments::option_definition(), views_handler_field_ncs_last_comment_name::option_definition(), views_handler_field_comment_username::option_definition(), views_handler_field_comment_node_link::option_definition(), views_handler_field_comment_link::option_definition(), views_handler_field_comment::option_definition(), views_plugin_row_aggregator_rss::option_definition(), views_handler_field_aggregator_title_link::option_definition(), views_handler_field_aggregator_category::option_definition(), views_handler_sort_date::option_definition(), views_handler_sort::option_definition(), views_handler_relationship::option_definition(), views_handler_filter_string::option_definition(), views_handler_filter_numeric::option_definition(), views_handler_filter_many_to_one::option_definition(), views_handler_filter_in_operator::option_definition(), views_handler_filter_date::option_definition(), views_handler_filter_boolean_operator::option_definition(), views_handler_filter::option_definition(), views_handler_field_url::option_definition(), views_handler_field_prerender_list::option_definition(), views_handler_field_numeric::option_definition(), views_handler_field_date::option_definition(), views_handler_field_custom::option_definition(), views_handler_field_counter::option_definition(), views_handler_field_boolean::option_definition(), views_handler_field_file_size::option_definition(), views_handler_field::option_definition(), views_handler_argument_string::option_definition(), views_handler_argument_numeric::option_definition(), views_handler_argument_null::option_definition(), views_handler_argument_many_to_one::option_definition(), views_handler_argument::option_definition(), views_plugin_style_default::options(), views_plugin_style_jump_menu::options_form(), views_plugin_style::options_form(), views_plugin_row_fields::options_form(), views_plugin_display::options_form(), views_plugin_cache_time::options_form(), views_handler_relationship_translation::options_form(), views_handler_relationship_node_term_data::options_form(), views_handler_field_term_node_tid::options_form(), views_handler_field_search_score::options_form(), views_plugin_row_node_view::options_form(), views_handler_field::options_form(), views_handler_argument::options_form(), views_plugin_display_page::options_summary(), views_plugin_display_feed::options_summary(), views_plugin_display_block::options_summary(), options_summary(), views_plugin_display::options_summary(), views_handler_filter_in_operator::reduce_value_options(), views_plugin_style_summary_jump_menu::render(), views_plugin_style_jump_menu::render(), views_plugin_style_jump_menu::render_set(), views_plugin_display::set_override(), views_object::unpack_options(), views_plugin_argument_validate_taxonomy_term::validate_form(), views_plugin_argument_validate_node::validate_form(), views_handler_filter_term_node_tid::value_form(), and views_handler_filter_in_operator::value_form().


The documentation for this class was generated from the following file:
Generated on Mon Nov 30 15:06:57 2009 for Views by  doxygen 1.4.7