Commit 05b1bd18f08599efe17354bbf38966e32dd66cd4
1 parent
42a3163b
Move view.php from
presentation/lookAndFeel/knowledgeTree/documentmanagement/ to / git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4492 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
9 additions
and
10 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/view.php renamed to view.php
100644 → 100755
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | // boilerplate. | 3 | // boilerplate. |
| 4 | -require_once("../../../../config/dmsDefaults.php"); | 4 | +require_once("config/dmsDefaults.php"); |
| 5 | require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | 5 | require_once(KT_LIB_DIR . "/templating/templating.inc.php"); |
| 6 | require_once(KT_LIB_DIR . "/templating/kt3template.inc.php"); | 6 | require_once(KT_LIB_DIR . "/templating/kt3template.inc.php"); |
| 7 | require_once(KT_LIB_DIR . "/dispatcher.inc.php"); | 7 | require_once(KT_LIB_DIR . "/dispatcher.inc.php"); |
| @@ -51,9 +51,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -51,9 +51,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 51 | 51 | ||
| 52 | $document_data = array(); | 52 | $document_data = array(); |
| 53 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 53 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 54 | - $oKTConfig = KTConfig::getSingleton(); | ||
| 55 | if ($document_id === null) { | 54 | if ($document_id === null) { |
| 56 | - $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.'); | 55 | + $this->oPage->addError('No document was requested. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 57 | return $this->do_error(); | 56 | return $this->do_error(); |
| 58 | } | 57 | } |
| 59 | $document_data["document_id"] = $document_id; | 58 | $document_data["document_id"] = $document_id; |
| @@ -61,7 +60,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -61,7 +60,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 61 | // try get the document. | 60 | // try get the document. |
| 62 | $oDocument =& Document::get($document_id); | 61 | $oDocument =& Document::get($document_id); |
| 63 | if (PEAR::isError($oDocument)) { | 62 | if (PEAR::isError($oDocument)) { |
| 64 | - $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.'); | 63 | + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 65 | return $this->do_error(); | 64 | return $this->do_error(); |
| 66 | } | 65 | } |
| 67 | if (!Permission::userHasDocumentReadPermission($oDocument)) { | 66 | if (!Permission::userHasDocumentReadPermission($oDocument)) { |
| @@ -139,7 +138,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -139,7 +138,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 139 | $document_data = array(); | 138 | $document_data = array(); |
| 140 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 139 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 141 | if ($document_id === null) { | 140 | if ($document_id === null) { |
| 142 | - $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.'); | 141 | + $this->oPage->addError('No document was requested. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 143 | return $this->do_error(); | 142 | return $this->do_error(); |
| 144 | } | 143 | } |
| 145 | $document_data["document_id"] = $document_id; | 144 | $document_data["document_id"] = $document_id; |
| @@ -147,7 +146,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -147,7 +146,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 147 | // try get the document. | 146 | // try get the document. |
| 148 | $oDocument =& Document::get($document_id); | 147 | $oDocument =& Document::get($document_id); |
| 149 | if (PEAR::isError($oDocument)) { | 148 | if (PEAR::isError($oDocument)) { |
| 150 | - $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.'); | 149 | + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 151 | return $this->do_error(); | 150 | return $this->do_error(); |
| 152 | } | 151 | } |
| 153 | // fixme check perms | 152 | // fixme check perms |
| @@ -195,7 +194,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -195,7 +194,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 195 | $document_data = array(); | 194 | $document_data = array(); |
| 196 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 195 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 197 | if ($document_id === null) { | 196 | if ($document_id === null) { |
| 198 | - $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.'); | 197 | + $this->oPage->addError('No document was requested. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 199 | return $this->do_error(); | 198 | return $this->do_error(); |
| 200 | } | 199 | } |
| 201 | $document_data["document_id"] = $document_id; | 200 | $document_data["document_id"] = $document_id; |
| @@ -203,7 +202,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -203,7 +202,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 203 | // try get the document. | 202 | // try get the document. |
| 204 | $oDocument =& Document::get($document_id); | 203 | $oDocument =& Document::get($document_id); |
| 205 | if (PEAR::isError($oDocument)) { | 204 | if (PEAR::isError($oDocument)) { |
| 206 | - $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.'); | 205 | + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 207 | return $this->do_error(); | 206 | return $this->do_error(); |
| 208 | } | 207 | } |
| 209 | // fixme check perms | 208 | // fixme check perms |
| @@ -243,7 +242,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -243,7 +242,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 243 | $document_data = array(); | 242 | $document_data = array(); |
| 244 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); | 243 | $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); |
| 245 | if ($document_id === null) { | 244 | if ($document_id === null) { |
| 246 | - $this->oPage->addError('No document was requested. Please <a href="' . $oKTConfig->get('KnowledgeTree/rootUrl') . '/presentation/lookAndFeel/knowledgeTree/browse.php">browse</a> for one.'); | 245 | + $this->oPage->addError('No document was requested. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 247 | return $this->do_error(); | 246 | return $this->do_error(); |
| 248 | } | 247 | } |
| 249 | $document_data["document_id"] = $document_id; | 248 | $document_data["document_id"] = $document_id; |
| @@ -251,7 +250,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | @@ -251,7 +250,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { | ||
| 251 | // try get the document. | 250 | // try get the document. |
| 252 | $oDocument =& Document::get($document_id); | 251 | $oDocument =& Document::get($document_id); |
| 253 | if (PEAR::isError($oDocument)) { | 252 | if (PEAR::isError($oDocument)) { |
| 254 | - $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.'); | 253 | + $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . $GLOBALS['KTRootUrl'] . '/browse.php">browse</a> for one.'); |
| 255 | return $this->do_error(); | 254 | return $this->do_error(); |
| 256 | } | 255 | } |
| 257 | if (!Permission::userHasDocumentReadPermission($oDocument)) { | 256 | if (!Permission::userHasDocumentReadPermission($oDocument)) { |