--- C:\xampp\htdocs\drupal-57\sites\all\modules\views\views.module.org +++ C:\xampp\htdocs\drupal-57\sites\all\modules\views\views.module @@ -709,21 +709,22 @@ */ function views_get_url($view, $args) { $url = $view->url; - - if (!empty($url)) { - $where = 1; + $tokens = array_keys(module_invoke_all('views_url_tokens')); + if (!empty($url)) { foreach ($args as $arg) { - // This odd construct prevents us from strposing once there is no - // longer an $arg to replace. - if ($where && $where = strpos($url, '$arg')) { - $url = substr_replace($url, $arg, $where, 4); - } - else { - $url .= "/$arg"; - } - } - } - + $where = 0; + foreach ($tokens as $token) { + if ($where = strpos($url, $token)){ + break; + } + } + if ($where){ + $url = substr_replace($url, $arg, $where, strlen($token)); + } else { + $url .= "/$arg"; + } + } + } return $url; } @@ -1480,17 +1481,23 @@ // Add a breadcrumb trail for each level of argument we're at. $url = $view->url; $args = array(); + $tokens = array_keys(module_invoke_all('views_url_tokens')); $where = 1; foreach ($view->args as $level => $arg) { + $internal = FALSE; + foreach ($tokens as $token) { + if ($where = strpos($url, $token)) { + $url = substr_replace($url, $arg, $where, strlen($token)); + $internal = TRUE; + } + } if ($view->argument[$level]['argdefault'] != 1) { $breadcrumb[] = l(filter_xss_admin(views_get_title($view, 'page', $args)), $url, NULL, NULL, NULL, NULL, TRUE); + // For next round. } $args[] = $arg; - if ($where && $where = strpos($url, '$arg')) { - $url = substr_replace($url, $arg, $where, 4); - } - else { + if (!$internal) { $url .= "/$arg"; } }