You are here

class panels_context in Panels 5.2

Same name and namespace in other branches
  1. 6.2 includes/plugins.inc \panels_context

Forms the basis for describing and storing a context that a display might be running in.

Hierarchy

Expanded class hierarchy of panels_context

File

includes/plugins.inc, line 14
plugins.inc

View source
class panels_context {
  var $type = NULL;
  var $data = NULL;

  // The title of this object.
  var $title = '';

  // The title of the page if this object exists
  var $page_title = '';

  // The identifier (in the UI) of this object
  var $identifier = '';
  var $argument = NULL;
  var $keyword = '';
  function panels_context($type = 'none', $data = NULL) {
    $this->type = $type;
    $this->data = $data;
    $this->title = t('Unknown context');
  }
  function is_type($type) {
    if ($type == 'any' || $this->type == 'any') {
      return TRUE;
    }
    $a = is_array($type) ? $type : array(
      $type,
    );
    $b = is_array($this->type) ? $this->type : array(
      $this->type,
    );
    return (bool) array_intersect($a, $b);
  }
  function get_argument() {
    return $this->argument;
  }
  function get_keyword() {
    return $this->keyword;
  }
  function get_identifier() {
    return $this->identifier;
  }
  function get_title() {
    return $this->title;
  }
  function get_page_title() {
    return $this->page_title;
  }

}

Members