From 094bb63a3096fe7ad06ad12e1626abef8d68cf78 Mon Sep 17 00:00:00 2001 From: nbm Date: Thu, 2 Feb 2006 09:07:19 +0000 Subject: [PATCH] Use KTUtil::addQueryStringSelf to generate URLs. --- plugins/ktstandard/KTDocumentLinks.php | 20 +++++--------------- search/booleanSearch.php | 2 +- search/simpleSearch.php | 2 +- view.php | 4 ++-- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/plugins/ktstandard/KTDocumentLinks.php b/plugins/ktstandard/KTDocumentLinks.php index d612df9..0f05836 100644 --- a/plugins/ktstandard/KTDocumentLinks.php +++ b/plugins/ktstandard/KTDocumentLinks.php @@ -13,27 +13,17 @@ require_once(KT_LIB_DIR . "/browse/browseutil.inc.php"); class KTDocumentLinkTitle extends TitleColumn { function buildDocumentLink($aDataRow) { - $baseurl = KTUtil::arrayGet($this->aOptions, "folderurl", ""); $parentDocumentId = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); - return sprintf('%s?action=type_select&fDocumentId=%d&fTargetDocumentId=%d', $baseurl, $parentDocumentId, $aDataRow["document"]->getId()); + return KTUtil::addQueryStringSelf(sprintf('action=type_select&fDocumentId=%d&fTargetDocumentId=%d', $baseurl, $parentDocumentId, $aDataRow["document"]->getId())); } function buildFolderLink($aDataRow) { - $baseurl = KTUtil::arrayGet($this->aOptions, "folderurl", ""); - $kt_path_info = KTUtil::arrayGet($_REQUEST, 'kt_path_info'); $parentDocumentId = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); - if (empty($kt_path_info)) { - return sprintf('%s?action=new&fDocumentId=%d&fFolderId=%d', $baseurl, $parentDocumentId, $aDataRow["folder"]->getId()); - } else { - return sprintf('%s?kt_path_info=%s&action=new&ftDocumentId=%d&fFolderId=%d', $baseurl, $kt_path_info, $parentDocumentId, $aDataRow["folder"]->getId()); - } + return KTUtil::addQueryStringSelf(sprintf('action=new&fDocumentId=%d&fFolderId=%d', $baseurl, $parentDocumentId, $aDataRow["folder"]->getId())); } } - - - class KTDocumentLinks extends KTPlugin { var $sNamespace = "ktstandard.documentlinks.plugin"; @@ -112,7 +102,7 @@ class KTDocumentLinkAction extends KTDocumentAction { $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0); $batchSize = 20; - $resultURL = sprintf("?action=new&fDocumentId=%d", $oParentDocument->getId()); + $resultURL = KTUtil::addQueryStringSelf(sprintf("action=new&fDocumentId=%d", $oParentDocument->getId())); $collection->setBatching($resultURL, $batchPage, $batchSize); // ordering. (direction and column) @@ -135,7 +125,7 @@ class KTDocumentLinkAction extends KTDocumentAction { foreach (range(0, count($folder_path_ids) - 1) as $index) { $id = $folder_path_ids[$index]; - $url = sprintf("?action=new&fDocumentId=%d&fFolderId=%d", $oParentDocument->getId(), $id); + $url = KTUtil::addQueryStringSelf(sprintf("action=new&fDocumentId=%d&fFolderId=%d", $oParentDocument->getId(), $id)); $aBreadcrumbs[] = array("url" => $url, "name" => $folder_path_names[$index]); } @@ -301,4 +291,4 @@ $oRegistry->registerPlugin('KTDocumentLinks', 'ktstandard.documentlinks.plugin', -?> \ No newline at end of file +?> diff --git a/search/booleanSearch.php b/search/booleanSearch.php index 3d6686b..8eccdc7 100755 --- a/search/booleanSearch.php +++ b/search/booleanSearch.php @@ -100,7 +100,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { $sSearch = md5(serialize($aCriteriaSet)); $_SESSION['boolean_search'][$sSearch] = $aCriteriaSet; - $resultURL = "?action=performSearch&boolean_search_id=" . urlencode($sSearch); + $resultURL = KTUtil::addQueryStringSelf("action=performSearch&boolean_search_id=" . urlencode($sSearch)); $collection->setBatching($resultURL, $batchPage, $batchSize); diff --git a/search/simpleSearch.php b/search/simpleSearch.php index 5baf73f..1237201 100644 --- a/search/simpleSearch.php +++ b/search/simpleSearch.php @@ -72,7 +72,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0); $batchSize = 20; - $resultURL = "?fSearchableText=" . $searchable_text; + $resultURL = KTUtil::addQueryStringSelf("fSearchableText=" . $searchable_text); $collection->setBatching($resultURL, $batchPage, $batchSize); diff --git a/view.php b/view.php index cd79a73..4c30902 100755 --- a/view.php +++ b/view.php @@ -287,7 +287,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion'); if ($comparison_version=== null) { - $this->oPage->addError('No comparison version was requested. Please select a version.'); + $this->oPage->addError('No comparison version was requested. Please select a version.'); return $this->do_error(); } @@ -398,7 +398,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion'); if ($comparison_version=== null) { - $this->oPage->addError('No comparison version was requested. Please select a version.'); + $this->oPage->addError('No comparison version was requested. Please select a version.'); return $this->do_error(); } -- libgit2 0.21.4