From c73fc89f2b550de7abe8fa8d68e8673962cfd62e Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Fri, 8 Dec 2017 15:30:58 +0100 Subject: [PATCH] Remove deprecated google api, use zend feed reader see #1988 --- plugin/rss/README.md | 4 +- plugin/rss/index.php | 61 +++++---------- plugin/rss/lib/rss_plugin.class.php | 23 +++--- plugin/rss/plugin.php | 11 --- plugin/rss/resources/arrow-bullet.png | Bin 1079 -> 0 bytes plugin/rss/resources/color.css | 41 ----------- plugin/rss/resources/rss.css | 102 -------------------------- 7 files changed, 32 insertions(+), 210 deletions(-) delete mode 100755 plugin/rss/resources/arrow-bullet.png delete mode 100755 plugin/rss/resources/color.css delete mode 100755 plugin/rss/resources/rss.css 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 bbb5d27e5ae06d3f96aa346f6bfc2298c3906d8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1079 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$3?vg*uel1O7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;`(;!skh5czFh_+PrqGx=H03@Z&#gtzva@0t(QM;yZmAMm5)2G zeA;>S)1K=e_uTln|K_b*w{G9QeFq5c-hFWU-orchJ|DXE`S9&W_Z|SjLm+tc@X@13 zzg~X&_44!Y*I)j;{`}|N*N-1Re){z3+qZAuzkmPp;rpLYK=k9!7a;oi_v^2}-+uo6 z_Up%wAAf)R`upSezh8fV;Q#-BKnQg9C>RX^+J%7At5z?d>6`@~k;M!Q+(IDCcb?xW RwLmv9c)I$ztaD0e0svcY_pAT_ 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