]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref_feeds.php
universal image caching and automatic cache directories maintenance
[tt-rss.git] / classes / pref_feeds.php
index eebd25c69a2631cf90d61fb68128f11de38c40f7..5937bfc8adb1a11afd0e240298c5c975a2f39949 100644 (file)
@@ -1,5 +1,12 @@
 <?php
 class Pref_Feeds extends Protected_Handler {
+
+       function csrf_ignore($method) {
+               $csrf_ignored = array("index", "getfeedtree", "add", "editcats", "editfeed");
+
+               return array_search($method, $csrf_ignored) !== false;
+       }
+
        function batch_edit_cbox($elem, $label = false) {
                print "<input type=\"checkbox\" title=\"".__("Check to enable field")."\"
                        onchange=\"dijit.byId('feedEditDlg').toggleField(this, '$elem', '$label')\">";
@@ -441,12 +448,10 @@ class Pref_Feeds extends Protected_Handler {
                        $checked = "";
                }
 
-               if (SIMPLEPIE_CACHE_IMAGES) {
-                       print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"cache_images\"
-                       name=\"cache_images\"
+               print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"cache_images\"
+               name=\"cache_images\"
                        $checked>&nbsp;<label for=\"cache_images\">".
-                       __('Cache images locally (SimplePie only)')."</label>";
-               }
+               __('Cache images locally')."</label>";
 
                $mark_unread_on_update = sql_bool_to_bool(db_fetch_result($result, 0, "mark_unread_on_update"));
 
@@ -648,16 +653,13 @@ class Pref_Feeds extends Protected_Handler {
 
                print "&nbsp;"; $this->batch_edit_cbox("always_display_enclosures", "always_display_enclosures_l");
 
-               if (SIMPLEPIE_CACHE_IMAGES) {
-                       print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"cache_images\"
-                               name=\"cache_images\"
-                               dojoType=\"dijit.form.CheckBox\">&nbsp;<label class='insensitive' id=\"cache_images_l\"
-                               for=\"cache_images\">".
-                       __('Cache images locally')."</label>";
-
+               print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"cache_images\"
+                       name=\"cache_images\"
+                       dojoType=\"dijit.form.CheckBox\">&nbsp;<label class='insensitive' id=\"cache_images_l\"
+                       for=\"cache_images\">".
+               __('Cache images locally')."</label>";
 
-                       print "&nbsp;"; $this->batch_edit_cbox("cache_images", "cache_images_l");
-               }
+               print "&nbsp;"; $this->batch_edit_cbox("cache_images", "cache_images_l");
 
                print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"mark_unread_on_update\"
                        name=\"mark_unread_on_update\"
@@ -734,11 +736,7 @@ class Pref_Feeds extends Protected_Handler {
                        $category_qpart_nocomma = "";
                }
 
-               if (SIMPLEPIE_CACHE_IMAGES) {
-                       $cache_images_qpart = "cache_images = $cache_images,";
-               } else {
-                       $cache_images_qpart = "";
-               }
+               $cache_images_qpart = "cache_images = $cache_images,";
 
                if (!$batch) {
 
@@ -1419,7 +1417,7 @@ class Pref_Feeds extends Protected_Handler {
                                action=\"backend.php\">
                        <input id=\"opml_file\" name=\"opml_file\" type=\"file\">&nbsp;
                        <input type=\"hidden\" name=\"op\" value=\"dlg\">
-                       <input type=\"hidden\" name=\"id\" value=\"importOpml\">
+                       <input type=\"hidden\" name=\"method\" value=\"importOpml\">
                        <button dojoType=\"dijit.form.Button\" onclick=\"return opmlImport();\" type=\"submit\">" .
                        __('Import') . "</button>";