offline: disable using init-param

This commit is contained in:
Andrew Dolgov 2009-02-10 11:31:53 +03:00
parent 44d148ccc6
commit 59b223d74d
3 changed files with 18 additions and 5 deletions

View File

@ -3013,6 +3013,8 @@
print "<param key=\"sync_counters\" value=\"1\"/>"; print "<param key=\"sync_counters\" value=\"1\"/>";
print "<param key=\"offline_enabled\" value=\"0\"/>";
$result = db_query($link, "SELECT COUNT(*) AS cf FROM $result = db_query($link, "SELECT COUNT(*) AS cf FROM
ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]); ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);

View File

@ -751,6 +751,7 @@ function update_offline_data(stage) {
if (!stage) stage = 0; if (!stage) stage = 0;
if (offline_mode) return; if (offline_mode) return;
if (getInitParam("offline_enabled") != "1") return;
debug("update_offline_data: stage " + stage); 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() { function init_gears() {
try { try {
@ -1019,10 +1034,6 @@ function init_gears() {
"DELETE FROM article_labels WHERE id = OLD.id; "+ "DELETE FROM article_labels WHERE id = OLD.id; "+
"END; "); "END; ");
init_local_sync_data();
Element.show("restartOfflinePic");
} }
cache_expire(); cache_expire();

View File

@ -553,7 +553,7 @@ function init_second_stage() {
resize_headlines(); resize_headlines();
window.setTimeout("update_offline_data(0)", 100); enable_offline_reading();
} catch (e) { } catch (e) {
exception_error("init_second_stage", e); exception_error("init_second_stage", e);