Commit 1635e58b17ccaa5a82a61d07eab355a83bea6b3f
1 parent
4132ebb8
KTS-1628
"Alter information to be displayed inside of rss feed body." Implemented. Reviewed By: Conrad git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6175 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
228 additions
and
106 deletions
plugins/rssplugin/KTrss.inc.php
| ... | ... | @@ -86,19 +86,9 @@ class KTrss{ |
| 86 | 86 | $aDList = KTrss::getDocumentList($iUserId); |
| 87 | 87 | if($aDList){ |
| 88 | 88 | foreach($aDList as $document_id){ |
| 89 | - $sQuery = "SELECT dt.document_id AS id, dt.datetime AS date, dt.comment AS transaction, dmv.name AS name " . | |
| 90 | - "FROM document_metadata_version AS dmv, document_subscriptions AS ds, document_transactions AS dt " . | |
| 91 | - "WHERE dmv.document_id = ds.document_id " . | |
| 92 | - "AND dt.document_id = ds.document_id " . | |
| 93 | - "AND ds.document_id = ? " . | |
| 94 | - "AND ds.user_id = ? " . | |
| 95 | - "ORDER BY date DESC " . | |
| 96 | - "LIMIT 1"; | |
| 97 | - $aParams = array($document_id, $iUserId); | |
| 98 | - $aDocumentsInfo = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 99 | - $aDocumentsInfo['itemType'] = 'document'; | |
| 100 | - if($aDocumentsInfo){ | |
| 101 | - $aDocuments[] = $aDocumentsInfo; | |
| 89 | + $document = KTrss::getOneDocument($document_id, $iUserId); | |
| 90 | + if($document){ | |
| 91 | + $aDocuments[] = $document; | |
| 102 | 92 | } |
| 103 | 93 | } |
| 104 | 94 | } |
| ... | ... | @@ -116,19 +106,9 @@ class KTrss{ |
| 116 | 106 | $aFList = KTrss::getFolderList($iUserId); |
| 117 | 107 | if($aFList){ |
| 118 | 108 | foreach($aFList as $folder_id){ |
| 119 | - $sQuery = "SELECT ft.folder_id AS id, ft.datetime AS date, ft.comment AS transaction, f.name AS name " . | |
| 120 | - "FROM folders AS f, folder_subscriptions AS fs, folder_transactions AS ft " . | |
| 121 | - "WHERE f.id = fs.folder_id " . | |
| 122 | - "AND ft.folder_id = fs.folder_id " . | |
| 123 | - "AND fs.folder_id = ? " . | |
| 124 | - "AND fs.user_id = ? " . | |
| 125 | - "ORDER BY date DESC " . | |
| 126 | - "LIMIT 1"; | |
| 127 | - $aParams = array($folder_id, $iUserId); | |
| 128 | - $aFoldersInfo = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 129 | - $aFoldersInfo['itemType'] = 'folder'; | |
| 130 | - if($aFoldersInfo){ | |
| 131 | - $aFolders[] = $aFoldersInfo; | |
| 109 | + $folder = KTrss::getOneFolder($folder_id, $iUserId); | |
| 110 | + if($folder){ | |
| 111 | + $aFolders[] = $folder; | |
| 132 | 112 | } |
| 133 | 113 | } |
| 134 | 114 | } |
| ... | ... | @@ -141,43 +121,49 @@ class KTrss{ |
| 141 | 121 | } |
| 142 | 122 | } |
| 143 | 123 | |
| 144 | - function getOneDocument($iDocumentId){ | |
| 145 | - $sQuery = "SELECT dt.document_id AS id, dt.datetime AS date, dt.comment AS transaction, dmv.name AS name " . | |
| 146 | - "FROM document_metadata_version AS dmv, document_transactions AS dt " . | |
| 147 | - "WHERE dmv.document_id = dt.document_id " . | |
| 148 | - "AND dt.document_id = ? " . | |
| 149 | - "ORDER BY date DESC "; | |
| 150 | - $aParams = array($iDocumentId); | |
| 151 | - $aDocumentInfo = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 152 | - if($aDocumentInfo){ | |
| 153 | - $aDocuments[] = $aDocumentInfo; | |
| 124 | + // get information on document | |
| 125 | + function getOneDocument($iDocumentId, $iUserId){ | |
| 126 | + $aDData = KTrss::getDocumentData($iUserId, $iDocumentId); | |
| 127 | + $aDTransactions = KTrss::getDocumentTransactions($iDocumentId); | |
| 128 | + if($aDData){ | |
| 129 | + $aDData['itemType'] = 'document'; | |
| 130 | + | |
| 131 | + // create mime info | |
| 132 | + $aMimeInfo = KTrss::getMimeTypeInfo($iUserId, $iDocumentId); | |
| 133 | + $aDData['mimeTypeFName'] = $aMimeInfo['typeFName']; | |
| 134 | + $aDData['mimeTypeIcon'] = $aMimeInfo['typeIcon']; | |
| 135 | + | |
| 136 | + $aDocument[] = $aDData; | |
| 137 | + $aDocument[] = $aDTransactions; | |
| 154 | 138 | } |
| 155 | - if (PEAR::isError($aDocumentInfo)) { | |
| 139 | + if (PEAR::isError($aDData)) { | |
| 156 | 140 | return false; |
| 157 | 141 | } |
| 158 | - if ($aDocuments){ | |
| 159 | - return $aDocuments; | |
| 142 | + if ($aDocument){ | |
| 143 | + return $aDocument; | |
| 160 | 144 | } |
| 161 | 145 | } |
| 162 | 146 | |
| 147 | + // get information for folder | |
| 163 | 148 | function getOneFolder($iFolderId){ |
| 164 | - $sQuery = "SELECT ft.folder_id AS id, ft.datetime AS date, ft.comment AS transaction, f.name AS name " . | |
| 165 | - "FROM folders AS f, folder_transactions AS ft " . | |
| 166 | - "WHERE ft.folder_id = f.id " . | |
| 167 | - "AND f.id = ? " . | |
| 168 | - "ORDER BY date DESC " . | |
| 169 | - "LIMIT 1"; | |
| 170 | - $aParams = array($iFolderId); | |
| 171 | - $aFoldersInfo = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 172 | - if($aFoldersInfo){ | |
| 173 | - $aFolders[] = $aFoldersInfo; | |
| 149 | + $aFData = KTrss::getFolderData($iFolderId); | |
| 150 | + $aFTransactions = KTrss::getFolderTransactions($iFolderId); | |
| 151 | + if($aFData){ | |
| 152 | + $aFData['itemType'] = 'folder'; | |
| 153 | + | |
| 154 | + // create mime info | |
| 155 | + $aFData['mimeTypeFName'] = 'Folder'; | |
| 156 | + $aFData['mimeTypeIcon'] = KTrss::getFolderIcon(); | |
| 157 | + | |
| 158 | + $aFolder[] = $aFData; | |
| 159 | + $aFolder[] = $aFTransactions; | |
| 160 | + $aFolderBox[] = $aFolder; | |
| 174 | 161 | } |
| 175 | - if (PEAR::isError($aFoldersInfo)) { | |
| 176 | - // XXX: log error | |
| 162 | + if (PEAR::isError($aFData)) { | |
| 177 | 163 | return false; |
| 178 | 164 | } |
| 179 | - if ($aFolders){ | |
| 180 | - return $aFolders; | |
| 165 | + if ($aFolder){ | |
| 166 | + return $aFolder; | |
| 181 | 167 | } |
| 182 | 168 | } |
| 183 | 169 | |
| ... | ... | @@ -200,16 +186,79 @@ class KTrss{ |
| 200 | 186 | "<link>".$hostPath."knowledgeTree/</link>\n". |
| 201 | 187 | "<url>".$hostPath."resources/graphics/ktlogo_rss.png</url>\n". |
| 202 | 188 | "</image>\n"; |
| 203 | - foreach($aItems as $item){ | |
| 204 | - if($item['itemType'] == 'folder'){ | |
| 189 | + foreach($aItems as $aItems){ | |
| 190 | + if($aItems[0][itemType] == 'folder'){ | |
| 205 | 191 | $sTypeSelect = 'folder.transactions&fFolderId'; |
| 206 | - }elseif($item['itemType'] == 'document'){ | |
| 192 | + }elseif($aItems[0][itemType] == 'document'){ | |
| 207 | 193 | $sTypeSelect = 'document.transactionhistory&fDocumentId'; |
| 208 | 194 | } |
| 209 | 195 | $feed .= "<item>\n" . |
| 210 | - "<title>".$item[0]['name']."</title>\n" . | |
| 211 | - "<link>".$hostPath."action.php?kt_path_info=ktcore.actions.".$sTypeSelect."=".$item[0]['id']."</link>\n" . | |
| 212 | - "<description>".$item[0]['transaction']."</description>\n". | |
| 196 | + "<title>".$aItems[0][0][name]."</title>\n" . | |
| 197 | + "<link>".$hostPath."action.php?kt_path_info=ktcore.actions.".$sTypeSelect."=".$aItems[0][0]['id']."</link>\n" . | |
| 198 | + "<description>\n" . | |
| 199 | + "<table border='0' width='90%'>\n". | |
| 200 | + "<tr>\n". | |
| 201 | + "<td width='5%' height='16px'>" . | |
| 202 | + "<a href='".$hostPath."action.php?kt_path_info=ktcore.actions.".$sTypeSelect."=".$aItems[0][0][id]."' ><img src='".$aItems[0][mimeTypeIcon]."' align='left' height='16px' width='16px' alt='' border='0' /></a>" . | |
| 203 | + "</td>\n". | |
| 204 | + "<td align='left'> ".$aItems[0][mimeTypeFName]."</td>\n". | |
| 205 | + "</tr>\n". | |
| 206 | + "<tr>\n". | |
| 207 | + "<td colspan='2'>\n". | |
| 208 | + ucfirst($aItems[0]['itemType'])." Information (ID: ".$aItems[0][0][id].")</>\n". | |
| 209 | + "<hr>\n". | |
| 210 | + "<table width='95%'>\n". | |
| 211 | + "<tr>\n". | |
| 212 | + "<td>Filename: ".$aItems[0][0][filename]."</td>\n". | |
| 213 | + "<td>\n". | |
| 214 | + "</tr>\n". | |
| 215 | + "<tr>\n". | |
| 216 | + "<td>Author: ".$aItems[0][0][author]."</td>\n". | |
| 217 | + "<td>\n". | |
| 218 | + "</tr>\n". | |
| 219 | + "<tr>\n". | |
| 220 | + "<td>Owner: ";if($aItems[0][0][owner]){$feed .= $aItems[0][0][owner];}else{$feed .= "None";} | |
| 221 | + $feed .= "</td>\n". | |
| 222 | + "<td></td>\n". | |
| 223 | + "</tr>\n". | |
| 224 | + "<tr>\n";if($aItems[0][0][type]){ | |
| 225 | + $feed .= "<td>Document type: ".$aItems[0][0][type]."</td>\n". | |
| 226 | + "<td></td>\n";} | |
| 227 | + $feed .= "</tr>\n". | |
| 228 | + "<tr>\n". | |
| 229 | + "<td>Workflow status: ";if($aItems[0][0][workflow_status]){$feed .= $aItems[0][0][workflow_status];}else{$feed .= "No Workflow";} | |
| 230 | + $feed .= "</td>\n". | |
| 231 | + "<td></td>\n". | |
| 232 | + "</tr>\n". | |
| 233 | + "</table><br>\n". | |
| 234 | + "Transaction Summary (Last 3)\n". | |
| 235 | + "<hr>\n". | |
| 236 | + "<table width='100%'>\n"; | |
| 237 | + foreach($aItems[1] as $item){ | |
| 238 | + $feed .= "<tr>\n". | |
| 239 | + "<td>Description:</td>\n". | |
| 240 | + "<td>".$item[comment]."</td>\n". | |
| 241 | + "</tr>\n". | |
| 242 | + "<tr>\n";if($item[version]){ | |
| 243 | + $feed .= "<td>Version:</td>\n". | |
| 244 | + "<td>".$item[version]."</td>\n";} | |
| 245 | + $feed .= "</tr>\n". | |
| 246 | + "<tr>\n". | |
| 247 | + "<td>Date:</td>\n". | |
| 248 | + "<td>".$item[datetime]."</td>\n". | |
| 249 | + "</tr>\n". | |
| 250 | + "<tr>\n". | |
| 251 | + "<td>User:</td>\n". | |
| 252 | + "<td>".$item[user_name]."</td>\n". | |
| 253 | + "</tr>\n". | |
| 254 | + "<tr>\n". | |
| 255 | + "<td colspan='2'><hr width='100' align='left'></td>\n". | |
| 256 | + "</tr>\n";} | |
| 257 | + $feed .= "</table>\n". | |
| 258 | + "</td>\n". | |
| 259 | + "</tr>\n". | |
| 260 | + "</table>". | |
| 261 | + "</description>\n". | |
| 213 | 262 | "</item>\n"; |
| 214 | 263 | } |
| 215 | 264 | $feed .= "</channel>\n" . |
| ... | ... | @@ -303,36 +352,6 @@ class KTrss{ |
| 303 | 352 | return $res; |
| 304 | 353 | } |
| 305 | 354 | |
| 306 | - // Should be removed...not being used anywhere | |
| 307 | - function authenticateFolder($iUserId, $iFolderId){ | |
| 308 | - $aFList = KTrss::getFolderList($iUserId); | |
| 309 | - $result = false; | |
| 310 | - if($aFList){ | |
| 311 | - foreach($aFList as $folder_id){ | |
| 312 | - if($folder_id == $iFolderId){ | |
| 313 | - $result = true; | |
| 314 | - } | |
| 315 | - } | |
| 316 | - } | |
| 317 | - | |
| 318 | - return $result; | |
| 319 | - } | |
| 320 | - | |
| 321 | - // Should be removed...not being used anywhere | |
| 322 | - function authenticateDocument($iUserId ,$iDocumentId){ | |
| 323 | - $aDList = KTrss::getDocumentList($iUserId); | |
| 324 | - $result = false; | |
| 325 | - if($aDList){ | |
| 326 | - foreach($aDList as $document_id){ | |
| 327 | - if($document_id == $iDocumentId){ | |
| 328 | - $result = true; | |
| 329 | - } | |
| 330 | - } | |
| 331 | - } | |
| 332 | - | |
| 333 | - return $result; | |
| 334 | - } | |
| 335 | - | |
| 336 | 355 | // Function to validate that a user has permissions for a specific document |
| 337 | 356 | function validateDocumentPermissions($iUserId, $iDocumentId){ |
| 338 | 357 | // check if user id is in session. If not, set it |
| ... | ... | @@ -373,6 +392,7 @@ class KTrss{ |
| 373 | 392 | } |
| 374 | 393 | } |
| 375 | 394 | |
| 395 | + // get icon link for rss | |
| 376 | 396 | function getRssLinkIcon(){ |
| 377 | 397 | // built server path |
| 378 | 398 | $sHostPath = "http://".$_SERVER['HTTP_HOST']."/".$GLOBALS['KTRootUrl']."/"; |
| ... | ... | @@ -383,6 +403,7 @@ class KTrss{ |
| 383 | 403 | return $icon; |
| 384 | 404 | } |
| 385 | 405 | |
| 406 | + // get rss link for a document/folder | |
| 386 | 407 | function getRssLink($iItemId, $sItemType){ |
| 387 | 408 | $item = strToLower($sItemType); |
| 388 | 409 | if($item == 'folder'){ |
| ... | ... | @@ -400,8 +421,115 @@ class KTrss{ |
| 400 | 421 | return $sLink; |
| 401 | 422 | } |
| 402 | 423 | |
| 424 | + // get rss icon link | |
| 403 | 425 | function getImageLink($iItemId, $sItemType){ |
| 404 | 426 | return "<a href='".KTrss::getRssLink($iItemId, $sItemType)."' target='_blank'>".KTrss::getRssLinkIcon()."</a>"; |
| 405 | 427 | } |
| 428 | + | |
| 429 | + // get the mime type id for a document | |
| 430 | + function getDocumentMimeTypeId($iUserId, $iDocumentId){ | |
| 431 | + if(!isset($_SESSION["userID"])){ | |
| 432 | + $_SESSION['userID'] = $iUserId; | |
| 433 | + } | |
| 434 | + // get document object | |
| 435 | + $oDocument =& Document::get($iDocumentId); | |
| 436 | + | |
| 437 | + $docMime = $oDocument->getMimeTypeID(); | |
| 438 | + return $docMime; | |
| 439 | + } | |
| 440 | + | |
| 441 | + // get mime information for a document | |
| 442 | + function getMimeTypeInfo($iUserId, $iDocumentId){ | |
| 443 | + $mimeinfo['typeId'] = KTrss::getDocumentMimeTypeId($iUserId, $iDocumentId); // mime type id | |
| 444 | + $mimeinfo['typeName'] = KTMime::getMimeTypeName($mimeinfo['typeId']); // mime type name | |
| 445 | + $mimeinfo['typeFName'] = KTMime::getFriendlyNameForString($mimeinfo['typeName']); // mime type friendly name | |
| 446 | + $mimeinfo['typeIcon'] = "http://".$_SERVER['HTTP_HOST']."/".$GLOBALS['KTRootUrl']."/resources/mimetypes/".KTMime::getIconPath($mimeinfo['typeId']).".png"; //icon path | |
| 447 | + | |
| 448 | + return $mimeinfo; | |
| 449 | + } | |
| 450 | + | |
| 451 | + // get the default folder icon | |
| 452 | + function getFolderIcon(){ | |
| 453 | + return $mimeinfo['typeIcon'] = "http://".$_SERVER['HTTP_HOST']."/".$GLOBALS['KTRootUrl']."/thirdparty/icon-theme/16x16/mimetypes/x-directory-normal.png"; //icon path | |
| 454 | + } | |
| 455 | + | |
| 456 | + // get a document information | |
| 457 | + function getDocumentData($iUserId, $iDocumentId){ | |
| 458 | + if(!isset($_SESSION["userID"])){ | |
| 459 | + $_SESSION['userID'] = $iUserId; | |
| 460 | + } | |
| 461 | + // get document object | |
| 462 | + $oDocument =& Document::get($iDocumentId); | |
| 463 | + | |
| 464 | + $cv = $oDocument->getContentVersionId(); | |
| 465 | + $mv = $oDocument->getMetadataVersionId(); | |
| 466 | + | |
| 467 | + $sQuery = "SELECT dcv.document_id AS id, dmver.name AS name, dcv.filename AS filename, c.name AS author, o.name AS owner, dtl.name AS type, dwfs.name AS workflow_status " . | |
| 468 | + "FROM documents AS d LEFT JOIN document_content_version AS dcv ON d.id = dcv.document_id " . | |
| 469 | + "LEFT JOIN users AS o ON d.owner_id = o.id " . | |
| 470 | + "LEFT JOIN users AS c ON d.creator_id = c.id " . | |
| 471 | + "LEFT JOIN document_metadata_version AS dmv ON d.id = dmv.document_id " . | |
| 472 | + "LEFT JOIN document_types_lookup AS dtl ON dmv.document_type_id = dtl.id " . | |
| 473 | + "LEFT JOIN document_metadata_version AS dmver ON d.id = dmver.document_id " . | |
| 474 | + "LEFT JOIN workflow_states AS dwfs ON dmver.workflow_state_id = dwfs.id " . | |
| 475 | + "WHERE d.id = ? " . | |
| 476 | + "AND dmver.id = ? " . | |
| 477 | + "AND dcv.id = ? " . | |
| 478 | + "LIMIT 1"; | |
| 479 | + | |
| 480 | + $aParams = array($iDocumentId, $mv, $cv); | |
| 481 | + $aDocumentData = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 482 | + if($aDocumentData){ | |
| 483 | + return $aDocumentData; | |
| 484 | + } | |
| 485 | + } | |
| 486 | + | |
| 487 | + // get a folder information | |
| 488 | + function getFolderData($iFolderId){ | |
| 489 | + $sQuery = "SELECT f.id AS id, f.name AS name, f.name AS filename, c.name AS author, o.name AS owner, f.description AS description " . | |
| 490 | + "FROM folders AS f " . | |
| 491 | + "LEFT JOIN users AS o ON f.owner_id = o.id " . | |
| 492 | + "LEFT JOIN users AS c ON f.creator_id = c.id " . | |
| 493 | + "WHERE f.id = ? " . | |
| 494 | + "LIMIT 1"; | |
| 495 | + | |
| 496 | + $aParams = array($iFolderId); | |
| 497 | + $aFolderData = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 498 | + if($aFolderData){ | |
| 499 | + return $aFolderData; | |
| 500 | + } | |
| 501 | + } | |
| 502 | + | |
| 503 | + // get a listing of the latest 3 transactions for a document | |
| 504 | + function getDocumentTransactions($iDocumentId){ | |
| 505 | + $sQuery = "SELECT DTT.name AS transaction_name, U.name AS user_name, DT.version AS version, DT.comment AS comment, DT.datetime AS datetime " . | |
| 506 | + "FROM document_transactions AS DT INNER JOIN users AS U ON DT.user_id = U.id " . | |
| 507 | + "INNER JOIN document_transaction_types_lookup AS DTT ON DTT.namespace = DT.transaction_namespace " . | |
| 508 | + "WHERE DT.document_id = ? " . | |
| 509 | + "ORDER BY DT.datetime DESC " . | |
| 510 | + "LIMIT 3"; | |
| 511 | + | |
| 512 | + $aParams = array($iDocumentId); | |
| 513 | + $aDocumentTransactions = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 514 | + if($aDocumentTransactions){ | |
| 515 | + return $aDocumentTransactions; | |
| 516 | + } | |
| 517 | + } | |
| 518 | + | |
| 519 | + // Get a listing of the latest 3 transactions for a folder | |
| 520 | + function getFolderTransactions($iFolderId){ | |
| 521 | + $sQuery = "SELECT DTT.name AS transaction_name, U.name AS user_name, FT.comment AS comment, FT.datetime AS datetime " . | |
| 522 | + "FROM folder_transactions AS FT LEFT JOIN users AS U ON FT.user_id = U.id " . | |
| 523 | + "LEFT JOIN document_transaction_types_lookup AS DTT ON DTT.namespace = FT.transaction_namespace " . | |
| 524 | + "WHERE FT.folder_id = ? " . | |
| 525 | + "ORDER BY FT.datetime DESC " . | |
| 526 | + "LIMIT 3"; | |
| 527 | + | |
| 528 | + $aParams = array($iFolderId); | |
| 529 | + $aFolderTransactions = DBUtil::getResultArray(array($sQuery, $aParams)); | |
| 530 | + if($iFolderId){ | |
| 531 | + return $aFolderTransactions; | |
| 532 | + } | |
| 533 | + } | |
| 406 | 534 | } |
| 407 | 535 | ?> | ... | ... |
plugins/rssplugin/loadFeed.inc.php
| ... | ... | @@ -24,19 +24,15 @@ |
| 24 | 24 | // Prepare response data to be passed back to page |
| 25 | 25 | $reposonse = "<h3>".$aRSSArray[channel][title]."</h3>" . |
| 26 | 26 | "<div class='outerContainer' id='outerContainer'>" . |
| 27 | - "<table width='80%'>"; | |
| 27 | + "<table width='90%'>"; | |
| 28 | 28 | for($i=0;$i<count($aRSSArray[items]);$i++){ |
| 29 | 29 | $reposonse .= "<tr> |
| 30 | - <td colspan='2'><strong>".$aRSSArray[items][$i][title]."<strong></td> | |
| 30 | + <td colspan='2'><strong><a href='".$aRSSArray[items][$i][link]."' target='_blank'>".$aRSSArray[items][$i][title]."</a><strong></td> | |
| 31 | 31 | </tr> |
| 32 | 32 | <tr> |
| 33 | 33 | <td>".$aRSSArray[items][$i][description]."</td> |
| 34 | - <td>".$aRSSArray[items][$i][pubDate]."</td> | |
| 35 | 34 | </tr> |
| 36 | - <tr> | |
| 37 | - <td colspan='2'><a href='".$aRSSArray[items][$i][link]."' target='_blank'>... read more</a></td> | |
| 38 | - </tr> | |
| 39 | - <tr><td colspan='2'><hr><br></td></tr>"; | |
| 35 | + <tr><td colspan='2'><br></td></tr>"; | |
| 40 | 36 | } |
| 41 | 37 | $reposonse .= "</table></div>"; |
| 42 | 38 | ... | ... |
plugins/rssplugin/templates/RSSPlugin/dashlet.smarty
| ... | ... | @@ -65,19 +65,15 @@ |
| 65 | 65 | {if ($internalrss)} |
| 66 | 66 | <h3>{$internalrss.channel.title}</h3> |
| 67 | 67 | <div class='outerContainer' id='outerContainer'> |
| 68 | - <table width='80%'> | |
| 68 | + <table width='90%'> | |
| 69 | 69 | {section name=i start=0 loop=$itemcount} |
| 70 | 70 | <tr> |
| 71 | - <td colspan='2'><strong>{$internalrss.items[i].title}<strong></td> | |
| 71 | + <td><strong><a href='{$internalrss.items[i].link}'>{$internalrss.items[i].title}</a><strong></td> | |
| 72 | 72 | </tr> |
| 73 | 73 | <tr> |
| 74 | 74 | <td>{$internalrss.items[i].description}</td> |
| 75 | - <td>{$internalrss.items[i].pubDate}</td> | |
| 76 | 75 | </tr> |
| 77 | - <tr> | |
| 78 | - <td colspan='2'><a href='{$internalrss.items[i].link}'>...read more story</a></td> | |
| 79 | - </tr> | |
| 80 | - <tr><td colspan='2'><hr><br></td></tr> | |
| 76 | + <tr><td><br></td></tr> | |
| 81 | 77 | {/section} |
| 82 | 78 | </table> |
| 83 | 79 | </div> | ... | ... |
rss.php
| ... | ... | @@ -17,6 +17,8 @@ require_once(KT_LIB_DIR . "/widgets/FieldsetDisplayRegistry.inc.php"); |
| 17 | 17 | require_once(KT_LIB_DIR . "/actions/documentaction.inc.php"); |
| 18 | 18 | require_once(KT_LIB_DIR . "/browse/browseutil.inc.php"); |
| 19 | 19 | |
| 20 | +require_once(KT_LIB_DIR . '/mime.inc.php'); | |
| 21 | + | |
| 20 | 22 | if (!validateUser($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) { |
| 21 | 23 | header('WWW-Authenticate: Basic realm="KnowledgeTree DMS"'); |
| 22 | 24 | header('HTTP/1.0 401 Unauthorized'); |
| ... | ... | @@ -33,9 +35,9 @@ if (!validateUser($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) { |
| 33 | 35 | |
| 34 | 36 | if(KTrss::validateDocumentPermissions($id, $iDocumentId)){ // if document passes validation check |
| 35 | 37 | // get document info |
| 36 | - $aDocumentInfo = KTrss::getOneDocument($iDocumentId); | |
| 38 | + $aDocumentInfo[] = KTrss::getOneDocument($iDocumentId, $id); | |
| 37 | 39 | |
| 38 | - if($aDocumentInfo){ | |
| 40 | + if($aDocumentInfo){ | |
| 39 | 41 | // create rss xml for document |
| 40 | 42 | $documentFeed = KTrss::arrayToXML($aDocumentInfo); |
| 41 | 43 | }else{ |
| ... | ... | @@ -58,7 +60,7 @@ if (!validateUser($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) { |
| 58 | 60 | |
| 59 | 61 | if(KTrss::validateFolderPermissions($id, $iFolderId)){ // if folder passes validation check |
| 60 | 62 | // get folder info |
| 61 | - $aFolderInfo = KTrss::getOneFolder($iFolderId); | |
| 63 | + $aFolderInfo[] = KTrss::getOneFolder($iFolderId); | |
| 62 | 64 | |
| 63 | 65 | if($aFolderInfo){ |
| 64 | 66 | // create rss xml for folder | ... | ... |