function panels_views_load_all in Panels 5.2
Load all view panes.
3 calls to panels_views_load_all()
- panels_views_content_types in panels_views/
panels_views.module - Return a list of each view type we support.
- panels_views_list_views in panels_views/
panels_views.module - Page callback to list view panes and the initial form to add new view panes.
- panels_views_panels_exportables in panels_views/
panels_views.module - Implementation of hook_panels_exportables().
File
- panels_views/
panels_views.module, line 1395 - panels_views.module
Code
function panels_views_load_all() {
static $panel_views = NULL;
if (isset($panel_views)) {
return $panel_views;
}
$panel_views = array();
$names = panels_views_pane_fields();
$result = db_query("SELECT * FROM {panels_views}");
while ($pv = db_fetch_object($result)) {
foreach ($names as $name => $data) {
if (!empty($data['serialize'])) {
$pv->{$name} = unserialize($pv->{$name});
}
}
$pv->type = t('Local');
$panel_views[$pv->name] = $pv;
}
// Now load all the in-code versions
$status = variable_get('panels_views_defaults', array());
foreach (panels_views_default_panels() as $pv) {
// Determine if default panel is enabled or disabled.
if (isset($status[$pv->name])) {
$pv->disabled = $status[$pv->name];
}
if (!empty($panel_views[$pv->name])) {
$panel_views[$pv->name]->type = t('Overridden');
}
else {
$pv->type = t('Default');
$panel_views[$pv->name] = $pv;
}
}
return $panel_views;
}