You are here

function panels_page_admin_cache_load in Panels 6.2

Menu loader for some panels_page admin screens. Loads the panels_page specified by the name arg from the edit cache, or induces a 404 when a bad arg is provided.

Use the empty string so that the behavior of callers that don't pass arg(6) will be identical to callers who do pass arg(6), but arg(6) is empty.

Parameters

string $name:

string $which:

Return value

mixed

1 string reference to 'panels_page_admin_cache_load'
panels_page_admin_dynamic_menu_items in panels_page/panels_page.menu.inc

File

panels_page/panels_page.module, line 154
panels_page.module

Code

function panels_page_admin_cache_load($name, $which = '') {
  static $panel_page;
  if (empty($panel_page)) {
    if (!empty($_POST)) {
      $panel_page = panels_cache_get('panel_object:panel_page', $name);
    }
    else {
      $panel_page = panels_page_load($name);
      panels_page_fetch_display($panel_page, $which);
      panels_cache_set('panel_object:panel_page', $name, $panel_page);
    }
  }
  if (is_object($panel_page) && !empty($panel_page->pid)) {
    panels_page_set_current($panel_page);
    return $panel_page;
  }
  return FALSE;
}