--- token_node.inc 2010-09-24 17:47:29.000000000 -0500 +++ token_node.inc.new 2010-10-18 16:55:48.017318313 -0500 @@ -79,24 +79,29 @@ $trail[] = check_plain($title); } - $values['menupath'] = !empty($options['pathauto']) ? $trail : implode('/', $trail); - $values['menupath-raw'] = !empty($options['pathauto']) ? $trail_raw : implode('/', $trail_raw); - $values['menu'] = check_plain($menu); - $values['menu-raw'] = $menu; - $values['menu-link-title'] = check_plain($menu_link['title']); - $values['menu-link-title-raw'] = $menu_link['link_title']; - $values['menu-link-mlid'] = $menu_link['mlid']; - $values['menu-link-plid'] = $menu_link['plid']; + $values['menupath'] = !empty($options['pathauto']) ? $trail : implode('/', $trail); + $values['menupath-raw'] = !empty($options['pathauto']) ? $trail_raw : implode('/', $trail_raw); + $values['menu'] = check_plain($menu); + $values['menu-raw'] = $menu; + $values['menu-link-title'] = check_plain($menu_link['title']); + $values['menu-link-title-raw'] = $menu_link['link_title']; + $values['menu-link-mlid'] = $menu_link['mlid']; + $values['menu-link-plid'] = $menu_link['plid']; + $values['title-or-menupath-raw'] = $values['menupath-raw']; + $values['title-or-menupath'] = $values['menupath']; + } else { - $values['menu'] = ''; - $values['menu-raw'] = ''; - $values['menupath'] = ''; - $values['menupath-raw'] = ''; - $values['menu-link-title'] = ''; - $values['menu-link-title-raw'] = ''; - $values['menu-link-mlid'] = ''; - $values['menu-link-plid'] = ''; + $values['menu'] = ''; + $values['menu-raw'] = ''; + $values['menupath'] = ''; + $values['menupath-raw'] = ''; + $values['menu-link-title'] = ''; + $values['menu-link-title-raw'] = ''; + $values['menu-link-mlid'] = ''; + $values['menu-link-plid'] = ''; + $values['title-or-menupath-raw'] = $values['title']; + $values['title-or-menupath'] = $values['title-raw']; } // And now taxonomy, which is a bit more work. This code is adapted from @@ -210,14 +215,16 @@ } if (module_exists('menu')) { - $tokens['node']['menu'] = t("The name of the menu the node belongs to."); - $tokens['node']['menu-raw'] = t("The name of the menu the node belongs to."); - $tokens['node']['menupath'] = t("The menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /."); - $tokens['node']['menupath-raw'] = t("The unfiltered menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /."); - $tokens['node']['menu-link-title'] = t("The text used in the menu as link text for this item."); - $tokens['node']['menu-link-title-raw'] = t("The unfiltered text used in the menu as link text for this item."); - $tokens['node']['menu-link-mlid'] = t("The unique ID of the node's menu link."); - $tokens['node']['menu-link-plid'] = t("The unique ID of the node's menu link parent."); + $tokens['node']['menu'] = t("The name of the menu the node belongs to."); + $tokens['node']['menu-raw'] = t("The name of the menu the node belongs to."); + $tokens['node']['menupath'] = t("The menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /."); + $tokens['node']['menupath-raw'] = t("The unfiltered menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /."); + $tokens['node']['menu-link-title'] = t("The text used in the menu as link text for this item."); + $tokens['node']['menu-link-title-raw'] = t("The unfiltered text used in the menu as link text for this item."); + $tokens['node']['menu-link-mlid'] = t("The unique ID of the node's menu link."); + $tokens['node']['menu-link-plid'] = t("The unique ID of the node's menu link parent."); + $tokens['node']['title-or-menupath'] = t("Equivalent to [menupath] if a menu item is defined, and [title] otherwise."); + $tokens['node']['title-or-menupath-raw'] = t("Equivalent to [menupath-raw] if a menu item is define, and [title-raw] otherwise. WARNING - raw user input."); } return $tokens;