Commit adb2d76e9894babef313c6a86b0ff06caed39ba2

Authored by nbm
1 parent 56d75bc5

If sending an absolute path, make sure to prefix it with the rootUrl of

the installation.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4301 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/view.php
... ... @@ -47,8 +47,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
47 47  
48 48 $document_data = array();
49 49 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
  50 + $oKTConfig = KTConfig::getSingleton();
50 51 if ($document_id === null) {
51   - $this->oPage->addError('No document was requested. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  52 + $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
52 53 return $this->do_error();
53 54 }
54 55 $document_data["document_id"] = $document_id;
... ... @@ -56,7 +57,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
56 57 // try get the document.
57 58 $oDocument =& Document::get($document_id);
58 59 if (PEAR::isError($oDocument)) {
59   - $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  60 + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
60 61 return $this->do_error();
61 62 }
62 63 if (!Permission::userHasDocumentReadPermission($oDocument)) {
... ... @@ -135,7 +136,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
135 136 $document_data = array();
136 137 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
137 138 if ($document_id === null) {
138   - $this->oPage->addError('No document was requested. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  139 + $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
139 140 return $this->do_error();
140 141 }
141 142 $document_data["document_id"] = $document_id;
... ... @@ -143,7 +144,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
143 144 // try get the document.
144 145 $oDocument =& Document::get($document_id);
145 146 if (PEAR::isError($oDocument)) {
146   - $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  147 + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
147 148 return $this->do_error();
148 149 }
149 150 // fixme check perms
... ... @@ -190,7 +191,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
190 191 $document_data = array();
191 192 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
192 193 if ($document_id === null) {
193   - $this->oPage->addError('No document was requested. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  194 + $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
194 195 return $this->do_error();
195 196 }
196 197 $document_data["document_id"] = $document_id;
... ... @@ -198,7 +199,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
198 199 // try get the document.
199 200 $oDocument =& Document::get($document_id);
200 201 if (PEAR::isError($oDocument)) {
201   - $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  202 + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
202 203 return $this->do_error();
203 204 }
204 205 // fixme check perms
... ... @@ -232,7 +233,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
232 233 $document_data = array();
233 234 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
234 235 if ($document_id === null) {
235   - $this->oPage->addError('No document was requested. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  236 + $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
236 237 return $this->do_error();
237 238 }
238 239 $document_data["document_id"] = $document_id;
... ... @@ -240,7 +241,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
240 241 // try get the document.
241 242 $oDocument =& Document::get($document_id);
242 243 if (PEAR::isError($oDocument)) {
243   - $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
  244 + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.');
244 245 return $this->do_error();
245 246 }
246 247 if (!Permission::userHasDocumentReadPermission($oDocument)) {
... ...