Commit 0c9a6230ef11992afa1ee75a529ac4de961f3af1

Authored by kevin_fourie
1 parent a11b81ae

Merged in from DEV trunk...

KTS-3305
"Disk/Folder Utilization dashlets have wrong URLs"
Fixed. The dispatcherUrl was being appended to itself.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.2c-Release-Branch@8397 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/housekeeper/DiskUsageDashlet.inc.php
... ... @@ -168,13 +168,12 @@ class DiskUsageDashlet extends KTBaseDashlet
168 168 $rootUrl = $config->get('KnowledgeTree/rootUrl');
169 169  
170 170 $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php');
171   - if (!empty($rootUrl)) $dispatcherURL .= $rootUrl . $dispatcherURL;
172   - if ( substr( $dispatcherURL, 0,1 ) == '/' || substr( $dispatcherURL, 0,1 ) == '\\')
  171 + if (!empty($rootUrl)) $dispatcherURL = $rootUrl . $dispatcherURL;
  172 + $dispatcherURL = str_replace( '\\', '/', $dispatcherURL);
  173 + if ( substr( $dispatcherURL, 0,1 ) != '/')
173 174 {
174   - $dispatcherURL = substr($dispatcherURL,1);
  175 + $dispatcherURL = '/'.$dispatcherURL;
175 176 }
176   - $dispatcherURL = str_replace( '\\', '/', $dispatcherURL);
177   -
178 177  
179 178 $aTemplateData = array(
180 179 'context' => $this,
... ...
plugins/housekeeper/FolderUsageDashlet.inc.php
... ... @@ -155,13 +155,13 @@ class FolderUsageDashlet extends KTBaseDashlet
155 155 $rootUrl = $config->get('KnowledgeTree/rootUrl');
156 156  
157 157 $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php');
158   - if (!empty($rootUrl)) $dispatcherURL .= $rootUrl . $dispatcherURL;
159   - if ( substr( $dispatcherURL, 0,1 ) == '/' || substr( $dispatcherURL, 0,1 ) == '\\')
  158 + if (!empty($rootUrl)) $dispatcherURL = $rootUrl . $dispatcherURL;
  159 + $dispatcherURL = str_replace( '\\', '/', $dispatcherURL);
  160 + if ( substr( $dispatcherURL, 0,1 ) != '/')
160 161 {
161   - $dispatcherURL = substr($dispatcherURL,1);
  162 + $dispatcherURL = '/'.$dispatcherURL;
162 163 }
163   - $dispatcherURL = str_replace( '\\', '/', $dispatcherURL);
164   -
  164 +
165 165 $this->getUsage();
166 166  
167 167 $aTemplateData = array(
... ...