function panels_page_load_all in Panels 5.2
Same name and namespace in other branches
- 6.2 panels_page/panels_page.read.inc \panels_page_load_all()
Fetch all panel pages in the system.
This function does not cache.
4 calls to panels_page_load_all()
- panels_page_list_page in panels_page/
panels_page.admin.inc - Provide a list of panels, with links to edit or delete them.
- panels_page_menu in panels_page/
panels_page.module - Implementation of hook_menu().
- panels_page_panels_exportables in panels_page/
panels_page.module - Implementation of hook_panels_exportables().
- panels_page_view_page in panels_page/
panels_page.module - Page callback to view a panel page.
File
- panels_page/
panels_page.module, line 891 - panels_page.module
Code
function panels_page_load_all($names = array(), $page_size = 0) {
$pages = $dids = array();
$query = "SELECT * FROM {panels_page}";
if ($names) {
$query .= " WHERE name IN (" . implode(', ', array_fill(0, sizeof($names), "'%s'")) . ")";
}
if ($page_size) {
$result = pager_query($query, $page_size, 0, $names);
}
else {
$result = db_query($query, $names);
}
while ($page = db_fetch_object($result)) {
$page->access = $page->access ? explode(', ', $page->access) : array();
$page->arguments = !empty($page->arguments) ? unserialize($page->arguments) : array();
$page->displays = !empty($page->displays) ? unserialize($page->displays) : array();
$page->contexts = !empty($page->contexts) ? unserialize($page->contexts) : array();
$page->relationships = !empty($page->relationships) ? unserialize($page->relationships) : array();
$page->switcher_options = !empty($page->switcher_options) ? unserialize($page->switcher_options) : array();
$page->type = t('Local');
$pages[$page->name] = panels_page_sanitize($page);
}
$status = variable_get('panel_page_defaults', array());
foreach (panels_page_default_panels() as $page) {
// Determine if default panel is enabled or disabled.
if (isset($status[$page->name])) {
$page->disabled = $status[$page->name];
}
if (!empty($pages[$page->name])) {
$pages[$page->name]->type = t('Overridden');
}
else {
$page->type = t('Default');
$page->primary = $page->display;
$pages[$page->name] = $page;
}
}
return $pages;
}