@$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"] == "true";\r
\r
if (is_numeric($feed)) $feed = (int) $feed;\r
\r
set_pref($this->link, "_DEFAULT_VIEW_MODE", $view_mode);\r
set_pref($this->link, "_DEFAULT_VIEW_LIMIT", $limit);\r
set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by);\r
- set_pref($this->link, "_DEFAULT_INCLUDE_CHILDREN", $include_children);\r
\r
if (!$cat_view && is_numeric($feed) && $feed > 0) {\r
db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW()\r
\r
$ret = $this->format_headlines_list($feed, $method,\r
$view_mode, $limit, $cat_view, $next_unread_feed, $offset,\r
- $vgroup_last_feed, $override_order, $include_children);\r
+ $vgroup_last_feed, $override_order, true);\r
\r
$topmost_article_ids = $ret[0];\r
$headlines_count = $ret[1];\r
}
$cv = array("id" => $line["cat_id"], "kind" => "cat",
- "child_counter" => $child_counter,
- "counter" => $line["unread"]);
+ "counter" => $line["unread"] + $child_counter);
array_push($ret_arr, $cv);
}
$params["icons_url"] = ICONS_URL;
$params["cookie_lifetime"] = SESSION_COOKIE_LIFETIME;
- $params["default_include_children"] = get_pref($link, "_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");
<option value="score"><?php echo __('Score') ?></option>
</select>
- <button dojoType="dijit.form.ToggleButton"
- id="include_children"
- onchange="viewCurrentFeed()">
- <?php echo __('With subcategories') ?></button>
-
<button dojoType="dijit.form.Button" name="update"
onclick="scheduleFeedUpdate()">
<?php echo __('Update') ?></button>
dojo.place(span, tnode.iconNode, 'replace');
}
- if (id.match("CAT:") && bare_id > 0) {
- param = dojo.doc.createElement('span');
- param.className = 'feedParam';
- param.innerHTML = "";
- dojo.place(param, tnode.labelNode, 'after');
- tnode._paramNode = param;
- }
-
if (id.match("FEED:")) {
var menu = new dijit.Menu();
menu.row_id = bare_id;
if (node) {
var check_unread = tree.model.getFeedUnread(bare_id, true);
- var check_param = tree.model.getFeedValue(bare_id, true, "child_unread");
- if (hide && cat_unread == 0 && check_unread == 0 && check_param == 0) {
+ if (hide && cat_unread == 0 && check_unread == 0) {
Effect.Fade(node[0].rowNode, {duration : 0.3,
queue: { position: 'end', scope: 'FFADE-' + id, limit: 1 }});
} else {
return false;
}
},
- setCatParam: function(cat, value) {
- var treeNode = this._itemNodesMap['CAT:' + cat];
-
- if (treeNode && treeNode[0] && treeNode[0]._paramNode) {
- if (value > 0)
- treeNode[0]._paramNode.innerHTML = '+' + value;
- else
- treeNode[0]._paramNode.innerHTML = "";
- }
- this.model.setFeedValue(cat, true, 'child_unread', value);
- },
});
}
query += "&cat=" + is_cat;
- query += "&include_children=" + dijit.byId("include_children").attr("checked");
console.log(query);
var error = elems[l].error;
var has_img = elems[l].has_img;
var updated = elems[l].updated;
- var child_unread = parseInt(elems[l].child_counter);
if (id == "global-unread") {
global_unread = ctr;
}
if (getFeedUnread(id, (kind == "cat")) != ctr ||
- (kind == "cat" && getCatParam(id) != child_unread)) {
+ (kind == "cat")) {
cache_delete("feed:" + id + ":" + (kind == "cat"));
}
setFeedIcon(id, false, 'images/blank_icon.gif');
}
}
- } else {
- setCatParam(id, child_unread);
}
}
}
}
-function setCatParam(cat, value) {
- try {
- var tree = dijit.byId("feedTree");
-
- if (tree && tree.model)
- return tree.setCatParam(cat, value);
-
- } catch (e) {
- //
- }
-}
-
-function getCatParam(cat) {
- try {
- return getFeedValue(cat, true, "child_unread");
- } catch (e) {
- //
- }
-}
-
-
function selectFeed(feed, is_cat) {
try {
var tree = dijit.byId("feedTree");
function decrementFeedCounter(feed, is_cat) {
try {
- // we have subcats, no way to figure out if this article is
- // actually from this category
- if (is_cat && getCatParam(feed) > 0)
- return;
-
var ctr = getFeedUnread(feed, is_cat);
if (ctr > 0) {
}
selectFeed(id, is_cat);
-
- dijit.byId("include_children").attr("disabled", !(is_cat && id > 0));
-
-
} catch (e) {
exception_error("setActiveFeedId", e);
}
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);