Public Member Functions | Public Attributes

views_plugin_display_page Class Reference
[Views' display plugins]

The plugin that handles a full page. More...

Inheritance diagram for views_plugin_display_page:
views_plugin_display views_plugin views_object views_plugin_display_feed

List of all members.

Public Member Functions

 has_path ()
 The page display has a path.
 uses_breadcrumb ()
 Check to see if the display needs a breadcrumb.
 option_definition ()
 Information about options for all kinds of purposes will be held here.
 execute_hook_menu ($callbacks)
 Add this display's path information to Drupal's menu system.
 execute ()
 The display page handler returns a normal view, but it also does a drupal_set_title for the page, and does a views_set_page_view on the view.
 options_summary (&$categories, &$options)
 Provide the summary for page options in the views UI.
 options_form (&$form, &$form_state)
 Provide the default form for setting options.
 options_validate (&$form, &$form_state)
 Validate the options form.
 options_submit (&$form, &$form_state)
 Perform any necessary changes to the form values prior to storage.
 validate ()
 Make sure the display and all associated handlers are valid.
 get_argument_text ()
 Provide some helpful text for the arguments.
 get_pager_text ()
 Provide some helpful text for pagers.
 init (&$view, &$display, $options=NULL)
 construct ()
 Views handlers use a special construct function so that we can more easily construct them with variable arguments.
 destroy ()
 is_default_display ()
 Determine if this display is the 'default' display which contains fallback settings.
 uses_exposed ()
 Determine if this display uses exposed filters, so the view will know whether or not to build them.
 displays_exposed ()
 Determine if this display should display the exposed filters widgets, so the view will know whether or not to render them.
 use_ajax ()
 Does the display use AJAX?
 use_pager ()
 Does the display have a pager enabled?
 use_more ()
 Does the display have a more link enabled?
 use_group_by ()
 Does the display have groupby 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?
 attach_to ($display_id)
 Allow displays to attach to other views.
 defaultable_sections ($section=NULL)
 Static member function to list which sections are defaultable and what items each section contains.
 uses_link_display ()
 Check to see if the display has some need to link to another display.
 uses_exposed_form_in_block ()
 Check to see if the display can put the exposed formin a block.
 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.
 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 instance of a plugin, for example style or row.
get_handler ($type, $id)
 Get the handler object for a single handler.
 get_handlers ($type)
 Get a full array of handlers for $type.
 get_field_labels ()
 Retrieve a list of fields for the current display with the relationship associated if it exists.
 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.
 get_arguments_tokens ()
 Returns to tokens for arguments.
 format_themes ($themes)
 Format a list of theme templates for output by the theme info helper.
 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_pager ()
 Not all display plugins will suppert pager rendering.
 render_more_link ()
 Render the 'more' link.
 render_header ()
 Legacy functions.
 render_footer ()
 Render the footer of the view.
 render_empty ()
 hook_block_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.
 render_area ($area, $empty=FALSE)
 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.
 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.
 export_option ($indent, $prefix, $storage, $option, $definition, $parents)
 Override of export_option().
 export_handler ($indent, $prefix, $storage, $option, $definition, $parents)
 Special method to export items that have handlers.
 export_style ($indent, $prefix, $storage, $option, $definition, $parents)
 Special handling for the style export.
 export_plugin ($indent, $prefix, $storage, $option, $definition, $parents)
 Special handling for plugin export.
 unpack_style ($indent, $prefix, $storage, $option, $definition, $parents)
 unpack_plugin (&$translatable, $storage, $option, $definition, $parents)
 Special handling for plugin unpacking.
 unpack_handler (&$translatable, $storage, $option, $definition, $parents)
 Special method to unpack items that have handlers.
 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.
 summary_title ()
 Returns the summary of the settings in the display.
 plugin_title ()
 Return the human readable name of the display.
 options (&$options)
 Set default options on this object.
 set_default_options ()
 Set default options.
 _set_option_defaults (&$storage, $options, $level=0)
 unpack_options (&$storage, $options, $definition=NULL, $all=TRUE, $check=TRUE, $localization_keys=array())
 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.
 export_options ($indent, $prefix)
 unpack_translatables (&$translatable, $parents=array())
 Unpacks each handler to store translatable texts.
 unpack_translatable (&$translatable, $storage, $option, $definition, $parents, $keys=array())
 Unpack a single option definition.

Public Attributes

 $view = NULL
 $handlers = array()
 $extender = array()
 Stores all available display extenders.
 $display = NULL
 $plugin_type = NULL
 The plugin type of this plugin, for example style or query.
 $options = array()
 Except for displays, options for the object will be held here.
 $definition

Detailed Description

The plugin that handles a full page.

Definition at line 12 of file views_plugin_display_page.inc.


Member Function Documentation

views_plugin_display::accept_attachments (  )  [inherited]

Can this display accept attachments?

Definition at line 365 of file views_plugin_display.inc.

                                {
    if (empty($this->definition['accept attachments'])) {
      return FALSE;
    }
    if (!empty($this->view->argument) && $this->get_option('hide_attachment_summary')) {
      foreach ($this->view->argument as $argument_id => $argument) {
        if ($argument->needs_style_plugin() && empty($argument->argument_validated)) {
          return FALSE;
        }
      }
    }
    return TRUE;
  }

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

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

Definition at line 2548 of file views_plugin_display.inc.

References views_plugin_display::get_plugin().

Referenced by views_plugin_display_attachment::attach_to().

                                   {
    if (!isset($account)) {
      global $user;
      $account = $user;
    }

    // Full override.
    if (user_access('access all views', $account)) {
      return TRUE;
    }

    $plugin = $this->get_plugin('access');
    if ($plugin) {
      return $plugin->access($account);
    }

    // fallback to all access if no plugin.
    return TRUE;
  }

views_plugin::additional_theme_functions (  )  [inherited]

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

Definition at line 518 of file plugins.inc.

References views_theme_functions().

Referenced by views_plugin_display::options_form().

                                        {
    $funcs = array();
    if (!empty($this->definition['additional themes'])) {
      foreach ($this->definition['additional themes'] as $theme => $type) {
        $funcs[] = views_theme_functions($theme, $this->view, $this->display);
      }
    }
    return $funcs;
  }

views_plugin_display::attach_to ( display_id  )  [inherited]

Allow displays to attach to other views.

Reimplemented in views_plugin_display_attachment, and views_plugin_display_feed.

Definition at line 382 of file views_plugin_display.inc.

{ }

views_plugin_display::construct (  )  [inherited]

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

Reimplemented from views_object.

Definition at line 221 of file views_plugin_display.inc.

References views_plugin_display::$extender, views_fetch_plugin_data(), views_get_enabled_display_extenders(), and vpr().

                       {
    // Load extenders as soon as possible
    $this->extender = array();
    $extenders = views_get_enabled_display_extenders();
    // If you update to the dev version the registry might not be loaded yet.
    if (!empty($extenders) && class_exists('views_plugin_display_extender')) {
      foreach ($extenders as $extender) {
        $data = views_fetch_plugin_data('display_extender', $extender);
        if (isset($data['handler']) && class_exists($data['handler'])) {
          $this->extender[$extender] = new $data['handler']($this->view, $this);
        }
        else {
          vpr('Invalid display extender @extender', array('@handler' => $extender));
        }
      }
    }
    parent::construct();
  }

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 388 of file views_plugin_display.inc.

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

                                                 {
    $sections = array(
      'access' => array('access', 'access_options'),
      'access_options' => array('access', 'access_options'),
      'cache' => array('cache', 'cache_options'),
      'cache_options' => array('cache', 'cache_options'),
      'title' => array('title'),
      'css_class' => array('css_class'),
      'use_ajax' => array('use_ajax'),
      'hide_attachment_summary' => array('hide_attachment_summary'),
      'group_by' => array('group_by'),
      'query' => array('query'),
      'use_more' => array('use_more', 'use_more_always', 'use_more_text'),
      'link_display' => array('link_display', 'link_url'),

      // Force these to cascade properly.
      'style_plugin' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),
      'style_options' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),
      'row_plugin' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),
      'row_options' => array('style_plugin', 'style_options', 'row_plugin', 'row_options'),

      'pager' => array('pager', 'pager_options'),
      'pager_options' => array('pager', 'pager_options'),

      'exposed_form' => array('exposed_form', 'exposed_form_options'),
      'exposed_form_options' => array('exposed_form', 'exposed_form_options'),

      // These guys are special
      'header' => array('header'),
      'footer' => array('footer'),
      'empty' => array('empty'),
      'relationships' => array('relationships'),
      'fields' => array('fields'),
      'sorts' => array('sorts'),
      'arguments' => array('arguments'),
      'filters' => array('filters', 'filter_groups'),
    );

    // If the display cannot use a pager, then we cannot default it.
    if (empty($this->definition['use pager'])) {
      unset($sections['pager']);
      unset($sections['items_per_page']);
    }

    foreach ($this->extender as $extender) {
      $extender->defaultable_sections($sections, $section);
    }

    if ($section) {
      if (!empty($sections[$section])) {
        return $sections[$section];
      }
    }
    else {
      return $sections;
    }
  }

views_plugin_display::displays_exposed (  )  [inherited]

Determine if this display should display the exposed filters widgets, so the view will know whether or not to render them.

Regardless of what this function returns, exposed filters will not be used nor displayed unless uses_exposed() returns TRUE.

Reimplemented in views_plugin_display_attachment.

Definition at line 301 of file views_plugin_display.inc.

                              {
    return TRUE;
  }

views_plugin_display_page::execute (  ) 

The display page handler returns a normal view, but it also does a drupal_set_title for the page, and does a views_set_page_view on the view.

Reimplemented from views_plugin_display.

Reimplemented in views_plugin_display_feed.

Definition at line 209 of file views_plugin_display_page.inc.

References views_set_page_view().

                     {
    // Let the world know that this is the page view we're using.
    views_set_page_view($this->view);

    // Prior to this being called, the $view should already be set to this
    // display, and arguments should be set on the view.
    $this->view->build();
    if (!empty($this->view->build_info['fail'])) {
      return drupal_not_found();
    }

    $this->view->get_breadcrumb(TRUE);


    // And now render the view.
    $render = $this->view->render();

    // First execute the view so it's possible to get tokens for the title.
    // And the title, which is much easier.
    drupal_set_title(filter_xss_admin($this->view->get_title()), PASS_THROUGH);
    return $render;
  }

views_plugin_display_page::execute_hook_menu ( callbacks  ) 

Add this display's path information to Drupal's menu system.

Definition at line 51 of file views_plugin_display_page.inc.

References views_plugin_display::get_option(), views_plugin_display::get_plugin(), and views_get_plugin().

                                         {
    $items = array();
    // Replace % with the link to our standard views argument loader
    // views_arg_load -- which lives in views.module

    $bits = explode('/', $this->get_option('path'));
    $page_arguments = array($this->view->name, $this->display->id);
    $this->view->init_handlers();
    $view_arguments = $this->view->argument;

    // Replace % with %views_arg for menu autoloading and add to the
    // page arguments so the argument actually comes through.
    foreach ($bits as $pos => $bit) {
      if ($bit == '%') {
        $argument = array_shift($view_arguments);
        if (!empty($argument->options['specify_validation']) && $argument->options['validate']['type'] != 'none') {
          $bits[$pos] = '%views_arg';
        }
        $page_arguments[] = $pos;
      }
    }

    $path = implode('/', $bits);

    $access_plugin = $this->get_plugin('access');
    if (!isset($access_plugin)) {
      $access_plugin = views_get_plugin('access', 'none');
    }

    // Get access callback might return an array of the callback + the dynamic arguments.
    $access_plugin_callback = $access_plugin->get_access_callback();

    if (is_array($access_plugin_callback)) {
      $access_arguments = array();

      // Find the plugin arguments.
      $access_plugin_method = array_shift($access_plugin_callback);
      $access_plugin_arguments = array_shift($access_plugin_callback);
      if (!is_array($access_plugin_arguments)) {
        $access_plugin_arguments = array();
      }

      $access_arguments[0] = array($access_plugin_method, &$access_plugin_arguments);

      // Move the plugin arguments to the access arguments array.
      $i = 1;
      foreach ($access_plugin_arguments as $key => $value) {
        if (is_int($value)) {
          $access_arguments[$i] = $value;
          $access_plugin_arguments[$key] = $i;
          $i++;
        }
      }
    }
    else {
      $access_arguments = array($access_plugin_callback);
    }

    if ($path) {
      $items[$path] = array(
        // default views page entry
        'page callback' => 'views_page',
        'page arguments' => $page_arguments,
        // Default access check (per display)
        'access callback' => 'views_access',
        'access arguments' => $access_arguments,
        // Identify URL embedded arguments and correlate them to a handler
        'load arguments'  => array($this->view->name, $this->display->id, '%index'),
      );
      $menu = $this->get_option('menu');
      if (empty($menu)) {
        $menu = array('type' => 'none');
      }
      // Set the title and description if we have one.
      if ($menu['type'] != 'none') {
        $items[$path]['title'] = $menu['title'];
        $items[$path]['description'] = $menu['description'];
      }

      if (isset($menu['weight'])) {
        $items[$path]['weight'] = intval($menu['weight']);
      }

      switch ($menu['type']) {
        case 'none':
        default:
          $items[$path]['type'] = MENU_CALLBACK;
          break;
        case 'normal':
          $items[$path]['type'] = MENU_NORMAL_ITEM;
          // Insert item into the proper menu
          $items[$path]['menu_name'] = $menu['name'];
          break;
        case 'tab':
          $items[$path]['type'] = MENU_LOCAL_TASK;
          break;
        case 'default tab':
          $items[$path]['type'] = MENU_DEFAULT_LOCAL_TASK;
          break;
      }

      // Add context for contextual links.
      // @see menu_contextual_links()
      if (!empty($menu['context'])) {
        $items[$path]['context'] = MENU_CONTEXT_INLINE;
      }

      // If this is a 'default' tab, check to see if we have to create teh
      // parent menu item.
      if ($menu['type'] == 'default tab') {
        $tab_options = $this->get_option('tab_options');
        if (!empty($tab_options['type']) && $tab_options['type'] != 'none') {
          $bits = explode('/', $path);
          // Remove the last piece.
          $bit = array_pop($bits);

          // we can't do this if they tried to make the last path bit variable.
          // @todo: We can validate this.
          if ($bit != '%views_arg' && !empty($bits)) {
            $default_path = implode('/', $bits);
            $items[$default_path] = array(
              // default views page entry
              'page callback' => 'views_page',
              'page arguments' => $page_arguments,
              // Default access check (per display)
              'access callback' => 'views_access',
              'access arguments' => $access_arguments,
              // Identify URL embedded arguments and correlate them to a handler
              'load arguments'  => array($this->view->name, $this->display->id, '%index'),
              'title' => $tab_options['title'],
              'description' => $tab_options['description'],
              'menu_name' => $tab_options['name'],
            );
            switch ($tab_options['type']) {
              default:
              case 'normal':
                $items[$default_path]['type'] = MENU_NORMAL_ITEM;
                break;
              case 'tab':
                $items[$default_path]['type'] = MENU_LOCAL_TASK;
                break;
            }
            if (isset($tab_options['weight'])) {
              $items[$default_path]['weight'] = intval($tab_options['weight']);
            }
          }
        }
      }
    }

    return $items;
  }

views_plugin_display::export_handler ( indent,
prefix,
storage,
option,
definition,
parents 
) [inherited]

Special method to export items that have handlers.

This method was specified in the option_definition() as the method to utilize to export fields, filters, sort criteria, relationships and arguments. This passes the export off to the individual handlers so that they can export themselves properly.

Definition at line 2757 of file views_plugin_display.inc.

References views_plugin_display::use_group_by(), views_get_handler(), and views_object_types().

                                                                                      {
    $output = '';

    // cut the 's' off because the data is stored as the plural form but we need
    // the singular form. Who designed that anyway? Oh yeah, I did. :(
    if ($option != 'header' && $option != 'footer' && $option != 'empty') {
      $type = substr($option, 0, -1);
    }
    else {
      $type = $option;
    }
    $types = views_object_types();
    foreach ($storage[$option] as $id => $info) {
      if (!empty($types[$type]['type'])) {
        $handler_type = $types[$type]['type'];
      }
      else {
        $handler_type = $type;
      }
      // If aggregation is on, the group type might override the actual
      // handler that is in use. This piece of code checks that and,
      // if necessary, sets the override handler.
      $override = NULL;
      if ($this->use_group_by() && !empty($info['group_type'])) {
        if (empty($this->view->query)) {
          $this->view->init_query();
        }
        $aggregate = $this->view->query->get_aggregation_info();
        if (!empty($aggregate[$info['group_type']]['handler'][$type])) {
          $override = $aggregate[$info['group_type']]['handler'][$type];
        }
      }
      $handler = views_get_handler($info['table'], $info['field'], $handler_type, $override);
      if ($handler) {
        $handler->init($this->view, $info);
        $output .= $indent . '/* ' . $types[$type]['stitle'] . ': ' . $handler->ui_name() . " */\n";
        $output .= $handler->export_options($indent, $prefix . "['$option']['$id']");
      }

      // Prevent reference problems.
      unset($handler);
    }

    return $output;
  }

views_plugin_display::export_option ( indent,
prefix,
storage,
option,
definition,
parents 
) [inherited]

Override of export_option().

Because displays do not want to export options that are NOT overridden from the default display, we need some special handling during the export process.

Reimplemented from views_object.

Definition at line 2728 of file views_plugin_display.inc.

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

                                                                                     {
    // The $prefix is wrong because we store our actual options a little differently:
    $prefix = '$handler->display->display_options';
    $output = '';
    if (!$parents && !$this->is_default_display()) {
      // Do not export items that are not overridden.
      if ($this->is_defaulted($option)) {
        return;
      }

      // If this is not defaulted and is overrideable, flip the switch to say this
      // is overridden.
      if ($this->defaultable_sections($option)) {
        $output .= $indent . $prefix . "['defaults']['$option'] = FALSE;\n";
      }
    }

    $output .= parent::export_option($indent, $prefix, $storage, $option, $definition, $parents);
    return $output;
  }

views_plugin_display::export_plugin ( indent,
prefix,
storage,
option,
definition,
parents 
) [inherited]

Special handling for plugin export.

Plugins other than styles are stored in array with 'type' being the key to the plugin. For modern plugins, the options are stored in the 'options' array, but for legacy plugins (access and cache) options are stored as siblings to the type.

Definition at line 2849 of file views_plugin_display.inc.

References views_plugin::$plugin_type, and views_plugin_display::get_plugin().

                                                                                     {
    $output = '';
    $plugin_type = end($parents);
    $plugin = $this->get_plugin($plugin_type);
    if ($plugin) {
      // Write which plugin to use.
      $value = $storage[$option];
      $new_prefix = $prefix . "['$plugin_type']";

      $output .= $indent . $new_prefix . "['$option'] = '$value';\n";

      if ($plugin_type != 'access' && $plugin_type!= 'cache') {
        $new_prefix .= "['options']";
      }

      // Pass off to the plugin to export itself.
      $output .= $plugin->export_options($indent, $new_prefix);
    }

    return $output;
  }

views_plugin_display::export_style ( indent,
prefix,
storage,
option,
definition,
parents 
) [inherited]

Special handling for the style export.

Styles are stored as style_plugin and style_options or row_plugin and row_options accordingly. The options are told not to export, and the export for the plugin should export both.

Definition at line 2810 of file views_plugin_display.inc.

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

                                                                                    {
    $output = '';
    $style_plugin = $this->get_plugin();
    if ($option == 'style_plugin') {
      $type = 'style';
      $options_field = 'style_options';
      $plugin = $style_plugin;
    }
    else {
      if (!$style_plugin || !$style_plugin->uses_row_plugin()) {
        return;
      }

      $type = 'row';
      $options_field = 'row_options';
      $plugin = $this->get_plugin('row');
      // If the style plugin doesn't use row plugins, don't even bother.
    }

    if ($plugin) {
      // Write which plugin to use.
      $value = $this->get_option($option);
      $output .= $indent . $prefix . "['$option'] = '$value';\n";

      // Pass off to the plugin to export itself.
      $output .= $plugin->export_options($indent, $prefix . "['$options_field']");
    }

    return $output;
  }

views_plugin_display::format_themes ( themes  )  [inherited]

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

Definition at line 2111 of file views_plugin_display.inc.

Referenced by views_plugin_display::options_form().

                                  {
    $registry = $this->theme_registry;
    $extension = $this->theme_extension;

    $output = '';
    $picked = FALSE;
    foreach ($themes as $theme) {
      $template = strtr($theme, '_', '-') . $extension;
      if (!$picked && !empty($registry[$theme])) {
        $template_path = isset($registry[$theme]['path']) ? $registry[$theme]['path'] . '/' : './';
        if (file_exists($template_path . $template)) {
          $hint = t('File found in folder @template-path', array('@template-path' => $template_path));
          $template = '<strong title="'. $hint .'">' . $template . '</strong>';
        }
        else {
          $template = '<strong class="error">' . $template . ' ' . t('(File not found, in folder @template-path)', array('@template-path' => $template_path)) . '</strong>';
        }
        $picked = TRUE;
      }
      $fixed[] = $template;
    }

    return implode(', ', array_reverse($fixed));
  }

views_plugin_display_page::get_argument_text (  ) 

Provide some helpful text for the arguments.

The result should contain of an array with

  • filter value present: The title of the fieldset in the argument where you can configure what should be done with a given argument.
  • filter value not present: The tiel of the fieldset in the argument where you can configure what should be done if the argument does not exist.
  • description: A description about how arguments comes to the display. For example blocks don't get it from url.

Reimplemented from views_plugin_display.

Definition at line 537 of file views_plugin_display_page.inc.

                               {
    return array(
      'filter value not present' => t('When the filter value is <em>NOT</em> in the URL'),
      'filter value present' => t('When the filter value <em>IS</em> in the URL or a default is provided'),
      'description' => t('The contextual filter values is provided by the URL.'),
    );
  }

views_plugin_display::get_arguments_tokens (  )  [inherited]

Returns to tokens for arguments.

This function is similar to views_handler_field::get_render_tokens() but without fields tokens.

Definition at line 1025 of file views_plugin_display.inc.

Referenced by views_plugin_display::render_more_link().

                                  {
    $tokens = array();
    if (!empty($this->view->build_info['substitutions'])) {
      $tokens = $this->view->build_info['substitutions'];
    }
    $count = 0;
    foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
      $token = '%' . ++$count;
      if (!isset($tokens[$token])) {
        $tokens[$token] = '';
      }

      // Use strip tags as there should never be HTML in the path.
      // However, we need to preserve special characters like " that
      // were removed by check_plain().
      $tokens['!' . $count] = isset($this->view->args[$count - 1]) ? strip_tags(decode_entities($this->view->args[$count - 1])) : '';
    }

    return $tokens;
  }

views_plugin_display::get_field_labels (  )  [inherited]

Retrieve a list of fields for the current display with the relationship associated if it exists.

Definition at line 949 of file views_plugin_display.inc.

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

                              {
    $options = array();
    foreach ($this->get_handlers('relationship') as $relationship => $handler) {
      if ($label = $handler->label()) {
        $relationships[$relationship] = $label;
      }
      else {
        $relationships[$relationship] = $handler->ui_name();
      }
    }

    foreach ($this->get_handlers('field') as $id => $handler) {
      if ($label = $handler->label()) {
        $options[$id] = $label;
      }
      else {
        $options[$id] = $handler->ui_name();
      }
      if (!empty($handler->options['relationship']) && !empty($relationships[$handler->options['relationship']])) {
        $options[$id] = '(' . $relationships[$handler->options['relationship']] . ') ' . $options[$id];
      }
    }
    return $options;
  }

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

Get the handler object for a single handler.

Definition at line 870 of file views_plugin_display.inc.

References views_plugin_display::get_handlers().

                                    {
    if (!isset($this->handlers[$type])) {
      $this->get_handlers($type);
    }

    if (isset($this->handlers[$type][$id])) {
      return $this->handlers[$type][$id];
    }

    // So we can return a reference.
    $null = NULL;
    return $null;
  }

views_plugin_display::get_handlers ( type  )  [inherited]

Get a full array of handlers for $type.

This caches them.

Definition at line 887 of file views_plugin_display.inc.

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

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

                               {
    if (!isset($this->handlers[$type])) {
      $this->handlers[$type] = array();
      $types = views_object_types();
      $plural = $types[$type]['plural'];

      foreach ($this->get_option($plural) as $id => $info) {
        // If this is during form submission and there are temporary options
        // which can only appear if the view is in the edit cache, use those
        // options instead. This is used for AJAX multi-step stuff.
        if (isset($_POST['form_id']) && isset($this->view->temporary_options[$type][$id])) {
          $info = $this->view->temporary_options[$type][$id];
        }

        if ($info['id'] != $id) {
          $info['id'] = $id;
        }

        // If aggregation is on, the group type might override the actual
        // handler that is in use. This piece of code checks that and,
        // if necessary, sets the override handler.
        $override = NULL;
        if ($this->use_group_by() && !empty($info['group_type'])) {
          if (empty($this->view->query)) {
            $this->view->init_query();
          }
          $aggregate = $this->view->query->get_aggregation_info();
          if (!empty($aggregate[$info['group_type']]['handler'][$type])) {
            $override = $aggregate[$info['group_type']]['handler'][$type];
          }
        }

        if (!empty($types[$type]['type'])) {
          $handler_type = $types[$type]['type'];
        }
        else {
          $handler_type = $type;
        }

        $handler = views_get_handler($info['table'], $info['field'], $handler_type, $override);
        if ($handler) {
          // Special override for area types so they know where they come from.
          if ($handler_type == 'area') {
            $handler->handler_type = $type;
          }

          $handler->init($this->view, $info);
          $this->handlers[$type][$id] = &$handler;
        }

        // Prevent reference problems.
        unset($handler);
      }
    }

    return $this->handlers[$type];
  }

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 729 of file views_plugin_display.inc.

References views_plugin_display::get_option().

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

                              {
    $display_id = $this->get_option('link_display');
    // If unknown, pick the first one.
    if (empty($display_id) || empty($this->view->display[$display_id])) {
      foreach ($this->view->display as $display_id => $display) {
        if (!empty($display->handler) && $display->handler->has_path()) {
          return $display_id;
        }
      }
    }
    else {
      return $display_id;
    }
    // fall-through returns NULL
  }

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 784 of file views_plugin_display.inc.

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

Referenced by views_plugin_display_feed::attach_to(), views_plugin_display_attachment::attach_to(), views_plugin_display_block::execute(), views_plugin_display_block::execute_hook_block_list(), execute_hook_menu(), views_plugin_display::export_style(), 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(), options_form(), views_plugin_display_feed::options_form(), views_plugin_display_block::options_form(), views_plugin_display_attachment::options_form(), views_plugin_display::options_form(), views_plugin_display::options_submit(), options_summary(), views_plugin_display_feed::options_summary(), views_plugin_display_block::options_summary(), views_plugin_display_attachment::options_summary(), views_plugin_display::options_summary(), options_validate(), views_plugin_display::render_more_link(), views_plugin_display_attachment::render_pager(), views_plugin_display::set_override(), views_plugin_display::use_ajax(), views_plugin_display::use_group_by(), views_plugin_display::use_more(), views_plugin_display::use_more_always(), views_plugin_display::use_more_text(), validate(), views_plugin_display::validate(), and views_plugin_display::view_special_blocks().

                               {
    if ($this->is_defaulted($option)) {
      return $this->default_display->get_option($option);
    }

    if (array_key_exists($option, $this->options)) {
      return $this->options[$option];
    }
  }

views_plugin_display_page::get_pager_text (  ) 

Provide some helpful text for pagers.

The result should contain of an array within

  • items per page title

Reimplemented from views_plugin_display.

Definition at line 545 of file views_plugin_display_page.inc.

                            {
    return array(
      'items per page title' => t('Items per page'),
      'items per page description' => t('The number of items to display per page. Enter 0 for no limit.')
    );
  }

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 751 of file views_plugin_display.inc.

References 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().

                      {
    if ($this->has_path()) {
      return $this->get_option('path');
    }

    $display_id = $this->get_link_display();
    if ($display_id && !empty($this->view->display[$display_id]) && is_object($this->view->display[$display_id]->handler)) {
      return $this->view->display[$display_id]->handler->get_path();
    }
  }

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

Get the instance of a plugin, for example style or row.

Parameters:
string $type The type of the plugin.
string $name The name of the plugin defined in hook_views_plugins.
Returns:
views_plugin|FALSE

Definition at line 814 of file views_plugin_display.inc.

References views_object::$options, views_plugin_display::get_option(), views_plugin_display::is_defaulted(), views_fetch_data(), and views_get_plugin().

Referenced by views_plugin_display::access(), views_plugin_display_feed::attach_to(), execute_hook_menu(), views_plugin_display::export_plugin(), views_plugin_display::export_style(), views_plugin_display::options_form(), views_plugin_display::options_submit(), views_plugin_display::options_summary(), views_plugin_display::options_validate(), views_plugin_display::pre_execute(), views_plugin_display::unpack_plugin(), views_plugin_display::use_pager(), views_plugin_display::uses_exposed(), views_plugin_display::uses_fields(), views_plugin_display::validate(), and views_plugin_display::view_special_blocks().

                                                     {
    static $cache = array();
    if (!isset($cache[$type][$name])) {
      switch ($type) {
        case 'style':
        case 'row':
          $option_name = $type . '_plugin';
          $options = $this->get_option($type . '_options');
          if (!$name) {
            $name = $this->get_option($option_name);
          }

          break;
        case 'query':
          $views_data = views_fetch_data($this->view->base_table);
          $name = !empty($views_data['table']['base']['query class']) ? $views_data['table']['base']['query class'] : 'views_query';
        default:
          $option_name = $type;
          $options = $this->get_option($type);
          if (!$name) {
            $name = $options['type'];
          }

          // access & cache store their options as siblings with the
          // type; all others use an 'options' array.
          if ($type != 'access' && $type != 'cache') {
            $options = $options['options'];
          }
      }
      $plugin = views_get_plugin($type, $name);

      if (!$plugin) {
        return;
      }
      if ($type != 'query') {
        $plugin->init($this->view, $this->display, $options);
      }
      else {
        $display_id = $this->is_defaulted($option_name) ? $this->display->id : 'default';
        $plugin->localization_keys = array($display_id, $type);

        if (!isset($this->base_field)) {
          $views_data = views_fetch_data($this->view->base_table);
          $this->view->base_field = !empty($views_data['table']['base']['field']) ? $views_data['table']['base']['field'] : '';
        }
        $plugin->init($this->view->base_table, $this->view->base_field, $options);
      }
      $cache[$type][$name] = $plugin;
    }

    return $cache[$type][$name];
  }

views_plugin_display::get_special_blocks (  )  [inherited]

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

Definition at line 2686 of file views_plugin_display.inc.

References views_plugin_display::uses_exposed_form_in_block().

                                {
    $blocks = array();

    if ($this->uses_exposed_form_in_block()) {
      $delta = '-exp-' . $this->view->name . '-' . $this->display->id;
      $desc = t('Exposed form: @view-@display_id', array('@view' => $this->view->name, '@display_id' => $this->display->id));

      $blocks[$delta] = array(
        'info' => $desc,
        'cache' => DRUPAL_NO_CACHE,
      );
    }

    return $blocks;
  }

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 2607 of file views_plugin_display.inc.

Referenced by views_plugin_display::options_form().

{ return 'normal'; }

views_plugin_display_page::has_path (  ) 

The page display has a path.

Reimplemented from views_plugin_display.

Definition at line 16 of file views_plugin_display_page.inc.

{ return TRUE; }

views_plugin_display::hook_block_list ( delta = 0,
edit = array() 
) [inherited]

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

Definition at line 2522 of file views_plugin_display.inc.

{ return array(); }

views_plugin_display::hook_menu (  )  [inherited]

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

Definition at line 2527 of file views_plugin_display.inc.

{ return array(); }

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 264 of file views_plugin_display.inc.

Referenced by views_plugin_display::export_option(), views_plugin_display::is_defaulted(), and views_plugin_display::option_definition().

{ 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 776 of file views_plugin_display.inc.

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

Referenced by views_plugin_display::export_option(), views_plugin_display::get_option(), views_plugin_display::get_plugin(), and views_plugin_display::set_option().

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

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

Check if the provided identifier is unique.

Definition at line 2670 of file views_plugin_display.inc.

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

                                                  {
    foreach (views_object_types() as $type => $info) {
      foreach ($this->get_handlers($type) as $key => $handler) {
        if ($handler->can_expose() && $handler->is_exposed()) {
          if ($id != $key && $identifier == $handler->options['expose']['identifier']) {
            return FALSE;
          }
        }
      }
    }
    return TRUE;
  }

views_plugin_display_page::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:

  • export_option_OPTIONNAME -- Special export handling if necessary.
  • translate_option_OPTIONNAME -- Special handling for translating data within the option, if necessary.

Reimplemented from views_plugin_display.

Reimplemented in views_plugin_display_feed.

Definition at line 19 of file views_plugin_display_page.inc.

References views_object::$options.

                               {
    $options = parent::option_definition();

    $options['path'] = array('default' => '');
    $options['menu'] = array(
      'contains' => array(
        'type' => array('default' => 'none'),
        // Do not translate menu and title as menu system will.
        'title' => array('default' => '', 'translatable' => FALSE),
        'description' => array('default' => '', 'translatable' => FALSE),
        'weight' => array('default' => 0),
        'name' => array('default' => variable_get('menu_default_node_menu', 'navigation')),
        'context' => array('default' => ''),
       ),
    );
    $options['tab_options'] = array(
      'contains' => array(
        'type' => array('default' => 'none'),
        // Do not translate menu and title as menu system will.
        'title' => array('default' => '', 'translatable' => FALSE),
        'description' => array('default' => '', 'translatable' => FALSE),
        'weight' => array('default' => 0),
        'name' => array('default' => 'navigation'),
       ),
    );

    return $options;
  }

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 1002 of file views_plugin_display.inc.

References views_add_js().

Referenced by views_plugin_display::options_form().

                                                                  {
    views_add_js('ajax');
    if (!empty($class)) {
      $text = '<span>' . $text . '</span>';
    }

    if (!trim($text)) {
      $text = t('Broken field');
    }

    if (empty($title)) {
      $title = $text;
    }

    return l($text, 'admin/structure/views/nojs/display/' . $this->view->name . '/' . $this->display->id . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title, 'id' => drupal_html_id('views-' . $this->display->id . '-' . $section)), 'html' => TRUE));
  }

views_object::options ( &$  options  )  [inherited]

Set default options on this object.

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

Reimplemented in views_plugin_style_default.

Definition at line 60 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_test_plugin_access_test_static::access(), views_test_plugin_access_test_dynamic::access(), views_plugin_access_role::access(), views_plugin_access_perm::access(), views_handler_field::add_additional_fields(), views_handler_field_field::add_field_table(), views_handler_field_user_roles::add_self_tokens(), views_handler_field_profile_list::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_query_default::build(), views_plugin_style_table::build_sort(), views_plugin_style_table::build_sort_post(), views_plugin_cache_time::cache_expire(), views_plugin_cache_time::cache_set_expire(), views_handler_field_field::click_sort(), views_handler_field::click_sort(), views_handler_field_field::click_sortable(), views_handler_field::construct(), views_handler_argument::default_action(), views_handler_argument::default_argument_form(), views_handler_argument::default_summary(), views_handler_argument::default_summary_form(), views_plugin_display_attachment::displays_exposed(), views_handler_field_user_roles::document_self_tokens(), views_handler_field_profile_list::document_self_tokens(), views_handler_field::element_classes(), views_handler_field::element_label_classes(), views_handler_field::element_label_type(), views_handler_field_user_picture::element_type(), views_handler_field::element_type(), views_handler_field::element_wrapper_classes(), views_handler_field::element_wrapper_type(), views_plugin_style_table::even_empty(), views_plugin_query_default::execute(), views_plugin_pager::execute_count_query(), views_handler_argument_date::export_plugin(), views_handler_filter_term_node_tid::expose_form(), views_handler_sort::expose_form(), views_handler_filter_in_operator::expose_form(), views_handler_filter::expose_form(), views_handler_sort::expose_options(), views_handler_filter_in_operator::expose_options(), views_handler_filter_boolean_operator::expose_options(), views_handler_filter::expose_options(), views_handler_filter::exposed_form(), views_plugin_exposed_form::exposed_form_submit(), 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_plugin_argument_default_raw::get_argument(), views_plugin_argument_default_php::get_argument(), views_plugin_argument_default_fixed::get_argument(), views_plugin_argument_default_user::get_argument(), views_plugin_argument_default_taxonomy_tid::get_argument(), views_handler_field_field::get_base_table(), views_handler_argument_date::get_default_argument(), views_handler::get_field(), views_plugin_pager::get_items_per_page(), views_plugin_pager::get_offset(), views_plugin_display::get_option(), views_plugin_pager::get_pager_id(), views_plugin_style::get_row_class(), views_handler_field_field::groupby_form(), views_handler::groupby_form(), views_handler_argument::has_default_argument(), views_plugin_style::init(), views_plugin_row::init(), views_plugin_query::init(), views_plugin_pager::init(), views_plugin_exposed_form::init(), views_plugin_cache::init(), views_plugin_argument_validate::init(), views_plugin_argument_default::init(), views_plugin_access::init(), views_handler_field_user_name::init(), views_handler_field_user::init(), views_plugin_argument_validate_taxonomy_term::init(), views_plugin_argument_default_taxonomy_tid::init(), views_handler_relationship_node_term_data::init(), views_handler_filter_term_node_tid::init(), views_handler_field_term_node_tid::init(), views_handler_field_accesslog_path::init(), views_plugin_row_node_view::init(), views_plugin_row_node_rss::init(), views_handler_field_node_revision::init(), views_handler_field_node::init(), views_handler_field_history_user_timestamp::init(), views_handler_field_field::init(), views_handler_field_node_new_comments::init(), views_handler_field_comment::init(), views_handler::init(), views_handler_filter::init(), views_handler_argument::init(), views_plugin_display::is_defaulted(), views_handler::is_exposed(), views_handler_relationship::label(), views_handler_field::label(), views_handler_area::label(), views_handler_field_field::multiple_options_form(), views_handler_argument::needs_style_plugin(), 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_query_default::options_form(), views_plugin_pager_some::options_form(), views_plugin_pager_none::options_form(), views_plugin_pager_full::options_form(), views_plugin_exposed_form_input_required::options_form(), views_plugin_exposed_form::options_form(), views_plugin_display::options_form(), views_plugin_cache_time::options_form(), views_plugin_argument_validate_php::options_form(), views_plugin_argument_default_raw::options_form(), views_plugin_argument_default_php::options_form(), views_plugin_argument_default_fixed::options_form(), views_plugin_access_role::options_form(), views_plugin_access_perm::options_form(), views_plugin_row_user_view::options_form(), views_plugin_argument_validate_user::options_form(), views_plugin_argument_default_user::options_form(), views_handler_field_user_picture::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_user::options_form(), views_handler_relationship_translation::options_form(), views_handler_field_node_language::options_form(), views_plugin_argument_validate_taxonomy_term::options_form(), views_plugin_argument_default_taxonomy_tid::options_form(), views_handler_relationship_node_term_data::options_form(), views_handler_field_term_node_tid::options_form(), views_handler_field_term_link_edit::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_uri::options_form(), views_handler_field_file_filemime::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_plugin_row_node_view::options_form(), views_plugin_row_node_rss::options_form(), views_plugin_argument_validate_node::options_form(), views_handler_field_node_type::options_form(), views_handler_field_node_revision::options_form(), views_handler_field_node_path::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_locale_language::options_form(), views_handler_field_field::options_form(), views_handler_argument_field_list::options_form(), views_handler_field_contact_link::options_form(), views_plugin_row_comment_view::options_form(), views_plugin_row_comment_rss::options_form(), views_handler_field_node_new_comments::options_form(), views_handler_field_comment_username::options_form(), views_handler_field_comment_node_link::options_form(), views_handler_field_comment_link_edit::options_form(), views_handler_field_comment_link::options_form(), views_handler_field_comment::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::options_form(), views_handler_sort_date::options_form(), views_handler_relationship_groupwise_max::options_form(), views_handler_relationship::options_form(), views_handler_field_url::options_form(), views_handler_field_time_interval::options_form(), views_handler_field_serialized::options_form(), views_handler_field_prerender_list::options_form(), views_handler_field_numeric::options_form(), views_handler_field_math::options_form(), views_handler_field_machine_name::options_form(), views_handler_field_date::options_form(), views_handler_field_counter::options_form(), views_handler_field_contextual_links::options_form(), views_handler_field_boolean::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_handler_area_view::options_form(), views_handler_area_text::options_form(), views_handler_area_result::options_form(), views_handler_area::options_form(), views_handler_sort::options_submit(), views_handler_relationship_groupwise_max::options_submit(), views_handler_filter::options_submit(), views_handler_sort::options_validate(), views_handler_filter_date::options_validate(), views_handler_filter::options_validate(), views_handler::placeholder(), views_handler_argument_term_node_tid_depth_modifier::pre_query(), views_plugin_argument_validate_user::process_summary_arguments(), views_plugin_argument_validate_taxonomy_term::process_summary_arguments(), views_handler_argument::process_summary_arguments(), views_plugin_style_summary::query(), views_plugin_row::query(), views_plugin_query_default::query(), views_plugin_pager_some::query(), views_plugin_pager_none::query(), views_plugin_pager_full::query(), views_handler_filter_user_current::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_relationship_entity_reverse::query(), views_handler_field_field::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_menu_hierarchy::query(), views_handler_sort_group_by_numeric::query(), views_handler_sort_date::query(), views_handler_sort::query(), views_handler_relationship_groupwise_max::query(), views_handler_relationship::query(), views_handler_filter_string::query(), views_handler_filter_numeric::query(), views_handler_filter_in_operator::query(), views_handler_filter_group_by_numeric::query(), views_handler_filter_boolean_operator_string::query(), views_handler_filter_boolean_operator::query(), views_handler_filter::query(), views_handler_field::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_row::render(), views_plugin_pager_mini::render(), views_plugin_pager_full::render(), views_handler_field_user_picture::render(), views_handler_field_node_language::render(), views_plugin_row_search_view::render(), views_handler_field_profile_date::render(), views_handler_field_node_path::render(), views_handler_field_history_user_timestamp::render(), views_handler_field_ncs_last_comment_name::render(), views_handler_field_last_comment_timestamp::render(), views_handler_field_comment_node_link::render(), views_handler_field_url::render(), views_handler_field_prerender_list::render(), views_handler_field_numeric::render(), views_handler_field_math::render(), views_handler_field_date::render(), views_handler_field_custom::render(), views_handler_field_counter::render(), views_handler_field_contextual_links::render(), views_handler_field_boolean::render(), views_handler_field_file_size::render(), views_handler_area_view::render(), views_handler_area_text::render(), views_handler_area_result::render(), views_plugin_style::render_grouping_sets(), views_handler_field_prerender_list::render_items(), views_handler_field_taxonomy::render_link(), views_handler_field_file::render_link(), views_handler_field_node_revision::render_link(), views_handler_field_node_link_edit::render_link(), views_handler_field_node_link_delete::render_link(), views_handler_field_node::render_link(), views_handler_field_aggregator_category::render_link(), views_handler_field_node_type::render_name(), views_handler_area_text::render_textarea(), views_handler_argument_term_node_tid_depth::set_breadcrumb(), views_handler_argument_term_node_tid::set_breadcrumb(), views_plugin_pager_full::set_current_page(), views_object::set_default_options(), views_plugin_pager::set_items_per_page(), views_plugin_pager::set_offset(), views_plugin_display::set_option(), views_plugin_display::set_override(), views_handler::set_relationship(), views_handler_sort::show_expose_button(), views_handler_filter::show_expose_button(), views_handler::show_expose_form(), views_handler_sort::show_sort_form(), views_handler_filter::store_exposed_input(), views_handler_argument_string::summary_query(), views_handler_argument_many_to_one::summary_query(), views_plugin_pager_some::summary_title(), views_plugin_pager_none::summary_title(), views_plugin_pager_mini::summary_title(), views_plugin_pager_full::summary_title(), views_plugin_cache_time::summary_title(), views_plugin_access_role::summary_title(), views_plugin_access_perm::summary_title(), views_plugin_row_user_view::summary_title(), views_plugin_row_node_view::summary_title(), views_plugin_row_node_rss::summary_title(), views_handler_argument_numeric::title(), views_handler_argument_many_to_one::title(), views_handler_field::tokenize_value(), views_handler::ui_name(), views_object::unpack_translatables(), views_plugin_pager_full::update_page_info(), views_handler_argument::uses_breadcrumb(), views_plugin_display_attachment::uses_exposed(), views_plugin_style::uses_tokens(), views_handler_filter_in_operator::validate(), views_handler_argument_null::validate_argument_basic(), views_handler_argument::validate_fail(), 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_boolean_operator::value_form(), and views_handler_filter_term_node_tid::value_validate().

{ }

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

Provide the default form for setting options.

Reimplemented from views_plugin_display.

Reimplemented in views_plugin_display_feed.

Definition at line 294 of file views_plugin_display_page.inc.

References views_plugin_display::get_option().

                                              {
    parent::options_form($form, $form_state);
    // It is very important to call the parent function here:
    parent::options_form($form, $form_state);

    switch ($form_state['section']) {
      case 'path':
        $form['#title'] .= t('The menu path or URL of this view');
        $form['#help_topic'] = 'path';
        $form['path'] = array(
          '#type' => 'textfield',
          '#description' => t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for contextual filters: For example, "node/%/feed".'),
          '#default_value' => $this->get_option('path'),
    '#field_prefix' => '<span dir="ltr">' . url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
    '#field_suffix' => '</span>&lrm;',
    '#attributes' => array('dir'=>'ltr'),
        );
        break;
      case 'menu':
        $form['#title'] .= t('Menu item entry');
        $form['#help_topic'] = 'menu';
        $form['menu'] = array(
          '#prefix' => '<div class="clearfix">',
          '#suffix' => '</div>',
          '#tree' => TRUE,
        );
        $menu = $this->get_option('menu');
        if (empty($menu)) {
          $menu = array('type' => 'none', 'title' => '', 'weight' => 0);
        }
        $form['menu']['type'] = array(
          '#prefix' => '<div class="views-left-30">',
          '#suffix' => '</div>',
          '#title' => t('Type'),
          '#type' => 'radios',
          '#options' => array(
            'none' => t('No menu entry'),
            'normal' => t('Normal menu entry'),
            'tab' => t('Menu tab'),
            'default tab' => t('Default menu tab')
          ),
          '#default_value' => $menu['type'],
        );
        $form['menu']['title'] = array(
          '#prefix' => '<div class="views-left-50">',
          '#title' => t('Title'),
          '#type' => 'textfield',
          '#default_value' => $menu['title'],
          '#description' => t('If set to normal or tab, enter the text to use for the menu item.'),
          '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
        );
        $form['menu']['description'] = array(
          '#title' => t('Description'),
          '#type' => 'textfield',
          '#default_value' => $menu['description'],
          '#description' => t("If set to normal or tab, enter the text to use for the menu item's description."),
          '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
        );

        // Only display the menu selector if menu module is enabled.
        if (module_exists('menu')) {
          $form['menu']['name'] = array(
            '#title' => t('Menu'),
            '#type' => 'select',
            '#options' => menu_get_menus(),
            '#default_value' => $menu['name'],
            '#description' => t('Insert item into an available menu.'),
            '#dependency' => array('radio:menu[type]' => array('normal', 'tab')),
          );
        }
        else {
          $form['menu']['name'] = array(
            '#type' => 'value',
            '#value' => $menu['name'],
          );
          $form['menu']['markup'] = array(
            '#markup' => t('Menu selection requires the activation of menu module.'),
          );
        }
        $form['menu']['weight'] = array(
          '#suffix' => '</div>',
          '#title' => t('Weight'),
          '#type' => 'textfield',
          '#default_value' => isset($menu['weight']) ? $menu['weight'] : 0,
          '#description' => t('The lower the weight the higher/further left it will appear.'),
          '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
        );
        $form['menu']['context'] = array(
          '#title' => t('Context'),
          '#type' => 'checkbox',
          '#default_value' => !empty($menu['context']),
          '#description' => t('Displays the link in contextual links'),
          '#dependency' => array('radio:menu[type]' => array('tab')),
        );
        break;
      case 'tab_options':
        $form['#title'] .= t('Default tab options');
        $tab_options = $this->get_option('tab_options');
        if (empty($tab_options)) {
          $tab_options = array('type' => 'none', 'title' => '', 'weight' => 0);
        }

        $form['tab_markup'] = array(
          '#markup' => '<div class="form-item description">' . t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.') . '</div>',
        );

        $form['tab_options'] = array(
          '#prefix' => '<div class="clearfix">',
          '#suffix' => '</div>',
          '#tree' => TRUE,
        );
        $form['tab_options']['type'] = array(
          '#prefix' => '<div class="views-left-25">',
          '#suffix' => '</div>',
          '#title' => t('Parent menu item'),
          '#type' => 'radios',
          '#options' => array('none' => t('Already exists'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')),
          '#default_value' => $tab_options['type'],
        );
        $form['tab_options']['title'] = array(
          '#prefix' => '<div class="views-left-75">',
          '#title' => t('Title'),
          '#type' => 'textfield',
          '#default_value' => $tab_options['title'],
          '#description' => t('If creating a parent menu item, enter the title of the item.'),
          '#dependency' => array('radio:tab_options[type]' => array('normal', 'tab')),
        );
        $form['tab_options']['description'] = array(
          '#title' => t('Description'),
          '#type' => 'textfield',
          '#default_value' => $tab_options['description'],
          '#description' => t('If creating a parent menu item, enter the description of the item.'),
          '#dependency' => array('radio:tab_options[type]' => array('normal', 'tab')),
        );
        // Only display the menu selector if menu module is enabled.
        if (module_exists('menu')) {
          $form['tab_options']['name'] = array(
            '#title' => t('Menu'),
            '#type' => 'select',
            '#options' => menu_get_menus(),
            '#default_value' => $tab_options['name'],
            '#description' => t('Insert item into an available menu.'),
            '#dependency' => array('radio:tab_options[type]' => array('normal')),
          );
        }
        else {
          $form['tab_options']['name'] = array(
            '#type' => 'value',
            '#value' => $tab_options['name'],
          );
          $form['tab_options']['markup'] = array(
            '#markup' => t('Menu selection requires the activation of menu module.'),
          );
        }
        $form['tab_options']['weight'] = array(
          '#suffix' => '</div>',
          '#title' => t('Tab weight'),
          '#type' => 'textfield',
          '#default_value' => $tab_options['weight'],
          '#size' => 5,
          '#description' => t('If the parent menu item is a tab, enter the weight of the tab. The lower the number, the more to the left it will be.'),
          '#dependency' => array('radio:tab_options[type]' => array('tab')),
        );
        break;
    }
  }

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

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

Definition at line 2411 of file views_plugin_display.inc.

References views_plugin_display::set_override().

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

views_plugin_display_page::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.

Reimplemented in views_plugin_display_feed.

Definition at line 499 of file views_plugin_display_page.inc.

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

                                                {
    // It is very important to call the parent function here:
    parent::options_submit($form, $form_state);
    switch ($form_state['section']) {
      case 'path':
        $this->set_option('path', $form_state['values']['path']);
        break;
      case 'menu':
        $this->set_option('menu', $form_state['values']['menu']);
        // send ajax form to options page if we use it.
        if ($form_state['values']['menu']['type'] == 'default tab') {
          views_ui_add_form_to_stack('display', $this->view, $this->display->id, array('tab_options'));
        }
        break;
      case 'tab_options':
        $this->set_option('tab_options', $form_state['values']['tab_options']);
        break;
    }
  }

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

Provide the summary for page options in the views UI.

This output is returned as an array.

Reimplemented from views_plugin_display.

Reimplemented in views_plugin_display_feed.

Definition at line 237 of file views_plugin_display_page.inc.

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

                                                    {
    // It is very important to call the parent function here:
    parent::options_summary($categories, $options);

    $categories['page'] = array(
      'title' => t('Page settings'),
      'column' => 'second',
      'build' => array(
        '#weight' => -10,
      ),
    );

    $path = strip_tags('/' . $this->get_option('path'));
    if (empty($path)) {
      $path = t('None');
    }

    $options['path'] = array(
      'category' => 'page',
      'title' => t('Path'),
      'value' => views_ui_truncate($path, 24),
    );

    $menu = $this->get_option('menu');
    if (!is_array($menu)) {
      $menu = array('type' => 'none');
    }
    switch($menu['type']) {
      case 'none':
      default:
        $menu_str = t('No menu');
        break;
      case 'normal':
        $menu_str = t('Normal: @title', array('@title' => $menu['title']));
        break;
      case 'tab':
      case 'default tab':
        $menu_str = t('Tab: @title', array('@title' => $menu['title']));
        break;
    }

    $options['menu'] = array(
      'category' => 'page',
      'title' => t('Menu'),
      'value' => views_ui_truncate($menu_str, 24),
    );

    // This adds a 'Settings' link to the style_options setting if the style has options.
    if ($menu['type'] == 'default tab') {
      $options['menu']['setting'] = t('Parent menu item');
      $options['menu']['links']['tab_options'] = t('Change settings for the parent menu');
    }
  }

views_plugin_display_page::options_validate ( &$  form,
&$  form_state 
)

Validate the options form.

Reimplemented from views_plugin_display.

Definition at line 461 of file views_plugin_display_page.inc.

References views_plugin_display::get_option().

                                                  {
    // It is very important to call the parent function here:
    parent::options_validate($form, $form_state);
    switch ($form_state['section']) {
      case 'path':
        if (strpos($form_state['values']['path'], '$arg') !== FALSE) {
          form_error($form['path'], t('"$arg" is no longer supported. Use % instead.'));
        }

        if (strpos($form_state['values']['path'], '%') === 0) {
          form_error($form['path'], t('"%" may not be used for the first segment of a path.'));
        }

        // automatically remove '/' from path.
        $form_state['values']['path'] = trim($form_state['values']['path'], '/');

        break;
      case 'menu':
        $path = $this->get_option('path');
        if ($form_state['values']['menu']['type'] == 'normal' && strpos($path, '%') !== FALSE) {
          form_error($form['menu']['type'], t('Views cannot create normal menu items for paths with a % in them.'));
        }

        if ($form_state['values']['menu']['type'] == 'default tab' || $form_state['values']['menu']['type'] == 'tab') {
          $bits = explode('/', $path);
          $last = array_pop($bits);
          if ($last == '%') {
            form_error($form['menu']['type'], t('A display whose path ends with a % cannot be a tab.'));
          }
        }

        if ($form_state['values']['menu']['type'] != 'none' && empty($form_state['values']['menu']['title'])) {
          form_error($form['menu']['title'], t('Title is required for this menu type.'));
        }
        break;
    }
  }

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

Set an option and force it to be an override.

Definition at line 993 of file views_plugin_display.inc.

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

                                            {
    $this->set_override($option, FALSE);
    $this->set_option($option, $value);
  }

views_plugin::plugin_title (  )  [inherited]

Return the human readable name of the display.

This appears on the ui beside each plugin and beside the settings link.

Definition at line 548 of file plugins.inc.

                          {
    if (isset($this->definition['short title'])) {
      return check_plain($this->definition['short title']);
    }
    return check_plain($this->definition['title']);
  }

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 2573 of file views_plugin_display.inc.

References views_plugin_display::get_plugin(), views_plugin_display::use_ajax(), views_plugin_display::use_more(), views_plugin_display::use_more_always(), and views_plugin_display::uses_exposed().

                         {
    $this->view->set_use_ajax($this->use_ajax());
    if ($this->use_more() && !$this->use_more_always()) {
      $this->view->get_total_rows = TRUE;
    }
    $this->view->init_handlers();
    if ($this->uses_exposed()) {
      $exposed_form = $this->get_plugin('exposed_form');
      $exposed_form->pre_execute();
    }

    foreach ($this->extender as $extender) {
      $extender->pre_execute();
    }
  }

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 2601 of file views_plugin_display.inc.

{ 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 2448 of file views_plugin_display.inc.

                   {
    foreach ($this->extender as $extender) {
      $extender->query();
    }
  }

views_plugin_display::render (  )  [inherited]

Render this display.

Reimplemented in views_plugin_display_feed.

Definition at line 2532 of file views_plugin_display.inc.

References views_plugin::theme_functions().

                    {
    return theme($this->theme_functions(), array('view' => $this->view));
  }

views_plugin_display::render_filters (  )  [inherited]

Not all display plugins will support filtering.

Definition at line 2457 of file views_plugin_display.inc.

{ }

views_plugin_display::render_footer (  )  [inherited]

Render the footer of the view.

Definition at line 2510 of file views_plugin_display.inc.

                           {
    $empty = !empty($this->view->result);
    return $this->render_area('footer', $empty);
  }

views_plugin_display::render_header (  )  [inherited]

Legacy functions.

Render the header of the view.

Definition at line 2502 of file views_plugin_display.inc.

                           {
    $empty = !empty($this->view->result);
    return $this->render_area('header', $empty);
  }

views_plugin_display::render_more_link (  )  [inherited]

Render the 'more' link.

Definition at line 2469 of file views_plugin_display.inc.

References views_plugin_display::get_arguments_tokens(), views_plugin_display::get_option(), views_plugin_display::get_path(), views_plugin_display::use_more(), views_plugin_display::use_more_always(), views_plugin_display::use_more_text(), and views_theme_functions().

                              {
    if ($this->use_more() && ($this->use_more_always() || (!empty($this->view->query->pager) && $this->view->query->pager->has_more_records()))) {
      $path = $this->get_path();

      if ($this->get_option('link_display') == 'custom_url' && $override_path = $this->get_option('link_url')) {
        $tokens = $this->get_arguments_tokens();
        $path = strtr($override_path, $tokens);
      }

      if ($path) {
        if (empty($override_path)) {
          $path = $this->view->get_url(NULL, $path);
        }
        $url_options = array();
        if (!empty($this->view->exposed_raw_input)) {
          $url_options['query'] = $this->view->exposed_raw_input;
        }
        $theme = views_theme_functions('views_more', $this->view, $this->display);
        $path = check_url(url($path, $url_options));

        return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view));
      }
    }
  }

views_plugin_display::render_pager (  )  [inherited]

Not all display plugins will suppert pager rendering.

Reimplemented in views_plugin_display_attachment.

Definition at line 2462 of file views_plugin_display.inc.

                          {
    return TRUE;
  }

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 67 of file base.inc.

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

Referenced by views_object::construct().

                                 {
    $this->_set_option_defaults($this->options, $this->option_definition());

    // Retained for complex defaults plus backward compatibility.
    $this->options($this->options);
  }

views_object::set_definition ( definition  )  [inherited]

Let the handler know what its full definition is.

Definition at line 173 of file base.inc.

                                       {
    $this->definition = $definition;
    if (isset($definition['field'])) {
      $this->real_field = $definition['field'];
    }
  }

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 978 of file views_plugin_display.inc.

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

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

                                       {
    if ($this->is_defaulted($option)) {
      return $this->default_display->set_option($option, $value);
    }

    // Set this in two places: On the handler where we'll notice it
    // but also on the display object so it gets saved. This should
    // only be a temporary fix.
    $this->display->display_options[$option] = $value;
    return $this->options[$option] = $value;
  }

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

Flip the override setting for the given section.

Definition at line 2418 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().

                                                     {
    $options = $this->defaultable_sections($section);
    if (!$options) {
      return;
    }

    if (!isset($new_state)) {
      $new_state = empty($this->options['defaults'][$section]);
    }

    // For each option that is part of this group, fix our settings.
    foreach ($options as $option) {
      if ($new_state) {
        // Revert to defaults.
        unset($this->options[$option]);
        unset($this->display->display_options[$option]);
      }
      else {
        // copy existing values into our display.
        $this->options[$option] = $this->get_option($option);
        $this->display->display_options[$option] = $this->options[$option];
      }
      $this->options['defaults'][$option] = $new_state;
      $this->display->display_options['defaults'][$option] = $new_state;
    }
  }

views_plugin::theme_functions (  )  [inherited]

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

Definition at line 511 of file plugins.inc.

References views_theme_functions().

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

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

views_plugin_display::unpack_handler ( &$  translatable,
storage,
option,
definition,
parents 
) [inherited]

Special method to unpack items that have handlers.

This method was specified in the option_definition() as the method to utilize to export fields, filters, sort criteria, relationships and arguments. This passes the export off to the individual handlers so that they can export themselves properly.

Definition at line 2915 of file views_plugin_display.inc.

References views_get_handler(), and views_object_types().

                                                                                    {
    $output = '';

    // cut the 's' off because the data is stored as the plural form but we need
    // the singular form. Who designed that anyway? Oh yeah, I did. :(
    if ($option != 'header' && $option != 'footer' && $option != 'empty') {
      $type = substr($option, 0, -1);
    }
    else {
      $type = $option;
    }
    $types = views_object_types();
    foreach ($storage[$option] as $id => $info) {
      if (!empty($types[$type]['type'])) {
        $handler_type = $types[$type]['type'];
      }
      else {
        $handler_type = $type;
      }
      $handler = views_get_handler($info['table'], $info['field'], $handler_type);
      if ($handler) {
        $handler->init($this->view, $info);
        $handler->unpack_translatables($translatable, array_merge($parents, array($type, $info['table'], $info['id'])));
      }

      // Prevent reference problems.
      unset($handler);
    }

    return $output;
  }

views_object::unpack_options ( &$  storage,
options,
definition = NULL,
all = TRUE,
check = TRUE,
localization_keys = array() 
) [inherited]

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

Definition at line 93 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_query::init(), views_plugin_pager::init(), views_plugin_exposed_form::init(), views_plugin_cache::init(), views_plugin_argument_validate::init(), views_plugin_argument_default::init(), views_plugin_access::init(), and views_handler::init().

                                                                                                                             {
    if ($check && !is_array($options)) {
      return;
    }

    if (!isset($definition)) {
      $definition = $this->option_definition();
    }

    if (!empty($this->view)) {
      // Ensure we have a localization plugin.
      $this->view->init_localization();

      // Set up default localization keys. Handlers and such set this for us
      if (empty($localization_keys) && isset($this->localization_keys)) {
        $localization_keys = $this->localization_keys;
      }
      // but plugins don't because there isn't a common init() these days.
      else if (!empty($this->is_plugin)) {
        if ($this->plugin_type != 'display') {
          $localization_keys = array($this->view->current_display);
          $localization_keys[] = $this->plugin_type;
        }
      }
    }

    foreach ($options as $key => $value) {
      if (is_array($value)) {
        // Ignore arrays with no definition.
        if (!$all && empty($definition[$key])) {
          continue;
        }

        if (!isset($storage[$key]) || !is_array($storage[$key])) {
          $storage[$key] = array();
        }

        // If we're just unpacking our known options, and we're dropping an
        // unknown array (as might happen for a dependent plugin fields) go
        // ahead and drop that in.
        if (!$all && isset($definition[$key]) && !isset($definition[$key]['contains'])) {
          $storage[$key] = $value;
          continue;
        }

        $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array(), $all, FALSE, array_merge($localization_keys, array($key)));
      }
      // Don't localize strings during editing. When editing, we need to work with
      // the original data, not the translated version.
      else if (empty($this->view->editing) && !empty($definition[$key]['translatable']) && !empty($value) || !empty($definition['contains'][$key]['translatable']) && !empty($value)) {
        if (!empty($this->view) && $this->view->is_translatable()) {
          // Allow other modules to make changes to the string before it's
          // sent for translation.
          // The $keys array is built from the view name, any localization keys
          // sent in, and the name of the property being processed.
          $format = NULL;
          if (isset($definition[$key]['format_key']) && isset($options[$definition[$key]['format_key']])) {
            $format = $options[$definition[$key]['format_key']];
          }
          $translation_data = array(
            'value' => $value,
            'format' => $format,
            'keys' => array_merge(array($this->view->name), $localization_keys, array($key)),
          );
          $storage[$key] = $this->view->localization_plugin->translate($translation_data);
        }
        // Otherwise, this is a code-based string, so we can use t().
        else {
          $storage[$key] = t($value);
        }
      }
      else if ($all || !empty($definition[$key])) {
        $storage[$key] = $value;
      }
    }
  }

views_plugin_display::unpack_plugin ( &$  translatable,
storage,
option,
definition,
parents 
) [inherited]

Special handling for plugin unpacking.

Definition at line 2898 of file views_plugin_display.inc.

References views_plugin::$plugin_type, and views_plugin_display::get_plugin().

                                                                                   {
    $plugin_type = end($parents);
    $plugin = $this->get_plugin($plugin_type);
    if ($plugin) {
      // Write which plugin to use.
      return $plugin->unpack_translatables($translatable, $parents);
    }
  }

views_object::unpack_translatable ( &$  translatable,
storage,
option,
definition,
parents,
keys = array() 
) [inherited]

Unpack a single option definition.

This function run's through all suboptions recursive.

Parameters:
$translatable Stores all available translatable items.
$storage 
$option 
$definition 
$parents 
$keys 

Definition at line 275 of file base.inc.

References views_object::$options.

Referenced by views_object::unpack_translatables().

                                                                                                          {
    // Do not export options for which we have no settings.
    if (!isset($storage[$option])) {
      return;
    }

    // Special handling for some items
    if (isset($definition['unpack_translatable']) && method_exists($this, $definition['unpack_translatable'])) {
      return $this->{$definition['unpack_translatable']}($translatable, $storage, $option, $definition, $parents, $keys);
    }

    if (isset($definition['translatable'])) {
      if ($definition['translatable'] === FALSE) {
        return;
      }
    }

    // Add the current option to the parents tree.
    $parents[] = $option;

    // If it has child items, unpack those separately.
    if (isset($definition['contains'])) {
      foreach ($definition['contains'] as $sub_option => $sub_definition) {
        $translation_keys = array_merge($keys, array($sub_option));
        $this->unpack_translatable($translatable, $storage[$option], $sub_option, $sub_definition, $parents, $translation_keys);
      }
    }

    // @todo Figure out this double definition stuff.
    $options = $storage[$option];
    if (is_array($options)) {
      foreach ($options as $key => $value) {
        $translation_keys = array_merge($keys, array($key));
        if (is_array($value)) {
          $this->unpack_translatable($translatable, $options, $key, $definition, $parents, $translation_keys);
        }
        else if (!empty($definition[$key]['translatable']) && !empty($value)) {
          // Build source data and add to the array
          $format = NULL;
          if (isset($definition['format_key']) && isset($options[$definition['format_key']])) {
            $format = $options[$definition['format_key']];
          }
          $translatable[] = array(
            'value' => $value,
            'keys' => $translation_keys,
            'format' => $format,
          );
        }
      }
    }
    else if (!empty($definition['translatable']) && !empty($options)) {
      $value = $options;
      // Build source data and add to the array
      $format = NULL;
      if (isset($definition['format_key']) && isset($storage[$definition['format_key']])) {
        $format = $options[$definition['format_key']];
      }
      $translatable[] = array(
        'value' => $value,
        'keys' => isset($translation_keys) ? $translation_keys : $parents,
        'format' => $format,
      );
    }
  }

views_object::unpack_translatables ( &$  translatable,
parents = array() 
) [inherited]

Unpacks each handler to store translatable texts.

Definition at line 256 of file base.inc.

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

                                                                    {
    foreach ($this->option_definition() as $option => $definition) {
      $this->unpack_translatable($translatable, $this->options, $option, $definition, $parents, array());
    }
  }

views_plugin_display::use_ajax (  )  [inherited]

Does the display use AJAX?

Definition at line 308 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::pre_execute(), and views_plugin_display_block::uses_exposed().

                      {
    if (!empty($this->definition['use ajax'])) {
      return $this->get_option('use_ajax');
    }
    return FALSE;
  }

views_plugin_display::use_group_by (  )  [inherited]

Does the display have groupby enabled?

Definition at line 338 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::export_handler(), and views_plugin_display::get_handlers().

                          {
    return $this->get_option('group_by');
  }

views_plugin_display::use_more (  )  [inherited]

Does the display have a more link enabled?

Definition at line 328 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::pre_execute(), and views_plugin_display::render_more_link().

                      {
    if (!empty($this->definition['use more'])) {
      return $this->get_option('use_more');
    }
    return FALSE;
  }

views_plugin_display::use_more_always (  )  [inherited]

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

Definition at line 345 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::pre_execute(), and views_plugin_display::render_more_link().

                             {
    if (!empty($this->definition['use more'])) {
      return $this->get_option('use_more_always');
    }
    return FALSE;
  }

views_plugin_display::use_more_text (  )  [inherited]

Does the display have custom link text?

Definition at line 355 of file views_plugin_display.inc.

References views_plugin_display::get_option().

Referenced by views_plugin_display::render_more_link().

                           {
    if (!empty($this->definition['use more'])) {
      return $this->get_option('use_more_text');
    }
    return FALSE;
  }

views_plugin_display::use_pager (  )  [inherited]

Does the display have a pager enabled?

Reimplemented in views_plugin_display_attachment.

Definition at line 318 of file views_plugin_display.inc.

References views_plugin_display::get_plugin().

                       {
    $pager = $this->get_plugin('pager');
    if ($pager) {
      return $pager->use_pager();
    }
  }

views_plugin_display_page::uses_breadcrumb (  ) 

Check to see if the display needs a breadcrumb.

By default, displays do not need breadcrumbs

Reimplemented from views_plugin_display.

Reimplemented in views_plugin_display_feed.

Definition at line 17 of file views_plugin_display_page.inc.

{ return TRUE; }

views_plugin_display::uses_exposed (  )  [inherited]

Determine if this display uses exposed filters, so the view will know whether or not to build them.

Reimplemented in views_plugin_display_attachment, and views_plugin_display_block.

Definition at line 270 of file views_plugin_display.inc.

References views_plugin_display::get_plugin().

Referenced by views_plugin_display::pre_execute(), and views_plugin_display::view_special_blocks().

                          {
    if (!isset($this->has_exposed)) {
      foreach ($this->handlers as $type => $value) {
        foreach ($this->view->$type as $id => $handler) {
          if ($handler->can_expose() && $handler->is_exposed()) {
            // one is all we need; if we find it, return true.
            $this->has_exposed = TRUE;
            return TRUE;
          }
        }
      }
      $pager = $this->get_plugin('pager');
      if (isset($pager) && $pager->uses_exposed()) {
        $this->has_exposed = TRUE;
        return TRUE;
      }
      $this->has_exposed = FALSE;
    }

    return $this->has_exposed;
  }

views_plugin_display::uses_exposed_form_in_block (  )  [inherited]

Check to see if the display can put the exposed formin a block.

By default, displays that do not have a path cannot disconnect the exposed form and put it in a block, because the form has no place to go and Views really wants the forms to go to a specific page.

Definition at line 723 of file views_plugin_display.inc.

References views_plugin_display::has_path().

Referenced by views_plugin_display::get_special_blocks(), and views_plugin_display::options_summary().

{ return $this->has_path(); }

views_plugin_display::uses_fields (  )  [inherited]

Determine if the display's style uses fields.

Definition at line 797 of file views_plugin_display.inc.

References views_plugin_display::get_plugin().

Referenced by views_plugin_display::validate().

                         {
    $plugin = $this->get_plugin();
    if ($plugin) {
      return $plugin->uses_fields();
    }
  }

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 713 of file views_plugin_display.inc.

References views_plugin_display::has_path().

Referenced by views_plugin_display::options_summary().

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

views_plugin_display_page::validate (  ) 

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_display.

Definition at line 519 of file views_plugin_display_page.inc.

References views_plugin_display::get_option().

                      {
    $errors = parent::validate();

    $menu = $this->get_option('menu');
    if (!empty($menu['type']) && $menu['type'] != 'none' && empty($menu['title'])) {
      $errors[] = t('Display @display is set to use a menu but the menu link text is not set.', array('@display' => $this->display->display_title));
    }

    if ($menu['type'] == 'default tab') {
      $tab_options = $this->get_option('tab_options');
      if (!empty($tab_options['type']) && $tab_options['type'] != 'none' && empty($tab_options['title'])) {
        $errors[] = t('Display @display is set to use a parent menu but the parent menu link text is not set.', array('@display' => $this->display->display_title));
      }
    }

    return $errors;
  }

views_plugin_display::view_special_blocks ( type  )  [inherited]

Render any special blocks provided for this display.

Definition at line 2705 of file views_plugin_display.inc.

References views_plugin_display::get_option(), views_plugin_display::get_plugin(), and views_plugin_display::uses_exposed().

                                      {
    if ($type == '-exp') {
      // avoid interfering with the admin forms.
      if (arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'views') {
        return;
      }
      $this->view->init_handlers();

      if ($this->uses_exposed() && $this->get_option('exposed_block')) {
        $exposed_form = $this->get_plugin('exposed_form');
        return array(
          'content' => $exposed_form->render_exposed_form(TRUE),
        );
      }
    }
  }


Member Data Documentation

views_plugin_display::$extender = array() [inherited]

Stores all available display extenders.

Definition at line 39 of file views_plugin_display.inc.

Referenced by views_plugin_display::construct().

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

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

Definition at line 15 of file base.inc.

Referenced by views_handler_filter_string::admin_summary(), views_handler_filter_numeric::admin_summary(), views_plugin_argument_validate_php::convert_options(), views_plugin_argument_default_php::convert_options(), views_plugin_argument_default_fixed::convert_options(), views_plugin_argument_validate_user::convert_options(), views_plugin_argument_default_user::convert_options(), views_plugin_argument_validate_taxonomy_term::convert_options(), views_plugin_argument_validate_node::convert_options(), views_handler_argument::default_argument_form(), views_handler_argument::default_summary_form(), views_handler_filter_term_node_tid::extra_options_form(), views_test_plugin_access_test_static::get_access_callback(), views_test_plugin_access_test_dynamic::get_access_callback(), views_handler_field_field::get_base_table(), views_plugin_display::get_field_labels(), views_plugin_display::get_plugin(), views_handler_filter_node_type::get_value_options(), views_handler_field_field::groupby_form(), views_plugin_style::init(), views_plugin_row::init(), views_plugin_query_default::init(), views_plugin_query::init(), views_plugin_pager_none::init(), views_plugin_pager::init(), views_plugin_exposed_form::init(), views_plugin_cache::init(), views_plugin_argument_validate::init(), views_plugin_argument_default::init(), views_plugin_access::init(), views_plugin_argument_validate_taxonomy_term::init(), views_plugin_argument_default_taxonomy_tid::init(), views_handler_relationship_node_term_data::init(), views_handler_filter_term_node_tid::init(), views_handler_field_term_node_tid::init(), views_handler_field_file::init(), views_handler_field_accesslog_path::init(), views_plugin_row_node_view::init(), views_plugin_row_node_rss::init(), views_handler_field_node_revision::init(), views_handler_field_node::init(), views_handler_field_history_user_timestamp::init(), views_handler_relationship_entity_reverse::init(), views_handler_field_field::init(), views_handler_argument_field_list::init(), views_handler_field_node_new_comments::init(), views_handler_field_comment::init(), views_handler::init(), views_handler_sort_group_by_numeric::init(), views_handler_relationship::init(), views_handler_filter_many_to_one::init(), views_handler_filter::init(), views_handler_field_entity::init(), views_handler_field_boolean::init(), views_handler_field::init(), views_handler_argument_string::init(), views_handler_argument_many_to_one::init(), views_handler_argument::init(), views_handler_relationship_groupwise_max::left_query(), views_handler_field_field::multiple_options_form(), 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_test_plugin_access_test_static::option_definition(), views_test_plugin_access_test_dynamic::option_definition(), 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_query_default::option_definition(), views_plugin_pager_some::option_definition(), views_plugin_pager_none::option_definition(), views_plugin_pager_full::option_definition(), views_plugin_exposed_form_input_required::option_definition(), views_plugin_exposed_form::option_definition(), option_definition(), views_plugin_display_feed::option_definition(), views_plugin_display_block::option_definition(), views_plugin_display_attachment::option_definition(), views_plugin_display::option_definition(), views_plugin_cache_time::option_definition(), views_plugin_argument_validate_php::option_definition(), views_plugin_argument_default_raw::option_definition(), views_plugin_argument_default_php::option_definition(), views_plugin_argument_default_fixed::option_definition(), views_plugin_access_role::option_definition(), views_plugin_access_perm::option_definition(), views_plugin_row_user_view::option_definition(), views_plugin_argument_validate_user::option_definition(), views_plugin_argument_default_user::option_definition(), views_handler_field_user_picture::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_relationship_translation::option_definition(), views_handler_filter_node_tnid::option_definition(), views_handler_field_node_language::option_definition(), views_plugin_argument_validate_taxonomy_term::option_definition(), views_plugin_argument_default_taxonomy_tid::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_term_link_edit::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_uri::option_definition(), views_handler_field_file_filemime::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_plugin_argument_validate_node::option_definition(), views_handler_field_node_type::option_definition(), views_handler_field_node_revision::option_definition(), views_handler_field_node_path::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_locale_language::option_definition(), views_handler_field_field::option_definition(), views_handler_argument_field_list::option_definition(), views_plugin_row_comment_view::option_definition(), views_plugin_row_comment_rss::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_edit::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::option_definition(), views_handler_sort_date::option_definition(), views_handler_sort::option_definition(), views_handler_relationship_groupwise_max::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_time_interval::option_definition(), views_handler_field_serialized::option_definition(), views_handler_field_prerender_list::option_definition(), views_handler_field_numeric::option_definition(), views_handler_field_math::option_definition(), views_handler_field_machine_name::option_definition(), views_handler_field_date::option_definition(), views_handler_field_custom::option_definition(), views_handler_field_counter::option_definition(), views_handler_field_contextual_links::option_definition(), views_handler_field_boolean::option_definition(), views_handler_field_file_size::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_handler_area_view::option_definition(), views_handler_area_text::option_definition(), views_handler_area_result::option_definition(), views_handler_area::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_plugin_row_user_view::options_form(), views_handler_relationship_translation::options_form(), views_plugin_argument_validate_taxonomy_term::options_form(), views_plugin_argument_default_taxonomy_tid::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_plugin_argument_validate_node::options_form(), views_plugin_row_comment_view::options_form(), views_handler_field_boolean::options_form(), views_handler_argument::options_form(), views_handler_area_view::options_form(), views_handler_area_text::options_form(), views_plugin_row_user_view::options_form_summary_options(), views_plugin_row_node_view::options_form_summary_options(), views_plugin_row_node_rss::options_form_summary_options(), views_plugin_row_comment_view::options_form_summary_options(), views_plugin_row_comment_rss::options_form_summary_options(), views_plugin_argument_validate_user::options_submit(), views_plugin_argument_validate_taxonomy_term::options_submit(), views_plugin_argument_default_taxonomy_tid::options_submit(), views_plugin_argument_validate_node::options_submit(), views_handler_argument::options_submit(), options_summary(), views_plugin_display_feed::options_summary(), views_plugin_display_block::options_summary(), views_plugin_display_attachment::options_summary(), views_plugin_display::options_summary(), views_plugin_pager_full::options_validate(), views_plugin_query_default::query(), views_handler_field_field::query(), views_handler_filter_in_operator::reduce_value_options(), views_plugin_style_summary_jump_menu::render(), views_plugin_style_jump_menu::render(), views_handler_field_locale_language::render(), views_plugin_display::set_override(), views_handler_sort::show_sort_form(), views_plugin_row_user_view::summary_title(), views_plugin_row_node_view::summary_title(), views_plugin_row_node_rss::summary_title(), views_object::unpack_options(), views_object::unpack_translatable(), views_handler_filter_term_node_tid::value_form(), and views_handler_filter_in_operator::value_form().

views_plugin::$plugin_type = NULL [inherited]

The plugin type of this plugin, for example style or query.

Definition at line 475 of file plugins.inc.

Referenced by views_plugin_display::export_plugin(), and views_plugin_display::unpack_plugin().


The documentation for this class was generated from the following file: