You are here

abstract class AuthcachePanelsAbstractDisplayLoader in Authenticated User Page Caching (Authcache) 7.2

Personalization fragment for panel pane.

Hierarchy

Expanded class hierarchy of AuthcachePanelsAbstractDisplayLoader

File

modules/authcache_panels/includes/AuthcachePanelsAbstractDisplayLoader.inc, line 10
Defines personalization fragment for panel pane.

View source
abstract class AuthcachePanelsAbstractDisplayLoader implements AuthcacheP13nFragmentLoaderInterface {
  protected $paneId;

  /**
   * Construct new display loader.
   */
  public function __construct($pane_id) {
    $this->paneId = $pane_id;
  }

  /**
   * Load the display object.
   */
  protected abstract function loadDisplay();

  /**
   * {@inheritdoc}
   */
  public function load($params, $context) {
    ctools_include('plugins', 'panels');
    ctools_include('content');
    $display = $this
      ->loadDisplay();
    if (!$display) {
      throw new AuthcacheP13nRequestNotFound();
    }
    if (!isset($display->content[$this->paneId])) {
      throw new AuthcacheP13nRequestNotFound();
    }

    // Assign page manager context and arguments prepared by a context
    // provider.
    $display->context = array();
    if (!empty($context['panels']['context'])) {
      $display->context = $context['panels']['context'];
    }
    $display->args = array();
    if (!empty($context['panels']['arguments'])) {
      $display->args = $context['panels']['arguments'];
    }
    return array(
      $this->paneId => $display,
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthcachePanelsAbstractDisplayLoader::$paneId protected property
AuthcachePanelsAbstractDisplayLoader::load public function Load the objects designated by the given list of keys. Overrides AuthcacheP13nFragmentLoaderInterface::load
AuthcachePanelsAbstractDisplayLoader::loadDisplay abstract protected function Load the display object. 1
AuthcachePanelsAbstractDisplayLoader::__construct public function Construct new display loader. 1