diff --git a/plugin/rss/README.md b/plugin/rss/README.md index 44969403fc..260d449d18 100755 --- a/plugin/rss/README.md +++ b/plugin/rss/README.md @@ -1,6 +1,4 @@ RSS plugin === -This plugin displays RSS feeds using the Google Dynamic Feed control. - -See http://www.google.com/uds/solutions/dynamicfeed/index.html for further information. \ No newline at end of file +This plugin displays RSS feeds. \ No newline at end of file diff --git a/plugin/rss/index.php b/plugin/rss/index.php index 79f542af1b..edf0ec8f1a 100755 --- a/plugin/rss/index.php +++ b/plugin/rss/index.php @@ -1,56 +1,31 @@ get_rss(); +$plugin = RssPlugin::create(); +$url = $plugin->get_rss(); $title = $plugin->get_block_title(); $title = $title ? "

$title

" : ''; - $css = $plugin->get_css(); -$css = $css ? "" : ''; -$bullet = api_get_path(WEB_PLUGIN_PATH).'rss/resources/arrow-bullet.png'; -if (empty($rss)) { +if (empty($url)) { echo Display::return_message(get_lang('NoRSSItem'), 'warning'); return; } -echo<< - $css - - - -EOT; +if (!empty($channel)) { + /** @var FeedInterface $item */ + foreach ($channel as $item) { + $title = $item->getTitle(); + $link = $item->getLink(); + if (!empty($link)) { + $title = Display::url($title, $link, ['target' => '_blank']); + } + echo Display::panel($item->getDescription(), $title); + } +} diff --git a/plugin/rss/lib/rss_plugin.class.php b/plugin/rss/lib/rss_plugin.class.php index 9a8de34ffb..ea96c19f0e 100755 --- a/plugin/rss/lib/rss_plugin.class.php +++ b/plugin/rss/lib/rss_plugin.class.php @@ -1,7 +1,7 @@ 'text', 'rss' => 'text')); + } + /** * - * @return RssPlugin + * @return RssPlugin */ - static function create() + public static function create() { static $result = null; return $result ? $result : $result = new self(); } - function get_block_title() + public function get_block_title() { return $this->get('block_title'); } - function get_rss() + public function get_rss() { return $this->get('rss'); } - protected function __construct() - { - parent::__construct('1.1', 'Laurent Opprecht', array('block_title' => 'text', 'rss' => 'text')); - } - } \ No newline at end of file diff --git a/plugin/rss/plugin.php b/plugin/rss/plugin.php index e94b1fe016..9b21e6f94c 100755 --- a/plugin/rss/plugin.php +++ b/plugin/rss/plugin.php @@ -1,14 +1,3 @@ get_info(); diff --git a/plugin/rss/resources/arrow-bullet.png b/plugin/rss/resources/arrow-bullet.png deleted file mode 100755 index bbb5d27e5a..0000000000 Binary files a/plugin/rss/resources/arrow-bullet.png and /dev/null differ diff --git a/plugin/rss/resources/color.css b/plugin/rss/resources/color.css deleted file mode 100755 index de6366f445..0000000000 --- a/plugin/rss/resources/color.css +++ /dev/null @@ -1,41 +0,0 @@ - -.gfg-root a:link, -.gfg-root a:visited, -.gfg-root a:focus, -.gfg-root a:active -{ - color: #CC0066; -} - -.gfg-subtitle, .gfg-title{ - background-color: #CC0066 !important; - color: #FFFFFF !important; -} - -.gfg-subtitle > a{ - color: #FFFFFF !important; -} - -.gfg-subtitle > a:hover{ - color: black !important; -} - -.gfg-root a:hover, .gfg-subtitle:hover { - color: black; -} - -.gfg-listentry-odd:hover{ - background-color: #E9E9F0 !important; -} - -.gfg-listentry-even:hover{ - background-color: #E9E9F0 !important; -} - -.gfg-horizontal-root .gfg-entry .gf-result, .gfg-horizontal-root .gfg-entry, .gfg-horizontal-root .gf-snippet{ - background-color: white !important; -} - -.gfg-horizontal-root .gfg-entry { - background-color: white !important; -} diff --git a/plugin/rss/resources/rss.css b/plugin/rss/resources/rss.css deleted file mode 100755 index 7ba812a4f4..0000000000 --- a/plugin/rss/resources/rss.css +++ /dev/null @@ -1,102 +0,0 @@ -@import url(http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css); - -.well.sidebar-nav.rss -{ -} - -/*google feeds*/ - -.gfg-listentry-highlight, -.gfg-listentry -{ - background-position: left center; - background-repeat: no-repeat; - padding-left: 20px; -} - -.gfg-root a:link, -.gfg-root a:visited, -.gfg-root a:focus, -.gfg-root a:active -{ - font-weight: normal; - text-decoration: none; -} - -.gfg-root { - border-left:0px; - border-right:0px; - border-top:0px ; -} -.gfg-listentry { - line-height: 14px !important; -} - -.gfg-listentry{ - white-space: normal; -} - -.gfg-subtitle, .gfg-title{ - font-weight: bold ; -} - -.gfg-title{ - display: none; -} - -.gfg-subtitle a:link, .gfg-title a:link{ - font-weight: bold; -} - -.gfg-root .gfg-entry .gf-result .gf-title{ - white-space: normal !important; -} - -.gfg-entry{ - height:9.5em !important; - /* border: 1px solid grey; - border-radius: 8px 8px 8px 8px; - margin:2px;*/ -} - -.gfg-root, .gfg-entry, .gf-result, .gf-snippet{ - background-color: transparent !important; -} - -.gfg-root a:hover, .gfg-subtitle:hover { - text-decoration: none; -} - -.gfg-listentry{ - height: auto; - padding-top:4px; - padding-bottom: 4px; - border-bottom-style: dotted; - border-bottom-width: 1px; -} - -.gfg-listentry-odd { - background-color: transparent !important; -} - -.gf-author, .gf-relativePublishedDate, .gf-spacer{ - display:none !important; -} - -.gfg-horizontal-root .gfg-entry .gf-result .gf-snippet { - display: block; - clear:both; -} - -.gfg-branding{ - display:none; -} - -.gfg-horizontal-root{ - height: auto; - border:none; -} - -.gfg-horizontal-container{ - display:inline; -} \ No newline at end of file