@$offset = db_escape_string($_REQUEST["skip"]);\r
@$vgroup_last_feed = db_escape_string($_REQUEST["vgrlf"]);\r
$order_by = db_escape_string($_REQUEST["order_by"]);\r
- $include_children = $_REQUEST["include_children"] == "on";\r
+ $include_children = $_REQUEST["include_children"] == "true";\r
\r
if (is_numeric($feed)) $feed = (int) $feed;\r
\r
set_pref($this->link, "_DEFAULT_VIEW_LIMIT", $limit);\r
set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by);\r
\r
+ $_SESSION["_DEFAULT_INCLUDE_CHILDREN"] = $include_children;\r
+\r
if (!$cat_view && preg_match("/^[0-9][0-9]*$/", $feed)) {\r
db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW()\r
WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]);\r
$params["icons_url"] = ICONS_URL;
$params["cookie_lifetime"] = SESSION_COOKIE_LIFETIME;
+ $params["default_include_children"] = $_SESSION["_DEFAULT_INCLUDE_CHILDREN"];
$params["default_view_mode"] = get_pref($link, "_DEFAULT_VIEW_MODE");
$params["default_view_limit"] = (int) get_pref($link, "_DEFAULT_VIEW_LIMIT");
$params["default_view_order_by"] = get_pref($link, "_DEFAULT_VIEW_ORDER_BY");
- <input dojoType="dijit.form.CheckBox" type="checkbox"
+ <!-- <input dojoType="dijit.form.CheckBox" type="checkbox"
onchange="viewCurrentFeed()"
name="include_children" id="include_children">
<label id="include_children_label" for="include_children">
- <?php echo __('With subcategories') ?></label>
+ <?php echo __('With subcategories') ?></label> -->
+
+ <button dojoType="dijit.form.ToggleButton" name="include_children"
+ id="include_children"
+ onchange="viewCurrentFeed()">
+ <?php echo __('With subcategories') ?></button>
<button dojoType="dijit.form.Button" name="update"
onclick="scheduleFeedUpdate()">
}
query += "&cat=" + is_cat;
+ query += "&include_children=" + dijit.byId("include_children").attr("checked");
console.log(query);
selectFeed(id, is_cat);
- if (is_cat && id > 0) {
- document.forms["main_toolbar_form"].include_children.disabled = false;
- $("include_children_label").removeClassName("insensitive");
- } else {
- document.forms["main_toolbar_form"].include_children.disabled = true;
- $("include_children_label").addClassName("insensitive");
- }
+ dijit.byId("include_children").attr("disabled", !(is_cat && id > 0));
+
} catch (e) {
exception_error("setActiveFeedId", e);
var treeModel = new fox.FeedStoreModel({
store: store,
query: {
- "type": init_params['enable_feed_cats'] == 1 ? "category" : "feed"
+ "type": getInitParam('enable_feed_cats') == 1 ? "category" : "feed"
},
rootId: "root",
rootLabel: "Feeds",
dijit.getEnclosingWidget(toolbar.order_by).attr('value',
getInitParam("default_view_order_by"));
+
+ if (getInitParam("enable_feed_cats") == 0)
+ Element.hide(dijit.byId("include_children").domNode);
+
+ dijit.byId("include_children").attr("checked",
+ getInitParam("default_include_children"));
+
feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
loading_set_progress(30);