$block->subject = $node->title;
- unset($node->title);
+// unset($node->title);
$block->content = panels_admin_node_content($node, $conf);
}
'links' => TRUE,
'page' => TRUE,
'no_extras' => TRUE,
+ 'override_title' => FALSE,
+ 'override_title_text' => '',
+ 'teaser' => TRUE,
+ 'identifier' => '',
+ 'link' => TRUE,
);
}
return $form;
}
-function panels_admin_title_node_content($conf, $context) {
+function panels_admin_title_node_content($subtype, $conf, $context) {
return t('"@s" content', array('@s' => $context->identifier));
}
$content[$panel_name] = panels_render_panel($display, $panel_name, $panel);
}
+ // Prevent notices by making sure that all panels at least have an entry:
+ $layout = panels_get_layout($display->layout);
+ $panels = panels_get_panels($layout, $display);
+ foreach ($panels as $id => $panel) {
+ if (!isset($content[$id])) {
+ $content[$id] = NULL;
+ }
+ }
+
return $content;
}
$url = $content->title_link;
}
// set defaults so we don't bring up notices
- $url += array('href' => '', 'attributes' => NULL, 'query' => NULL, 'fragment' => NULL, 'absolute' => NULL);
- $content->title = l($content->title,
- $url['href'],
- $url['attributes'],
- $url['query'],
- $url['fragment'],
- $url['absolute'], TRUE);
+ $url += array('href' => '', 'attributes' => NULL, 'query' => NULL, 'fragment' => NULL, 'absolute' => NULL, 'html' => TRUE);
+ $content->title = l($content->title, $url['href'], $url);
}
}
return $content;
if (!empty($pane->configuration['style'])) {
$style = panels_get_style($pane->configuration['style']);
- if (isset($style)) {
+ if (isset($style) && isset($style['render pane'])) {
$output = theme($style['render pane'], $content, $pane, $display);
// This could be null if no theme function existed.
// this is safe as it's always programmatic
$item[] = $panel_page->type;
- if (empty($panel_page->display)) {
+ if ($panel_page->type == t('Default')) {
+ $panel_page->display = &$panel_page->primary;
+ }
+ else {
$panel_page->display = $displays[$panel_page->did];
}
$item[] = check_plain($layouts[$panel_page->display->layout]['title']);
*/
function panels_page_delete_confirm(&$form_state, $panel_page) {
$form_state['panel_page'] = $panel_page;
+ $form = array();
if ($panel_page->type != t('Overridden')) {
return confirm_form($form,
t('Are you sure you want to delete "@title"?', array('@title' => panels_page_get_title($panel_page))),
- $_GET['destination'] ? $_GET['destination'] : 'admin/panels/panel-page',
+ isset($_GET['destination']) ? $_GET['destination'] : 'admin/panels/panel-page',
t('This action cannot be undone.'),
t('Delete'), t('Cancel')
);
else {
return confirm_form($form,
t('Are you sure you want to revert "@title" to its default configuration?', array('@title' => panels_page_get_title($panel_page))),
- $_GET['destination'] ? $_GET['destination'] : 'admin/panels/panel-page',
+ isset($_GET['destination']) ? $_GET['destination'] : 'admin/panels/panel-page',
t('This action cannot be undone.'),
t('Revert'), t('Cancel')
);
$form_state['next'] = $next;
drupal_add_css(panels_get_path('css/panels_admin.css'));
- $layout = panels_get_layout($panel_page->display->layout);
$form['right'] = array(
'#prefix' => '<div class="right-container">',
}
else {
$page->type = t('Default');
+ // move the 'display' to the new 'primary' location.
+ $page->primary = $page->display;
+ unset($page->display);
$pages[$page->name] = $page;
}
}
$where = is_numeric($id) ? 'pid = %d' : "name = '%s'";
$page = db_fetch_object(db_query("SELECT * FROM {panels_page} WHERE $where", $id));
+ $defaults = panels_page_default_panels();
if (!$page) {
- $defaults = panels_page_default_panels();
if (isset($defaults[$id])) {
// Default panel pages will always only be identified by name, so no need
// for the both-ids-point-to-same-object trick.
$page = $defaults[$id];
+ $page->type = t('Default');
+ // move the 'display' to the new 'primary' location.
+ $page->primary = $page->display;
+ unset($page->display);
panels_page_loaded_cache($id, $page);
return $page;
}
return;
}
+ else {
+ $page->type = isset($defaults[$id]) ? t('Overridden') : t('Local');
+ }
$page->access = ($page->access ? explode(', ', $page->access) : array());
$page->arguments = (!empty($page->arguments)) ? unserialize($page->arguments) : array();
// Commented out is a more precise way of telling, but it's probably moot.
// if (empty($panel_page->primary) || !is_a($panel_page->primary, 'panels_display')) {
if (empty($panel_page->primary) || !is_object($panel_page->primary)) {
- $panel_page->primary = panels_load_display($panel_page->did);
+ if ($panel_page->type != t('Default')) {
+ $panel_page->primary = panels_load_display($panel_page->did);
+ }
}
$panel_page->display = &$panel_page->primary;
$panel_page->current = 'primary';
function _panels_page_prepare_panels_render(&$panel_page) {
_panels_page_check_switchers($panel_page);
- // $panel_page->context = panels_context_load_contexts($panel_page, FALSE, $panel_page->contexts);
- // $panel_page->context = panels_context_load_contexts($panel_page);
+ $panel_page->context = panels_context_load_contexts($panel_page, FALSE, $panel_page->context);
+
+ // The below does not make sense.
+// $panel_page->context = panels_context_load_contexts($panel_page);
// If we're wrapping FAPI with with panel, this function gets the data.
$panel_page->form = panels_context_get_form($panel_page->context);
// Get any keywords (for title substitution in panes)