Commit 22e21c1134785d82cabd144fbde78fced3cfa226
1 parent
7e2d2c1a
Query string related changes - use addQS and friends.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4777 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
10 changed files
with
25 additions
and
20 deletions
lib/session/control.inc
| ... | ... | @@ -139,7 +139,7 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) { |
| 139 | 139 | } else { |
| 140 | 140 | $url = generateControllerUrl("login"); |
| 141 | 141 | } |
| 142 | - $redirect = urlencode($_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"]); | |
| 142 | + $redirect = urlencode(KTUtil::addQueryStringSelf($_SERVER["QUERY_STRING"])); | |
| 143 | 143 | if ((strlen($redirect) > 1)) { |
| 144 | 144 | $default->log->debug("checkSession:: redirect url=$redirect"); |
| 145 | 145 | // this session verification failure represents either the first visit to | ... | ... |
lib/templating/kt3template.inc.php
| ... | ... | @@ -282,6 +282,8 @@ class KTPage { |
| 282 | 282 | $sUrl = KTUtil::addQueryString($sUrl, $sQuery); |
| 283 | 283 | } |
| 284 | 284 | $aTuple["url"] = $sUrl; |
| 285 | + } else if ($aActionTuple["query"]) { | |
| 286 | + $aTuple['url'] = KTUtil::addQueryStringSelf($aActionTuple["query"]); | |
| 285 | 287 | } else { |
| 286 | 288 | $aTuple["url"] = false; |
| 287 | 289 | } | ... | ... |
plugins/ktcore/admin/documentFields.php
| ... | ... | @@ -721,7 +721,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { |
| 721 | 721 | // since the root is virtual, we need to fake it here. |
| 722 | 722 | // the inner section is generised. |
| 723 | 723 | $treeStr .= '<ul class="kt_treenodes"><li class="treenode active"><a class="pathnode" onclick="toggleElementClass(\'active\', this.parentNode);">Root</a>'; |
| 724 | - $treeStr .= ' (<a href="?action=editTree&field_id='.$treeToRender->field_id.'¤t_node=0">edit</a>)'; | |
| 724 | + $treeStr .= ' (<a href="' . KTUtil::addQueryStringSelf('action=editTree&field_id='.$treeToRender->field_id.'¤t_node=0') . '">edit</a>)'; | |
| 725 | 725 | $treeStr .= '<ul>'; |
| 726 | 726 | //$default->log->debug("EVILRENDER: " . print_r($treeToRender, true)); |
| 727 | 727 | foreach ($treeToRender->getRoot() as $node_id => $subtree_nodes) |
| ... | ... | @@ -755,12 +755,12 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { |
| 755 | 755 | function _evilActionHelper($iFieldId, $bIsKeyword, $current_node) { |
| 756 | 756 | $actionStr = " ("; |
| 757 | 757 | if ($bIsKeyword === true) { |
| 758 | - $actionStr .= '<a href="?action=editTree&field_id='.$iFieldId.'&keyword_id='.$current_node.'&subaction=unlinkKeyword">unlink</a>'; | |
| 758 | + $actionStr .= '<a href="' . KTUtil::addQueryStringSelf('action=editTree&field_id='.$iFieldId.'&keyword_id='.$current_node.'&subaction=unlinkKeyword') . '">unlink</a>'; | |
| 759 | 759 | } |
| 760 | 760 | else |
| 761 | 761 | { |
| 762 | - $actionStr .= '<a href="?action=editTree&field_id='.$iFieldId.'¤t_node='.$current_node.'">attach keywords</a> '; | |
| 763 | - $actionStr .= '| <a href="?action=editTree&field_id='.$iFieldId.'¤t_node='.$current_node.'&subaction=deleteCategory">delete</a>'; | |
| 762 | + $actionStr .= '<a href="' . KTUtil::addQueryStringSlef('action=editTree&field_id=' . $iFieldId . '¤t_node=' . $current_node) .'">attach keywords</a> '; | |
| 763 | + $actionStr .= '| <a href="' . KTUtil::addQueryStringSelf('action=editTree&field_id='.$iFieldId.'¤t_node='.$current_node.'&subaction=deleteCategory') . '">delete</a>'; | |
| 764 | 764 | } |
| 765 | 765 | $actionStr .= ")"; |
| 766 | 766 | return $actionStr; | ... | ... |
plugins/ktcore/admin/userManagement.php
| ... | ... | @@ -101,7 +101,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { |
| 101 | 101 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); |
| 102 | 102 | |
| 103 | 103 | $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('User Management')); |
| 104 | - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'] . '?action=addUser', 'name' => _('add a new user')); | |
| 104 | + $this->aBreadcrumbs[] = array('url' => KTUtil::addQueryStringSelf('action=addUser'), 'name' => _('add a new user')); | |
| 105 | 105 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; |
| 106 | 106 | $oProvider->oPage->setBreadcrumbDetails($oSource->getName()); |
| 107 | 107 | $oProvider->oPage->setTitle(_("Modify User Details")); | ... | ... |
plugins/ktcore/admin/workflows.php
| ... | ... | @@ -36,11 +36,10 @@ class WorkflowNavigationPortlet extends KTPortlet { |
| 36 | 36 | if (is_null($this->oWorkflow)) { return _('No Workflow Selected.'); } |
| 37 | 37 | |
| 38 | 38 | $aAdminPages = array(); |
| 39 | - $aAdminPages[] = array('name' => _('Overview'), 'url' => KTUtil::addQueryStringSelf('action=editWorkflow&fWorkflowId=' . $this->oWorkflow->getId())); | |
| 40 | - $aAdminPages[] = array('name' => _('States'), 'url' => KTUtil::addQueryStringSelf('action=manageStates&fWorkflowId=' . $this->oWorkflow->getId())); | |
| 41 | - $aAdminPages[] = array('name' => _('Transitions'), 'url' => KTUtil::addQueryStringSelf('action=manageTransitions&fWorkflowId=' . $this->oWorkflow->getId())); | |
| 42 | - $aAdminPages[] = array('name' => _('Actions'), 'url' => KTUtil::addQueryStringSelf('action=manageActions&fWorkflowId=' . $this->oWorkflow->getId())); | |
| 43 | - | |
| 39 | + $aAdminPages[] = array('name' => _('Overview'), 'query' => 'action=editWorkflow&fWorkflowId=' . $this->oWorkflow->getId()); | |
| 40 | + $aAdminPages[] = array('name' => _('States'), 'query' => 'action=manageStates&fWorkflowId=' . $this->oWorkflow->getId()); | |
| 41 | + $aAdminPages[] = array('name' => _('Transitions'), 'query' => 'action=manageTransitions&fWorkflowId=' . $this->oWorkflow->getId()); | |
| 42 | + $aAdminPages[] = array('name' => _('Actions'), 'query' => 'action=manageActions&fWorkflowId=' . $this->oWorkflow->getId()); | |
| 44 | 43 | |
| 45 | 44 | $oTemplating = new KTTemplating; |
| 46 | 45 | $oTemplate = $oTemplating->loadTemplate("ktcore/workflow/admin_portlet"); |
| ... | ... | @@ -208,7 +207,8 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { |
| 208 | 207 | } |
| 209 | 208 | |
| 210 | 209 | foreach ($aInfo['transitions_to_state'][$oState->getId()] as $aTransition) { |
| 211 | - $aT[] = sprintf('<a href="%s?action=editTransition&fWorkflowId=%d&fTransitionId=%d">%s</a>', $_SERVER['PHP_SELF'], $aInfo['workflow']->getId(), $aTransition->getId() ,$aTransition->getName()); | |
| 210 | + $sUrl = KTUtil::addQueryStringSelf(sprintf('action=editTransition&fWorkflowId=%d&fTransitionId=%d', $aInfo['workflow']->getId(), $aTransition->getId())); | |
| 211 | + $aT[] = sprintf('<a href="%s">%s</a>', $sUrl, $aTransition->getName()); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | return implode(', ',$aT); |
| ... | ... | @@ -302,7 +302,8 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { |
| 302 | 302 | |
| 303 | 303 | $aT = array(); |
| 304 | 304 | foreach ($aInfo['transitions_from_state'][$oState->getId()] as $aTransition) { |
| 305 | - $aT[] = sprintf('<a href="%s?action=editTransition&fWorkflowId=%d&fTransitionId=%d">%s</a>', $_SERVER['PHP_SELF'], $aInfo['workflow']->getId(), $aTransition->getId() ,$aTransition->getName()); | |
| 305 | + $sUrl = KTUtil::addQueryStringSelf(sprintf('action=editTransition&fWorkflowId=%d&fTransitionId=%d', $aInfo['workflow']->getId(), $aTransition->getId())); | |
| 306 | + $aT[] = sprintf('<a href="%s">%s</a>', $sUrl, $aTransition->getName()); | |
| 306 | 307 | } |
| 307 | 308 | return implode(', ', $aT); |
| 308 | 309 | } | ... | ... |
plugins/ktcore/authentication/authenticationadminpage.inc.php
| ... | ... | @@ -109,7 +109,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { |
| 109 | 109 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); |
| 110 | 110 | |
| 111 | 111 | $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); |
| 112 | - $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); | |
| 112 | + $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => KTUtil::addQueryStringSelf("source_id=" . $oSource->getId())); | |
| 113 | 113 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; |
| 114 | 114 | |
| 115 | 115 | $oProvider->dispatch(); |
| ... | ... | @@ -123,7 +123,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { |
| 123 | 123 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); |
| 124 | 124 | |
| 125 | 125 | $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); |
| 126 | - $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); | |
| 126 | + $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => KTUtil::addQueryStringSelf("source_id=" . $oSource->getId())); | |
| 127 | 127 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; |
| 128 | 128 | |
| 129 | 129 | $oProvider->dispatch(); | ... | ... |
plugins/ktstandard/KTDiscussion.php
| ... | ... | @@ -133,7 +133,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { |
| 133 | 133 | // breadcrumbs... |
| 134 | 134 | $this->aBreadcrumbs[] = array( |
| 135 | 135 | 'name' => _('discussion'), |
| 136 | - 'url' => $_SERVER['PHP_SELF'] . sprintf('?fDocumentId=%d', $this->oDocument->getId()), | |
| 136 | + 'query' => sprintf('fDocumentId=%d', $this->oDocument->getId()), | |
| 137 | 137 | ); |
| 138 | 138 | $this->aBreadcrumbs[] = array( |
| 139 | 139 | 'name' => $oComment->getSubject(), | ... | ... |
plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
| ... | ... | @@ -36,7 +36,9 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | function showUserSource($oUser, $oSource) { |
| 39 | - return '<a href="?action=editUserSource&user_id=' . $oUser->getId() .'">' . _('Edit LDAP info') . '</a>'; | |
| 39 | + $sQuery = sprintf("action=editUserSource&user_id=%d", $oUser->getId()); | |
| 40 | + $sUrl = KTUtil::addQueryStringSelf($sQuery); | |
| 41 | + return '<a href="' . $sUrl . '">' . _('Edit LDAP info') . '</a>'; | |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | function do_editUserSource() { | ... | ... |
templates/ktcore/authentication/manage.smarty
| ... | ... | @@ -32,7 +32,7 @@ ensure that the Plugin is enabled.{/i18n}<p></div> |
| 32 | 32 | |
| 33 | 33 | <ul> |
| 34 | 34 | {foreach from=$sources item=oSource} |
| 35 | - <li><a href="{addQS}action=viewsource&source_id={$oSource->getId()}">{$oSource->getName()}{/addQS}</a></li> | |
| 35 | + <li><a href="{addQS}action=viewsource&source_id={$oSource->getId()}{/addQS}">{$oSource->getName()}</a></li> | |
| 36 | 36 | {/foreach} |
| 37 | 37 | </ul> |
| 38 | 38 | {else} | ... | ... |
templates/ktcore/workflow/admin_portlet.smarty