diff options
-rw-r--r-- | 3rdparty/SimplePie/library/SimplePie/IRI.php | 42 | ||||
-rw-r--r-- | ajax/createfeed.php | 2 | ||||
-rw-r--r-- | ajax/deletefeed.php | 2 | ||||
-rw-r--r-- | ajax/deletefolder.php | 2 | ||||
-rw-r--r-- | ajax/loadfeed.php | 2 | ||||
-rw-r--r-- | appinfo/database.xml | 411 | ||||
-rw-r--r-- | appinfo/version | 2 | ||||
-rw-r--r-- | css/news.css | 16 | ||||
-rw-r--r-- | img/opml-icon-16x16.png | bin | 0 -> 462 bytes | |||
-rw-r--r-- | img/opml-icon.svg | 293 | ||||
-rw-r--r-- | js/news.js | 3 | ||||
-rw-r--r-- | lib/feed.php | 2 | ||||
-rw-r--r-- | lib/feedmapper.php | 55 | ||||
-rw-r--r-- | lib/foldermapper.php | 10 | ||||
-rw-r--r-- | lib/item.php | 9 | ||||
-rw-r--r-- | lib/itemmapper.php | 27 | ||||
-rw-r--r-- | templates/part.items.php | 2 | ||||
-rw-r--r-- | templates/part.nofeeds.php | 4 |
18 files changed, 613 insertions, 271 deletions
diff --git a/3rdparty/SimplePie/library/SimplePie/IRI.php b/3rdparty/SimplePie/library/SimplePie/IRI.php index 012866da6..ffe3c9d91 100644 --- a/3rdparty/SimplePie/library/SimplePie/IRI.php +++ b/3rdparty/SimplePie/library/SimplePie/IRI.php @@ -768,27 +768,31 @@ class SimplePie_IRI */ public function is_valid() { - $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null; - if ($this->ipath !== '' && - ( - $isauthority && ( - $this->ipath[0] !== '/' || - substr($this->ipath, 0, 2) === '//' - ) || - ( - $this->scheme === null && - !$isauthority && - strpos($this->ipath, ':') !== false && - (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/')) - ) - ) - ) - { - return false; - } - return true; } +// NOTE: this is temporary commented out to bypass issue #214: https://github.com/simplepie/simplepie/issues/214 +// +// $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null; +// if ($this->ipath !== '' && +// ( +// $isauthority && ( +// $this->ipath[0] !== '/' || +// substr($this->ipath, 0, 2) === '//' +// ) || +// ( +// $this->scheme === null && +// !$isauthority && +// strpos($this->ipath, ':') !== false && +// (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/')) +// ) +// ) +// ) +// { +// return false; +// } +// +// return true; +// } /** * Set the entire IRI. Returns true on success, false on failure (if there diff --git a/ajax/createfeed.php b/ajax/createfeed.php index 5b4b31ffe..c0ad68815 100644 --- a/ajax/createfeed.php +++ b/ajax/createfeed.php @@ -60,7 +60,7 @@ if($feed === null || !$feedid) { // FIXME: assign counter $tmpl_listfeed = new OCP\Template("news", "part.listfeed"); -$tmpl_listfeed->assign('child', $feed); +$tmpl_listfeed->assign('feed', $feed); $listfeed = $tmpl_listfeed->fetchPage(); $tmpl_newfeed = new OCP\Template("news", "part.items.new"); diff --git a/ajax/deletefeed.php b/ajax/deletefeed.php index c9c9056ca..d9ef6f85d 100644 --- a/ajax/deletefeed.php +++ b/ajax/deletefeed.php @@ -19,7 +19,7 @@ $userid = OCP\USER::getUser(); $feedid = $_POST['feedid']; -$feedmapper = new OCA\News\FeedMapper(); +$feedmapper = new OCA\News\FeedMapper($userid); $success = $feedmapper->deleteById($feedid); $l = OC_L10N::get('news'); diff --git a/ajax/deletefolder.php b/ajax/deletefolder.php index a6950ed40..daf9a8397 100644 --- a/ajax/deletefolder.php +++ b/ajax/deletefolder.php @@ -21,7 +21,7 @@ $folderid = trim($_POST['folderid']); $shownfeedid = trim($_POST['shownfeedid']); $part_items = false; -$foldermapper = new OCA\News\FolderMapper(); +$foldermapper = new OCA\News\FolderMapper($userid); if(!$foldermapper->deleteById($folderid)) { OCP\JSON::error(array('data' => array('message' => $l->t('Error removing folder.')))); diff --git a/ajax/loadfeed.php b/ajax/loadfeed.php index 020f7a706..d87c71328 100644 --- a/ajax/loadfeed.php +++ b/ajax/loadfeed.php @@ -31,5 +31,5 @@ $feedTitle = $feed->getTitle(); OCP\JSON::success(array('data' => array( 'message' => $l->t('Feed loaded!'), 'feedTitle' => $feedTitle, - 'feedItems' => $feedItems ))); + 'feedItems' => $feedItems ))); diff --git a/appinfo/database.xml b/appinfo/database.xml index 1fbfe29a4..1d5cef5b9 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -1,199 +1,216 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <database> - <name>*dbname*</name> - <create>true</create> - <overwrite>false</overwrite> - <charset>latin1</charset> - <table> - <name>*dbprefix*news_folders</name> - <declaration> - <field> - <name>id</name> - <type>integer</type> - <default>0</default> - <notnull>true</notnull> - <autoincrement>1</autoincrement> - <length>4</length> - </field> - <field> - <name>parent_id</name> - <type>integer</type> - <notnull>false</notnull> - <length>4</length> - </field> - <field> - <name>name</name> - <type>text</type> - <notnull>true</notnull> - <length>100</length> - </field> - <field> - <name>user_id</name> - <type>text</type> - <default></default> - <notnull>true</notnull> - <length>64</length> - </field> - - <index> - <name>folder_id</name> - <unique>true</unique> - <field> - <name>id</name> - <sorting>descending</sorting> - </field> - </index> - <index> - <name>user_id</name> - <field> - <name>user_id</name> - </field> - </index> - </declaration> - </table> - - <table> - <name>*dbprefix*news_feeds</name> - <declaration> - <field> - <name>id</name> - <type>integer</type> - <default>0</default> - <notnull>true</notnull> - <autoincrement>1</autoincrement> - <length>4</length> - </field> - <field> - <name>user_id</name> - <type>text</type> - <default></default> - <notnull>true</notnull> - <length>64</length> - </field> - <field> - <name>url</name> - <type>text</type> - <notnull>true</notnull> - <length>100</length> - </field> - <field> - <name>title</name> - <type>text</type> - <notnull>true</notnull> - <length>100</length> - </field> - <field> - <name>favicon_link</name> - <type>text</type> - <notnull>false</notnull> - <length>100</length> - </field> - <field> - <name>added</name> - <type>integer</type> - <default></default> - <notnull>false</notnull> - <unsigned>true</unsigned> - <length>4</length> - </field> - <field> - <name>lastmodified</name> - <type>integer</type> - <default></default> - <notnull>false</notnull> - <unsigned>true</unsigned> - <length>4</length> - </field> - <field> - <name>folder_id</name> - <type>integer</type> - <notnull>true</notnull> - <length>4</length> - </field> - - <index> - <name>feed_id</name> - <unique>true</unique> - <primary>true</primary> - <field> - <name>id</name> - <sorting>descending</sorting> - </field> - </index> - - <index> - <name>feed_url</name> - <unique>true</unique> - <primary>false</primary> - <field> - <name>url</name> - </field> - </index> - </declaration> - </table> - - <table> - <name>*dbprefix*news_items</name> - <declaration> - <field> - <name>id</name> - <type>integer</type> - <default>0</default> - <notnull>true</notnull> - <autoincrement>1</autoincrement> - <length>4</length> - </field> - <field> - <name>guid</name> - <type>text</type> - <notnull>true</notnull> - <length>300</length> - </field> - <field> - <name>url</name> - <type>text</type> - <length>300</length> - </field> - <field> - <name>title</name> - <type>text</type> - <length>300</length> - </field> - <field> - <name>feed_id</name> - <type>integer</type> - <notnull>true</notnull> - <length>4</length> - </field> - <field> - <name>body</name> - <type>text</type> - <length>4000</length> - </field> - <field> - <name>status</name> - <type>integer</type> - <length>1</length> - </field> - - <index> - <name>item_id</name> - <unique>true</unique> - <field> - <name>id</name> - <sorting>descending</sorting> - </field> - </index> - <index> - <name>item_guid</name> - <unique>true</unique> - <field> - <name>guid</name> - </field> - <field> - <name>feed_id</name> - </field> - </index> - </declaration> - </table> + <name>*dbname*</name> + <create>true</create> + <overwrite>false</overwrite> + <charset>latin1</charset> + <table> + <name>*dbprefix*news_folders</name> + <declaration> + <field> + <name>id</name> + <type>integer</type> + <notnull>true</notnull> + <autoincrement>1</autoincrement> + </field> + <field> + <name>parent_id</name> + <type>integer</type> + <notnull>false</notnull> + </field> + <field> + <name>name</name> + <type>text</type> + <length>100</length> + <notnull>true</notnull> + </field> + <field> + <name>user_id</name> + <type>text</type> + <default></default> + <notnull>true</notnull> + <length>64</length> + </field> + + <index> + <name>PRIMARY</name> + <unique>true</unique> + <primary>true</primary> + <field> + <name>id</name> + <sorting>descending</sorting> + </field> + </index> + + <index> + <name>user_id</name> + <field> + <name>user_id</name> + </field> + </index> + </declaration> + </table> + + <table> + <name>*dbprefix*news_feeds</name> + <declaration> + <field> + <name>id</name> + <type>integer</type> + <notnull>true</notnull> + <autoincrement>1</autoincrement> + </field> + <field> + <name>user_id</name> + <type>text</type> + <default></default> + <notnull>true</notnull> + <length>64</length> + </field> + <field> + <name>url_hash</name> + <type>text</type> + <length>32</length> + <notnull>true</notnull> + </field> + <field> + <name>url</name> + <type>clob</type> + <notnull>true</notnull> + </field> + <field> + <name>title</name> + <type>clob</type> + <notnull>true</notnull> + </field> + <field> + <name>favicon_link</name> + <type>clob</type> + <notnull>false</notnull> + </field> + <field> + <name>added</name> + <type>integer</type> + <default></default> + <notnull>false</notnull> + <unsigned>true</unsigned> + </field> + <field> + <name>lastmodified</name> + <type>integer</type> + <default></default> + <notnull>false</notnull> + <unsigned>true</unsigned> + </field> + <field> + <name>folder_id</name> + <type>integer</type> + <notnull>true</notnull> + </field> + + <index> + <name>PRIMARY</name> + <unique>true</unique> + <primary>true</primary> + <field> + <name>id</name> + <sorting>descending</sorting> + </field> + </index> + + <index> + <name>feed_url</name> + <unique>true</unique> + <primary>false</primary> + <field> + <name>url_hash</name> + </field> + </index> + </declaration> + </table> + + <table> + <name>*dbprefix*news_items</name> + <declaration> + <field> + <name>id</name> + <type>integer</type> + <notnull>true</notnull> + <autoincrement>1</autoincrement> + </field> + <field> + <name>guid_hash</name> + <type>text</type> + <notnull>true</notnull> + <length>32</length> + </field> + <field> + <name>guid</name> + <type>clob</type> + <notnull>true</notnull> + </field> + <field> + <name>url</name> + <type>clob</type> + </field> + <field> + <name>title</name> + <type>clob</type> + </field> + <field> + <name>author</name> + <type>clob</type> + <notnull>false</notnull> + </field> + <field> + <name>date</name> + <type>integer</type> + <default></default> + <notnull>false</notnull> + <unsigned>true</unsigned> + </field> + <field> + <name>body</name> + <type>clob</type> + <notnull>false</notnull> + </field> + <field> + <name>feed_id</name> + <type>integer</type> + <notnull>true</notnull> + </field> + <field> + <name>status</name> + <type>integer</type> + </field> + + + <index> + <name>PRIMARY</name> + <unique>true</unique> + <primary>true</primary> + <field> + <name>id</name> + <sorting>descending</sorting> + </field> + </index> + + <index> + <name>feed_id</name> + <field> + <name>feed_id</name> + </field> + </index> + + <index> + <name>item_guid</name> + <unique>true</unique> + <field> + <name>guid_hash</name> + </field> + <field> + <name>feed_id</name> + </field> + </index> + </declaration> + </table> </database> diff --git a/appinfo/version b/appinfo/version index 1f2be2a26..295ec490e 100644 --- a/appinfo/version +++ b/appinfo/version @@ -1 +1 @@ -6.3
\ No newline at end of file +6.8.2
\ No newline at end of file diff --git a/css/news.css b/css/news.css index 6c9b03bb5..d5262d06c 100644 --- a/css/news.css +++ b/css/news.css @@ -219,7 +219,9 @@ div.feed_controls { margin: 0 0.3em 0 0; } -/* feed controls */ + + +/* feed settings */ #addfolder { background: url('%webroot%/core/img/places/folder.svg') no-repeat left center; padding-left: 20px !important; @@ -230,6 +232,16 @@ div.feed_controls { padding-left: 20px !important; } +#addfeedbtn { + background: url('%appswebroot%/news/img/rss.svg') no-repeat left; + padding-left: 20px; +} + +#importopmlbtn { + background: url('%appswebroot%/news/img/opml-icon.svg') no-repeat left center; + padding-left: 20px; +} + #feed_settings { padding: 0; bottom:0px; @@ -432,7 +444,7 @@ div.dialog { } #dropdownBtn { - width: 20em; + width: 12.5em; padding-left: 0; padding-right:20px; background: url('%webroot%/core/img/actions/triangle-s.svg') no-repeat right center; diff --git a/img/opml-icon-16x16.png b/img/opml-icon-16x16.png Binary files differnew file mode 100644 index 000000000..a6b2b5021 --- /dev/null +++ b/img/opml-icon-16x16.png diff --git a/img/opml-icon.svg b/img/opml-icon.svg new file mode 100644 index 000000000..ce386d2ef --- /dev/null +++ b/img/opml-icon.svg @@ -0,0 +1,293 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:ns0="http://ns.adobe.com/SaveForWeb/1.0/" + xmlns:ns="http://ns.adobe.com/Variables/1.0/" + xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" + xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + width="16" + height="16" + id="svg2" + xml:space="preserve" + style="overflow:visible"><defs + id="defs53"> + <foreignObject + requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" + x="0" + y="0" + width="1" + height="1" + id="foreignObject8"> + <i:pgfRef + xlink:href="#adobe_illustrator_pgf"> + </i:pgfRef> + </foreignObject> + + <linearGradient + x1="116.0049" + y1="116.0059" + x2="11.9932" + y2="11.9942" + id="linearGradient3055" + xlink:href="#gradient_1_" + gradientUnits="userSpaceOnUse" /><linearGradient + x1="149.5" + y1="186.5" + x2="149.5" + y2="186.5" + id="linearGradient3057" + xlink:href="#XMLID_1_" + gradientUnits="userSpaceOnUse" /> + + <linearGradient + x1="116.0049" + y1="116.0059" + x2="11.9932" + y2="11.9942" + id="linearGradient3082" + xlink:href="#gradient_1_" + gradientUnits="userSpaceOnUse" /><linearGradient + x1="149.5" + y1="186.5" + x2="149.5" + y2="186.5" + id="linearGradient3084" + xlink:href="#XMLID_1_" + gradientUnits="userSpaceOnUse" /> + + + <linearGradient + x1="116.0049" + y1="116.0059" + x2="11.9932" + y2="11.9942" + id="gradient_1_" + gradientUnits="userSpaceOnUse"> + <stop + id="stop16" + style="stop-color:#264fa1;stop-opacity:1" + offset="0" /> + <stop + id="stop18" + style="stop-color:#2658a1;stop-opacity:1" + offset="0.1134" /> + <stop + id="stop20" + style="stop-color:#2570a1;stop-opacity:1" + offset="0.29840001" /> + <stop + id="stop22" + style="stop-color:#2492a1;stop-opacity:1" + offset="0.5" /> + <stop + id="stop24" + style="stop-color:#2489a0;stop-opacity:1" + offset="0.61470002" /> + <stop + id="stop26" + style="stop-color:#26719f;stop-opacity:1" + offset="0.8017" /> + <stop + id="stop28" + style="stop-color:#27509d;stop-opacity:1" + offset="1" /> + <a:midPointStop + offset="0" + style="stop-color:#264FA1" /> + <a:midPointStop + offset="0.6" + style="stop-color:#264FA1" /> + <a:midPointStop + offset="0.5" + style="stop-color:#2492A1" /> + <a:midPointStop + offset="0.6" + style="stop-color:#2492A1" /> + <a:midPointStop + offset="1" + style="stop-color:#27509D" /> + </linearGradient> + + + + <linearGradient + x1="149.5" + y1="186.5" + x2="149.5" + y2="186.5" + id="XMLID_1_" + gradientUnits="userSpaceOnUse"> + <stop + id="stop35" + style="stop-color:#264fa1;stop-opacity:1" + offset="0" /> + <stop + id="stop37" + style="stop-color:#2658a1;stop-opacity:1" + offset="0.1134" /> + <stop + id="stop39" + style="stop-color:#2570a1;stop-opacity:1" + offset="0.29840001" /> + <stop + id="stop41" + style="stop-color:#2492a1;stop-opacity:1" + offset="0.5" /> + <stop + id="stop43" + style="stop-color:#2489a0;stop-opacity:1" + offset="0.61470002" /> + <stop + id="stop45" + style="stop-color:#26719f;stop-opacity:1" + offset="0.8017" /> + <stop + id="stop47" + style="stop-color:#27509d;stop-opacity:1" + offset="1" /> + <a:midPointStop + offset="0" + style="stop-color:#264FA1" /> + <a:midPointStop + offset="0.6" + style="stop-color:#264FA1" /> + <a:midPointStop + offset="0.5" + style="stop-color:#2492A1" /> + <a:midPointStop + offset="0.6" + style="stop-color:#2492A1" /> + <a:midPointStop + offset="1" + style="stop-color:#27509D" /> + </linearGradient> + + <linearGradient + x1="149.5" + y1="186.5" + x2="149.5" + y2="186.5" + id="linearGradient3103" + xlink:href="#XMLID_1_" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-56,-56)" /><linearGradient + x1="116.0049" + y1="116.0059" + x2="11.9932" + y2="11.9942" + id="linearGradient3108" + xlink:href="#gradient_1_" + gradientUnits="userSpaceOnUse" + gradientTransform="scale(0.125,0.125)" /><filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter3010"><feColorMatrix + values="0" + type="saturate" + id="feColorMatrix3012" /></filter><filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter3014"><feColorMatrix + values="0" + type="saturate" + id="feColorMatrix3016" /></filter><filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter3018"><feColorMatrix + values="0" + type="saturate" + id="feColorMatrix3020" /></filter><filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter3022"><feColorMatrix + values="0" + type="saturate" + id="feColorMatrix3024" /></filter><filter + x="0" + y="0" + width="1" + height="1" + color-interpolation-filters="sRGB" + id="filter3026"><feColorMatrix + values="0" + type="saturate" + id="feColorMatrix3028" /></filter><linearGradient + x1="116.0049" + y1="116.0059" + x2="11.9932" + y2="11.9942" + id="linearGradient3023" + xlink:href="#gradient_1_" + gradientUnits="userSpaceOnUse" + gradientTransform="scale(0.125,0.125)" /></defs> + <metadata + id="metadata4"> + <ns:variableSets> + <ns:variableSet + locked="none" + varSetName="binding1"> + <ns:variables /> + <ns:sampleDataSets /> + </ns:variableSet> + </ns:variableSets> + <ns0:sfw> + <ns0:slices /> + <ns0:sliceSourceBounds + bottomLeftOrigin="true" + height="16383" + width="16383" + x="-8127" + y="-8256" /> + </ns0:sfw> + <rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title><cc:license + rdf:resource="http://creativecommons.org/licenses/by-nc-sa/3.0/" /></cc:Work><cc:License + rdf:about="http://creativecommons.org/licenses/by-nc-sa/3.0/"><cc:permits + rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits + rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:requires + rdf:resource="http://creativecommons.org/ns#Notice" /><cc:requires + rdf:resource="http://creativecommons.org/ns#Attribution" /><cc:prohibits + rdf:resource="http://creativecommons.org/ns#CommercialUse" /><cc:permits + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><cc:requires + rdf:resource="http://creativecommons.org/ns#ShareAlike" /></cc:License></rdf:RDF></metadata> + <path + d="M 16,12.588125 C 16.053976,14.480741 14.291982,16.142358 12.408106,16 9.3504986,15.997068 6.2927429,16.005883 3.2352293,15.995559 1.3881413,15.950375 -0.15322091,14.195697 0,12.361851 0.0029306,9.319976 -0.00587967,6.2779529 0.00443792,3.2361715 0.04925356,1.3892432 1.8028964,-0.15338155 3.6370242,0 6.6795391,0.00293039 9.7222025,-0.00587987 12.764624,0.00443901 14.61173,0.04954095 16.153311,1.8040879 16,3.6380242 c 0,2.9833669 0,5.9667339 0,8.9501008 z" |