From 9df31da82987a2948a327e558c20bd8a7d65cf51 Mon Sep 17 00:00:00 2001 From: John Flatness Date: Thu, 11 Aug 2011 11:22:59 -0400 Subject: [PATCH] Makes link_to family discard current route params. Fix #96. (cherry picked from commit ae3d52f5a54f240fd8364009cca6858655892f78) --- application/helpers/LinkFunctions.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/application/helpers/LinkFunctions.php b/application/helpers/LinkFunctions.php index 5a81ee33cf..ab0281ac60 100644 --- a/application/helpers/LinkFunctions.php +++ b/application/helpers/LinkFunctions.php @@ -37,7 +37,7 @@ function link_to($record, $action=null, $text='View', $props = array(), $queryPa $route = 'default'; $urlOptions['controller'] = (string) $record; if($action) $urlOptions['action'] = (string) $action; - $url = uri($urlOptions, $route, $queryParams); + $url = uri($urlOptions, $route, $queryParams, true); } @@ -78,9 +78,7 @@ function link_to_advanced_search($text = 'Advanced Search', $props = array(), $u **/ function link_to_browse_items($text, $browseParams = array(), $linkProperties = array()) { - // Set the link href to the items/browse page. - $linkProperties['href'] = uri(array('controller'=>'items', 'action'=>'browse'), 'default', $browseParams); - return "$text"; + return link_to('items', 'browse', $text, $linkProperties, $browseParams); } /**