error_reporting(DEFAULT_ERROR_LEVEL); */
- define('SCHEMA_VERSION', 14);
+ define('SCHEMA_VERSION', 15);
require_once "sanity_check.php";
require_once "config.php";
if (!$offset) $offset = 0;
+ set_pref($link, "_DEFAULT_VIEW_MODE", $view_mode);
+ set_pref($link, "_DEFAULT_VIEW_LIMIT", $limit);
+
if ($subop == "undefined") $subop = "";
if ($subop == "CatchupSelected") {
toolbar_form.query.value = "";
}
- storeInitParam("toolbar_limit",
- toolbar_form.limit[toolbar_form.limit.selectedIndex].value);
-
- storeInitParam("toolbar_view_mode",
- toolbar_form.view_mode[toolbar_form.view_mode.selectedIndex].value);
-
var query = "backend.php?op=viewfeed&feed=" + feed + "&" +
toolbar_query + "&subop=" + param_escape(subop);
}
function getInitParam(key) {
- var c = getCookie("TTIP:" + key);
- if (c) {
- return c;
- } else {
- return getMainContext().init_params[key];
- }
+ return init_params[key];
}
function storeInitParam(key, value) {
- try {
- init_params[key] = value;
- debug("storeInitParam: " + key + " => " + value +
- " (" + getInitParam("cookie_lifetime") + ")");
- if (getInitParam("cookie_lifetime") > 0) {
- setCookie("TTIP:" + key, value, getInitParam("cookie_lifetime"));
- } else {
- setCookie("TTIP:" + key, value);
- }
- } catch (e) {
- exception_error("storeInitParam", e);
- }
+ debug("<b>storeInitParam is OBSOLETE: " + key + " => " + value + "</b>");
}
-
-/*
-function storeInitParam(key, value, is_client) {
- try {
- if (!is_client) {
- if (getMainContext().init_params[key] != value) {
- debug("storeInitParam: " + key + " => " + value);
- //new Ajax.Request("backend.php?op=rpc&subop=storeParam&key=" +
- // param_escape(key) + "&value=" + param_escape(value));
- var f = getMainContext().document.getElementById("backReqBox");
- f.src = "backend.php?op=rpc&subop=storeParam&key=" +
- param_escape(key) + "&value=" + param_escape(value);
- }
- }
- getMainContext().init_params[key] = value;
- } catch (e) {
- exception_error("storeInitParam", e);
- }
-} */
-
-/*
-function storeInitParams(params, is_client) {
- try {
- var s = "";
-
- for (k in params) {
- if (getMainContext().init_params[k] != params[k]) {
- s += k + "=" + params[k] + ";";
- getMainContext().init_params[k] = params[k];
- }
- }
-
- debug("storeInitParams: " + s);
-
- if (!is_client) {
- new Ajax.Request("backend.php?op=rpc&subop=storeParams&str=" + s);
- }
- } catch (e) {
- exception_error("storeInitParams", e);
- }
-}*/
-
function fatalError(code, message) {
try {
print "<param key=\"cookie_lifetime\" value=\"" . SESSION_COOKIE_LIFETIME . "\"/>";
+ print "<param key=\"default_view_mode\" value=\"" .
+ get_pref($link, "_DEFAULT_VIEW_MODE") . "\"/>";
+
+ print "<param key=\"default_view_limit\" value=\"" .
+ sprintf("%d", get_pref($link, "_DEFAULT_VIEW_LIMIT")) . "\"/>";
+
print "</init-params>";
}
WHERE type_id = ttrss_prefs_types.id AND
section_id = ttrss_prefs_sections.id AND
ttrss_user_prefs.pref_name = ttrss_prefs.pref_name AND
+ short_desc != '' AND
owner_uid = ".$_SESSION["uid"]."
ORDER BY section_id,short_desc");
}
}
- if (active_tab != id) {
- storeInitParam("prefs_active_tab", id);
- }
-
active_tab = id;
} catch (e) {
create table ttrss_version (schema_version int not null) TYPE=InnoDB;
-insert into ttrss_version values (14);
+insert into ttrss_version values (15);
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null) TYPE=InnoDB;
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('CDM_AUTO_CATCHUP', 1, 'false', 'Mark articles as read automatically',2,
'This option enables marking articles as read automatically in combined mode while you scroll article list.');
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
create table ttrss_user_prefs (
owner_uid integer not null,
pref_name varchar(250),
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (14);
+insert into ttrss_version values (15);
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('CDM_AUTO_CATCHUP', 1, 'false', 'Mark articles as read automatically',2,
'This option enables marking articles as read automatically in combined mode while you scroll article list.');
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
create table ttrss_user_prefs (
owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,
--- /dev/null
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
+update ttrss_version set schema_version = 15;
--- /dev/null
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
+update ttrss_version set schema_version = 15;
document.onkeydown = hotkey_handler;
- var tb = parent.document.forms["main_toolbar_form"];
+ var toolbar = document.forms["main_toolbar_form"];
- dropboxSelect(tb.view_mode, getInitParam("toolbar_view_mode"));
- dropboxSelect(tb.limit, getInitParam("toolbar_limit"));
+ dropboxSelect(toolbar.view_mode, getInitParam("default_view_mode"));
+ dropboxSelect(toolbar.limit, getInitParam("default_view_limit"));
daemon_enabled = getInitParam("daemon_enabled") == 1;
daemon_refresh_only = getInitParam("daemon_refresh_only") == 1;
exit;
}
- define('SCHEMA_VERSION', 14);
+ define('SCHEMA_VERSION', 15);
?>