feeds.php 37 KB

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