You are here

public function AuthcachePanelsAbstractDisplayLoader::load in Authenticated User Page Caching (Authcache) 7.2

Load the objects designated by the given list of keys.

Parameters

array $keys: A list of strings representing the keys of the fragment(s) to load.

array $context: Additional run-time per-request context (key-value pairs).

Return value

array An associative array of key-value pairs where keys correspond to the input keys and the values to the objects loaded from the database.

Throws

AuthcacheP13nRequestNotFound

Overrides AuthcacheP13nFragmentLoaderInterface::load

File

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

Class

AuthcachePanelsAbstractDisplayLoader
Personalization fragment for panel pane.

Code

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