]> git.wh0rd.org Git - tt-rss.git/commitdiff
offline: disable using init-param
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 10 Feb 2009 08:31:53 +0000 (11:31 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 10 Feb 2009 08:31:53 +0000 (11:31 +0300)
functions.php
offline.js
tt-rss.js

index 08e71b9d9de36ce027af729ddafd1ecddb17e948..748cc6156ec35e159421633ce4c7c7aa87c65de3 100644 (file)
 
                print "<param key=\"sync_counters\" value=\"1\"/>";
 
+               print "<param key=\"offline_enabled\" value=\"0\"/>";
+
                $result = db_query($link, "SELECT COUNT(*) AS cf FROM
                        ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
 
index c2171d981e01087685c048243ddffd7451ee10ee..543930d25b4d2086fe468beb0ded169ecc5384ce 100644 (file)
@@ -751,6 +751,7 @@ function update_offline_data(stage) {
 
                if (!stage) stage = 0;
                if (offline_mode) return;
+               if (getInitParam("offline_enabled") != "1") return;
 
                debug("update_offline_data: stage " + stage);
 
@@ -935,6 +936,20 @@ function get_local_feed_unread(id) {
        }
 }
 
+function enable_offline_reading() {
+       try {
+
+               if (getInitParam("offline_enabled") == "1") {
+                       init_local_sync_data();
+                       Element.show("restartOfflinePic");
+                       window.setTimeout("update_offline_data(0)", 100);
+               }
+
+       } catch (e) {
+               exception_error("enable_offline_reading", e);
+       }
+}
+
 function init_gears() {
        try {
 
@@ -1019,10 +1034,6 @@ function init_gears() {
                                "DELETE FROM article_labels WHERE id = OLD.id; "+
                                "END; ");
 
-                       init_local_sync_data();
-
-                       Element.show("restartOfflinePic");
-
                }       
        
                cache_expire();
index 931a5b6116b79800f515761ddfdf2e6813ddfa2c..90ac934d7fffe97cb2f789b4f2443f5747598627 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -553,7 +553,7 @@ function init_second_stage() {
 
                resize_headlines();
 
-               window.setTimeout("update_offline_data(0)", 100);
+               enable_offline_reading();
 
        } catch (e) {
                exception_error("init_second_stage", e);