diff --git a/hansel.module b/hansel.module index ebbd942f935ce412bb531355a1a226f621937c39..1b3ed0d3e7adca4f7a8ea14d72b604ad251dbbb0 100644 --- a/hansel.module +++ b/hansel.module @@ -454,13 +454,18 @@ function hansel_get_config() { * @param bool $keep_last_item * Force this function to keep the last item, even when the settings are set * to hide it. This is used for the alias token. + * @param array $flags + * Breadcrumb actions and switches can act differently upon the given flags. * @return mixed * Array with breadcrumbs or FALSE (means: leave with restore option). */ -function hansel_get_breadcrumbs($test = FALSE, $plaintext = FALSE, $keep_last_item = FALSE) { +function hansel_get_breadcrumbs($test = FALSE, $plaintext = FALSE, $keep_last_item = FALSE, $flags = array()) { + global $_hansel_flags; + $_hansel_flags = $flags; + $config = hansel_get_config(); extract($config); - + if (!$start_rid) { !$test or _hansel_test_message(t('No rule found with name "start" on the top level')); return FALSE; @@ -771,11 +776,11 @@ function hansel_cache_set($cid, $data) { */ function hansel_tokens($type, $tokens, $data = array(), $options = array()) { global $_hansel_test_path; - + if (!in_array($type, array('node', 'taxonomy_term', 'user'))) { return array(); } - + switch ($type) { case 'node': $object = $data['node']; @@ -795,8 +800,8 @@ function hansel_tokens($type, $tokens, $data = array(), $options = array()) { default: return array(); } - - $path = hansel_get_breadcrumbs(FALSE, TRUE, TRUE); + + $path = hansel_get_breadcrumbs(FALSE, TRUE, TRUE, array('alias')); if (is_array($path)) { $path = $path['breadcrumb']; }