Newer
Older
Daniel Wehner
committed
* Definition of Drupal\views\ViewExecutable.
namespace Drupal\views;
Alex Pott
committed
use Drupal\Component\Utility\Html;
use Drupal\Core\Cache\Cache;
use Drupal\Component\Utility\SafeMarkup;
Dries Buytaert
committed
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Form\FormState;
use Drupal\Core\Routing\RouteProviderInterface;
Angie Byron
committed
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
use Drupal\views\Plugin\views\display\DisplayRouterInterface;
catch
committed
use Drupal\views\Plugin\views\query\QueryPluginBase;
use Drupal\views\ViewEntityInterface;
Alex Pott
committed
use Drupal\Component\Utility\Tags;
use Symfony\Component\HttpFoundation\Request;
catch
committed
use Symfony\Component\HttpFoundation\Response;
Jess
committed
use Symfony\Component\Routing\Exception\RouteNotFoundException;
Daniel Wehner
committed
Angie Byron
committed
* Represents a view as a whole.
*
* An object to contain all of the data to generate a view, plus the member
* functions to build the view query, execute the query and render the output.
*/
Alex Pott
committed
class ViewExecutable implements \Serializable {
Dries Buytaert
committed
use DependencySerializationTrait;
Tim Plunkett
committed
Daniel Wehner
committed
* The config entity in which the view is stored.
Alex Pott
committed
* @var \Drupal\views\Entity\View
Tim Plunkett
committed
public $storage;
Damian Lee
committed
/**
* Whether or not the view has been built.
*
Tim Plunkett
committed
* @todo Group with other static properties.
*
Damian Lee
committed
* @var bool
*/
public $built = FALSE;
/**
* Whether the view has been executed/query has been run.
*
Tim Plunkett
committed
* @todo Group with other static properties.
*
Damian Lee
committed
* @var bool
*/
public $executed = FALSE;
/**
* Any arguments that have been passed into the view.
*
* @var array
*/
public $args = array();
/**
* An array of build info.
*
* @var array
*/
public $build_info = array();
/**
* Whether this view uses AJAX.
*
* @var bool
*/
protected $ajaxEnabled = FALSE;
Peter Philipp
committed
/**
* Where the results of a query will go.
*
* The array must use a numeric index starting at 0.
*
* @var \Drupal\views\ResultRow[]
Peter Philipp
committed
*/
Damian Lee
committed
public $result = array();
// May be used to override the current pager info.
Damian Lee
committed
/**
* The current page. If the view uses pagination.
*
* @var int
*/
protected $current_page = NULL;
Damian Lee
committed
/**
* The number of items per page.
*
* @var int
*/
protected $items_per_page = NULL;
Damian Lee
committed
/**
* The pager offset.
*
* @var int
*/
protected $offset = NULL;
Damian Lee
committed
/**
* The total number of rows returned from the query.
*
* @var int
Damian Lee
committed
*/
public $total_rows = NULL;
/**
Dries Buytaert
committed
* Attachments to place before the view.
Damian Lee
committed
*
Dries Buytaert
committed
* @var array()
Damian Lee
committed
*/
Dries Buytaert
committed
public $attachment_before = array();
Damian Lee
committed
/**
Dries Buytaert
committed
* Attachments to place after the view.
Damian Lee
committed
*
Dries Buytaert
committed
* @var array
Damian Lee
committed
*/
Dries Buytaert
committed
public $attachment_after = array();
Alex Pott
committed
/**
* Feed icons attached to the view.
*
* @var array
*/
public $feedIcons = array();
Damian Lee
committed
/**
Alex Pott
committed
* All the form data from $form_state->getValues().
Damian Lee
committed
*
* @var array
*/
public $exposed_data = array();
Damian Lee
committed
/**
* An array of input values from exposed forms.
*
* @var array
*/
protected $exposed_input = array();
Damian Lee
committed
/**
Alex Pott
committed
* Exposed widget input directly from the $form_state->getValues().
Damian Lee
committed
*
* @var array
*/
public $exposed_raw_input = array();
/**
* Used to store views that were previously running if we recurse.
*
* @var \Drupal\views\ViewExecutable[]
Damian Lee
committed
*/
public $old_view = array();
/**
* To avoid recursion in views embedded into areas.
*
* @var \Drupal\views\ViewExecutable[]
Damian Lee
committed
*/
public $parent_views = array();
/**
* Whether this view is an attachment to another view.
*
* @var bool
*/
public $is_attachment = NULL;
/**
* Identifier of the current display.
*
* @var string
*/
Damian Lee
committed
public $current_display;
Damian Lee
committed
* Where the $query object will reside.
* @var \Drupal\views\Plugin\views\query\QueryPluginBase
Damian Lee
committed
public $query = NULL;
Daniel Wehner
committed
/**
* The used pager plugin used by the current executed view.
*
Alex Pott
committed
* @var \Drupal\views\Plugin\views\pager\PagerPluginBase
Daniel Wehner
committed
*/
public $pager = NULL;
/**
Alex Pott
committed
* @var \Drupal\views\Plugin\views\display\DisplayPluginBase
Damian Lee
committed
public $display_handler;
Daniel Wehner
committed
/**
* The list of used displays of the view.
*
* An array containing Drupal\views\Plugin\views\display\DisplayPluginBase
* objects.
*
Alex Pott
committed
* @var \Drupal\views\DisplayPluginCollection
Daniel Wehner
committed
*/
public $displayHandlers;
/**
* The current used style plugin.
*
Alex Pott
committed
* @var \Drupal\views\Plugin\views\style\StylePluginBase
Damian Lee
committed
public $style_plugin;
Angie Byron
committed
/**
* The current used row plugin, if the style plugin supports row plugins.
*
* @var \Drupal\views\Plugin\views\row\RowPluginBase
*/
public $rowPlugin;
/**
* Stores the current active row while rendering.
*
* @var int
*/
Damian Lee
committed
public $row_index;
Dries Buytaert
committed
/**
* Allow to override the url of the current view.
*
* @var \Drupal\Core\Url
public $override_url;
/**
* Allow to override the path used for generated urls.
*
* @var string
*/
Damian Lee
committed
public $override_path = NULL;
/**
* Allow to override the used database which is used for this query.
Damian Lee
committed
*
* @var bool
Damian Lee
committed
public $base_database = NULL;
Damian Lee
committed
// Handlers which are active on this view.
/**
* Stores the field handlers which are initialized on this view.
Damian Lee
committed
*
* @var \Drupal\views\Plugin\views\field\FieldPluginBase[]
Damian Lee
committed
public $field;
/**
* Stores the argument handlers which are initialized on this view.
Damian Lee
committed
*
* @var \Drupal\views\Plugin\views\argument\ArgumentPluginBase[]
Damian Lee
committed
public $argument;
/**
* Stores the sort handlers which are initialized on this view.
Damian Lee
committed
*
* @var \Drupal\views\Plugin\views\sort\SortPluginBase[]
Damian Lee
committed
public $sort;
/**
* Stores the filter handlers which are initialized on this view.
Damian Lee
committed
*
* @var \Drupal\views\Plugin\views\filter\FilterPluginBase[]
Damian Lee
committed
public $filter;
/**
* Stores the relationship handlers which are initialized on this view.
Damian Lee
committed
*
* @var \Drupal\views\Plugin\views\relationship\RelationshipPluginBase[]
Damian Lee
committed
public $relationship;
/**
* Stores the area handlers for the header which are initialized on this view.
Damian Lee
committed
*
* @var \Drupal\views\Plugin\views\area\AreaPluginBase[]
Damian Lee
committed
public $header;
/**
* Stores the area handlers for the footer which are initialized on this view.
Damian Lee
committed
*
* @var \Drupal\views\Plugin\views\area\AreaPluginBase[]
Damian Lee
committed
public $footer;
/**
* Stores the area handlers for the empty text which are initialized on this view.
Damian Lee
committed
*
* An array containing Drupal\views\Plugin\views\area\AreaPluginBase objects.
*
* @var \Drupal\views\Plugin\views\area\AreaPluginBase[]
Damian Lee
committed
public $empty;
Daniel Wehner
committed
/**
* Stores the current response object.
*
* @var \Symfony\Component\HttpFoundation\Response
Daniel Wehner
committed
*/
protected $response = NULL;
/**
* Stores the current request object.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
Tim Plunkett
committed
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
/**
* Does this view already have loaded it's handlers.
*
* @todo Group with other static properties.
*
* @var bool
*/
public $inited;
/**
* The rendered output of the exposed form.
*
* @var string
*/
public $exposed_widgets;
/**
* If this view has been previewed.
*
* @var bool
*/
public $preview;
/**
* Force the query to calculate the total number of results.
*
* @todo Move to the query.
*
* @var bool
*/
public $get_total_rows;
/**
* Indicates if the sorts have been built.
*
* @todo Group with other static properties.
*
* @var bool
*/
public $build_sort;
/**
* Stores the many-to-one tables for performance.
*
* @var array
*/
public $many_to_one_tables;
/**
* A unique identifier which allows to update multiple views output via js.
*
* @var string
*/
public $dom_id;
catch
committed
/**
* A render array container to store render related information.
*
* For example you can alter the array and attach some asset library or JS
* settings via the #attached key. This is the required way to add custom
* CSS or JS.
catch
committed
*
* @var array
*
* @see drupal_process_attached
*/
public $element = [
'#attached' => [
'library' => [],
'drupalSettings' => [],
]
];
catch
committed
Angie Byron
committed
/**
* The current user.
*
* @var \Drupal\Core\Session\AccountInterface
*/
protected $user;
Angie Byron
committed
/**
* Should the admin links be shown on the rendered view.
*
* @var bool
*/
protected $showAdminLinks;
/**
* The views data.
*
* @var \Drupal\views\ViewsData
*/
protected $viewsData;
/**
* The route provider.
*
* @var \Drupal\Core\Routing\RouteProviderInterface
*/
protected $routeProvider;
Daniel Wehner
committed
/**
* Constructs a new ViewExecutable object.
*
* @param \Drupal\views\ViewEntityInterface $storage
Daniel Wehner
committed
* The view config entity the actual information is stored on.
Angie Byron
committed
* @param \Drupal\Core\Session\AccountInterface $user
* The current user.
* @param \Drupal\views\ViewsData $views_data
* The views data.
* @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
* The route provider.
Daniel Wehner
committed
*/
public function __construct(ViewEntityInterface $storage, AccountInterface $user, ViewsData $views_data, RouteProviderInterface $route_provider) {
Daniel Wehner
committed
// Reference the storage and the executable to each other.
$this->storage = $storage;
$this->storage->set('executable', $this);
Angie Byron
committed
$this->user = $user;
$this->viewsData = $views_data;
$this->routeProvider = $route_provider;
catch
committed
// Add the default css for a view.
$this->element['#attached']['library'][] = 'views/views.module';
Daniel Wehner
committed
}
/**
* Returns the identifier.
*
* @return string|null
* The entity identifier, or NULL if the object does not yet have an
* identifier.
*/
public function id() {
return $this->storage->id();
}
/**
* Saves the view.
Daniel Wehner
committed
*/
Tim Plunkett
committed
public function save() {
$this->storage->save();
}
/**
* Set the arguments that come to this view. Usually from the URL
* but possibly from elsewhere.
*/
public function setArguments(array $args) {
// The array keys of the arguments will be incorrect if set by
// views_embed_view() or \Drupal\views\ViewExecutable:preview().
$this->args = array_values($args);
}
/**
* Change/Set the current page for the pager.
*
* @param int $page
* The current page.
* @param bool $keep_cacheability
* (optional) Keep the cacheability. By default we mark the view as not
* cacheable. The reason for this parameter is that we do not know what the
* passed in value varies by. For example, it could be per role. Defaults to
* FALSE.
public function setCurrentPage($page, $keep_cacheability = FALSE) {
Daniel Wehner
committed
if (!$keep_cacheability) {
$this->element['#cache']['max-age'] = 0;
}
Daniel Wehner
committed
// If the pager is already initialized, pass it through to the pager.
Daniel Wehner
committed
if (!empty($this->pager)) {
return $this->pager->setCurrentPage($page);
Daniel Wehner
committed
}
}
/**
* Get the current page from the pager.
*/
Damian Lee
committed
public function getCurrentPage() {
Daniel Wehner
committed
// If the pager is already initialized, pass it through to the pager.
Daniel Wehner
committed
if (!empty($this->pager)) {
Angie Byron
committed
return $this->pager->getCurrentPage();
Daniel Wehner
committed
if (isset($this->current_page)) {
return $this->current_page;
}
}
/**
* Get the items per page from the pager.
*/
Damian Lee
committed
public function getItemsPerPage() {
Daniel Wehner
committed
// If the pager is already initialized, pass it through to the pager.
Daniel Wehner
committed
if (!empty($this->pager)) {
return $this->pager->getItemsPerPage();
Daniel Wehner
committed
if (isset($this->items_per_page)) {
return $this->items_per_page;
}
}
/**
* Set the items per page on the pager.
*
* @param int $items_per_page
* The items per page.
* @param bool $keep_cacheability
* (optional) Keep the cacheability. By default we mark the view as not
* cacheable. The reason for this parameter is that we do not know what the
* passed in value varies by. For example, it could be per role. Defaults to
* FALSE.
public function setItemsPerPage($items_per_page, $keep_cacheability = FALSE) {
$this->items_per_page = $items_per_page;
// If the pager is already initialized, pass it through to the pager.
Daniel Wehner
committed
if (!empty($this->pager)) {
$this->pager->setItemsPerPage($items_per_page);
if (!$keep_cacheability) {
$this->element['#cache']['max-age'] = 0;
}
}
/**
* Get the pager offset from the pager.
*/
Damian Lee
committed
public function getOffset() {
Daniel Wehner
committed
// If the pager is already initialized, pass it through to the pager.
Daniel Wehner
committed
if (!empty($this->pager)) {
Angie Byron
committed
return $this->pager->getOffset();
Daniel Wehner
committed
if (isset($this->offset)) {
return $this->offset;
}
}
/**
* Set the offset on the pager.
*
* @param int $offset
* The pager offset.
* @param bool $keep_cacheability
* (optional) Keep the cacheability. By default we mark the view as not
* cacheable. The reason for this parameter is that we do not know what the
* passed in value varies by. For example, it could be per role. Defaults to
* FALSE.
public function setOffset($offset, $keep_cacheability = FALSE) {
$this->offset = $offset;
// If the pager is already initialized, pass it through to the pager.
Daniel Wehner
committed
if (!empty($this->pager)) {
Alex Pott
committed
$this->pager->setOffset($offset);
if (!$keep_cacheability) {
$this->element['#cache']['max-age'] = 0;
}
}
/**
* Determine if the pager actually uses a pager.
*/
Damian Lee
committed
public function usePager() {
Daniel Wehner
committed
if (!empty($this->pager)) {
Alex Pott
committed
return $this->pager->usePager();
* Sets whether or not AJAX should be used.
*
* If AJAX is used, paging, tablesorting and exposed filters will be fetched
* via an AJAX call rather than a page refresh.
*
* @param bool $use_ajax
* TRUE if AJAX should be used, FALSE otherwise.
*/
public function setAjaxEnabled($ajax_enabled) {
$this->ajaxEnabled = (bool) $ajax_enabled;
}
/**
* Whether or not AJAX should be used.
*
* @see \Drupal\views\ViewExecutable::setAjaxEnabled().
*
* @return bool
public function ajaxEnabled() {
return $this->ajaxEnabled;
}
/**
* Set the exposed filters input to an array. If unset they will be taken
Angie Byron
committed
* from \Drupal::request()->query when the time comes.
Damian Lee
committed
public function setExposedInput($filters) {
$this->exposed_input = $filters;
}
/**
* Figure out what the exposed input for this view is.
*/
Damian Lee
committed
public function getExposedInput() {
Angie Byron
committed
// Fill our input either from \Drupal::request()->query or from something
// previously set on the view.
// Ensure that we can call the method at any point in time.
$this->initDisplay();
$this->exposed_input = \Drupal::request()->query->all();
// unset items that are definitely not our input:
foreach (array('page', 'q') as $key) {
if (isset($this->exposed_input[$key])) {
unset($this->exposed_input[$key]);
}
}
// If we have no input at all, check for remembered input via session.
// If filters are not overridden, store the 'remember' settings on the
// default display. If they are, store them on this display. This way,
// multiple displays in the same view can share the same filters and
// remember settings.
Daniel Wehner
committed
$display_id = ($this->display_handler->isDefaulted('filters')) ? 'default' : $this->current_display;
Angie Byron
committed
if (empty($this->exposed_input) && !empty($_SESSION['views'][$this->storage->id()][$display_id])) {
$this->exposed_input = $_SESSION['views'][$this->storage->id()][$display_id];
}
}
return $this->exposed_input;
}
/**
* Set the display for this view and initialize the display handler.
*/
Damian Lee
committed
public function initDisplay() {
if (isset($this->current_display)) {
return TRUE;
}
catch
committed
// Initialize the display cache array.
Alex Pott
committed
$this->displayHandlers = new DisplayPluginCollection($this, Views::pluginManager('display'));
$this->display_handler = $this->displayHandlers->get('default');
return TRUE;
}
/**
* Get the first display that is accessible to the user.
*
Daniel Wehner
committed
* @param array|string $displays
* Either a single display id or an array of display ids.
Daniel Wehner
committed
*
* @return string
* The first accessible display id, at least default.
Damian Lee
committed
public function chooseDisplay($displays) {
if (!is_array($displays)) {
return $displays;
}
Damian Lee
committed
$this->initDisplay();
Angie Byron
committed
if ($this->displayHandlers->get($display_id)->access($this->user)) {
return $display_id;
}
}
return 'default';
}
catch
committed
/**
* Gets the current display plugin.
*
* @return \Drupal\views\Plugin\views\display\DisplayPluginBase
*/
public function getDisplay() {
if (!isset($this->display_handler)) {
$this->initDisplay();
}
return $this->display_handler;
}
Dries Buytaert
committed
* Sets the current display.
Dries Buytaert
committed
* @param string $display_id
* The ID of the display to mark as current.
*
* @return bool
* TRUE if the display was correctly set, FALSE otherwise.
Damian Lee
committed
public function setDisplay($display_id = NULL) {
Dries Buytaert
committed
// If we have not already initialized the display, do so.
if (!isset($this->current_display)) {
// This will set the default display and instantiate the default display
// plugin.
Damian Lee
committed
$this->initDisplay();
Dries Buytaert
committed
}
Dries Buytaert
committed
// If no display ID is passed, we either have initialized the default or
// already have a display set.
if (!isset($display_id)) {
return TRUE;
Damian Lee
committed
$display_id = $this->chooseDisplay($display_id);
if (!$this->displayHandlers->has($display_id)) {
Dries Buytaert
committed
debug(format_string('setDisplay() called with invalid display ID "@display".', array('@display' => $display_id)));
return FALSE;
Angie Byron
committed
// Reset if the display has changed. It could be called multiple times for
// the same display, especially in the UI.
if ($this->current_display != $display_id) {
// Set the current display.
$this->current_display = $display_id;
// Reset the style and row plugins.
$this->style_plugin = NULL;
$this->plugin_name = NULL;
$this->rowPlugin = NULL;
}
Dries Buytaert
committed
if ($display = $this->displayHandlers->get($display_id)) {
// Set a shortcut.
$this->display_handler = $display;
return TRUE;
}
Dries Buytaert
committed
return FALSE;
/**
* Creates a new display and a display handler instance for it.
*
* @param string $plugin_id
* (optional) The plugin type from the Views plugin annotation. Defaults to
* 'page'.
* @param string $title
* (optional) The title of the display. Defaults to NULL.
* @param string $id
* (optional) The ID to use, e.g., 'default', 'page_1', 'block_2'. Defaults
* to NULL.
*
* @return \Drupal\views\Plugin\views\display\DisplayPluginBase
* A new display plugin instance if executable is set, the new display ID
* otherwise.
*/
public function newDisplay($plugin_id = 'page', $title = NULL, $id = NULL) {
$this->initDisplay();
$id = $this->storage->addDisplay($plugin_id, $title, $id);
catch
committed
$this->displayHandlers->addInstanceId($id);
Angie Byron
committed
$display = $this->displayHandlers->get($id);
$display->newDisplay();
return $display;
}
catch
committed
/**
* Gets the current style plugin.
*
* @return \Drupal\views\Plugin\views\style\StylePluginBase
*/
public function getStyle() {
if (!isset($this->style_plugin)) {
$this->initStyle();
}
return $this->style_plugin;
}
/**
* Find and initialize the style plugin.
*
* Note that arguments may have changed which style plugin we use, so
* check the view object first, then ask the display handler.
*/
Damian Lee
committed
public function initStyle() {
Alex Pott
committed
return TRUE;
Alex Pott
committed
$this->style_plugin = $this->display_handler->getPlugin('style');
if (empty($this->style_plugin)) {
return FALSE;
}
return TRUE;
}
/**
* Acquire and attach all of the handlers.
*/
Damian Lee
committed
public function initHandlers() {
Tim Plunkett
committed
$this->initDisplay();
catch
committed
foreach ($this::getHandlerTypes() as $key => $info) {
Damian Lee
committed
$this->_initHandler($key, $info);
catch
committed
/**
* Get the current pager plugin.
*
* @return \Drupal\views\Plugin\views\pager\PagerPluginBase
*/
public function getPager() {
if (!isset($this->pager)) {
$this->initPager();
}
return $this->pager;
}
/**
* Initialize the pager
*
* Like style initialization, pager initialization is held until late
* to allow for overrides.
*/
Damian Lee
committed
public function initPager() {
Daniel Wehner
committed
if (!isset($this->pager)) {
Daniel Wehner
committed
$this->pager = $this->display_handler->getPlugin('pager');
Alex Pott
committed
if ($this->pager->usePager()) {
$this->pager->setCurrentPage($this->current_page);
}
// These overrides may have been set earlier via $view->set_*
// functions.
if (isset($this->items_per_page)) {
$this->pager->setItemsPerPage($this->items_per_page);
Alex Pott
committed
$this->pager->setOffset($this->offset);
Daniel Wehner
committed
/**
* Render the pager, if necessary.
*/
Damian Lee
committed
public function renderPager($exposed_input) {
Alex Pott
committed
if (!empty($this->pager) && $this->pager->usePager()) {
Daniel Wehner
committed
return $this->pager->render($exposed_input);
}
return '';
}
/**
* Create a list of base tables eligible for this view. Used primarily
* for the UI. Display must be already initialized.
*/
Damian Lee
committed
public function getBaseTables() {
Angie Byron
committed
$this->storage->get('base_table') => TRUE,
Daniel Wehner
committed
foreach ($this->display_handler->getHandlers('relationship') as $handler) {
$base_tables[$handler->definition['base']] = TRUE;
}
return $base_tables;
}
/**
* Run the preQuery() on all active handlers.
Damian Lee
committed
protected function _preQuery() {
catch
committed
foreach ($this::getHandlerTypes() as $key => $info) {
$handlers = &$this->$key;
$position = 0;
foreach ($handlers as $id => $handler) {
$handlers[$id]->position = $position;
$handlers[$id]->preQuery();
* Run the postExecute() on all active handlers.
Damian Lee
committed
protected function _postExecute() {
catch
committed
foreach ($this::getHandlerTypes() as $key => $info) {
$handlers = &$this->$key;
foreach ($handlers as $id => $handler) {
$handlers[$id]->postExecute($this->result);
}
}
}
/**
* Attach all of the handlers for each type.
*
* @param $key
* One of 'argument', 'field', 'sort', 'filter', 'relationship'
* @param $info
catch
committed
* The $info from getHandlerTypes for this object.
Damian Lee
committed
protected function _initHandler($key, $info) {
// Load the requested items from the display onto the object.
Alex Pott
committed
$this->$key = &$this->display_handler->getHandlers($key);
// This reference deals with difficult PHP indirection.
$handlers = &$this->$key;
// Run through and test for accessibility.
foreach ($handlers as $id => $handler) {
Angie Byron
committed
if (!$handler->access($this->user)) {
unset($handlers[$id]);
}
}
}
/**
* Build all the arguments.
*/
Damian Lee
committed
protected function _buildArguments() {
// Initially, we want to build sorts and fields. This can change, though,
// if we get a summary view.
if (empty($this->argument)) {
return TRUE;
}
// build arguments.
$position = -1;
$substitutions = array();
$status = TRUE;
// Get the title.
$title = $this->display_handler->getOption('title');
// Iterate through each argument and process.
foreach ($this->argument as $id => $arg) {
$position++;
$argument = $this->argument[$id];