From 647ddec174206a3cc5a9a41863bafb75010d4f35 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Mon, 10 Nov 2003 09:53:57 +0000 Subject: [PATCH] #3425 changed to use common function in documentUI.inc --- presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php | 3 ++- presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc | 20 ++------------------ presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php | 5 +++-- presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc | 21 ++------------------- 4 files changed, 9 insertions(+), 40 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php index 8d30f3a..2453920 100644 --- a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php +++ b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php @@ -36,7 +36,8 @@ require_once("$default->fileSystemRoot/lib/users/User.inc"); require_once("$default->fileSystemRoot/lib/security/Permission.inc"); require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); //### -require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); //### +require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); //### +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc"); require_once("$default->fileSystemRoot/presentation/Html.inc"); if(checkSession()) { diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc index eb10305..bd46d7c 100644 --- a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc @@ -39,22 +39,6 @@ function getSubmitSuccessPage($iDocumentID){ } /** - * Renders the path for the document - * - * @param $fDocumentID -> a valid document ID - */ -function renderDocumentPath($iDocumentID) { - global $default; - - $oDocument = & Document::get($iDocumentID); - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); - $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); - $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > "; - $sDocumentPath .= "rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . ""; - return "
$sDocumentPath
\n"; -} - -/** * Display the ADD COMMENT page * * @param $fDocumentID -> a valid Document ID @@ -66,7 +50,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody, $iCommentID, $fNewCommen $sHeading = "Add a Comment"; $sToRender .= renderHeading($sHeading); - $sToRender .= renderDocumentPath($fDocumentID); + $sToRender .= displayDocumentPath($fDocumentID); $sToRender .= "\n"; $sToRender .= "
"; $sToRender .= "               "; @@ -100,7 +84,7 @@ function getCommentBody($sCommentBody, $sCommentSubject,$dDate,$iDocumentID, $sU $sHeading = "Document Comment"; $sToRender .= renderHeading($sHeading); - $sToRender .= renderDocumentPath($iDocumentID); + $sToRender .= displayDocumentPath($iDocumentID); $sToRender .= "
 Author: $sUserName"; $sToRender .= ""; $sToRender .= ""; diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php index 2d115dd..cac34dd 100644 --- a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php +++ b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php @@ -36,7 +36,8 @@ require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc"); require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); -require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); +require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc"); require_once("$default->fileSystemRoot/presentation/Html.inc"); if (checkSession()) { @@ -70,7 +71,7 @@ if (checkSession()) { $oSearchResults = & new PatternTableSqlQuery ($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars); $sToRender .= renderHeading("Document Discussion Thread"); - $sToRender .= renderDocumentPath($oThread->getDocumentID()); + $sToRender .= displayDocumentPath($oThread->getDocumentID()); $oPatternCustom->addHtml($sToRender); $oPatternCustom->addHtml(getPageButtons($oThread)); $oPatternCustom->addHtml($oSearchResults->render()); diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc index d135d3b..ce9d0c3 100644 --- a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc @@ -66,23 +66,6 @@ function getNewThreadOption($fDocumentID) { return $sToRender; } - -/** - * Renders the path for the document - * - * @param $fDocumentID -> a valid document ID - */ -function renderDocumentPath($iDocumentID) { - global $default; - - $oDocument = & Document::get($iDocumentID); - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); - $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); - $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > "; - $sDocumentPath .= "rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . ""; - return "
Subject: $sCommentSubject
$sDocumentPath
\n"; -} - /** * Views the list of comments for a document * Prints out 1 comment @@ -110,7 +93,7 @@ function getViewComment($iNum,$oThread,$oComment,$oUser) { $sHeading = "Document Discussion Comments"; $sToRender .= renderHeading($sHeading ); - $sToRender .= renderDocumentPath($oThread->getDocumentID()); + $sToRender .= displayDocumentPath($oThread->getDocumentID()); $sToRender .= ""; $sToRender .= ""; $sToRender .= ""; @@ -148,7 +131,7 @@ function getCommentBody($oComment, $iDocumentID, $oUser) { $sHeading = "Document Comment"; $sToRender .= renderHeading($sHeading); - $sToRender .= renderDocumentPath($iDocumentID); + $sToRender .= displayDocumentPath($iDocumentID); $aBody = explode("\n",$oComment->getBody()); $sBody = ""; $numChars = 160; // number of chars in a line -- libgit2 0.21.4
Views: " . $oThread->getNumberOfViews() . "