You are here

function panels_context::is_type in Panels 5.2

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

File

includes/plugins.inc, line 32
plugins.inc

Class

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

Code

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);
}