diff options
author | Gregor Tätzner <gregor@freenet.de> | 2012-07-21 16:45:37 +0200 |
---|---|---|
committer | Gregor Tätzner <gregor@freenet.de> | 2012-07-21 16:45:37 +0200 |
commit | 912374165b89b0e6aae71d6fd0930176da259fbf (patch) | |
tree | cc08adfcec594a32912a45c16ea247ada181334e | |
parent | 67ba166c822254a682bfc88546de2a92fd722539 (diff) |
Add feed fallback icon and set a relative width on the feed list items.
-rw-r--r-- | css/news.css | 4 | ||||
-rw-r--r-- | lib/utils.php | 19 |
2 files changed, 12 insertions, 11 deletions
diff --git a/css/news.css b/css/news.css index fca758dc9..9bc7f04c4 100644 --- a/css/news.css +++ b/css/news.css @@ -16,7 +16,7 @@ #addfolder { background: url('%webroot%/core/img/places/folder.svg') no-repeat left center; padding-left: 20px !important; } #addfeed { background: url('%appswebroot%/apps/news/img/rss.svg') no-repeat left center; padding-left: 20px !important; } -#unreaditemcounter { position: relative; background: #5E5E5E; border-radius: 5px; padding: 0 5px; color: white; text-align: center; margin-right: 0.3em; } +#unreaditemcounter { position: relative; background: #5E5E5E; border-radius: 5px; padding: 0 5px; color: white; text-align: center; margin: 0 0.3em 0 0.3em;} ul.controls li { float: left; } @@ -55,7 +55,7 @@ ul#feedfoldermenu { position:fixed; margin-left: 0; bottom: 2.8em; border-left:1 li { padding: 0px !important; } li.menuItem { margin-left:0.7em; margin-right:0.7em; float: none !important; text-align: left; } li.feeds_list { margin-left: 16px !important; text-align: right; border-radius: 5px; padding-left: 5px !important; } -li.feeds_list a { padding: 0 0 0 20px !important; overflow: hidden; text-overflow: ellipsis; text-align: left; width: 13em; } +li.feeds_list a { padding: 0 0 0 20px !important; overflow: hidden; text-overflow: ellipsis; text-align: left; width: 70%; } div.collapsable_container { padding-left: 5px !important; border-radius: 5px; } ul.folders { margin-left: 16px !important; } diff --git a/lib/utils.php b/lib/utils.php index a9f1488b1..cddfcaaa3 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -4,10 +4,10 @@ * * @author Alessandro Cosentino * Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ // load SimplePie library @@ -18,8 +18,8 @@ class OC_News_Utils { /** * @brief Fetch a feed from remote - * @param url remote url of the feed - * @returns + * @param url remote url of the feed + * @returns */ public static function fetch($url){ //TODO: handle the case where fetching of the feed fails @@ -29,7 +29,7 @@ class OC_News_Utils { $spfeed->init(); $spfeed->handle_content_type(); $title = $spfeed->get_title(); - + $spitems = $spfeed->get_items(); $items = array(); foreach($spitems as $spitem) { //FIXME: maybe we can avoid this loop @@ -37,18 +37,19 @@ class OC_News_Utils { $itemTitle = $spitem->get_title(); $itemGUID = $spitem->get_id(); $itemBody = $spitem->get_content(); - $items[] = new OC_News_Item($itemUrl, $itemTitle, $itemGUID, $itemBody); + $items[] = new OC_News_Item($itemUrl, $itemTitle, $itemGUID, $itemBody); } $feed = new OC_News_Feed($url, $title, $items); - + $favicon = $spfeed->get_image_url(); if ($favicon == null) { - $favicon = $url . "favicon.ico"; + // fallback icon + $favicon = OCP\Util::imagePath('news', 'rss.svg'); //check if this file exists } $feed->setFavicon($favicon); - + return $feed; } }
\ No newline at end of file |