Commit 65b71d2f5e10bbb728107d1af4dd5c032b64464f

Authored by Jonathan Byrne
1 parent 7f3c1e46

KTS-3100

"Various <a href> links don't work when kt installed in subfolder off root url"
Fixed. Fixed all broken href links I could find.

Committed By: Jonathan Byrne
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8276 c91229c3-7414-0410-bfa2-8a42b809f60b
config/dmsDefaults.php
... ... @@ -393,7 +393,11 @@ function catchFatalErrors($p_OnOff=&#39;On&#39;){
393 393 $phperror='><div id="phperror" style="display:none">';
394 394 ini_set('error_prepend_string',$phperror);
395 395  
396   - $phperror='</div>><form name="catcher" action="/customerrorpage.php" method="post" ><input type="hidden" name="fatal" value=""></form>
  396 + $sUrl = KTInit::guessRootUrl();
  397 + global $default;
  398 + $sRootUrl = ($default->sslEnabled ? 'https' : 'http') .'://'.$_SERVER['HTTP_HOST'].$sUrl;
  399 +
  400 + $phperror='</div>><form name="catcher" action="'.$sRootUrl.'/customerrorpage.php" method="post" ><input type="hidden" name="fatal" value=""></form>
397 401 <script> document.catcher.fatal.value = document.getElementById("phperror").innerHTML; document.catcher.submit();</script>';
398 402 ini_set('error_append_string',$phperror);
399 403 }
... ...
customerrorpage.php
... ... @@ -13,19 +13,23 @@ if (array_key_exists(&#39;Error_MessageOne&#39;, $_POST) &amp;&amp; array_key_exists(&#39;Error_Mess
13 13 }
14 14  
15 15 session_start();
  16 +require_once("config/dmsDefaults.php");
  17 +
16 18 if (array_key_exists('sErrorMessage', $_SESSION))
17 19 {
18 20 $phperror = $_SESSION['sErrorMessage'];
19 21 }
20 22  
  23 +global $default;
21 24  
  25 +$sUrl = $default->rootUrl;
22 26  
23 27 ?>
24 28  
25 29 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
26 30 <head>
27 31 <title>Knowledgetree - Desklet</title>
28   - <link rel="stylesheet" type="text/css" href="/resources/css/errors.css" />
  32 + <link rel="stylesheet" type="text/css" href="<?php echo $sUrl ?>/resources/css/errors.css" />
29 33  
30 34 <script type="text/javascript">
31 35  
... ... @@ -49,7 +53,7 @@ border.style.height = &#39;250px&#39;;
49 53  
50 54 <h1>Error!! - You have encountered a problem starting your document management system.</h1>
51 55 <p><h2>Please contact your systems administrator</h2></p>
52   - <p>For more details, click here <img src="/resources/graphics/info.gif" style="cursor: pointer;" onclick="Click()" /><div id ="exp" style="display: none; "> <?php if(isset($sErrorMessage)){ echo $sErrorMessage; }else if(isset($posted)){ echo $posted; } else if($phperror){ echo $phperror; } ?></div></p>
  56 + <p>For more details, click here <img src="<?php echo $sUrl ?>/resources/graphics/info.gif" style="cursor: pointer;" onclick="Click()" /><div id ="exp" style="display: none; "> <?php if(isset($sErrorMessage)){ echo $sErrorMessage; }else if(isset($posted)){ echo $posted; } else if($phperror){ echo $phperror; } ?></div></p>
53 57  
54 58 </div>
55 59 </div>
... ...
plugins/search2/ExternalDashlet.php
... ... @@ -129,9 +129,12 @@ class ExternalResourceStatusDashlet extends KTBaseDashlet
129 129 $oTemplating =& KTTemplating::getSingleton();
130 130 $oTemplate = $oTemplating->loadTemplate('ktcore/search2/external_resources');
131 131  
  132 + $sUrl = KTUtil::kt_url();
  133 +
132 134 $aTemplateData = array(
133 135 'context' => $this,
134   - 'resources' => $this->resources
  136 + 'resources' => $this->resources,
  137 + 'url' => $sUrl
135 138 );
136 139  
137 140 return $oTemplate->render($aTemplateData);
... ...
search2.php
... ... @@ -70,14 +70,14 @@ class SearchDispatcher extends KTStandardDispatcher {
70 70 function do_refreshLuceneStats()
71 71 {
72 72 session_unregister('LuceneStats');
73   - redirect('/dashboard.php');
  73 + redirect(KTUtil::kt_url().'/dashboard.php');
74 74 }
75 75  
76 76 function do_refreshDashboardStatus()
77 77 {
78 78 session_unregister('ExternalResourceStatus');
79 79 session_unregister('IndexingStatus');
80   - redirect('/dashboard.php');
  80 + redirect(KTUtil::kt_url().'/dashboard.php');
81 81 }
82 82  
83 83 /**
... ...
templates/ktcore/search2/external_resources.smarty
... ... @@ -7,5 +7,5 @@
7 7 <tr><td valign=top><I>{$resource.name}</td><td>{$resource.status}</td>
8 8 <tr ><td colspan=2><hr></tr>
9 9 {/foreach}
10   -<tr><td colspan=2 align=right><a href="/search2.php?action=refreshDashboardStatus" align=right>{i18n}Refresh{/i18n}</a></tr>
  10 +<tr><td colspan=2 align=right><a href="{$url}/search2.php?action=refreshDashboardStatus" align=right>{i18n}Refresh{/i18n}</a></tr>
11 11 </table>
... ...