Commit adb2d76e9894babef313c6a86b0ff06caed39ba2
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
Showing
1 changed file
with
9 additions
and
8 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/view.php
| @@ -47,8 +47,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -47,8 +47,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 47 | 47 | ||
| 48 | $document_data = array(); | 48 | $document_data = array(); |
| 49 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 49 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 50 | + $oKTConfig = KTConfig::getSingleton(); | ||
| 50 | if ($document_id === null) { | 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 | return $this->do_error(); | 53 | return $this->do_error(); |
| 53 | } | 54 | } |
| 54 | $document_data["document_id"] = $document_id; | 55 | $document_data["document_id"] = $document_id; |
| @@ -56,7 +57,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -56,7 +57,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 56 | // try get the document. | 57 | // try get the document. |
| 57 | $oDocument =& Document::get($document_id); | 58 | $oDocument =& Document::get($document_id); |
| 58 | if (PEAR::isError($oDocument)) { | 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 | return $this->do_error(); | 61 | return $this->do_error(); |
| 61 | } | 62 | } |
| 62 | if (!Permission::userHasDocumentReadPermission($oDocument)) { | 63 | if (!Permission::userHasDocumentReadPermission($oDocument)) { |
| @@ -135,7 +136,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -135,7 +136,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 135 | $document_data = array(); | 136 | $document_data = array(); |
| 136 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 137 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 137 | if ($document_id === null) { | 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 | return $this->do_error(); | 140 | return $this->do_error(); |
| 140 | } | 141 | } |
| 141 | $document_data["document_id"] = $document_id; | 142 | $document_data["document_id"] = $document_id; |
| @@ -143,7 +144,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -143,7 +144,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 143 | // try get the document. | 144 | // try get the document. |
| 144 | $oDocument =& Document::get($document_id); | 145 | $oDocument =& Document::get($document_id); |
| 145 | if (PEAR::isError($oDocument)) { | 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 | return $this->do_error(); | 148 | return $this->do_error(); |
| 148 | } | 149 | } |
| 149 | // fixme check perms | 150 | // fixme check perms |
| @@ -190,7 +191,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -190,7 +191,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 190 | $document_data = array(); | 191 | $document_data = array(); |
| 191 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 192 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 192 | if ($document_id === null) { | 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 | return $this->do_error(); | 195 | return $this->do_error(); |
| 195 | } | 196 | } |
| 196 | $document_data["document_id"] = $document_id; | 197 | $document_data["document_id"] = $document_id; |
| @@ -198,7 +199,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -198,7 +199,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 198 | // try get the document. | 199 | // try get the document. |
| 199 | $oDocument =& Document::get($document_id); | 200 | $oDocument =& Document::get($document_id); |
| 200 | if (PEAR::isError($oDocument)) { | 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 | return $this->do_error(); | 203 | return $this->do_error(); |
| 203 | } | 204 | } |
| 204 | // fixme check perms | 205 | // fixme check perms |
| @@ -232,7 +233,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -232,7 +233,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 232 | $document_data = array(); | 233 | $document_data = array(); |
| 233 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 234 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 234 | if ($document_id === null) { | 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 | return $this->do_error(); | 237 | return $this->do_error(); |
| 237 | } | 238 | } |
| 238 | $document_data["document_id"] = $document_id; | 239 | $document_data["document_id"] = $document_id; |
| @@ -240,7 +241,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -240,7 +241,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 240 | // try get the document. | 241 | // try get the document. |
| 241 | $oDocument =& Document::get($document_id); | 242 | $oDocument =& Document::get($document_id); |
| 242 | if (PEAR::isError($oDocument)) { | 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 | return $this->do_error(); | 245 | return $this->do_error(); |
| 245 | } | 246 | } |
| 246 | if (!Permission::userHasDocumentReadPermission($oDocument)) { | 247 | if (!Permission::userHasDocumentReadPermission($oDocument)) { |