feeds.php 37 KB

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