diff --git a/arguments/nid.inc b/arguments/nid.inc index db9522b46ef3133a1be141d5d99729082b827d4b..7e3b85ab2da7eadad59d779e56aac9a8cb88bd64 100644 --- a/arguments/nid.inc +++ b/arguments/nid.inc @@ -28,7 +28,7 @@ function panels_nid_panels_arguments() { function panels_nid_context($arg = NULL, $conf = NULL, $empty = FALSE) { // If unset it wants a generic, unfilled context. if ($empty) { - return panels_context_create_empty('node'); + return panels_context_create_empty('node', $conf); } if (!is_numeric($arg)) { @@ -44,7 +44,7 @@ function panels_nid_context($arg = NULL, $conf = NULL, $empty = FALSE) { return FALSE; } - return panels_context_create('node', $node); + return panels_context_create('node', $node, $conf); } /** diff --git a/contexts/node.inc b/contexts/node.inc index be48b17eefbf7dcdc22d5c2042228c81828c11b4..eca7f6abca4fb8ff26b5a8ca66c5ac8710f17d44 100644 --- a/contexts/node.inc +++ b/contexts/node.inc @@ -26,7 +26,15 @@ function panels_node_panels_contexts() { * are not always created from the UI. */ function panels_context_create_node($empty, $data = NULL, $conf = FALSE) { - $context = new panels_context('node'); + $types = array('node'); + if (!empty($conf['types'])) { + foreach ($conf['types'] as $type) { + if ($type) { + $types[] = 'node-'. $type; + } + } + } + $context = new panels_context($types); $context->plugin = 'node'; if ($empty) { diff --git a/includes/plugins.inc b/includes/plugins.inc index ca191dbe087713ba1954feae6a44f84c87164e4b..6def5b7edc64fe70552d9ea0ba0ffa85e129f945 100644 --- a/includes/plugins.inc +++ b/includes/plugins.inc @@ -1092,9 +1092,9 @@ function panels_context_create($type, $data = NULL, $conf = FALSE) { } } -function panels_context_create_empty($type) { +function panels_context_create_empty($type, $conf = FALSE) { if ($function = panels_plugin_get_function('contexts', $type, 'context')) { - return $function(TRUE); + return $function(TRUE, NULL, $conf); } } @@ -1387,8 +1387,7 @@ function panels_panels_include_directory($plugin_type) { /** * Load plugin info for all hooks; this is handled separately from plugins - * from files. This is cached so we don't find ourselves building htis - * repeatedly. + * from files. This caches so we don't find ourselves building it repeatedly. * * NOTE: This hook does work, but if you are implementing Panels in a client, * @see panels_get_include_directories() as it is the preferred method.