feeds.php 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  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 make_gradient($end, $class) {
  9. $start = $class == "even" ? "#f0f0f0" : "#ffffff";
  10. return "style='background: linear-gradient(left , $start 6%, $end 100%);
  11. background: -o-linear-gradient(left , $start 6%, $end 100%);
  12. background: -moz-linear-gradient(left , $start 6%, $end 100%);
  13. background: -webkit-linear-gradient(left , $start 6%, $end 100%);
  14. background: -ms-linear-gradient(left , $start 6%, $end 100%);
  15. background: -webkit-gradient(linear, left top, right top,
  16. color-stop(0.06, $start), color-stop(1, $end));'";
  17. }
  18. private function format_headline_subtoolbar($feed_site_url, $feed_title,
  19. $feed_id, $is_cat, $search,
  20. $search_mode, $view_mode, $error) {
  21. $page_prev_link = "viewFeedGoPage(-1)";
  22. $page_next_link = "viewFeedGoPage(1)";
  23. $page_first_link = "viewFeedGoPage(0)";
  24. $catchup_page_link = "catchupPage()";
  25. $catchup_feed_link = "catchupCurrentFeed()";
  26. $catchup_sel_link = "catchupSelection()";
  27. $archive_sel_link = "archiveSelection()";
  28. $delete_sel_link = "deleteSelection()";
  29. $sel_all_link = "selectArticles('all')";
  30. $sel_unread_link = "selectArticles('unread')";
  31. $sel_none_link = "selectArticles('none')";
  32. $sel_inv_link = "selectArticles('invert')";
  33. $tog_unread_link = "selectionToggleUnread()";
  34. $tog_marked_link = "selectionToggleMarked()";
  35. $tog_published_link = "selectionTogglePublished()";
  36. $set_score_link = "setSelectionScore()";
  37. if ($is_cat) $cat_q = "&is_cat=$is_cat";
  38. if ($search) {
  39. $search_q = "&q=$search&smode=$search_mode";
  40. } else {
  41. $search_q = "";
  42. }
  43. $rss_link = htmlspecialchars(get_self_url_prefix() .
  44. "/public.php?op=rss&id=$feed_id$cat_q$search_q");
  45. // right part
  46. $reply .= "<span class='r'>";
  47. $reply .= "<span id='feed_title'>";
  48. if ($feed_site_url) {
  49. $target = "target=\"_blank\"";
  50. $reply .= "<a title=\"".__("Visit the website")."\" $target href=\"$feed_site_url\">".
  51. truncate_string($feed_title,30)."</a>";
  52. if ($error) {
  53. $reply .= " (<span class=\"error\" title=\"$error\">Error</span>)";
  54. }
  55. } else {
  56. $reply .= $feed_title;
  57. }
  58. $reply .= "</span>";
  59. $reply .= "
  60. <a href=\"#\"
  61. title=\"".__("View as RSS feed")."\"
  62. onclick=\"displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
  63. <img class=\"noborder\" style=\"vertical-align : middle\" src=\"images/pub_set.svg\"></a>";
  64. $reply .= "</span>";
  65. // left part
  66. $reply .= __('Select:')."
  67. <a href=\"#\" onclick=\"$sel_all_link\">".__('All')."</a>,
  68. <a href=\"#\" onclick=\"$sel_unread_link\">".__('Unread')."</a>,
  69. <a href=\"#\" onclick=\"$sel_inv_link\">".__('Invert')."</a>,
  70. <a href=\"#\" onclick=\"$sel_none_link\">".__('None')."</a></li>";
  71. $reply .= " ";
  72. $reply .= "<select dojoType=\"dijit.form.Select\"
  73. onchange=\"headlineActionsChange(this)\">";
  74. $reply .= "<option value=\"false\">".__('More...')."</option>";
  75. $reply .= "<option value=\"0\" disabled=\"1\">".__('Selection toggle:')."</option>";
  76. $reply .= "<option value=\"$tog_unread_link\">".__('Unread')."</option>
  77. <option value=\"$tog_marked_link\">".__('Starred')."</option>
  78. <option value=\"$tog_published_link\">".__('Published')."</option>";
  79. $reply .= "<option value=\"0\" disabled=\"1\">".__('Selection:')."</option>";
  80. $reply .= "<option value=\"$catchup_sel_link\">".__('Mark as read')."</option>";
  81. $reply .= "<option value=\"$set_score_link\">".__('Set score')."</option>";
  82. if ($feed_id != "0") {
  83. $reply .= "<option value=\"$archive_sel_link\">".__('Archive')."</option>";
  84. } else {
  85. $reply .= "<option value=\"$archive_sel_link\">".__('Move back')."</option>";
  86. $reply .= "<option value=\"$delete_sel_link\">".__('Delete')."</option>";
  87. }
  88. global $pluginhost;
  89. if ($pluginhost->get_plugin("mail")) {
  90. $reply .= "<option value=\"emailArticle(false)\">".__('Forward by email').
  91. "</option>";
  92. }
  93. if ($pluginhost->get_plugin("mailto")) {
  94. $reply .= "<option value=\"mailtoArticle(false)\">".__('Forward by email').
  95. "</option>";
  96. }
  97. $reply .= "<option value=\"0\" disabled=\"1\">".__('Feed:')."</option>";
  98. //$reply .= "<option value=\"catchupPage()\">".__('Mark as read')."</option>";
  99. $reply .= "<option value=\"displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">".__('View as RSS')."</option>";
  100. $reply .= "</select>";
  101. //$reply .= "</div>";
  102. //$reply .= "</h2";
  103. foreach ($pluginhost->get_hooks($pluginhost::HOOK_HEADLINE_TOOLBAR_BUTTON) as $p) {
  104. echo $p->hook_headline_toolbar_button($feed_id, $is_cat);
  105. }
  106. return $reply;
  107. }
  108. private function format_headlines_list($feed, $method, $view_mode, $limit, $cat_view,
  109. $next_unread_feed, $offset, $vgr_last_feed = false,
  110. $override_order = false, $include_children = false) {
  111. if (isset($_REQUEST["DevForceUpdate"]))
  112. header("Content-Type: text/plain");
  113. $disable_cache = false;
  114. $reply = array();
  115. $timing_info = microtime(true);
  116. $topmost_article_ids = array();
  117. if (!$offset) $offset = 0;
  118. if ($method == "undefined") $method = "";
  119. $method_split = explode(":", $method);
  120. if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) {
  121. // Update the feed if required with some basic flood control
  122. $result = db_query($this->link,
  123. "SELECT cache_images,".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
  124. FROM ttrss_feeds WHERE id = '$feed'");
  125. if (db_num_rows($result) != 0) {
  126. $last_updated = strtotime(db_fetch_result($result, 0, "last_updated"));
  127. $cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images"));
  128. if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) {
  129. include "rssfuncs.php";
  130. update_rss_feed($this->link, $feed, true, true);
  131. } else {
  132. db_query($this->link, "UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01'
  133. WHERE id = '$feed'");
  134. }
  135. }
  136. }
  137. if ($method_split[0] == "MarkAllReadGR") {
  138. catchup_feed($this->link, $method_split[1], false);
  139. }
  140. // FIXME: might break tag display?
  141. if (is_numeric($feed) && $feed > 0 && !$cat_view) {
  142. $result = db_query($this->link,
  143. "SELECT id FROM ttrss_feeds WHERE id = '$feed' LIMIT 1");
  144. if (db_num_rows($result) == 0) {
  145. $reply['content'] = "<div align='center'>".__('Feed not found.')."</div>";
  146. }
  147. }
  148. @$search = db_escape_string($this->link, $_REQUEST["query"]);
  149. if ($search) {
  150. $disable_cache = true;
  151. }
  152. @$search_mode = db_escape_string($this->link, $_REQUEST["search_mode"]);
  153. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
  154. // error_log("format_headlines_list: [" . $feed . "] method [" . $method . "]");
  155. if( $search_mode == '' && $method != '' ){
  156. $search_mode = $method;
  157. }
  158. // error_log("search_mode: " . $search_mode);
  159. if (!$cat_view && is_numeric($feed) && $feed < PLUGIN_FEED_BASE_INDEX && $feed > LABEL_BASE_INDEX) {
  160. global $pluginhost;
  161. $handler = $pluginhost->get_feed_handler(
  162. PluginHost::feed_to_pfeed_id($feed));
  163. // function queryFeedHeadlines($link, $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) {
  164. if ($handler) {
  165. $options = array(
  166. "limit" => $limit,
  167. "view_mode" => $view_mode,
  168. "cat_view" => $cat_view,
  169. "search" => $search,
  170. "search_mode" => $search_mode,
  171. "override_order" => $override_order,
  172. "offset" => $offset,
  173. "owner_uid" => $_SESSION["uid"],
  174. "filter" => false,
  175. "since_id" => 0,
  176. "include_children" => $include_children);
  177. $qfh_ret = $handler->get_headlines(PluginHost::feed_to_pfeed_id($feed),
  178. $options);
  179. }
  180. } else {
  181. $qfh_ret = queryFeedHeadlines($this->link, $feed, $limit, $view_mode, $cat_view,
  182. $search, $search_mode, $override_order, $offset, 0,
  183. false, 0, $include_children);
  184. }
  185. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info);
  186. $result = $qfh_ret[0];
  187. $feed_title = $qfh_ret[1];
  188. $feed_site_url = $qfh_ret[2];
  189. $last_error = $qfh_ret[3];
  190. $vgroup_last_feed = $vgr_last_feed;
  191. $reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
  192. $feed_title,
  193. $feed, $cat_view, $search, $search_mode, $view_mode,
  194. $last_error);
  195. $headlines_count = db_num_rows($result);
  196. /* if (get_pref($this->link, 'COMBINED_DISPLAY_MODE')) {
  197. $button_plugins = array();
  198. foreach (explode(",", ARTICLE_BUTTON_PLUGINS) as $p) {
  199. $pclass = "button_" . trim($p);
  200. if (class_exists($pclass)) {
  201. $plugin = new $pclass($link);
  202. array_push($button_plugins, $plugin);
  203. }
  204. }
  205. } */
  206. global $pluginhost;
  207. if (db_num_rows($result) > 0) {
  208. $lnum = $offset;
  209. $num_unread = 0;
  210. $cur_feed_title = '';
  211. $fresh_intl = get_pref($this->link, "FRESH_ARTICLE_MAX_AGE") * 60 * 60;
  212. if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info);
  213. $expand_cdm = get_pref($this->link, 'CDM_EXPANDED');
  214. while ($line = db_fetch_assoc($result)) {
  215. $class = ($lnum % 2) ? "even" : "odd";
  216. $id = $line["id"];
  217. $feed_id = $line["feed_id"];
  218. $label_cache = $line["label_cache"];
  219. $labels = false;
  220. $label_row_style = "";
  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($this->link, $id);
  231. if (count($labels) > 0) {
  232. for ($i = 0; $i < min(4, count($labels)); $i++) {
  233. $bg = rgb2hsl(_color_unpack($labels[$i][3]));
  234. if ($bg && $bg[1] > 0) {
  235. $bg[1] = 0.1;
  236. $bg[2] = 1;
  237. $bg = _color_pack(hsl2rgb($bg));
  238. $label_row_style = $this->make_gradient($bg, $class);;
  239. break;
  240. }
  241. }
  242. }
  243. $labels_str = "<span id=\"HLLCTR-$id\">";
  244. $labels_str .= format_article_labels($labels, $id);
  245. $labels_str .= "</span>";
  246. if (count($topmost_article_ids) < 3) {
  247. array_push($topmost_article_ids, $id);
  248. }
  249. if (sql_bool_to_bool($line["unread"])) {
  250. $class .= " Unread";
  251. ++$num_unread;
  252. }
  253. if (sql_bool_to_bool($line["marked"])) {
  254. $marked_pic = "<img
  255. src=\"images/mark_set.svg\"
  256. class=\"markedPic\" alt=\"Unstar article\"
  257. onclick='toggleMark($id)'>";
  258. $class .= " marked";
  259. } else {
  260. $marked_pic = "<img
  261. src=\"images/mark_unset.svg\"
  262. class=\"markedPic\" alt=\"Star article\"
  263. onclick='toggleMark($id)'>";
  264. }
  265. if (sql_bool_to_bool($line["published"])) {
  266. $published_pic = "<img src=\"images/pub_set.svg\"
  267. class=\"pubPic\"
  268. alt=\"Unpublish article\" onclick='togglePub($id)'>";
  269. $class .= " published";
  270. } else {
  271. $published_pic = "<img src=\"images/pub_unset.svg\"
  272. class=\"pubPic\"
  273. alt=\"Publish article\" onclick='togglePub($id)'>";
  274. }
  275. # $content_link = "<a target=\"_blank\" href=\"".$line["link"]."\">" .
  276. # $line["title"] . "</a>";
  277. # $content_link = "<a
  278. # href=\"" . htmlspecialchars($line["link"]) . "\"
  279. # onclick=\"view($id,$feed_id);\">" .
  280. # $line["title"] . "</a>";
  281. # $content_link = "<a href=\"javascript:viewContentUrl('".$line["link"]."');\">" .
  282. # $line["title"] . "</a>";
  283. $updated_fmt = make_local_datetime($this->link, $line["updated"], false);
  284. $date_entered_fmt = T_sprintf("Imported at %s",
  285. make_local_datetime($this->link, $line["date_entered"], false));
  286. if (get_pref($this->link, 'SHOW_CONTENT_PREVIEW')) {
  287. $content_preview = truncate_string(strip_tags($line["content_preview"]),
  288. 100);
  289. }
  290. $score = $line["score"];
  291. $score_pic = "images/" . get_score_pic($score);
  292. /* $score_title = __("(Click to change)");
  293. $score_pic = "<img class='hlScorePic' src=\"images/$score_pic\"
  294. onclick=\"adjustArticleScore($id, $score)\" title=\"$score $score_title\">"; */
  295. $score_pic = "<img class='hlScorePic' score='$score' onclick='changeScore($id, this)' src=\"$score_pic\"
  296. title=\"$score\">";
  297. if ($score > 500) {
  298. $hlc_suffix = "H";
  299. } else if ($score < -100) {
  300. $hlc_suffix = "L";
  301. } else {
  302. $hlc_suffix = "";
  303. }
  304. $entry_author = $line["author"];
  305. if ($entry_author) {
  306. $entry_author = " - $entry_author";
  307. }
  308. $has_feed_icon = feed_has_icon($feed_id);
  309. if ($has_feed_icon) {
  310. $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
  311. } else {
  312. $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/pub_set.svg\" alt=\"\">";
  313. }
  314. $entry_site_url = $line["site_url"];
  315. if (!get_pref($this->link, 'COMBINED_DISPLAY_MODE')) {
  316. if (get_pref($this->link, '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' $label_row_style $mouseover_attrs>";
  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($this->link, '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($this->link, '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($this->link, '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($this->link, $id, $_SESSION["uid"], $line["tag_cache"]);
  375. unset($line["tag_cache"]);
  376. $line["content"] = sanitize($this->link, $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($this->link, '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\">";
  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($this->link, '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($this->link, "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 = db_query($this->link, "SELECT * FROM ttrss_archived_feeds
  461. WHERE id = ".$line["orig_feed_id"]);
  462. if (db_num_rows($tmp_result) != 0) {
  463. $reply['content'] .= "<div clear='both'>";
  464. $reply['content'] .= __("Originally from:");
  465. $reply['content'] .= "&nbsp;";
  466. $tmp_line = db_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($this->link, $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 = db_query($this->link, "SELECT ".SUBSTRING_FOR_DATE."(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
  549. WHERE owner_uid = " . $_SESSION['uid']);
  550. $last_updated = db_fetch_result($result, 0, "last_updated");
  551. $last_updated = make_local_datetime($this->link, $last_updated, false);
  552. $reply['content'] .= sprintf(__("Feeds last updated at %s"), $last_updated);
  553. $result = db_query($this->link, "SELECT COUNT(id) AS num_errors
  554. FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
  555. $num_errors = db_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. db_query($this->link, "UPDATE ttrss_user_entries SET
  570. last_read = NOW(), unread = false WHERE unread = true AND owner_uid = " . $_SESSION["uid"]);
  571. ccache_zero_all($this->link, $_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 = db_escape_string($this->link, $_REQUEST["omode"]);
  578. $feed = db_escape_string($this->link, $_REQUEST["feed"]);
  579. $method = db_escape_string($this->link, $_REQUEST["m"]);
  580. $view_mode = db_escape_string($this->link, $_REQUEST["view_mode"]);
  581. $limit = 30;
  582. @$cat_view = $_REQUEST["cat"] == "true";
  583. @$next_unread_feed = db_escape_string($this->link, $_REQUEST["nuf"]);
  584. @$offset = db_escape_string($this->link, $_REQUEST["skip"]);
  585. @$vgroup_last_feed = db_escape_string($this->link, $_REQUEST["vgrlf"]);
  586. $order_by = db_escape_string($this->link, $_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($this->link));
  592. return;
  593. }
  594. $result = false;
  595. if ($feed < LABEL_BASE_INDEX) {
  596. $label_feed = feed_to_label_id($feed);
  597. $result = db_query($this->link, "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 = db_query($this->link, "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 = db_query($this->link, "SELECT id FROM ttrss_feed_categories WHERE
  604. id = '$feed' AND owner_uid = " . $_SESSION['uid']);
  605. }
  606. if ($result && db_num_rows($result) == 0) {
  607. print json_encode($this->generate_error_feed($this->link, __("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($this->link, $feed, $_SESSION["uid"], $cat_view);
  614. }
  615. set_pref($this->link, "_DEFAULT_VIEW_MODE", $view_mode);
  616. set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by);
  617. /* bump login timestamp if needed */
  618. if (time() - $_SESSION["last_login_update"] > 3600) {
  619. db_query($this->link, "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. db_query($this->link, "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($this->link);
  662. print json_encode($reply);
  663. }
  664. private function generate_dashboard_feed($link) {
  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 = db_query($link, "SELECT ".SUBSTRING_FOR_DATE."(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
  672. WHERE owner_uid = " . $_SESSION['uid']);
  673. $last_updated = db_fetch_result($result, 0, "last_updated");
  674. $last_updated = make_local_datetime($link, $last_updated, false);
  675. $reply['headlines']['content'] .= sprintf(__("Feeds last updated at %s"), $last_updated);
  676. $result = db_query($link, "SELECT COUNT(id) AS num_errors
  677. FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
  678. $num_errors = db_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($link, $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($this->link, 'ENABLE_FEED_CATS')) {
  716. print __('Place in category:') . " ";
  717. print_feed_cat_select($this->link, "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 = db_escape_string($this->link, $_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($this->link, $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(":", db_escape_string($this->link, $_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($this->link, $active_feed_id);
  804. if (!$is_cat) {
  805. $feed_cat_title = getFeedCatTitle($this->link, $active_feed_id);
  806. } else {
  807. $feed_cat_title = getCategoryTitle($this->link, $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($this->link, '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. ?>