Commit 0715082b authored by mauritsl's avatar mauritsl
Browse files

Add flags option to hansel_get_breadcrumbs to provide a way for switches and...

Add flags option to hansel_get_breadcrumbs to provide a way for switches and actions to act different
parent a4f3efbd
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -454,10 +454,15 @@ 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);
  
@@ -796,7 +801,7 @@ function hansel_tokens($type, $tokens, $data = array(), $options = array()) {
      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'];
  }