feeds.php 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. <?php
  2. require_once "colors.php";
  3. class Feeds extends Handler_Protected {
  4. function csrf_ignore($method) {
  5. $csrf_ignored = array("index", "feedbrowser", "quickaddfeed", "search");
  6. return array_search($method, $csrf_ignored) !== false;
  7. }
  8. private function format_headline_subtoolbar($feed_site_url, $feed_title,
  9. $feed_id, $is_cat, $search,
  10. $search_mode, $view_mode, $error) {
  11. $page_prev_link = "viewFeedGoPage(-1)";
  12. $page_next_link = "viewFeedGoPage(1)";
  13. $page_first_link = "viewFeedGoPage(0)";
  14. $catchup_page_link = "catchupPage()";
  15. $catchup_feed_link = "catchupCurrentFeed()";
  16. $catchup_sel_link = "catchupSelection()";
  17. $archive_sel_link = "archiveSelection()";
  18. $delete_sel_link = "deleteSelection()";
  19. $sel_all_link = "selectArticles('all')";
  20. $sel_unread_link = "selectArticles('unread')";
  21. $sel_none_link = "selectArticles('none')";
  22. $sel_inv_link = "selectArticles('invert')";
  23. $tog_unread_link = "selectionToggleUnread()";
  24. $tog_marked_link = "selectionToggleMarked()";
  25. $tog_published_link = "selectionTogglePublished()";
  26. $set_score_link = "setSelectionScore()";
  27. if ($is_cat) $cat_q = "&is_cat=$is_cat";
  28. if ($search) {
  29. $search_q = "&q=$search&smode=$search_mode";
  30. } else {
  31. $search_q = "";
  32. }
  33. $rss_link = htmlspecialchars(get_self_url_prefix() .
  34. "/public.php?op=rss&id=$feed_id$cat_q$search_q");
  35. // right part
  36. $reply .= "<span class='r'>";
  37. $reply .= "<span id='selected_prompt'></span>";
  38. $reply .= "<span id='feed_title'>";
  39. if ($feed_site_url) {
  40. $target = "target=\"_blank\"";
  41. $reply .= "<a title=\"".__("Visit the website")."\" $target href=\"$feed_site_url\">".
  42. truncate_string($feed_title,30)."</a>";
  43. if ($error) {
  44. $reply .= " (<span class=\"error\" title=\"$error\">Error</span>)";
  45. }
  46. } else {
  47. $reply .= $feed_title;
  48. }
  49. $reply .= "</span>";
  50. $reply .= "
  51. <a href=\"#\"
  52. title=\"".__("View as RSS feed")."\"
  53. onclick=\"displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
  54. <img class=\"noborder\" style=\"vertical-align : middle\" src=\"images/pub_set.svg\"></a>";
  55. $reply .= "</span>";
  56. // left part
  57. $reply .= __('Select:')."
  58. <a href=\"#\" onclick=\"$sel_all_link\">".__('All')."</a>,
  59. <a href=\"#\" onclick=\"$sel_unread_link\">".__('Unread')."</a>,
  60. <a href=\"#\" onclick=\"$sel_inv_link\">".__('Invert')."</a>,
  61. <a href=\"#\" onclick=\"$sel_none_link\">".__('None')."</a></li>";
  62. $reply .= " ";
  63. $reply .= "<select dojoType=\"dijit.form.Select\"
  64. onchange=\"headlineActionsChange(this)\">";
  65. $reply .= "<option value=\"false\">".__('More...')."</option>";
  66. $reply .= "<option value=\"0\" disabled=\"1\">".__('Selection toggle:')."</option>";
  67. $reply .= "<option value=\"$tog_unread_link\">".__('Unread')."</option>
  68. <option value=\"$tog_marked_link\">".__('Starred')."</option>
  69. <option value=\"$tog_published_link\">".__('Published')."</option>";
  70. $reply .= "<option value=\"0\" disabled=\"1\">".__('Selection:')."</option>";
  71. $reply .= "<option value=\"$catchup_sel_link\">".__('Mark as read')."</option>";
  72. $reply .= "<option value=\"$set_score_link\">".__('Set score')."</option>";
  73. if ($feed_id != "0") {
  74. $reply .= "<option value=\"$archive_sel_link\">".__('Archive')."</option>";
  75. } else {
  76. $reply .= "<option value=\"$archive_sel_link\">".__('Move back')."</option>";
  77. $reply .= "<option value=\"$delete_sel_link\">".__('Delete')."</option>";
  78. }
  79. if (PluginHost::getInstance()->get_plugin("mail")) {
  80. $reply .= "<option value=\"emailArticle(false)\">".__('Forward by email').
  81. "</option>";
  82. }
  83. if (PluginHost::getInstance()->get_plugin("mailto")) {
  84. $reply .= "<option value=\"mailtoArticle(false)\">".__('Forward by email').
  85. "</option>";
  86. }
  87. $reply .= "<option value=\"0\" disabled=\"1\">".__('Feed:')."</option>";
  88. //$reply .= "<option value=\"catchupPage()\">".__('Mark as read')."</option>";
  89. $reply .= "<option value=\"displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">".__('View as RSS')."</option>";
  90. $reply .= "</select>";
  91. //$reply .= "</div>";
  92. //$reply .= "</h2";
  93. foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_HEADLINE_TOOLBAR_BUTTON) as $p) {
  94. echo $p->hook_headline_toolbar_button($feed_id, $is_cat);
  95. }
  96. return $reply;
  97. }
  98. private function format_headlines_list($feed, $method, $view_mode, $limit, $cat_view,
  99. $next_unread_feed, $offset, $vgr_last_feed = false,
  100. $override_order = false, $include_children = false) {
  101. if (isset($_REQUEST["DevForceUpdate"]))
  102. header("Content-Type: text/plain");
  103. $disable_cache = false;
  104. $reply = array();
  105. $rgba_cache = array();
  106. $timing_info = microtime(true);
  107. $topmost_article_ids = array();
  108. if (!$offset) $offset = 0;
  109. if ($method == "undefined") $method = "";
  110. $method_split = explode(":", $method);
  111. if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) {
  112. // Update the feed if required with some basic flood control
  113. $result = $this->dbh->query(
  114. "SELECT cache_images,".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
  115. FROM ttrss_feeds WHERE id = '$feed'");
  116. if ($this->dbh->num_rows($result) != 0) {
  117. $last_updated = strtotime($this->dbh->fetch_result($result, 0, "last_updated"));
  118. $cache_images = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "cache_images"));
  119. if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) {
  120. include "rssfuncs.php";
  121. update_rss_feed($feed, true, true);
  122. } else {
  123. $this->dbh->query("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01'
  124. WHERE id = '$feed'");
  125. }
  126. }
  127. }
  128. if ($method_split[0] == "MarkAllReadGR") {
  129. catchup_feed($method_split[1], false);
  130. }
  131. // FIXME: might break tag display?
  132. if (is_numeric($feed) && $feed > 0 && !$cat_view) {
  133. $result = $this->dbh->query(
  134. "SELECT id FROM ttrss_feeds WHERE id = '$feed' LIMIT 1");
  135. if ($this->dbh->num_rows($result) == 0) {
  136. $reply['content'] = "<div align='center'>".__('Feed not found.')."</div>";
  137. }
  138. }
  139. @$search = $this->dbh->escape_string($_REQUEST["query"]);
  140. if ($search) {
  141. $disable_cache = true;
  142. }
  143. @$search_mode = $this->dbh->escape_string($_REQUEST["search_mode"]);
  144. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
  145. // error_log("format_headlines_list: [" . $feed . "] method [" . $method . "]");
  146. if($search_mode == '' && $method != '' ){
  147. $search_mode = $method;
  148. }
  149. // error_log("search_mode: " . $search_mode);
  150. if (!$cat_view && is_numeric($feed) && $feed < PLUGIN_FEED_BASE_INDEX && $feed > LABEL_BASE_INDEX) {
  151. $handler = PluginHost::getInstance()->get_feed_handler(
  152. PluginHost::feed_to_pfeed_id($feed));
  153. // function queryFeedHeadlines($feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false) {
  154. if ($handler) {
  155. $options = array(
  156. "limit" => $limit,
  157. "view_mode" => $view_mode,
  158. "cat_view" => $cat_view,
  159. "search" => $search,
  160. "search_mode" => $search_mode,
  161. "override_order" => $override_order,
  162. "offset" => $offset,
  163. "owner_uid" => $_SESSION["uid"],
  164. "filter" => false,
  165. "since_id" => 0,
  166. "include_children" => $include_children);
  167. $qfh_ret = $handler->get_headlines(PluginHost::feed_to_pfeed_id($feed),
  168. $options);
  169. }
  170. } else {
  171. $qfh_ret = queryFeedHeadlines($feed, $limit, $view_mode, $cat_view,
  172. $search, $search_mode, $override_order, $offset, 0,
  173. false, 0, $include_children);
  174. }
  175. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info);
  176. $result = $qfh_ret[0];
  177. $feed_title = $qfh_ret[1];
  178. $feed_site_url = $qfh_ret[2];
  179. $last_error = $qfh_ret[3];
  180. $vgroup_last_feed = $vgr_last_feed;
  181. $reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
  182. $feed_title,
  183. $feed, $cat_view, $search, $search_mode, $view_mode,
  184. $last_error);
  185. $headlines_count = $this->dbh->num_rows($result);
  186. /* if (get_pref('COMBINED_DISPLAY_MODE')) {
  187. $button_plugins = array();
  188. foreach (explode(",", ARTICLE_BUTTON_PLUGINS) as $p) {
  189. $pclass = "button_" . trim($p);
  190. if (class_exists($pclass)) {
  191. $plugin = new $pclass();
  192. array_push($button_plugins, $plugin);
  193. }
  194. }
  195. } */
  196. if ($this->dbh->num_rows($result) > 0) {
  197. $lnum = $offset;
  198. $num_unread = 0;
  199. $cur_feed_title = '';
  200. $fresh_intl = get_pref("FRESH_ARTICLE_MAX_AGE") * 60 * 60;
  201. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info);
  202. $expand_cdm = get_pref('CDM_EXPANDED');
  203. while ($line = $this->dbh->fetch_assoc($result)) {
  204. $class = ($lnum % 2) ? "even" : "odd";
  205. $id = $line["id"];
  206. $feed_id = $line["feed_id"];
  207. $label_cache = $line["label_cache"];
  208. $labels = false;
  209. if ($label_cache) {
  210. $label_cache = json_decode($label_cache, true);
  211. if ($label_cache) {
  212. if ($label_cache["no-labels"] == 1)
  213. $labels = array();
  214. else
  215. $labels = $label_cache;
  216. }
  217. }
  218. if (!is_array($labels)) $labels = get_article_labels($id);
  219. $labels_str = "<span id=\"HLLCTR-$id\">";
  220. $labels_str .= format_article_labels($labels, $id);
  221. $labels_str .= "</span>";
  222. if (count($topmost_article_ids) < 3) {
  223. array_push($topmost_article_ids, $id);
  224. }
  225. if (sql_bool_to_bool($line["unread"])) {
  226. $class .= " Unread";
  227. ++$num_unread;
  228. }
  229. if (sql_bool_to_bool($line["marked"])) {
  230. $marked_pic = "<img
  231. src=\"images/mark_set.svg\"
  232. class=\"markedPic\" alt=\"Unstar article\"
  233. onclick='toggleMark($id)'>";
  234. $class .= " marked";
  235. } else {
  236. $marked_pic = "<img
  237. src=\"images/mark_unset.svg\"
  238. class=\"markedPic\" alt=\"Star article\"
  239. onclick='toggleMark($id)'>";
  240. }
  241. if (sql_bool_to_bool($line["published"])) {
  242. $published_pic = "<img src=\"images/pub_set.svg\"
  243. class=\"pubPic\"
  244. alt=\"Unpublish article\" onclick='togglePub($id)'>";
  245. $class .= " published";
  246. } else {
  247. $published_pic = "<img src=\"images/pub_unset.svg\"
  248. class=\"pubPic\"
  249. alt=\"Publish article\" onclick='togglePub($id)'>";
  250. }
  251. # $content_link = "<a target=\"_blank\" href=\"".$line["link"]."\">" .
  252. # $line["title"] . "</a>";
  253. # $content_link = "<a
  254. # href=\"" . htmlspecialchars($line["link"]) . "\"
  255. # onclick=\"view($id,$feed_id);\">" .
  256. # $line["title"] . "</a>";
  257. # $content_link = "<a href=\"javascript:viewContentUrl('".$line["link"]."');\">" .
  258. # $line["title"] . "</a>";
  259. $updated_fmt = make_local_datetime($line["updated"], false);
  260. $date_entered_fmt = T_sprintf("Imported at %s",
  261. make_local_datetime($line["date_entered"], false));
  262. if (get_pref('SHOW_CONTENT_PREVIEW')) {
  263. $content_preview = truncate_string(strip_tags($line["content_preview"]),
  264. 100);
  265. }
  266. $score = $line["score"];
  267. $score_pic = "images/" . get_score_pic($score);
  268. /* $score_title = __("(Click to change)");
  269. $score_pic = "<img class='hlScorePic' src=\"images/$score_pic\"
  270. onclick=\"adjustArticleScore($id, $score)\" title=\"$score $score_title\">"; */
  271. $score_pic = "<img class='hlScorePic' score='$score' onclick='changeScore($id, this)' src=\"$score_pic\"
  272. title=\"$score\">";
  273. if ($score > 500) {
  274. $hlc_suffix = "H";
  275. } else if ($score < -100) {
  276. $hlc_suffix = "L";
  277. } else {
  278. $hlc_suffix = "";
  279. }
  280. $entry_author = $line["author"];
  281. if ($entry_author) {
  282. $entry_author = " &mdash; $entry_author";
  283. }
  284. $has_feed_icon = feed_has_icon($feed_id);
  285. if ($has_feed_icon) {
  286. $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
  287. } else {
  288. $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/pub_set.svg\" alt=\"\">";
  289. }
  290. $entry_site_url = $line["site_url"];
  291. //setting feed headline background color, needs to change text color based on dark/light
  292. $fav_color = $line['favicon_avg_color'];
  293. require_once "colors.php";
  294. if ($fav_color) {
  295. if (!isset($rgba_cache[$feed_id])) {
  296. $rgba_cache[$feed_id] = join(",", _color_unpack($fav_color));
  297. }
  298. $rgba = $rgba_cache[$feed_id];
  299. if (sql_bool_to_bool($line["unread"]))
  300. $endalpha = '0.3';
  301. else
  302. $endalpha = '0.1';
  303. // W3C definition seems to work in FF and Chrome
  304. $row_background = "background-image : linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba($rgba, $endalpha) 100%);";
  305. /* $row_background = "background-image : -moz-linear-gradient(left, rgba(255, 255, 255, 0) 50%, rgba($rgba, 0.2) 100%);".
  306. "background-image : linear-gradient(to right, rgba(255, 255, 255, 0) 50%, rgba($rgba, 0.2) 100%);";
  307. "background-image : -webkit-gradient(linear, left top, right top, color-stop(50%, rgba(255,255,255,0)),
  308. color-stop(100%, rgba($rgba, 0.2)));"; */
  309. } else {
  310. $row_background = "";
  311. }
  312. if (!get_pref('COMBINED_DISPLAY_MODE')) {
  313. if (get_pref('VFEED_GROUP_BY_FEED')) {
  314. if ($feed_id != $vgroup_last_feed && $line["feed_title"]) {
  315. $cur_feed_title = $line["feed_title"];
  316. $vgroup_last_feed = $feed_id;
  317. $cur_feed_title = htmlspecialchars($cur_feed_title);
  318. $vf_catchup_link = "(<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('Mark as read')."</a>)";
  319. $reply['content'] .= "<div class='cdmFeedTitle'>".
  320. "<div style=\"float : right\">$feed_icon_img</div>".
  321. "<a class='title' href=\"#\" onclick=\"viewfeed($feed_id)\">".
  322. $line["feed_title"]."</a> $vf_catchup_link</div>";
  323. }
  324. }
  325. $mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
  326. onmouseout='postMouseOut($id)'";
  327. $reply['content'] .= "<div class='hl $class' id='RROW-$id' $mouseover_attrs style='$row_background'>";
  328. $reply['content'] .= "<div class='hlLeft'>";
  329. $reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
  330. type=\"checkbox\" onclick=\"toggleSelectRow2(this)\"
  331. class='rchk'>";
  332. $reply['content'] .= "$marked_pic";
  333. $reply['content'] .= "$published_pic";
  334. $reply['content'] .= "</div>";
  335. $reply['content'] .= "<div onclick='return hlClicked(event, $id)'
  336. class=\"hlTitle\"><span class='hlContent$hlc_suffix'>";
  337. $reply['content'] .= "<a id=\"RTITLE-$id\" class=\"title\"
  338. href=\"" . htmlspecialchars($line["link"]) . "\"
  339. onclick=\"\">" .
  340. truncate_string($line["title"], 200);
  341. if (get_pref('SHOW_CONTENT_PREVIEW')) {
  342. if ($content_preview) {
  343. $reply['content'] .= "<span class=\"contentPreview\"> - $content_preview</span>";
  344. }
  345. }
  346. $reply['content'] .= "</a></span>";
  347. $reply['content'] .= $labels_str;
  348. $reply['content'] .= "</div>";
  349. $reply['content'] .= "<span class=\"hlUpdated\">";
  350. if (!get_pref('VFEED_GROUP_BY_FEED')) {
  351. if (@$line["feed_title"]) {
  352. $reply['content'] .= "<div class=\"hlFeed\">
  353. <a href=\"#\" onclick=\"viewfeed($feed_id)\">".
  354. truncate_string($line["feed_title"],30)."</a>
  355. </div>";
  356. }
  357. }
  358. $reply['content'] .= "<span title='$date_entered_fmt'>$updated_fmt</span>
  359. </span>";
  360. $reply['content'] .= "<div class=\"hlRight\">";
  361. $reply['content'] .= $score_pic;
  362. if ($line["feed_title"] && !get_pref('VFEED_GROUP_BY_FEED')) {
  363. $reply['content'] .= "<span onclick=\"viewfeed($feed_id)\"
  364. style=\"cursor : pointer\"
  365. title=\"".htmlspecialchars($line['feed_title'])."\">
  366. $feed_icon_img<span>";
  367. }
  368. $reply['content'] .= "</div>";
  369. $reply['content'] .= "</div>";
  370. } else {
  371. $line["tags"] = get_article_tags($id, $_SESSION["uid"], $line["tag_cache"]);
  372. unset($line["tag_cache"]);
  373. $line["content"] = sanitize($line["content_preview"],
  374. sql_bool_to_bool($line['hide_images']), false, $entry_site_url);
  375. foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_CDM) as $p) {
  376. $line = $p->hook_render_article_cdm($line);
  377. }
  378. if (get_pref('VFEED_GROUP_BY_FEED') && $line["feed_title"]) {
  379. if ($feed_id != $vgroup_last_feed) {
  380. $cur_feed_title = $line["feed_title"];
  381. $vgroup_last_feed = $feed_id;
  382. $cur_feed_title = htmlspecialchars($cur_feed_title);
  383. $vf_catchup_link = "(<a class='catchup' onclick='javascript:catchupFeedInGroup($feed_id);' href='#'>".__('mark as read')."</a>)";
  384. $has_feed_icon = feed_has_icon($feed_id);
  385. if ($has_feed_icon) {
  386. $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
  387. } else {
  388. //$feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\" alt=\"\">";
  389. }
  390. $reply['content'] .= "<div class='cdmFeedTitle'>".
  391. "<div style=\"float : right\">$feed_icon_img</div>".
  392. "<a href=\"#\" class='title' onclick=\"viewfeed($feed_id)\">".
  393. $line["feed_title"]."</a> $vf_catchup_link</div>";
  394. }
  395. }
  396. $mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
  397. onmouseout='postMouseOut($id)'";
  398. $expanded_class = $expand_cdm ? "expanded" : "expandable";
  399. $reply['content'] .= "<div class=\"cdm $expanded_class $class\"
  400. id=\"RROW-$id\" $mouseover_attrs'>";
  401. $reply['content'] .= "<div class=\"cdmHeader\" style=\"$row_background\">";
  402. $reply['content'] .= "<div style=\"vertical-align : middle\">";
  403. $reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
  404. type=\"checkbox\" onclick=\"toggleSelectRow2(this, false, true)\"
  405. class='rchk'>";
  406. $reply['content'] .= "$marked_pic";
  407. $reply['content'] .= "$published_pic";
  408. $reply['content'] .= "</div>";
  409. $reply['content'] .= "<span id=\"RTITLE-$id\"
  410. onclick=\"return cdmClicked(event, $id);\"
  411. class=\"titleWrap$hlc_suffix\">
  412. <a class=\"title\"
  413. target=\"_blank\" href=\"".
  414. htmlspecialchars($line["link"])."\">".
  415. $line["title"] .
  416. " <span class=\"author\">$entry_author</span></a>";
  417. $reply['content'] .= $labels_str;
  418. $reply['content'] .= "<span class='collapseBtn' style='display : none'>
  419. <img src=\"images/collapse.png\" onclick=\"cdmCollapseArticle(event, $id)\"
  420. title=\"".__("Collapse article")."\"/></span>";
  421. if (!$expand_cdm)
  422. $content_hidden = "style=\"display : none\"";
  423. else
  424. $excerpt_hidden = "style=\"display : none\"";
  425. $reply['content'] .= "<span $excerpt_hidden
  426. id=\"CEXC-$id\" class=\"cdmExcerpt\"> - $content_preview</span>";
  427. $reply['content'] .= "</span>";
  428. if (!get_pref('VFEED_GROUP_BY_FEED')) {
  429. if (@$line["feed_title"]) {
  430. $reply['content'] .= "<div class=\"hlFeed\">
  431. <a href=\"#\" onclick=\"viewfeed($feed_id)\">".
  432. truncate_string($line["feed_title"],30)."</a>
  433. </div>";
  434. }
  435. }
  436. $reply['content'] .= "<span class='updated' title='$date_entered_fmt'>
  437. $updated_fmt</span>";
  438. $reply['content'] .= "<div style=\"vertical-align : middle\">";
  439. $reply['content'] .= "$score_pic";
  440. if (!get_pref("VFEED_GROUP_BY_FEED") && $line["feed_title"]) {
  441. $reply['content'] .= "<span style=\"cursor : pointer\"
  442. title=\"".htmlspecialchars($line["feed_title"])."\"
  443. onclick=\"viewfeed($feed_id)\">$feed_icon_img</span>";
  444. }
  445. $reply['content'] .= "</div>";
  446. $reply['content'] .= "</div>";
  447. $reply['content'] .= "<div class=\"cdmContent\" $content_hidden
  448. onclick=\"return cdmClicked(event, $id);\"
  449. id=\"CICD-$id\">";
  450. $reply['content'] .= "<div id=\"POSTNOTE-$id\">";
  451. if ($line['note']) {
  452. $reply['content'] .= format_article_note($id, $line['note']);
  453. }
  454. $reply['content'] .= "</div>";
  455. $reply['content'] .= "<div class=\"cdmContentInner\">";
  456. if ($line["orig_feed_id"]) {
  457. $tmp_result = $this->dbh->query("SELECT * FROM ttrss_archived_feeds
  458. WHERE id = ".$line["orig_feed_id"]);
  459. if ($this->dbh->num_rows($tmp_result) != 0) {
  460. $reply['content'] .= "<div clear='both'>";
  461. $reply['content'] .= __("Originally from:");
  462. $reply['content'] .= "&nbsp;";
  463. $tmp_line = $this->dbh->fetch_assoc($tmp_result);
  464. $reply['content'] .= "<a target='_blank'
  465. href=' " . htmlspecialchars($tmp_line['site_url']) . "'>" .
  466. $tmp_line['title'] . "</a>";
  467. $reply['content'] .= "&nbsp;";
  468. $reply['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
  469. $reply['content'] .= "<img title='".__('Feed URL')."'class='tinyFeedIcon' src='images/pub_unset.svg'></a>";
  470. $reply['content'] .= "</div>";
  471. }
  472. }
  473. $reply['content'] .= "<span id=\"CWRAP-$id\">";
  474. // if (!$expand_cdm) {
  475. $reply['content'] .= "<span id=\"CENCW-$id\" style=\"display : none\">";
  476. $reply['content'] .= htmlspecialchars($line["content"]);
  477. $reply['content'] .= "</span.";
  478. // } else {
  479. // $reply['content'] .= $line["content"];
  480. // }
  481. $reply['content'] .= "</span>";
  482. $always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
  483. $reply['content'] .= format_article_enclosures($id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"]));
  484. $reply['content'] .= "</div>";
  485. $reply['content'] .= "<div class=\"cdmFooter\">";
  486. foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
  487. $reply['content'] .= $p->hook_article_left_button($line);
  488. }
  489. $tags_str = format_tags_string($line["tags"], $id);
  490. $reply['content'] .= "<img src='images/tag.png' alt='Tags' title='Tags'>
  491. <span id=\"ATSTR-$id\">$tags_str</span>
  492. <a title=\"".__('Edit tags for this article')."\"
  493. href=\"#\" onclick=\"editArticleTags($id, $feed_id, true)\">(+)</a>";
  494. $num_comments = $line["num_comments"];
  495. $entry_comments = "";
  496. if ($num_comments > 0) {
  497. if ($line["comments"]) {
  498. $comments_url = htmlspecialchars($line["comments"]);
  499. } else {
  500. $comments_url = htmlspecialchars($line["link"]);
  501. }
  502. $entry_comments = "<a target='_blank' href=\"$comments_url\">$num_comments comments</a>";
  503. } else {
  504. if ($line["comments"] && $line["link"] != $line["comments"]) {
  505. $entry_comments = "<a target='_blank' href=\"".htmlspecialchars($line["comments"])."\">comments</a>";
  506. }
  507. }
  508. if ($entry_comments) $reply['content'] .= "&nbsp;($entry_comments)";
  509. $reply['content'] .= "<div style=\"float : right\">";
  510. // $reply['content'] .= "$marked_pic";
  511. // $reply['content'] .= "$published_pic";
  512. foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_BUTTON) as $p) {
  513. $reply['content'] .= $p->hook_article_button($line);
  514. }
  515. $reply['content'] .= "</div>";
  516. $reply['content'] .= "</div>";
  517. $reply['content'] .= "</div>";
  518. $reply['content'] .= "</div>";
  519. }
  520. ++$lnum;
  521. }
  522. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PE", $timing_info);
  523. } else {
  524. $message = "";
  525. switch ($view_mode) {
  526. case "unread":
  527. $message = __("No unread articles found to display.");
  528. break;
  529. case "updated":
  530. $message = __("No updated articles found to display.");
  531. break;
  532. case "marked":
  533. $message = __("No starred articles found to display.");
  534. break;
  535. default:
  536. if ($feed < LABEL_BASE_INDEX) {
  537. $message = __("No articles found to display. You can assign articles to labels manually from article header context menu (applies to all selected articles) or use a filter.");
  538. } else {
  539. $message = __("No articles found to display.");
  540. }
  541. }
  542. if (!$offset && $message) {
  543. $reply['content'] .= "<div class='whiteBox'>$message";
  544. $reply['content'] .= "<p><span class=\"insensitive\">";
  545. $result = $this->dbh->query("SELECT ".SUBSTRING_FOR_DATE."(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
  546. WHERE owner_uid = " . $_SESSION['uid']);
  547. $last_updated = $this->dbh->fetch_result($result, 0, "last_updated");
  548. $last_updated = make_local_datetime($last_updated, false);
  549. $reply['content'] .= sprintf(__("Feeds last updated at %s"), $last_updated);
  550. $result = $this->dbh->query("SELECT COUNT(id) AS num_errors
  551. FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
  552. $num_errors = $this->dbh->fetch_result($result, 0, "num_errors");
  553. if ($num_errors > 0) {
  554. $reply['content'] .= "<br/>";
  555. $reply['content'] .= "<a class=\"insensitive\" href=\"#\" onclick=\"showFeedsWithErrors()\">".
  556. __('Some feeds have update errors (click for details)')."</a>";
  557. }
  558. $reply['content'] .= "</span></p></div>";
  559. }
  560. }
  561. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H2", $timing_info);
  562. return array($topmost_article_ids, $headlines_count, $feed, $disable_cache,
  563. $vgroup_last_feed, $reply);
  564. }
  565. function catchupAll() {
  566. $this->dbh->query("UPDATE ttrss_user_entries SET
  567. last_read = NOW(), unread = false WHERE unread = true AND owner_uid = " . $_SESSION["uid"]);
  568. ccache_zero_all($_SESSION["uid"]);
  569. }
  570. function view() {
  571. $timing_info = microtime(true);
  572. $reply = array();
  573. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("0", $timing_info);
  574. $omode = $this->dbh->escape_string($_REQUEST["omode"]);
  575. $feed = $this->dbh->escape_string($_REQUEST["feed"]);
  576. $method = $this->dbh->escape_string($_REQUEST["m"]);
  577. $view_mode = $this->dbh->escape_string($_REQUEST["view_mode"]);
  578. $limit = 30;
  579. @$cat_view = $_REQUEST["cat"] == "true";
  580. @$next_unread_feed = $this->dbh->escape_string($_REQUEST["nuf"]);
  581. @$offset = $this->dbh->escape_string($_REQUEST["skip"]);
  582. @$vgroup_last_feed = $this->dbh->escape_string($_REQUEST["vgrlf"]);
  583. $order_by = $this->dbh->escape_string($_REQUEST["order_by"]);
  584. if (is_numeric($feed)) $feed = (int) $feed;
  585. /* Feed -5 is a special case: it is used to display auxiliary information
  586. * when there's nothing to load - e.g. no stuff in fresh feed */
  587. if ($feed == -5) {
  588. print json_encode($this->generate_dashboard_feed());
  589. return;
  590. }
  591. $result = false;
  592. if ($feed < LABEL_BASE_INDEX) {
  593. $label_feed = feed_to_label_id($feed);
  594. $result = $this->dbh->query("SELECT id FROM ttrss_labels2 WHERE
  595. id = '$label_feed' AND owner_uid = " . $_SESSION['uid']);
  596. } else if (!$cat_view && is_numeric($feed) && $feed > 0) {
  597. $result = $this->dbh->query("SELECT id FROM ttrss_feeds WHERE
  598. id = '$feed' AND owner_uid = " . $_SESSION['uid']);
  599. } else if ($cat_view && is_numeric($feed) && $feed > 0) {
  600. $result = $this->dbh->query("SELECT id FROM ttrss_feed_categories WHERE
  601. id = '$feed' AND owner_uid = " . $_SESSION['uid']);
  602. }
  603. if ($result && $this->dbh->num_rows($result) == 0) {
  604. print json_encode($this->generate_error_feed(__("Feed not found.")));
  605. return;
  606. }
  607. /* Updating a label ccache means recalculating all of the caches
  608. * so for performance reasons we don't do that here */
  609. if ($feed >= 0) {
  610. ccache_update($feed, $_SESSION["uid"], $cat_view);
  611. }
  612. set_pref("_DEFAULT_VIEW_MODE", $view_mode);
  613. set_pref("_DEFAULT_VIEW_ORDER_BY", $order_by);
  614. /* bump login timestamp if needed */
  615. if (time() - $_SESSION["last_login_update"] > 3600) {
  616. $this->dbh->query("UPDATE ttrss_users SET last_login = NOW() WHERE id = " .
  617. $_SESSION["uid"]);
  618. $_SESSION["last_login_update"] = time();
  619. }
  620. if (!$cat_view && is_numeric($feed) && $feed > 0) {
  621. $this->dbh->query("UPDATE ttrss_feeds SET last_viewed = NOW()
  622. WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]);
  623. }
  624. $reply['headlines'] = array();
  625. if (!$next_unread_feed)
  626. $reply['headlines']['id'] = $feed;
  627. else
  628. $reply['headlines']['id'] = $next_unread_feed;
  629. $reply['headlines']['is_cat'] = (bool) $cat_view;
  630. $override_order = false;
  631. switch ($order_by) {
  632. case "title":
  633. $override_order = "ttrss_entries.title";
  634. break;
  635. case "date_reverse":
  636. $override_order = "date_entered, updated";
  637. break;
  638. case "feed_dates":
  639. $override_order = "updated DESC";
  640. break;
  641. }
  642. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("04", $timing_info);
  643. $ret = $this->format_headlines_list($feed, $method,
  644. $view_mode, $limit, $cat_view, $next_unread_feed, $offset,
  645. $vgroup_last_feed, $override_order, true);
  646. //$topmost_article_ids = $ret[0];
  647. $headlines_count = $ret[1];
  648. $returned_feed = $ret[2];
  649. $disable_cache = $ret[3];
  650. $vgroup_last_feed = $ret[4];
  651. $reply['headlines']['content'] =& $ret[5]['content'];
  652. $reply['headlines']['toolbar'] =& $ret[5]['toolbar'];
  653. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("05", $timing_info);
  654. $reply['headlines-info'] = array("count" => (int) $headlines_count,
  655. "vgroup_last_feed" => $vgroup_last_feed,
  656. "disable_cache" => (bool) $disable_cache);
  657. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("30", $timing_info);
  658. $reply['runtime-info'] = make_runtime_info();
  659. print json_encode($reply);
  660. }
  661. private function generate_dashboard_feed() {
  662. $reply = array();
  663. $reply['headlines']['id'] = -5;
  664. $reply['headlines']['is_cat'] = false;
  665. $reply['headlines']['toolbar'] = '';
  666. $reply['headlines']['content'] = "<div class='whiteBox'>".__('No feed selected.');
  667. $reply['headlines']['content'] .= "<p><span class=\"insensitive\">";
  668. $result = $this->dbh->query("SELECT ".SUBSTRING_FOR_DATE."(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
  669. WHERE owner_uid = " . $_SESSION['uid']);
  670. $last_updated = $this->dbh->fetch_result($result, 0, "last_updated");
  671. $last_updated = make_local_datetime($last_updated, false);
  672. $reply['headlines']['content'] .= sprintf(__("Feeds last updated at %s"), $last_updated);
  673. $result = $this->dbh->query("SELECT COUNT(id) AS num_errors
  674. FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
  675. $num_errors = $this->dbh->fetch_result($result, 0, "num_errors");
  676. if ($num_errors > 0) {
  677. $reply['headlines']['content'] .= "<br/>";
  678. $reply['headlines']['content'] .= "<a class=\"insensitive\" href=\"#\" onclick=\"showFeedsWithErrors()\">".
  679. __('Some feeds have update errors (click for details)')."</a>";
  680. }
  681. $reply['headlines']['content'] .= "</span></p>";
  682. $reply['headlines-info'] = array("count" => 0,
  683. "vgroup_last_feed" => '',
  684. "unread" => 0,
  685. "disable_cache" => true);
  686. return $reply;
  687. }
  688. private function generate_error_feed($error) {
  689. $reply = array();
  690. $reply['headlines']['id'] = -6;
  691. $reply['headlines']['is_cat'] = false;
  692. $reply['headlines']['toolbar'] = '';
  693. $reply['headlines']['content'] = "<div class='whiteBox'>". $error . "</div>";
  694. $reply['headlines-info'] = array("count" => 0,
  695. "vgroup_last_feed" => '',
  696. "unread" => 0,
  697. "disable_cache" => true);
  698. return $reply;
  699. }
  700. function quickAddFeed() {
  701. print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
  702. print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"addfeed\">";
  703. print "<div class=\"dlgSec\">".__("Feed or site URL")."</div>";
  704. print "<div class=\"dlgSecCont\">";
  705. print "<div style='float : right'>
  706. <img style='display : none'
  707. id='feed_add_spinner' src='images/indicator_white.gif'></div>";
  708. print "<input style=\"font-size : 16px; width : 20em;\"
  709. placeHolder=\"".__("Feed or site URL")."\"
  710. dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"feed\" id=\"feedDlg_feedUrl\">";
  711. print "<hr/>";
  712. if (get_pref('ENABLE_FEED_CATS')) {
  713. print __('Place in category:') . " ";
  714. print_feed_cat_select("cat", false, 'dojoType="dijit.form.Select"');
  715. }
  716. print "</div>";
  717. print '<div id="feedDlg_feedsContainer" style="display : none">
  718. <div class="dlgSec">' . __('Available feeds') . '</div>
  719. <div class="dlgSecCont">'.
  720. '<select id="feedDlg_feedContainerSelect"
  721. dojoType="dijit.form.Select" size="3">
  722. <script type="dojo/method" event="onChange" args="value">
  723. dijit.byId("feedDlg_feedUrl").attr("value", value);
  724. </script>
  725. </select>'.
  726. '</div></div>';
  727. print "<div id='feedDlg_loginContainer' style='display : none'>
  728. <div class=\"dlgSec\">".__("Authentication")."</div>
  729. <div class=\"dlgSecCont\">".
  730. " <input dojoType=\"dijit.form.TextBox\" name='login'\"
  731. placeHolder=\"".__("Login")."\"
  732. style=\"width : 10em;\"> ".
  733. " <input
  734. placeHolder=\"".__("Password")."\"
  735. dojoType=\"dijit.form.TextBox\" type='password'
  736. style=\"width : 10em;\" name='pass'\">
  737. </div></div>";
  738. print "<div style=\"clear : both\">
  739. <input type=\"checkbox\" name=\"need_auth\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
  740. onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'>
  741. <label for=\"feedDlg_loginCheck\">".
  742. __('This feed requires authentication.')."</div>";
  743. print "</form>";
  744. print "<div class=\"dlgButtons\">
  745. <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button>";
  746. if (!(defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER)) {
  747. print "<button dojoType=\"dijit.form.Button\" onclick=\"return feedBrowser()\">".__('More feeds')."</button>";
  748. }
  749. print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button>
  750. </div>";
  751. //return;
  752. }
  753. function feedBrowser() {
  754. if (defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER) return;
  755. $browser_search = $this->dbh->escape_string($_REQUEST["search"]);
  756. print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
  757. print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"updateFeedBrowser\">";
  758. print "<div dojoType=\"dijit.Toolbar\">
  759. <div style='float : right'>
  760. <img style='display : none'
  761. id='feed_browser_spinner' src='images/indicator_white.gif'>
  762. <input name=\"search\" dojoType=\"dijit.form.TextBox\" size=\"20\" type=\"search\"
  763. onchange=\"dijit.byId('feedBrowserDlg').update()\" value=\"$browser_search\">
  764. <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').update()\">".__('Search')."</button>
  765. </div>";
  766. print " <select name=\"mode\" dojoType=\"dijit.form.Select\" onchange=\"dijit.byId('feedBrowserDlg').update()\">
  767. <option value='1'>" . __('Popular feeds') . "</option>
  768. <option value='2'>" . __('Feed archive') . "</option>
  769. </select> ";
  770. print __("limit:");
  771. print " <select dojoType=\"dijit.form.Select\" name=\"limit\" onchange=\"dijit.byId('feedBrowserDlg').update()\">";
  772. foreach (array(25, 50, 100, 200) as $l) {
  773. $issel = ($l == $limit) ? "selected=\"1\"" : "";
  774. print "<option $issel value=\"$l\">$l</option>";
  775. }
  776. print "</select> ";
  777. print "</div>";
  778. $owner_uid = $_SESSION["uid"];
  779. require_once "feedbrowser.php";
  780. print "<ul class='browseFeedList' id='browseFeedList'>";
  781. print make_feed_browser($search, 25);
  782. print "</ul>";
  783. print "<div align='center'>
  784. <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').execute()\">".__('Subscribe')."</button>
  785. <button dojoType=\"dijit.form.Button\" style='display : none' id='feed_archive_remove' onclick=\"dijit.byId('feedBrowserDlg').removeFromArchive()\">".__('Remove')."</button>
  786. <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').hide()\" >".__('Cancel')."</button></div>";
  787. }
  788. function search() {
  789. $this->params = explode(":", $this->dbh->escape_string($_REQUEST["param"]), 2);
  790. $active_feed_id = sprintf("%d", $this->params[0]);
  791. $is_cat = $this->params[1] != "false";
  792. print "<div class=\"dlgSec\">".__('Look for')."</div>";
  793. print "<div class=\"dlgSecCont\">";
  794. print "<input dojoType=\"dijit.form.ValidationTextBox\"
  795. style=\"font-size : 16px; width : 20em;\"
  796. required=\"1\" name=\"query\" type=\"search\" value=''>";
  797. print "<hr/>".__('Limit search to:')." ";
  798. print "<select name=\"search_mode\" dojoType=\"dijit.form.Select\">
  799. <option value=\"all_feeds\">".__('All feeds')."</option>";
  800. $feed_title = getFeedTitle($active_feed_id);
  801. if (!$is_cat) {
  802. $feed_cat_title = getFeedCatTitle($active_feed_id);
  803. } else {
  804. $feed_cat_title = getCategoryTitle($active_feed_id);
  805. }
  806. if ($active_feed_id && !$is_cat) {
  807. print "<option selected=\"1\" value=\"this_feed\">$feed_title</option>";
  808. } else {
  809. print "<option disabled=\"1\" value=\"false\">".__('This feed')."</option>";
  810. }
  811. if ($is_cat) {
  812. $cat_preselected = "selected=\"1\"";
  813. }
  814. if (get_pref('ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
  815. print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>";
  816. } else {
  817. //print "<option disabled>".__('This category')."</option>";
  818. }
  819. print "</select>";
  820. print "</div>";
  821. print "<div class=\"dlgButtons\">";
  822. if (!SPHINX_ENABLED) {
  823. print "<div style=\"float : left\">
  824. <a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/wiki/SearchSyntax\">Search syntax</a>
  825. </div>";
  826. }
  827. print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button>
  828. <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">".__('Cancel')."</button>
  829. </div>";
  830. }
  831. }
  832. ?>