Commit 7de8db7ec0b560de2d03a1e53e4e6524f6943e81

Authored by Neil Blakey-Milner
1 parent 39945a13

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
presentation/lookAndFeel/knowledgeTree/documentmanagement/view.php renamed to view.php 100644 → 100755
1 1 <?php
2 2  
3 3 // boilerplate.
4   -require_once("../../../../config/dmsDefaults.php");
  4 +require_once("config/dmsDefaults.php");
5 5 require_once(KT_LIB_DIR . "/templating/templating.inc.php");
6 6 require_once(KT_LIB_DIR . "/templating/kt3template.inc.php");
7 7 require_once(KT_LIB_DIR . "/dispatcher.inc.php");
... ... @@ -51,9 +51,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
51 51  
52 52 $document_data = array();
53 53 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
54   - $oKTConfig = KTConfig::getSingleton();
55 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 56 return $this->do_error();
58 57 }
59 58 $document_data["document_id"] = $document_id;
... ... @@ -61,7 +60,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
61 60 // try get the document.
62 61 $oDocument =& Document::get($document_id);
63 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 64 return $this->do_error();
66 65 }
67 66 if (!Permission::userHasDocumentReadPermission($oDocument)) {
... ... @@ -139,7 +138,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
139 138 $document_data = array();
140 139 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
141 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 142 return $this->do_error();
144 143 }
145 144 $document_data["document_id"] = $document_id;
... ... @@ -147,7 +146,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
147 146 // try get the document.
148 147 $oDocument =& Document::get($document_id);
149 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 150 return $this->do_error();
152 151 }
153 152 // fixme check perms
... ... @@ -195,7 +194,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
195 194 $document_data = array();
196 195 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
197 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 198 return $this->do_error();
200 199 }
201 200 $document_data["document_id"] = $document_id;
... ... @@ -203,7 +202,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
203 202 // try get the document.
204 203 $oDocument =& Document::get($document_id);
205 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 206 return $this->do_error();
208 207 }
209 208 // fixme check perms
... ... @@ -243,7 +242,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
243 242 $document_data = array();
244 243 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
245 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 246 return $this->do_error();
248 247 }
249 248 $document_data["document_id"] = $document_id;
... ... @@ -251,7 +250,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
251 250 // try get the document.
252 251 $oDocument =& Document::get($document_id);
253 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 254 return $this->do_error();
256 255 }
257 256 if (!Permission::userHasDocumentReadPermission($oDocument)) {
... ...