Commit f8bee8f26aad3c87d973db540bca7a1a64a91eab

Authored by Michael Joseph
1 parent be1a8cc4

update ui to display folder creator


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1745 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
... ... @@ -46,6 +46,8 @@ function renderBrowseTypeSelect($sBrowseType) {
46 46 (($sBrowseType=="documentType") ? " checked=\"checked\"" : "") . "/> Document Type\n</span>";
47 47 }
48 48  
  49 +// <category display helper methods>
  50 +
49 51 /**
50 52 * Displays the passed category path as a link
51 53 *
... ... @@ -78,6 +80,11 @@ function displayCategoryLink($sCategoryName) {
78 80 }
79 81 }
80 82  
  83 +/**
  84 + * Displays the results for category browsing
  85 + *
  86 + * @param array the category browse results
  87 + */
81 88 function renderCategoryResults($aResults) {
82 89 $sToRender = "";
83 90  
... ... @@ -95,6 +102,9 @@ function renderCategoryResults($aResults) {
95 102 return $sToRender;
96 103 }
97 104  
  105 +// </category display helper methods>
  106 +
  107 +// <document type display helper methods>
98 108 /**
99 109 * Displays the passed document type path as a link
100 110 *
... ... @@ -123,7 +133,11 @@ function displayDocumentTypeLink($aDocumentType) {
123 133 $aDocumentType["name"]);
124 134 }
125 135  
126   -
  136 +/**
  137 + * Displays the results for document type browsing
  138 + *
  139 + * @param array the document type browse results
  140 + */
127 141 function renderDocumentTypeResults($aResults) {
128 142 $sToRender = "";
129 143  
... ... @@ -140,6 +154,8 @@ function renderDocumentTypeResults($aResults) {
140 154 }
141 155 return $sToRender;
142 156 }
  157 +// </document type display helper methods>
  158 +
143 159  
144 160 /**
145 161 * Displays the headings for the displayed document details and enables
... ... @@ -184,6 +200,11 @@ function renderSortHeadings($sSortBy, $sSortDirection) {
184 200 return $sToRender;
185 201 }
186 202  
  203 +/**
  204 + * Displays the folders in the browse results
  205 + *
  206 + * @param array the browse result objects
  207 + */
187 208 function renderFolderResults($aResults) {
188 209 global $default;
189 210 $sToRender = "";
... ... @@ -191,8 +212,9 @@ function renderFolderResults($aResults) {
191 212 // now loop through the rest of the folders and display links
192 213 if (count($aResults["folders"]) > 1) {
193 214 for ($i=1; $i<count($aResults["folders"]); $i++) {
194   - $sRow = displayFolderLink($aResults["folders"][$i]);
195   - $sToRender .= "<tr><td colspan=\"5\" nowrap width=\"100%\" bgcolor=\"" . getColour($i) . "\">" . $sRow . "</td></tr>\n";
  215 + $sFolderLink = displayFolderLink($aResults["folders"][$i]);
  216 + $oCreator = User::get($aResults["folders"][$i]->getCreatorID());
  217 + $sToRender .= "<tr bgcolor=\"" . getColour($i) . "\"><td colspan=\"2\" nowrap width=\"100%\">" . $sFolderLink . "</td><td>" . $oCreator->getName() . "</td><td colspan=\"2\"></td></tr>\n";
196 218 }
197 219 } else {
198 220 $sToRender .= "<tr><td>This folder contains no sub folders</td></tr>";
... ... @@ -203,6 +225,14 @@ function renderFolderResults($aResults) {
203 225 return $sToRender;
204 226 }
205 227  
  228 +/**
  229 + * Displays the documents in the browse results
  230 + *
  231 + * @param array the browse result objects
  232 + * @param string the message to display if there are no documents
  233 + * @param string the message to display if the current user doesn't have permission to view the documents
  234 + * @param boolean whether to display the complete path to the document or not
  235 + */
206 236 function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) {
207 237 // loop through the files and display links
208 238 if (count($aResults["documents"]) > 0) {
... ... @@ -269,7 +299,9 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) {
269 299 return $sToRender;
270 300 }
271 301  
272   -
  302 +/**
  303 + * Candy striping helper method
  304 + */
273 305 function getColour($iColourCount) {
274 306 return ($iColourCount%2 == 0) ? "F5F6EE" : "FFFFFF";
275 307 }
... ...