Commit c93f8e237630df1d292f2188351ab5a2aeca46b5
1 parent
121738da
added displayDocumentPath method
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1936 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
18 additions
and
1 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc
| @@ -11,7 +11,24 @@ | @@ -11,7 +11,24 @@ | ||
| 11 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 11 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 12 | * @package presentation.lookAndFeel.knowledgeTree.documentmanagement | 12 | * @package presentation.lookAndFeel.knowledgeTree.documentmanagement |
| 13 | */ | 13 | */ |
| 14 | - | 14 | + |
| 15 | +/** | ||
| 16 | + * | ||
| 17 | + */ | ||
| 18 | +function displayDocumentPath($iDocumentID) { | ||
| 19 | + global $default; | ||
| 20 | + $oDocument = Document::get($iDocumentID); | ||
| 21 | + if ($oDocument) { | ||
| 22 | + $iFolderID = $oDocument->getFolderID(); | ||
| 23 | + $sDocumentName = $oDocument->getName(); | ||
| 24 | + $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | ||
| 25 | + $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); | ||
| 26 | + $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($iFolderID), Folder::getFolderPathNamesAsArray($iFolderID), "$default->rootUrl/control.php?action=browse") . " > " . $sDocumentName; | ||
| 27 | + return "<table border=\"0\" width=\"600\"><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n"; | ||
| 28 | + } else { | ||
| 29 | + return ""; | ||
| 30 | + } | ||
| 31 | +} | ||
| 15 | 32 | ||
| 16 | /* only used when users choose a template document when setting up document linking | 33 | /* only used when users choose a template document when setting up document linking |
| 17 | * on the folder collaboration page. Formats the link so that the child window | 34 | * on the folder collaboration page. Formats the link so that the child window |