diff --git a/includes/common.inc b/includes/common.inc
index 242d6949f5a139656dd68cc263628717af9fafdf..ffeac4561c09f79387457f2c5f2f6f948f49c8c6 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -494,16 +494,39 @@ function theme_panels_common_content_list($display) {
*
* Contexts must be preloaded.
*/
-function theme_panels_common_context_list($object) {
+function theme_panels_common_context_list($object, $header = '') {
$titles = array();
$output = '';
$count = 1;
+ // Describe 'built in' contexts.
+ if (!empty($object->base_contexts)) {
+ foreach ($object->base_contexts as $id => $context) {
+ $output .= '
',
+ '#prefix' => '
',
'#suffix' => '
',
- '#value' => t('This should be a summary of the contexts provided by the task, so for node_view here it will tell you about the node context it provides.'),
+ '#value' => theme('panels_common_context_list', $cache, t('Summary of contexts')),
);
+ drupal_add_css(panels_get_path('css/panels_admin.css'));
$form_state['cache'] = &$cache;
}
diff --git a/panels_page/panels_page.css_filter.inc b/panels_page/panels_page.css_filter.inc
index 49f024e4a418d77888802dee54df3612f2cfa57d..71b362d604b949f2c6bd3d584aad49b4d9947470 100644
--- a/panels_page/panels_page.css_filter.inc
+++ b/panels_page/panels_page.css_filter.inc
@@ -2,7 +2,7 @@
/* $Id$ */
/*
- * @file panels_page/panels_page.css_filter.inc
+ * @file
* CSS filtering functions. Contains a disassembler, filter, compressor, and
* decompressor. Separated out into this file for cleanliness, as it's likely
* that these won't live in panels_page for long.
@@ -93,7 +93,7 @@ function panels_page_disassemble_css($css) {
foreach ($statements as $statement) {
// Get the selector(s) and declaration.
list($selector_str, $declaration) = explode('{', $statement);
-
+
// If the selector exists, then disassemble it, check it, and regenerate
// the selector string.
$selector_str = empty($selector_str) ? FALSE : panels_page_disassemble_css_selector($selector_str);
@@ -101,7 +101,7 @@ function panels_page_disassemble_css($css) {
// No valid selectors. Bomb out and start the next item.
continue;
}
-
+
// Disassemble the declaration, check it and tuck it into an array.
$disassembled_css[$selector_str] = panels_page_disassemble_css_declaration(strtolower($declaration));
}
@@ -173,7 +173,7 @@ function panels_page_filter_css($css, $allowed_properties = array(), $allowed_va
// Define disallowed url() value contents, if none is provided.
// $disallowed_values_regex = !empty($disallowed_values_regex) ? $disallowed_values_regex : '/[url|expression]\s*\(\s*[^\s)]+?\s*\)\s*/';
$disallowed_values_regex = !empty($disallowed_values_regex) ? $disallowed_values_regex : '/(url|expression)/';
-
+
foreach ($css as $selector_str => $declaration) {
foreach ($declaration as $property => $value) {
if (!in_array($property, $allowed_properties)) {
diff --git a/plugins/task_handlers/panel_node_view.inc b/plugins/task_handlers/panel_node_view.inc
index 6e5b22f809722583c1cac9e4a55a84eeaa931e20..d4dc0386d1e99b986d899987726b504bd15e0802 100644
--- a/plugins/task_handlers/panel_node_view.inc
+++ b/plugins/task_handlers/panel_node_view.inc
@@ -25,6 +25,7 @@ function panels_panel_node_view_delegator_task_handlers() {
'layout-settings' => t('Layout settings'),
'node_type' => t('Node type'),
),
+ 'save' => 'panels_panel_node_view_save',
'forms' => array(
'node_type' => array(
'form' => 'panels_panel_node_view_edit_node_type',
@@ -71,6 +72,7 @@ function panels_panel_node_view_delegator_task_handlers() {
),
'form' => 'panels_delegator_edit_content',
'submit' => 'panels_edit_display_form_submit',
+ 'no blocks' => TRUE,
),
'context' => array(
'include' => drupal_get_path('module', 'panels') . '/includes/delegator.inc',
@@ -83,6 +85,7 @@ function panels_panel_node_view_delegator_task_handlers() {
'no_blocks' => FALSE,
'css_id' => '',
'css' => '',
+ 'css_cache_file' => '',
'contexts' => array(),
'relationships' => array(),
),
@@ -115,12 +118,38 @@ function panels_panel_node_view_render($handler, $node) {
$display->context = array(
'panel-node' => $context,
);
+ $display->css_id = $handler->conf['css_id'];
+
+ // Check to see if there is any CSS.
+ if ($handler->conf['css_cache']) {
+ if (!file_exists($handler->conf['css_cache'])) {
+ // This will force the task handler to re-cache the CSS and save the filename:
+ delegator_save_task_handler($handler);
+ }
+ dsm("Addning: " . $handler->conf['css_cache']);
+ drupal_add_css($handler->conf['css_cache']);
+ }
// Since we're not using node_show() we need to emulate what it used to do.
// Update the history table, stating that this user viewed this node.
node_tag_new($node->nid);
- return panels_render_display($display);
+ $output = panels_render_display($display);
+ if (!empty($handler->conf['no_blocks'])) {
+ print theme('page', $output, FALSE);
+ // We return TRUE to let it know we handled this but have already
+ // handled the output rendering ourselves.
+ return TRUE;
+ }
+ return $output;
+}
+
+/**
+ * Call through to the delegator function for this.
+ */
+function panels_panel_node_view_save(&$handler, $update) {
+ panels_load_include('delegator');
+ return panels_delegator_save($handler, $update);
}
/**