]>
git.wh0rd.org - tt-rss.git/blob - modules/popup-dialog.php
2 function module_popup_dialog ( $link ) {
4 $param = db_escape_string ( $_REQUEST [ "param" ]);
6 print "<dlg id= \" $id\" >" ;
8 if ( $id == "importOpml" ) {
9 print "<div class= \" prefFeedOPMLHolder \" >" ;
10 header ( "Content-Type: text/html" ); # required for iframe
12 $owner_uid = $_SESSION [ "uid" ];
14 db_query ( $link , "BEGIN" );
16 /* create Imported feeds category just in case */
18 $result = db_query ( $link , "SELECT id FROM
19 ttrss_feed_categories WHERE title = 'Imported feeds' AND
20 owner_uid = ' $owner_uid ' LIMIT 1" );
22 if ( db_num_rows ( $result ) == 0 ) {
23 db_query ( $link , "INSERT INTO ttrss_feed_categories
25 VALUES ('Imported feeds', ' $owner_uid ')" );
28 db_query ( $link , "COMMIT" );
30 /* Handle OPML import by DOMXML/DOMDocument */
32 if ( function_exists ( 'domxml_open_file' )) {
33 print "<ul class='nomarks'>" ;
34 print "<li>" . __ ( "Importing using DOMXML." ). "</li>" ;
35 require_once "opml_domxml.php" ;
36 opml_import_domxml ( $link , $owner_uid );
38 } else if ( PHP_VERSION
>= 5 ) {
39 print "<ul class='nomarks'>" ;
40 print "<li>" . __ ( "Importing using DOMDocument." ). "</li>" ;
41 require_once "opml_domdoc.php" ;
42 opml_import_domdoc ( $link , $owner_uid );
45 print_error ( __ ( "DOMXML extension is not found. It is required for PHP versions below 5." ));
50 print "<div align='center'>" ;
51 print "<button dojoType= \" dijit.form.Button \"
52 onclick= \" dijit.byId('opmlImportDlg').hide() \" >" .
53 __ ( 'Close this window' ). "</button>" ;
61 if ( $id == "editPrefProfiles" ) {
63 print "<div dojoType= \" dijit.Toolbar \" >" ;
65 # TODO: depends on selectTableRows() being broken for this list
66 # print "<div dojoType=\"dijit.form.DropDownButton\">".
67 # "<span>" . __('Select')."</span>";
68 # print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
69 # print "<div onclick=\"selectTableRows('prefFeedProfileList', 'all')\"
70 # dojoType=\"dijit.MenuItem\">".__('All')."</div>";
71 # print "<div onclick=\"selectTableRows('prefFeedProfileList', 'none')\"
72 # dojoType=\"dijit.MenuItem\">".__('None')."</div>";
73 # print "</div></div>";
75 # print "<div style='float : right'>";
76 print "<input name= \" newprofile \" dojoType= \" dijit.form.ValidationTextBox \"
78 <button dojoType= \" dijit.form.Button \"
79 onclick= \" dijit.byId('profileEditDlg').addProfile() \" >" .
80 __ ( 'Create profile' ). "</button></div>" ;
85 $result = db_query ( $link , "SELECT title,id FROM ttrss_settings_profiles
86 WHERE owner_uid = " . $_SESSION [ "uid" ]. " ORDER BY title" );
88 print "<div class= \" prefFeedCatHolder \" >" ;
90 print "<form id= \" profile_edit_form \" onsubmit= \" return false \" >" ;
92 print "<table width= \" 100% \" class= \" prefFeedProfileList \"
93 cellspacing= \" 0 \" id= \" prefFeedProfileList \" >" ;
95 print "<tr class= \"\" id= \" FCATR-0 \" >" ; #odd
97 print "<td width='5%' align='center'><input
98 onclick='toggleSelectRow2(this);'
99 dojoType= \" dijit.form.CheckBox \"
100 type= \" checkbox \" ></td>" ;
102 if (! $_SESSION [ "profile" ]) {
103 $is_active = __ ( "(active)" );
109 __ ( "Default profile" ) . " $is_active </span></td>" ;
115 while ( $line = db_fetch_assoc ( $result )) {
117 $class = ( $lnum %
2 ) ?
"even" : "odd" ;
119 $profile_id = $line [ "id" ];
120 $this_row_id = "id= \" FCATR- $profile_id\" " ;
122 print "<tr class= \"\" $this_row_id >" ;
124 $edit_title = htmlspecialchars ( $line [ "title" ]);
126 print "<td width='5%' align='center'><input
127 onclick='toggleSelectRow2(this);'
128 dojoType= \" dijit.form.CheckBox \"
129 type= \" checkbox \" ></td>" ;
131 if ( $_SESSION [ "profile" ] == $line [ "id" ]) {
132 $is_active = __ ( "(active)" );
137 print "<td><span dojoType= \" dijit.InlineEditBox \"
138 width= \" 300px \" autoSave= \" false \"
139 profile-id= \" $profile_id\" >" . $edit_title .
140 "<script type= \" dojo/method \" event= \" onChange \" args= \" item \" >
144 content: {op: 'rpc', subop: 'saveprofile',
146 id: this.srcNodeRef.getAttribute('profile-id')},
147 load: function(response) {
148 elem.attr('value', response);
152 </span> $is_active </td>" ;
163 print "<div class='dlgButtons'>
164 <div style='float : left'>
165 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').removeSelected() \" >" .
166 __ ( 'Remove selected profiles' ). "</button>
167 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').activateProfile() \" >" .
168 __ ( 'Activate profile' ). "</button>
171 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').hide() \" >" .
172 __ ( 'Close this window' ). "</button>" ;
177 if ( $id == "pubOPMLUrl" ) {
179 print "<title>" . __ ( 'Public OPML URL' ). "</title>" ;
180 print "<content><![CDATA[" ;
182 $url_path = opml_publish_url ( $link );
184 print __ ( "Your Public OPML URL is:" );
186 print "<div class= \" tagCloudContainer \" >" ;
187 print "<a id='pub_opml_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
190 print "<div align='center'>" ;
192 print "<button dojoType= \" dijit.form.Button \" onclick= \" return opmlRegenKey() \" >" .
193 __ ( 'Generate new URL' ). "</button> " ;
195 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
196 __ ( 'Close this window' ). "</button>" ;
199 print "]]></content>" ;
204 if ( $id == "explainError" ) {
206 print "<title>" . __ ( 'Notice' ). "</title>" ;
207 print "<content><![CDATA[" ;
209 print "<div class= \" errorExplained \" >" ;
212 print __ ( "Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner." );
214 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
216 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
221 $msg = check_for_update ( $link );
224 print __ ( "You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug." );
232 print __ ( "Update daemon is taking too long to perform a feed update. This could indicate a problem like crash or a hang. Please check the daemon process or contact instance owner." );
234 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
236 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
242 print "<div align='center'>" ;
244 print "<button onclick= \" return closeInfoBox() \" " .
245 __ ( 'Close this window' ). "</button>" ;
248 print "]]></content>" ;
253 if ( $id == "quickAddFeed" ) {
255 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
256 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" addfeed \" >" ;
258 print "<div class= \" dlgSec \" >" . __ ( "Feed" ). "</div>" ;
259 print "<div class= \" dlgSecCont \" >" ;
261 print "<input style= \" font-size : 16px; width : 20em; \"
262 placeHolder= \" " . __ ( "Feed URL" ). " \"
263 dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \" name= \" feed \" id= \" feedDlg_feedUrl \" >" ;
267 if ( get_pref ( $link , 'ENABLE_FEED_CATS' )) {
268 print __ ( 'Place in category:' ) . " " ;
269 print_feed_cat_select ( $link , "cat" , false , 'dojoType="dijit.form.Select"' );
274 print '<div id="feedDlg_feedsContainer" style="display : none">
276 <div class="dlgSec">' . __ ( 'Available feeds' ) . '</div>
277 <div class="dlgSecCont">' .
278 '<select id="feedDlg_feedContainerSelect"
279 dojoType="dijit.form.Select" size="3">
280 <script type="dojo/method" event="onChange" args="value">
281 dijit.byId("feedDlg_feedUrl").attr("value", value);
286 print "<div id='feedDlg_loginContainer' style='display : none'>
288 <div class= \" dlgSec \" >" . __ ( "Authentication" ). "</div>
289 <div class= \" dlgSecCont \" >" .
291 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
292 placeHolder= \" " . __ ( "Login" ). " \"
293 style= \" width : 10em; \" > " .
295 placeHolder= \" " . __ ( "Password" ). " \"
296 dojoType= \" dijit.form.TextBox \" type='password'
297 style= \" width : 10em; \" name='pass' \" >
301 print "<div style= \" clear : both \" >
302 <input type= \" checkbox \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
303 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
304 <label for= \" feedDlg_loginCheck \" >" .
305 __ ( 'This feed requires authentication.' ). "</div>" ;
309 print "<div class= \" dlgButtons \" >
310 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
311 <button dojoType= \" dijit.form.Button \" onclick= \" return feedBrowser() \" >" . __ ( 'More feeds' ). "</button>
312 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
318 if ( $id == "feedBrowser" ) {
320 $browser_search = db_escape_string ( $_REQUEST [ "search" ]);
322 # print "<form onsubmit='return false;' display='inline'
323 # name='feed_browser' id='feed_browser'>";
325 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
326 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" updateFeedBrowser \" >" ;
328 print "<div dojoType= \" dijit.Toolbar \" >
329 <div style='float : right'>
330 <img style='display : none'
331 id='feed_browser_spinner' src='" .
332 theme_image ( $link , 'images/indicator_white.gif' ). "'>
333 <input name= \" search \" dojoType= \" dijit.form.TextBox \" size= \" 20 \" type= \" search \"
334 onchange= \" dijit.byId('feedBrowserDlg').update() \" value= \" $browser_search\" >
335 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').update() \" >" . __ ( 'Search' ). "</button>
338 print " <select name= \" mode \" dojoType= \" dijit.form.Select \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >
339 <option value='1'>" . __ ( 'Popular feeds' ) . "</option>
340 <option value='2'>" . __ ( 'Feed archive' ) . "</option>
345 print " <select dojoType= \" dijit.form.Select \" name= \" limit \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >" ;
347 foreach ( array ( 25 , 50 , 100 , 200 ) as $l ) {
348 $issel = ( $l == $limit ) ?
"selected= \" 1 \" " : "" ;
349 print "<option $issel value= \" $l\" > $l </option>" ;
356 $owner_uid = $_SESSION [ "uid" ];
358 print "<ul class='browseFeedList' id='browseFeedList'>" ;
359 print_feed_browser ( $link , $search , 25 );
362 print "<div align='center'>
363 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
364 <button dojoType= \" dijit.form.Button \" style='display : none' id='feed_archive_remove' onclick= \" dijit.byId('feedBrowserDlg').removeFromArchive() \" >" . __ ( 'Remove' ). "</button>
365 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').hide() \" >" . __ ( 'Cancel' ). "</button></div>" ;
369 if ( $id == "search" ) {
371 $params = explode ( ":" , db_escape_string ( $_REQUEST [ "param" ]), 2 );
373 $active_feed_id = sprintf ( " %d " , $params [ 0 ]);
374 $is_cat = ( bool ) $params [ 1 ];
376 print "<div class= \" dlgSec \" >" . __ ( 'Look for' ). "</div>" ;
378 print "<div class= \" dlgSecCont \" >" ;
380 if (! SPHINX_ENABLE
) {
382 print "<input dojoType= \" dijit.form.ValidationTextBox \"
383 style= \" font-size : 16px; width : 12em; \"
384 required= \" 1 \" name= \" query \" type= \" search \" value=''>" ;
386 print " " . __ ( 'match on' ). " " ;
388 $search_fields = array (
389 "title" => __ ( "Title" ),
390 "content" => __ ( "Content" ),
391 "both" => __ ( "Title or content" ));
393 print_select_hash ( "match_on" , 3 , $search_fields ,
394 'dojoType="dijit.form.Select"' );
396 print "<input dojoType= \" dijit.form.ValidationTextBox \"
397 style= \" font-size : 16px; width : 20em; \"
398 required= \" 1 \" name= \" query \" type= \" search \" value=''>" ;
402 print "<hr/>" . __ ( 'Limit search to:' ). " " ;
404 print "<select name= \" search_mode \" dojoType= \" dijit.form.Select \" >
405 <option value= \" all_feeds \" >" . __ ( 'All feeds' ). "</option>" ;
407 $feed_title = getFeedTitle ( $link , $active_feed_id );
410 $feed_cat_title = getFeedCatTitle ( $link , $active_feed_id );
412 $feed_cat_title = getCategoryTitle ( $link , $active_feed_id );
415 if ( $active_feed_id && ! $is_cat ) {
416 print "<option selected= \" 1 \" value= \" this_feed \" > $feed_title </option>" ;
418 print "<option disabled= \" 1 \" value= \" false \" >" . __ ( 'This feed' ). "</option>" ;
422 $cat_preselected = "selected= \" 1 \" " ;
425 if ( get_pref ( $link , 'ENABLE_FEED_CATS' ) && ( $active_feed_id > 0 ||
$is_cat )) {
426 print "<option $cat_preselected value= \" this_cat \" > $feed_cat_title </option>" ;
428 //print "<option disabled>".__('This category')."</option>";
435 print "<div class= \" dlgButtons \" >
436 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').execute() \" >" . __ ( 'Search' ). "</button>
437 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
441 if ( $id == "quickAddFilter" ) {
443 $active_feed_id = db_escape_string ( $_REQUEST [ "param" ]);
445 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" pref-filters \" >" ;
446 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" quiet \" value= \" 1 \" >" ;
447 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" add \" >" ;
449 $result = db_query ( $link , "SELECT id,description
450 FROM ttrss_filter_types ORDER BY description" );
452 $filter_types = array ();
454 while ( $line = db_fetch_assoc ( $result )) {
455 //array_push($filter_types, $line["description"]);
456 $filter_types [ $line [ "id" ]] = __ ( $line [ "description" ]);
459 print "<div class= \" dlgSec \" >" . __ ( "Match" ). "</div>" ;
461 print "<div class= \" dlgSecCont \" >" ;
463 print "<span id= \" filterDlg_dateModBox \" style= \" display : none \" >" ;
465 $filter_params = array (
466 "before" => __ ( "before" ),
467 "after" => __ ( "after" ));
469 print_select_hash ( "filter_date_modifier" , "before" ,
470 $filter_params , 'dojoType="dijit.form.Select"' );
472 print " </span>" ;
474 print "<input dojoType= \" dijit.form.ValidationTextBox \"
475 required= \" true \" id= \" filterDlg_regExp \"
476 style= \" font-size : 16px \"
477 name= \" reg_exp \" value= \" $reg_exp\" />" ;
479 print "<span id= \" filterDlg_dateChkBox \" style= \" display : none \" >" ;
480 print " <button onclick= \" return filterDlgCheckDate() \" >" .
481 __ ( 'Check it' ). "</button>" ;
484 print "<hr/>" . __ ( "on field" ) . " " ;
485 print_select_hash ( "filter_type" , 1 , $filter_types ,
486 'onchange="filterDlgCheckType(this)" dojoType="dijit.form.Select"' );
490 print __ ( "in" ) . " " ;
491 print_feed_select ( $link , "feed_id" , $active_feed_id ,
492 'dojoType="dijit.form.FilteringSelect"' );
496 print "<div class= \" dlgSec \" >" . __ ( "Perform Action" ). "</div>" ;
498 print "<div class= \" dlgSecCont \" >" ;
500 print "<select name= \" action_id \" dojoType= \" dijit.form.Select \"
501 onchange= \" filterDlgCheckAction(this) \" >" ;
503 $result = db_query ( $link , "SELECT id,description FROM ttrss_filter_actions
506 while ( $line = db_fetch_assoc ( $result )) {
507 printf ( "<option value=' %d '> %s </option>" , $line [ "id" ], __ ( $line [ "description" ]));
512 print "<span id= \" filterDlg_paramBox \" style= \" display : none \" >" ;
513 print " " . __ ( "with parameters:" ) . " " ;
514 print "<input dojoType= \" dijit.form.TextBox \"
515 id= \" filterDlg_actionParam \"
516 name= \" action_param \" >" ;
518 print_label_select ( $link , "action_param_label" , $action_param ,
519 'id="filterDlg_actionParamLabel" dojoType="dijit.form.Select"' );
523 print " " ; // tiny layout hack
527 print "<div class= \" dlgSec \" >" . __ ( "Options" ). "</div>" ;
528 print "<div class= \" dlgSecCont \" >" ;
530 print "<input dojoType= \" dijit.form.CheckBox \" type= \" checkbox \" name= \" enabled \" id= \" enabled \" checked= \" 1 \" >
531 <label for= \" enabled \" >" . __ ( 'Enabled' ). "</label><hr/>" ;
533 print "<input dojoType= \" dijit.form.CheckBox \" type= \" checkbox \" name= \" inverse \" id= \" inverse \" >
534 <label for= \" inverse \" >" . __ ( 'Inverse match' ). "</label>" ;
538 print "<div class= \" dlgButtons \" >" ;
540 print "<button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('filterEditDlg').execute() \" >" .
541 __ ( 'Create' ). "</button> " ;
543 print "<button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('filterEditDlg').hide() \" >" .
544 __ ( 'Cancel' ). "</button>" ;
551 if ( $id == "feedUpdateErrors" ) {
553 print "<title>" . __ ( 'Feeds with update errors' ). "</title>" ;
554 print "<content><![CDATA[" ;
556 print __ ( "These feeds have not been updated because of errors:" );
558 $result = db_query ( $link , "SELECT id,title,feed_url,last_error
559 FROM ttrss_feeds WHERE last_error != '' AND owner_uid = " . $_SESSION [ "uid" ]);
561 print "<ul class='feedErrorsList'>" ;
563 while ( $line = db_fetch_assoc ( $result )) {
564 print "<li><b>" . $line [ "title" ] . "</b> (" . $line [ "feed_url" ] . "): " .
565 "<em>" . $line [ "last_error" ] . "</em>" ;
570 print "<div align='center'>" ;
572 print "<button dojoType= \" dijit.form.Button \"
573 onclick= \" return closeInfoBox() \" >" .
574 __ ( 'Close this window' ). "</button>" ;
576 print "]]></content>" ;
581 if ( $id == "editArticleTags" ) {
583 print "<title>" . __ ( 'Edit Tags' ). "</title>" ;
584 print "<content><![CDATA[" ;
586 print "<form id= \" tag_edit_form \" onsubmit='return false'>" ;
588 print __ ( "Tags for this article (separated by commas):" ). "<br>" ;
590 $tags = get_article_tags ( $link , $param );
592 $tags_str = join ( ", " , $tags );
594 print "<table width='100%'>" ;
596 print "<tr><td colspan='2'><input type= \" hidden \" name= \" id \" value= \" $param\" ></td></tr>" ;
598 print "<tr><td colspan='2'><textarea rows='4' class='iedit' id='tags_str'
599 name='tags_str'> $tags_str </textarea>
600 <div class= \" autocomplete \" id= \" tags_choices \"
601 style= \" display:none \" ></div>
608 print "<div align='right'>" ;
610 print "<button onclick= \" return editTagsSave() \" >" . __ ( 'Save' ). "</button> " ;
611 print "<button onclick= \" return closeInfoBox() \" >" . __ ( 'Cancel' ). "</button>" ;
613 print "]]></content>" ;
618 if ( $id == "printTagCloud" ) {
619 print "<title>" . __ ( 'Tag Cloud' ). "</title>" ;
620 print "<content><![CDATA[" ;
622 # print __("Showing most popular tags ")." (<a
623 # href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>";
625 print "<div class= \" tagCloudContainer \" >" ;
627 printTagCloud ( $link );
631 print "<div align='center'>" ;
632 print "<button dojoType= \" dijit.form.Button \"
633 onclick= \" return closeInfoBox() \" >" .
634 __ ( 'Close this window' ). "</button>" ;
637 print "]]></content>" ;
642 if ( $id == "emailArticle" ) {
644 $secretkey = sha1 ( uniqid ( rand (), true ));
646 $_SESSION [ 'email_secretkey' ] = $secretkey ;
648 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" secretkey \" value= \" $secretkey\" >" ;
649 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
650 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" sendEmail \" >" ;
652 $result = db_query ( $link , "SELECT email, full_name FROM ttrss_users WHERE
653 id = " . $_SESSION [ "uid" ]);
655 $user_email = htmlspecialchars ( db_fetch_result ( $result , 0 , "email" ));
656 $user_name = htmlspecialchars ( db_fetch_result ( $result , 0 , "full_name" ));
658 if (! $user_name ) $user_name = $_SESSION [ 'name' ];
660 $_SESSION [ 'email_replyto' ] = $user_email ;
661 $_SESSION [ 'email_fromname' ] = $user_name ;
663 require_once "lib/MiniTemplator.class.php" ;
665 $tpl = new MiniTemplator
;
666 $tpl_t = new MiniTemplator
;
668 $tpl -> readTemplateFromFile ( "templates/email_article_template.txt" );
670 $tpl -> setVariable ( 'USER_NAME' , $_SESSION [ "name" ]);
671 $tpl -> setVariable ( 'USER_EMAIL' , $user_email );
672 $tpl -> setVariable ( 'TTRSS_HOST' , $_SERVER [ "HTTP_HOST" ]);
674 // $tpl->addBlock('header');
676 $result = db_query ( $link , "SELECT link, content, title
677 FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND
678 id IN ( $param ) AND owner_uid = " . $_SESSION [ "uid" ]);
680 if ( db_num_rows ( $result ) > 1 ) {
681 $subject = __ ( "[Forwarded]" ) . " " . __ ( "Multiple articles" );
684 while ( $line = db_fetch_assoc ( $result )) {
687 $subject = __ ( "[Forwarded]" ) . " " . htmlspecialchars ( $line [ "title" ]);
689 $tpl -> setVariable ( 'ARTICLE_TITLE' , strip_tags ( $line [ "title" ]));
690 $tpl -> setVariable ( 'ARTICLE_URL' , strip_tags ( $line [ "link" ]));
692 $tpl -> addBlock ( 'article' );
695 $tpl -> addBlock ( 'email' );
698 $tpl -> generateOutputToString ( $content );
700 print "<table width='100%'><tr><td>" ;
706 print "<input dojoType= \" dijit.form.TextBox \" disabled= \" 1 \" style= \" width : 30em; \"
707 value= \" $user_name < $user_email > \" >" ;
709 print "</td></tr><tr><td>" ;
715 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" true \"
716 style= \" width : 30em; \"
717 name= \" destination \" id= \" emailArticleDlg_destination \" >" ;
719 print "<div class= \" autocomplete \" id= \" emailArticleDlg_dst_choices \"
720 style= \" z-index: 30; display : none \" ></div>" ;
722 print "</td></tr><tr><td>" ;
724 print __ ( 'Subject:' );
728 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" true \"
729 style= \" width : 30em; \"
730 name= \" subject \" value= \" $subject\" id= \" subject \" >" ;
734 print "<tr><td colspan='2'><textarea dojoType= \" dijit.form.SimpleTextarea \" style='font-size : 12px; width : 100%' rows= \" 20 \"
735 name='content'> $content </textarea>" ;
737 print "</td></tr></table>" ;
739 print "<div class='dlgButtons'>" ;
740 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('emailArticleDlg').execute() \" >" . __ ( 'Send e-mail' ). "</button> " ;
741 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('emailArticleDlg').hide() \" >" . __ ( 'Cancel' ). "</button>" ;
747 if ( $id == "generatedFeed" ) {
749 print "<title>" . __ ( 'View as RSS' ). "</title>" ;
750 print "<content><![CDATA[" ;
752 $params = explode ( ":" , $param , 3 );
753 $feed_id = db_escape_string ( $params [ 0 ]);
754 $is_cat = ( bool ) $params [ 1 ];
756 $key = get_feed_access_key ( $link , $feed_id , $is_cat );
758 $url_path = htmlspecialchars ( $params [ 2 ]) . "&key=" . $key ;
760 print __ ( "You can view this feed as RSS using the following URL:" );
762 print "<div class= \" tagCloudContainer \" >" ;
763 print "<a id='gen_feed_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
766 print "<div align='center'>" ;
768 print "<button dojoType= \" dijit.form.Button \" onclick= \" return genUrlChangeKey(' $feed_id ', ' $is_cat ') \" >" .
769 __ ( 'Generate new URL' ). "</button> " ;
771 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
772 __ ( 'Close this window' ). "</button>" ;
775 print "]]></content>" ;