From fcf70c510686a0b289f8f5e8713f959d95ae743b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Nov 2010 21:49:00 +0300 Subject: dijit.tree feedlist improvements --- functions.php | 211 ++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 130 insertions(+), 81 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 17bb9774f..bf9c72641 100644 --- a/functions.php +++ b/functions.php @@ -4117,25 +4117,119 @@ # print "
"; - $page_prev_link = "javascript:viewFeedGoPage(-1)"; - $page_next_link = "javascript:viewFeedGoPage(1)"; - $page_first_link = "javascript:viewFeedGoPage(0)"; + $page_prev_link = "viewFeedGoPage(-1)"; + $page_next_link = "viewFeedGoPage(1)"; + $page_first_link = "viewFeedGoPage(0)"; - $catchup_page_link = "javascript:catchupPage()"; - $catchup_feed_link = "javascript:catchupCurrentFeed()"; - $catchup_sel_link = "javascript:catchupSelection()"; + $catchup_page_link = "catchupPage()"; + $catchup_feed_link = "catchupCurrentFeed()"; + $catchup_sel_link = "catchupSelection()"; - $archive_sel_link = "javascript:archiveSelection()"; - $delete_sel_link = "javascript:deleteSelection()"; + $archive_sel_link = "archiveSelection()"; + $delete_sel_link = "deleteSelection()"; - $sel_all_link = "javascript:selectArticles('all')"; - $sel_unread_link = "javascript:selectArticles('unread')"; - $sel_none_link = "javascript:selectArticles('none')"; - $sel_inv_link = "javascript:selectArticles('invert')"; + $sel_all_link = "selectArticles('all')"; + $sel_unread_link = "selectArticles('unread')"; + $sel_none_link = "selectArticles('none')"; + $sel_inv_link = "selectArticles('invert')"; - $tog_unread_link = "javascript:selectionToggleUnread()"; - $tog_marked_link = "javascript:selectionToggleMarked()"; - $tog_published_link = "javascript:selectionTogglePublished()"; + $tog_unread_link = "selectionToggleUnread()"; + $tog_marked_link = "selectionToggleMarked()"; + $tog_published_link = "selectionTogglePublished()"; + + print "
"; + + print __('Select:')." + ".__('All').", + ".__('Unread').", + ".__('Invert').", + ".__('None').""; + + print " "; + +/* print "". + __("Actions...") . "   + "; + + print "
    "; + + print "
  • ".__('Selection toggle:')."
  • +
  •   ".__('Unread')."
  • +
  •   ".__('Starred')."
  • +
  •   ".__('Published')."
  • +
  • ".__('Selection:')."
  • +
  •   ".__('Mark as read')."
  • "; + +// print "
  •   ".__('Entire feed'). +// "
  • "; + + if ($feed_id != "0") { + print "
  •   ".__('Archive')."
  • "; + } else { + print "
  •   ".__('Move back')."
  • "; + print "
  •   ".__('Delete')."
  • "; + + } + + print "
  •   ". + __('Forward by email')."
  • "; + + //print "
  • --------
  • "; + print "
  • ".__('Assign label:')."
  • "; + + print_labels_headlines_dropdown($link, $feed_id); + + print "
  • ".__('Feed:')."
  • "; + print "
  •   ".__('View as RSS')."
  • "; + + print "
"; */ + + print ""; + + print "
"; print "
"; @@ -4197,56 +4291,6 @@ print "
"; - print __('Select:')." - ".__('All').", - ".__('Unread').", - ".__('Invert').", - ".__('None').""; - - print "  "; - - print "". - __("Actions...") . "   - "; - - print ""; - -# print "
"; } function printCategoryHeader($link, $cat_id, $hidden = false, $can_browse = true, @@ -4437,8 +4481,10 @@ $cat = feedlist_init_cat($link, $cat_id, $collapsed); } + $updated = make_local_datetime($link, $line["updated_noms"], false); + array_push($cat['items'], feedlist_init_feed($link, $feed_id, - $feed, $unread)); + $feed, $unread, $line['last_error'], $updated)); } if (!$enable_cats) { @@ -6294,8 +6340,7 @@ } function print_labels_headlines_dropdown($link, $feed_id) { - print "
  • -   ".__("Create label...")."
  • "; + print ""; $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption"); @@ -6307,13 +6352,13 @@ $id = $line["id"]; if ($feed_id < -10 && $feed_id == -11-$label_id) { - print "
  • -   $label_caption ".__('(remove)')."
  • "; + print ""; } else { - print "
  • -   $label_caption
  • "; + print ""; } } } @@ -6397,10 +6442,12 @@ return $str; } - function toggle_collapse_cat($link, $cat_id) { + function toggle_collapse_cat($link, $cat_id, $mode) { if ($cat_id > 0) { + $mode = bool_to_sql_bool($mode); + db_query($link, "UPDATE ttrss_feed_categories SET - collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " . + collapsed = $mode WHERE id = '$cat_id' AND owner_uid = " . $_SESSION["uid"]); } else { $pref_name = ''; @@ -6418,10 +6465,10 @@ } if ($pref_name) { - if (get_pref($link, $pref_name)) { - set_pref($link, $pref_name, 'false'); - } else { + if ($mode) { set_pref($link, $pref_name, 'true'); + } else { + set_pref($link, $pref_name, 'false'); } } } @@ -7145,7 +7192,7 @@ $cat_unread = getCategoryUnread($link, $cat_id); } - $obj['id'] = 'CAT:' . $cat_id; + $obj['id'] = 'CAT:' . ((int)$cat_id); $obj['items'] = array(); $obj['name'] = getCategoryTitle($link, $cat_id); $obj['type'] = 'feed'; @@ -7155,7 +7202,7 @@ return $obj; } - function feedlist_init_feed($link, $feed_id, $title = false, $unread = false) { + function feedlist_init_feed($link, $feed_id, $title = false, $unread = false, $error = '', $updated = '') { $obj = array(); if (!$title) @@ -7168,6 +7215,8 @@ $obj['name'] = $title; $obj['unread'] = (int) $unread; $obj['type'] = 'feed'; + $obj['error'] = $error; + $obj['updated'] = $updated; return $obj; } -- cgit v1.2.3-54-g00ecf