function views_handler::init

cis7 handlers.inc views_handler::init(&$view, &$options)
cle7 handlers.inc views_handler::init(&$view, &$options)
elmsmedia7 handlers.inc views_handler::init(&$view, &$options)
icor7 handlers.inc views_handler::init(&$view, &$options)
meedjum_blog7 handlers.inc views_handler::init(&$view, &$options)
mooc7 handlers.inc views_handler::init(&$view, &$options)

init the handler with necessary data.

Parameters

$view: The $view object this handler is attached to.

$options: The item from the database; the actual contents of this will vary based upon the type of handler.

6 methods override views_handler::init()
views_handler_area::init in sites/all/modules/ulmus/views/handlers/views_handler_area.inc
Overrides views_handler::init().
views_handler_argument::init in sites/all/modules/ulmus/views/handlers/views_handler_argument.inc
init the handler with necessary data.
views_handler_field::init in sites/all/modules/ulmus/views/handlers/views_handler_field.inc
init the handler with necessary data.
views_handler_filter::init in sites/all/modules/ulmus/views/handlers/views_handler_filter.inc
Provide some extra help to get the operator/value easier to use.
views_handler_relationship::init in sites/all/modules/ulmus/views/handlers/views_handler_relationship.inc
Init handler to let relationships live on tables other than the table they operate on.

... See full list

File

sites/all/modules/ulmus/views/includes/handlers.inc, line 198
Defines the various handler objects to help build and display views.

Class

views_handler
Base handler, from which all the other handlers are derived. It creates a common interface to create consistency amongst handlers and data.

Code

function init(&$view, &$options) {
  $this->view = &$view;
  $display_id = $this->view->current_display;
  // Check to see if this handler type is defaulted. Note that
  // we have to do a lookup because the type is singular but the
  // option is stored as the plural.

  // If the 'moved to' keyword moved our handler, let's fix that now.
  if (isset($this->actual_table)) {
    $options['table'] = $this->actual_table;
  }

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

  $types = views_object_types();
  $plural = $this->handler_type;
  if (isset($types[$this->handler_type]['plural'])) {
    $plural = $types[$this->handler_type]['plural'];
  }
  if ($this->view->display_handler->is_defaulted($plural)) {
    $display_id = 'default';
  }

  $this->localization_keys = array(
    $display_id,
    $this->handler_type,
    $options['table'],
    $options['id'],
  );

  $this->unpack_options($this->options, $options);

  // This exist on most handlers, but not all. So they are still optional.
  if (isset($options['table'])) {
    $this->table = $options['table'];
  }

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

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

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

  $this->query = &$view->query;
}
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.