function views_db_object::add_display

cis7 view.inc views_db_object::add_display($type = 'page', $title = NULL, $id = NULL)
cle7 view.inc views_db_object::add_display($type = 'page', $title = NULL, $id = NULL)
elmsmedia7 view.inc views_db_object::add_display($type = 'page', $title = NULL, $id = NULL)
icor7 view.inc views_db_object::add_display($type = 'page', $title = NULL, $id = NULL)
meedjum_blog7 view.inc views_db_object::add_display($type = 'page', $title = NULL, $id = NULL)
mooc7 view.inc views_db_object::add_display($type = 'page', $title = NULL, $id = NULL)

Add a new display handler to the view, automatically creating an id.

Parameters

$type: The plugin type from the views plugin data. Defaults to 'page'.

$title: The title of the display; optional, may be filled in from default.

$id: The id to use.

Return value

The key to the display in $view->display, so that the new display can be easily located.

1 call to views_db_object::add_display()
views_db_object::new_display in sites/all/modules/ulmus/views/includes/view.inc
Create a new display and a display handler for it.

File

sites/all/modules/ulmus/views/includes/view.inc, line 2318
Provides the view object type and associated methods.

Class

views_db_object
Base class for views' database objects.

Code

function add_display($type = 'page', $title = NULL, $id = NULL) {
  if (empty($type)) {
    return FALSE;
  }

  $plugin = views_fetch_plugin_data('display', $type);
  if (empty($plugin)) {
    $plugin['title'] = t('Broken');
  }


  if (empty($id)) {
    $id = $this->generate_display_id($type);
    if ($id !== 'default') {
      preg_match("/[0-9]+/", $id, $count);
      $count = $count[0];
    }
    else {
      $count = '';
    }

    if (empty($title)) {
      if ($count > 1) {
        $title = $plugin['title'] . ' ' . $count;
      }
      else {
        $title = $plugin['title'];
      }
    }
  }

  // Create the new display object
  $display = new views_display;
  $display->options($type, $id, $title);

  // Add the new display object to the view.
  $this->display[$id] = $display;
  return $id;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.