Commit d0ebfdc4 authored by Eric Bremner's avatar Eric Bremner
parent d2ed753a
......@@ -289,6 +289,19 @@ function context_load($name = NULL, $reset = FALSE) {
}
}
if (isset($name)) {
// Allow modules a last-ditch effort to define a context with a given name
if (!isset($contexts[$name])) {
foreach (module_implements('context_custom') as $module) {
$function = $module.'_context_custom';
if (function_exists($function)) {
$context = $function($name);
if (is_object($context)) {
$contexts[$name] = $context;
break;
}
}
}
}
// Allow other modules to alter the value just before it's returned.
if (isset($contexts[$name]) && !isset($altered[$name])) {
$altered[$name] = TRUE;
......
......@@ -585,7 +585,7 @@ class context_reaction_block extends context_reaction {
* Sort callback.
*/
static function block_sort($a, $b) {
return ($a->weight - $b->weight);
return (($a->weight - $b->weight) > 0)? 1 : -1;
}
/**
......
......@@ -140,6 +140,10 @@ class context_reaction_menu extends context_reaction {
list($menu_name, $path) = explode(':', $id);
$by_menu_name[$menu_name][] = $path;
}
return $by_menu_name;
return $active_paths;
// Disabling return $by_menu_name
// to return active paths before getting exploded against ":"
// Versions before context-7.x-3.3 are like exactly this
//return $by_menu_name;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment