diff --git a/plugins/rssplugin/KTrss.inc.php b/plugins/rssplugin/KTrss.inc.php
index 10fd72e..48b0894 100644
--- a/plugins/rssplugin/KTrss.inc.php
+++ b/plugins/rssplugin/KTrss.inc.php
@@ -22,10 +22,6 @@ require_once(KT_LIB_DIR . "/documentmanagement/documentcontentversion.inc.php");
require_once(KT_LIB_DIR . "/metadata/fieldset.inc.php");
require_once(KT_LIB_DIR . "/security/Permission.inc");
-// widget includes.
-require_once(KT_LIB_DIR . "/widgets/portlet.inc.php");
-require_once(KT_LIB_DIR . "/widgets/fieldsetDisplay.inc.php");
-require_once(KT_LIB_DIR . "/widgets/FieldsetDisplayRegistry.inc.php");
require_once(KT_LIB_DIR . "/actions/documentaction.inc.php");
require_once(KT_LIB_DIR . "/browse/browseutil.inc.php");
@@ -100,7 +96,10 @@ class KTrss{
"LIMIT 1";
$aParams = array($document_id, $iUserId);
$aDocumentsInfo = DBUtil::getResultArray(array($sQuery, $aParams));
- $aDocuments[] = $aDocumentsInfo;
+ $aDocumentsInfo['itemType'] = 'document';
+ if($aDocumentsInfo){
+ $aDocuments[] = $aDocumentsInfo;
+ }
}
}
if (PEAR::isError($aDocuments)) {
@@ -127,6 +126,7 @@ class KTrss{
"LIMIT 1";
$aParams = array($folder_id, $iUserId);
$aFoldersInfo = DBUtil::getResultArray(array($sQuery, $aParams));
+ $aFoldersInfo['itemType'] = 'folder';
if($aFoldersInfo){
$aFolders[] = $aFoldersInfo;
}
@@ -201,41 +201,14 @@ class KTrss{
"
+You can copy the following link into any RSS aggregator to create a feed to the selected document.
+
";
+
+ return $icon;
+ }
+
+ function getRssLink($iItemId, $sItemType){
+ $item = strToLower($sItemType);
+ if($item == 'folder'){
+ $sItemParameter = '?folderId';
+ }else if($item == 'document'){
+ $sItemParameter = '?docId';
+ }
+
+ // built server path
+ $sHostPath = "http://".$_SERVER['HTTP_HOST'];
+
+ // build link
+ $sLink = $sHostPath.KTBrowseUtil::buildBaseUrl('rss').$sItemParameter.'='.$iItemId;
+
+ return $sLink;
+ }
+
+ function getImageLink($iItemId, $sItemType){
+ return "".KTrss::getRssLinkIcon()."";
+ }
}
?>
diff --git a/plugins/rssplugin/RSSDocumentLinkAction.php b/plugins/rssplugin/RSSDocumentLinkAction.php
index afbfbc2..97e5a9b 100644
--- a/plugins/rssplugin/RSSDocumentLinkAction.php
+++ b/plugins/rssplugin/RSSDocumentLinkAction.php
@@ -1,5 +1,5 @@
oDocument;
@@ -25,7 +23,26 @@ class RSSDocumentLinkAction extends KTDocumentAction {
$iFId = $oDocument->getID();
// return link...there MIGHT be a nicer way of doing this?
- return "
";
+ return "RSS ".KTrss::getImageLink($iFId, 'document');
+ }
+
+ function do_main() {
+ //get document object
+ $oDocument = $this->oDocument;
+
+ // get document id
+ $iDId = $oDocument->getID();
+
+ $oTemplating =& KTTemplating::getSingleton();
+ $oTemplate = $oTemplating->loadTemplate('RSSPlugin/rssdocumentaction');
+
+ $aTemplateData = array(
+ 'context' => $this,
+ 'link' => KTrss::getRssLink($iDId, 'document'),
+ 'linkIcon' => KTrss::getImageLink($iDId, 'document'),
+ );
+
+ return $oTemplate->render($aTemplateData);
}
}
?>
\ No newline at end of file
diff --git a/plugins/rssplugin/RSSFolderLinkAction.php b/plugins/rssplugin/RSSFolderLinkAction.php
index d364cba..7bdf75a 100644
--- a/plugins/rssplugin/RSSFolderLinkAction.php
+++ b/plugins/rssplugin/RSSFolderLinkAction.php
@@ -8,16 +8,14 @@ require_once(KT_LIB_DIR . '/plugins/plugin.inc.php');
require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php');
require_once(KT_LIB_DIR . '/roles/Role.inc');
+require_once(KT_DIR. '/plugins/rssplugin/KTrss.inc.php');
class RSSFolderLinkAction extends KTFolderAction {
var $sName = 'ktcore.rss.plugin.folder.link';
var $_sShowPermission = "ktcore.permissions.read";
- var $sDisplayName = "RSS";
+ var $sDisplayName = 'RSS';
function getDisplayName() {
- // built server path
- $hostPath = "http://".$_SERVER['HTTP_HOST']."/".$GLOBALS['KTRootUrl']."/";
-
//get folder object
$oFolder = $this->oFolder;
@@ -25,7 +23,26 @@ class RSSFolderLinkAction extends KTFolderAction {
$iFId = $oFolder->getID();
// return link...there MIGHT be a nicer way of doing this?
- return "
";
+ return "RSS ".KTrss::getImageLink($iFId, 'folder');
+ }
+
+ function do_main() {
+ //get folder object
+ $oFolder = $this->oFolder;
+
+ // get folder id
+ $iFId = $oFolder->getID();
+
+ $oTemplating =& KTTemplating::getSingleton();
+ $oTemplate = $oTemplating->loadTemplate('RSSPlugin/rssfolderaction');
+
+ $aTemplateData = array(
+ 'context' => $this,
+ 'link' => KTrss::getRssLink($iFId, 'folder'),
+ 'linkIcon' => KTrss::getImageLink($iFId, 'folder'),
+ );
+
+ return $oTemplate->render($aTemplateData);
}
}
?>
\ No newline at end of file
diff --git a/plugins/rssplugin/RSSPlugin.php b/plugins/rssplugin/RSSPlugin.php
index 400e807..2d5a5df 100644
--- a/plugins/rssplugin/RSSPlugin.php
+++ b/plugins/rssplugin/RSSPlugin.php
@@ -26,7 +26,7 @@ require_once('RSSDocumentLinkAction.php');
function setup() {
$this->registerAction('folderaction', 'RSSFolderLinkAction', 'ktcore.rss.plugin.folder.link', $sFilename = null);
- $this->registerAction('documentaction', 'RSSDocumentLinkAction', 'ktcore.rss.document.plugin', $sFilename = null);
+ $this->registerAction('documentaction', 'RSSDocumentLinkAction', 'ktcore.rss.plugin.document.link', $sFilename = null);
$this->registerDashlet('RSSDashlet', 'ktcore.rss.feed.dashlet', 'RSSDashlet.php');
$this->registerPage('managerssfeeds', 'ManageRSSFeedsDispatcher');
diff --git a/plugins/rssplugin/templates/RSSPlugin/dashlet.smarty b/plugins/rssplugin/templates/RSSPlugin/dashlet.smarty
index 757f741..ea09c81 100644
--- a/plugins/rssplugin/templates/RSSPlugin/dashlet.smarty
+++ b/plugins/rssplugin/templates/RSSPlugin/dashlet.smarty
@@ -75,7 +75,7 @@
{$internalrss.items[i].pubDate}
-
...full story
+ ...read more story
{/section}
diff --git a/plugins/rssplugin/templates/RSSPlugin/rssdocumentaction.smarty b/plugins/rssplugin/templates/RSSPlugin/rssdocumentaction.smarty
new file mode 100644
index 0000000..5c9c55d
--- /dev/null
+++ b/plugins/rssplugin/templates/RSSPlugin/rssdocumentaction.smarty
@@ -0,0 +1,9 @@
+
+
Document RSS
+
+Another way of quickly accessing a RSS feed for a document of folder is by RSS icon {$linkIcon},
+which you will find in your actions portlet on the left.
+
Folder RSS+You can copy the following link into any RSS aggragator to create a feed to the selected folder. +