function panels_page_fetch_display in Panels 6.2
Same name and namespace in other branches
- 5.2 panels_page/panels_page.module \panels_page_fetch_display()
Load a display into the 'current display' position, $panel_page->current.
The family of panels_page_fetch*() functions are specifically dedicated to retrieving a particular display and placing them in $panels_page->display, which is the 'current' display upon which all other operations act. via reference to its permanent home in the $panels_page object. The permanent homes vary:
-# For the primary display, that location is $panels_page->primary. -# For alternate default displays, that location is in $panels_page->alternates['defaults'][$did]. TODO this isn't true right now -# For alternate non-default displays, that location is in $panels_page->alternates['all'][$did].
The structure of this function family essentially means that no other panels_page function should ever act on anything except $panel_page->display.
Parameters
object $panel_page:
string $id: A string of the format generated by panels_argument_get_display().
Return value
mixed Can return NULL or TRUE. Most of the substantial operations are performed by reference. NULL returns indicate that the fetched display corresponds exactly to the one requested by $id; TRUE return values indicate that the requested $id does not have its own display associated with it, and so a default (either an alternate default or the primary display) were returned in its stead.
5 calls to panels_page_fetch_display()
- panels_page_admin_cache_load in panels_page/
panels_page.module - 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.
- panels_page_admin_load in panels_page/
panels_page.module - Menu loader for some panels_page admin screens. Loads the panels_page specified by the name arg, induces a 404 when a bad arg is provided.
- panels_page_edit_alternate in panels_page/
panels_page.admin.inc - panels_page_export in panels_page/
panels_page.write.inc - Export a panel page into PHP code for use in import.
- _panels_page_prepare_panels_render in panels_page/
panels_page.render.inc
File
- panels_page/
panels_page.read.inc, line 193 - panels_page.write.inc
Code
function panels_page_fetch_display(&$panel_page, $id = NULL) {
// Redirect to the appropriate fetcher depending on whether $id is provided
return empty($id) ? panels_page_fetch_primary_display($panel_page) : panels_page_fetch_alternate_display($panel_page, $id);
}