diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-21 13:50:52 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-21 13:50:52 -0400 |
commit | 5ab51aa17656548a047ebe8d7aee74ce1f89c020 (patch) | |
tree | b32dadcad73840097fb2a2cb1b477a4015665526 | |
parent | 912374165b89b0e6aae71d6fd0930176da259fbf (diff) |
makes previous commit more logical
-rw-r--r-- | lib/utils.php | 7 | ||||
-rw-r--r-- | templates/part.feeds.php | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/utils.php b/lib/utils.php index cddfcaaa3..24dd5493e 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -43,11 +43,12 @@ class OC_News_Utils { $feed = new OC_News_Feed($url, $title, $items); $favicon = $spfeed->get_image_url(); + //check if this file exists and the size with getimagesize() + if ($favicon == null) { - // fallback icon - $favicon = OCP\Util::imagePath('news', 'rss.svg'); - //check if this file exists + //handle favicon detection } + $feed->setFavicon($favicon); return $feed; diff --git a/templates/part.feeds.php b/templates/part.feeds.php index db7852efc..dd6a93c5f 100644 --- a/templates/part.feeds.php +++ b/templates/part.feeds.php @@ -17,6 +17,9 @@ } elseif ($child instanceOf OC_News_Feed) { //onhover $(element).attr('id', 'newID'); $favicon = $child->getFavicon(); + if ($favicon == null) { + $favicon = OCP\Util::imagePath('news', 'rss.svg'); + } echo '<li class="feeds_list" data-id="' . $child->getId() . '"><a href="' . OCP\Util::linkTo('news', 'index.php'). '?feedid=' . $child->getId() . '" style="background: url(' . $favicon . ') left center no-repeat; background-size:16px 16px;">' . $child->getTitle() .'</a>'; countUnreadItems($child->getId()); echo '<button class="svg action" id="feeds_delete" onClick="(News.Feed.delete(' . $child->getId(). '))" title="' . $l->t('Delete feed') . '"></button>'; |