]>
git.wh0rd.org - tt-rss.git/blob - modules/popup-dialog.php
5d225da57fa80d2868abfa215fa0cbe42cc4d0b5
2 function module_popup_dialog ( $link ) {
4 $param = db_escape_string ( $_REQUEST [ "param" ]);
6 print "<dlg id= \" $id\" >" ;
8 if ( $id == "importOpml" ) {
9 print "<title>" . __ ( 'OPML Import' ). "</title>" ;
10 print "<content><![CDATA[" ;
12 print "<div class= \" prefFeedCatHolder \" >" ;
14 $owner_uid = $_SESSION [ "uid" ];
16 db_query ( $link , "BEGIN" );
18 /* create Imported feeds category just in case */
20 $result = db_query ( $link , "SELECT id FROM
21 ttrss_feed_categories WHERE title = 'Imported feeds' AND
22 owner_uid = ' $owner_uid ' LIMIT 1" );
24 if ( db_num_rows ( $result ) == 0 ) {
25 db_query ( $link , "INSERT INTO ttrss_feed_categories
27 VALUES ('Imported feeds', ' $owner_uid ')" );
30 db_query ( $link , "COMMIT" );
32 /* Handle OPML import by DOMXML/DOMDocument */
34 if ( function_exists ( 'domxml_open_file' )) {
35 print "<ul class='nomarks'>" ;
36 print "<li>" . __ ( "Importing using DOMXML." ). "</li>" ;
37 require_once "opml_domxml.php" ;
38 opml_import_domxml ( $link , $owner_uid );
40 } else if ( PHP_VERSION
>= 5 ) {
41 print "<ul class='nomarks'>" ;
42 print "<li>" . __ ( "Importing using DOMDocument." ). "</li>" ;
43 require_once "opml_domdoc.php" ;
44 opml_import_domdoc ( $link , $owner_uid );
47 print_error ( __ ( "DOMXML extension is not found. It is required for PHP versions below 5." ));
52 print "<div align='center'>" ;
54 print "<button onclick= \" return opmlImportDone() \" >" .
55 __ ( 'Close this window' ). "</button>" ;
59 print "<script type= \" text/javascript \" >" ;
60 print "parent.opmlImportHandler(this)" ;
64 print "]]></content>" ;
69 if ( $id == "editPrefProfiles" ) {
71 print "<div dojoType= \" dijit.Toolbar \" >" ;
73 # TODO: depends on selectTableRows() being broken for this list
74 # print "<div dojoType=\"dijit.form.DropDownButton\">".
75 # "<span>" . __('Select')."</span>";
76 # print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
77 # print "<div onclick=\"selectTableRows('prefFeedProfileList', 'all')\"
78 # dojoType=\"dijit.MenuItem\">".__('All')."</div>";
79 # print "<div onclick=\"selectTableRows('prefFeedProfileList', 'none')\"
80 # dojoType=\"dijit.MenuItem\">".__('None')."</div>";
81 # print "</div></div>";
83 # print "<div style='float : right'>";
84 print "<input name= \" newprofile \" dojoType= \" dijit.form.ValidationTextBox \"
86 <button dojoType= \" dijit.form.Button \"
87 onclick= \" dijit.byId('profileEditDlg').addProfile() \" >" .
88 __ ( 'Create profile' ). "</button></div>" ;
93 $result = db_query ( $link , "SELECT title,id FROM ttrss_settings_profiles
94 WHERE owner_uid = " . $_SESSION [ "uid" ]. " ORDER BY title" );
96 print "<div class= \" prefFeedCatHolder \" >" ;
98 print "<form id= \" profile_edit_form \" onsubmit= \" return false \" >" ;
100 print "<table width= \" 100% \" class= \" prefFeedProfileList \"
101 cellspacing= \" 0 \" id= \" prefFeedProfileList \" >" ;
103 print "<tr class= \"\" id= \" FCATR-0 \" >" ; #odd
105 print "<td width='5%' align='center'><input
106 onclick='toggleSelectRow2(this);'
107 dojoType= \" dijit.form.CheckBox \"
108 type= \" checkbox \" ></td>" ;
110 if (! $_SESSION [ "profile" ]) {
111 $is_active = __ ( "(active)" );
117 __ ( "Default profile" ) . " $is_active </span></td>" ;
123 while ( $line = db_fetch_assoc ( $result )) {
125 $class = ( $lnum %
2 ) ?
"even" : "odd" ;
127 $profile_id = $line [ "id" ];
128 $this_row_id = "id= \" FCATR- $profile_id\" " ;
130 print "<tr class= \"\" $this_row_id >" ;
132 $edit_title = htmlspecialchars ( $line [ "title" ]);
134 print "<td width='5%' align='center'><input
135 onclick='toggleSelectRow2(this);'
136 dojoType= \" dijit.form.CheckBox \"
137 type= \" checkbox \" ></td>" ;
139 if ( $_SESSION [ "profile" ] == $line [ "id" ]) {
140 $is_active = __ ( "(active)" );
145 print "<td><span dojoType= \" dijit.InlineEditBox \"
146 width= \" 300px \" autoSave= \" false \"
147 profile-id= \" $profile_id\" >" . $edit_title .
148 "<script type= \" dojo/method \" event= \" onChange \" args= \" item \" >
152 content: {op: 'rpc', subop: 'saveprofile',
154 id: this.srcNodeRef.getAttribute('profile-id')},
155 load: function(response) {
156 elem.attr('value', response);
160 </span> $is_active </td>" ;
171 print "<div class='dlgButtons'>
172 <div style='float : left'>
173 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').removeSelected() \" >" .
174 __ ( 'Remove selected profiles' ). "</button>
175 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').activateProfile() \" >" .
176 __ ( 'Activate profile' ). "</button>
179 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').hide() \" >" .
180 __ ( 'Close this window' ). "</button>" ;
185 if ( $id == "pubOPMLUrl" ) {
187 print "<title>" . __ ( 'Public OPML URL' ). "</title>" ;
188 print "<content><![CDATA[" ;
190 $url_path = opml_publish_url ( $link );
192 print __ ( "Your Public OPML URL is:" );
194 print "<div class= \" tagCloudContainer \" >" ;
195 print "<a id='pub_opml_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
198 print "<div align='center'>" ;
200 print "<button dojoType= \" dijit.form.Button \" onclick= \" return opmlRegenKey() \" >" .
201 __ ( 'Generate new URL' ). "</button> " ;
203 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
204 __ ( 'Close this window' ). "</button>" ;
207 print "]]></content>" ;
212 if ( $id == "explainError" ) {
214 print "<title>" . __ ( 'Notice' ). "</title>" ;
215 print "<content><![CDATA[" ;
217 print "<div class= \" errorExplained \" >" ;
220 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." );
222 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
224 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
229 $msg = check_for_update ( $link );
232 print __ ( "You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug." );
240 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." );
242 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
244 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
250 print "<div align='center'>" ;
252 print "<button onclick= \" return closeInfoBox() \" " .
253 __ ( 'Close this window' ). "</button>" ;
256 print "]]></content>" ;
261 if ( $id == "quickAddFeed" ) {
263 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
264 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" addfeed \" >" ;
266 print "<div class= \" dlgSec \" >" . __ ( "Feed" ). "</div>" ;
267 print "<div class= \" dlgSecCont \" >" ;
269 print "<input style= \" font-size : 16px; width : 20em; \"
270 placeHolder= \" " . __ ( "Feed URL" ). " \"
271 dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \" name= \" feed \" id= \" feedDlg_feedUrl \" >" ;
275 if ( get_pref ( $link , 'ENABLE_FEED_CATS' )) {
276 print __ ( 'Place in category:' ) . " " ;
277 print_feed_cat_select ( $link , "cat" , false , 'dojoType="dijit.form.Select"' );
282 print '<div id="feedDlg_feedsContainer" style="display : none">
284 <div class="dlgSec">' . __ ( 'Available feeds' ) . '</div>
285 <div class="dlgSecCont">' .
286 '<select id="feedDlg_feedContainerSelect"
287 dojoType="dijit.form.Select" size="3">
288 <script type="dojo/method" event="onChange" args="value">
289 dijit.byId("feedDlg_feedUrl").attr("value", value);
294 print "<div id='feedDlg_loginContainer' style='display : none'>
296 <div class= \" dlgSec \" >" . __ ( "Authentication" ). "</div>
297 <div class= \" dlgSecCont \" >" .
299 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
300 placeHolder= \" " . __ ( "Login" ). " \"
301 style= \" width : 10em; \" > " .
303 placeHolder= \" " . __ ( "Password" ). " \"
304 dojoType= \" dijit.form.TextBox \" type='password'
305 style= \" width : 10em; \" name='pass' \" >
309 print "<div style= \" clear : both \" >
310 <input type= \" checkbox \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
311 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
312 <label for= \" feedDlg_loginCheck \" >" .
313 __ ( 'This feed requires authentication.' ). "</div>" ;
317 print "<div class= \" dlgButtons \" >
318 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
319 <button dojoType= \" dijit.form.Button \" onclick= \" return feedBrowser() \" >" . __ ( 'More feeds' ). "</button>
320 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
326 if ( $id == "feedBrowser" ) {
328 $browser_search = db_escape_string ( $_REQUEST [ "search" ]);
330 # print "<form onsubmit='return false;' display='inline'
331 # name='feed_browser' id='feed_browser'>";
333 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
334 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" updateFeedBrowser \" >" ;
336 print "<div dojoType= \" dijit.Toolbar \" >
337 <div style='float : right'>
338 <img style='display : none'
339 id='feed_browser_spinner' src='" .
340 theme_image ( $link , 'images/indicator_white.gif' ). "'>
341 <input name= \" search \" dojoType= \" dijit.form.TextBox \" size= \" 20 \" type= \" search \"
342 onchange= \" dijit.byId('feedBrowserDlg').update() \" value= \" $browser_search\" >
343 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').update() \" >" . __ ( 'Search' ). "</button>
346 print " <select name= \" mode \" dojoType= \" dijit.form.Select \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >
347 <option value='1'>" . __ ( 'Popular feeds' ) . "</option>
348 <option value='2'>" . __ ( 'Feed archive' ) . "</option>
353 print " <select dojoType= \" dijit.form.Select \" name= \" limit \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >" ;
355 foreach ( array ( 25 , 50 , 100 , 200 ) as $l ) {
356 $issel = ( $l == $limit ) ?
"selected= \" 1 \" " : "" ;
357 print "<option $issel value= \" $l\" > $l </option>" ;
364 $owner_uid = $_SESSION [ "uid" ];
366 print "<ul class='browseFeedList' id='browseFeedList'>" ;
367 print_feed_browser ( $link , $search , 25 );
370 print "<div align='center'>
371 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
372 <button dojoType= \" dijit.form.Button \" style='display : none' id='feed_archive_remove' onclick= \" dijit.byId('feedBrowserDlg').removeFromArchive() \" >" . __ ( 'Remove' ). "</button>
373 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').hide() \" >" . __ ( 'Cancel' ). "</button></div>" ;
377 if ( $id == "search" ) {
379 $params = explode ( ":" , db_escape_string ( $_REQUEST [ "param" ]), 2 );
381 $active_feed_id = sprintf ( " %d " , $params [ 0 ]);
382 $is_cat = ( bool ) $params [ 1 ];
384 print "<div class= \" dlgSec \" >" . __ ( 'Look for' ). "</div>" ;
386 print "<div class= \" dlgSecCont \" >" ;
388 if (! SPHINX_ENABLE
) {
390 print "<input onkeypress= \" return filterCR(event, search) \"
391 name= \" query \" size= \" 20 \" type= \" search \" value=''>" ;
393 print " " . __ ( 'match on' ). " " ;
395 $search_fields = array (
396 "title" => __ ( "Title" ),
397 "content" => __ ( "Content" ),
398 "both" => __ ( "Title or content" ));
400 print_select_hash ( "match_on" , 3 , $search_fields );
402 print "<input dojoType= \" dijit.form.ValidationTextBox \"
403 style= \" font-size : 16px; width : 20em; \"
404 required= \" 1 \" name= \" query \" type= \" search \" value=''>" ;
408 print "<br/>" . __ ( 'Limit search to:' ). " " ;
410 print "<select name= \" search_mode \" dojoType= \" dijit.form.Select \" >
411 <option value= \" all_feeds \" >" . __ ( 'All feeds' ). "</option>" ;
413 $feed_title = getFeedTitle ( $link , $active_feed_id );
416 $feed_cat_title = getFeedCatTitle ( $link , $active_feed_id );
418 $feed_cat_title = getCategoryTitle ( $link , $active_feed_id );
421 if ( $active_feed_id && ! $is_cat ) {
422 print "<option selected= \" 1 \" value= \" this_feed \" > $feed_title </option>" ;
424 print "<option disabled= \" 1 \" value= \" false \" >" . __ ( 'This feed' ). "</option>" ;
428 $cat_preselected = "selected= \" 1 \" " ;
431 if ( get_pref ( $link , 'ENABLE_FEED_CATS' ) && ( $active_feed_id > 0 ||
$is_cat )) {
432 print "<option $cat_preselected value= \" this_cat \" > $feed_cat_title </option>" ;
434 //print "<option disabled>".__('This category')."</option>";
441 print "<div class= \" dlgButtons \" >
442 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').execute() \" >" . __ ( 'Search' ). "</button>
443 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
447 if ( $id == "quickAddFilter" ) {
449 $active_feed_id = db_escape_string ( $_REQUEST [ "param" ]);
451 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" pref-filters \" >" ;
452 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" quiet \" value= \" 1 \" >" ;
453 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" add \" >" ;
455 $result = db_query ( $link , "SELECT id,description
456 FROM ttrss_filter_types ORDER BY description" );
458 $filter_types = array ();
460 while ( $line = db_fetch_assoc ( $result )) {
461 //array_push($filter_types, $line["description"]);
462 $filter_types [ $line [ "id" ]] = __ ( $line [ "description" ]);
465 print "<div class= \" dlgSec \" >" . __ ( "Match" ). "</div>" ;
467 print "<div class= \" dlgSecCont \" >" ;
469 print "<span id= \" filterDlg_dateModBox \" style= \" display : none \" >" ;
471 $filter_params = array (
472 "before" => __ ( "before" ),
473 "after" => __ ( "after" ));
475 print_select_hash ( "filter_date_modifier" , "before" ,
476 $filter_params , 'dojoType="dijit.form.Select"' );
478 print " </span>" ;
480 print "<input dojoType= \" dijit.form.ValidationTextBox \"
481 required= \" true \" id= \" filterDlg_regExp \"
482 style= \" font-size : 16px \"
483 name= \" reg_exp \" value= \" $reg_exp\" />" ;
485 print "<span id= \" filterDlg_dateChkBox \" style= \" display : none \" >" ;
486 print " <button onclick= \" return filterDlgCheckDate() \" >" .
487 __ ( 'Check it' ). "</button>" ;
490 print "<br/>" . __ ( "on field" ) . " " ;
491 print_select_hash ( "filter_type" , 1 , $filter_types ,
492 'onchange="filterDlgCheckType(this)" dojoType="dijit.form.Select"' );
496 print __ ( "in" ) . " " ;
497 print_feed_select ( $link , "feed_id" , $active_feed_id ,
498 'dojoType="dijit.form.FilteringSelect"' );
502 print "<div class= \" dlgSec \" >" . __ ( "Perform Action" ). "</div>" ;
504 print "<div class= \" dlgSecCont \" >" ;
506 print "<select name= \" action_id \" dojoType= \" dijit.form.Select \"
507 onchange= \" filterDlgCheckAction(this) \" >" ;
509 $result = db_query ( $link , "SELECT id,description FROM ttrss_filter_actions
512 while ( $line = db_fetch_assoc ( $result )) {
513 printf ( "<option value=' %d '> %s </option>" , $line [ "id" ], __ ( $line [ "description" ]));
518 print "<span id= \" filterDlg_paramBox \" style= \" display : none \" >" ;
519 print " " . __ ( "with parameters:" ) . " " ;
520 print "<input dojoType= \" dijit.form.TextBox \"
521 id= \" filterDlg_actionParam \"
522 name= \" action_param \" >" ;
524 print_label_select ( $link , "action_param_label" , $action_param ,
525 'id="filterDlg_actionParamLabel" dojoType="dijit.form.Select"' );
529 print " " ; // tiny layout hack
533 print "<div class= \" dlgSec \" >" . __ ( "Options" ). "</div>" ;
534 print "<div class= \" dlgSecCont \" >" ;
536 print "<input dojoType= \" dijit.form.CheckBox \" type= \" checkbox \" name= \" enabled \" id= \" enabled \" checked= \" 1 \" >
537 <label for= \" enabled \" >" . __ ( 'Enabled' ). "</label><br/>" ;
539 print "<input dojoType= \" dijit.form.CheckBox \" type= \" checkbox \" name= \" inverse \" id= \" inverse \" >
540 <label for= \" inverse \" >" . __ ( 'Inverse match' ). "</label>" ;
544 print "<div class= \" dlgButtons \" >" ;
546 print "<button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('filterEditDlg').execute() \" >" .
547 __ ( 'Create' ). "</button> " ;
549 print "<button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('filterEditDlg').hide() \" >" .
550 __ ( 'Cancel' ). "</button>" ;
557 if ( $id == "feedUpdateErrors" ) {
559 print "<title>" . __ ( 'Feeds with update errors' ). "</title>" ;
560 print "<content><![CDATA[" ;
562 print __ ( "These feeds have not been updated because of errors:" );
564 $result = db_query ( $link , "SELECT id,title,feed_url,last_error
565 FROM ttrss_feeds WHERE last_error != '' AND owner_uid = " . $_SESSION [ "uid" ]);
567 print "<ul class='feedErrorsList'>" ;
569 while ( $line = db_fetch_assoc ( $result )) {
570 print "<li><b>" . $line [ "title" ] . "</b> (" . $line [ "feed_url" ] . "): " .
571 "<em>" . $line [ "last_error" ] . "</em>" ;
576 print "<div align='center'>" ;
578 print "<button dojoType= \" dijit.form.Button \"
579 onclick= \" return closeInfoBox() \" >" .
580 __ ( 'Close this window' ). "</button>" ;
582 print "]]></content>" ;
587 if ( $id == "editArticleTags" ) {
589 print "<title>" . __ ( 'Edit Tags' ). "</title>" ;
590 print "<content><![CDATA[" ;
592 print "<form id= \" tag_edit_form \" onsubmit='return false'>" ;
594 print __ ( "Tags for this article (separated by commas):" ). "<br>" ;
596 $tags = get_article_tags ( $link , $param );
598 $tags_str = join ( ", " , $tags );
600 print "<table width='100%'>" ;
602 print "<tr><td colspan='2'><input type= \" hidden \" name= \" id \" value= \" $param\" ></td></tr>" ;
604 print "<tr><td colspan='2'><textarea rows='4' class='iedit' id='tags_str'
605 name='tags_str'> $tags_str </textarea>
606 <div class= \" autocomplete \" id= \" tags_choices \"
607 style= \" display:none \" ></div>
614 print "<div align='right'>" ;
616 print "<button onclick= \" return editTagsSave() \" >" . __ ( 'Save' ). "</button> " ;
617 print "<button onclick= \" return closeInfoBox() \" >" . __ ( 'Cancel' ). "</button>" ;
619 print "]]></content>" ;
624 if ( $id == "printTagCloud" ) {
625 print "<title>" . __ ( 'Tag Cloud' ). "</title>" ;
626 print "<content><![CDATA[" ;
628 # print __("Showing most popular tags ")." (<a
629 # href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>";
631 print "<div class= \" tagCloudContainer \" >" ;
633 printTagCloud ( $link );
637 print "<div align='center'>" ;
638 print "<button onclick= \" return closeInfoBox() \" >" .
639 __ ( 'Close this window' ). "</button>" ;
642 print "]]></content>" ;
647 if ( $id == "emailArticle" ) {
649 $secretkey = sha1 ( uniqid ( rand (), true ));
651 $_SESSION [ 'email_secretkey' ] = $secretkey ;
653 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" secretkey \" value= \" $secretkey\" >" ;
654 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
655 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" subop \" value= \" sendEmail \" >" ;
657 $result = db_query ( $link , "SELECT email, full_name FROM ttrss_users WHERE
658 id = " . $_SESSION [ "uid" ]);
660 $user_email = htmlspecialchars ( db_fetch_result ( $result , 0 , "email" ));
661 $user_name = htmlspecialchars ( db_fetch_result ( $result , 0 , "full_name" ));
663 if (! $user_name ) $user_name = $_SESSION [ 'name' ];
665 $_SESSION [ 'email_replyto' ] = $user_email ;
666 $_SESSION [ 'email_fromname' ] = $user_name ;
668 require_once "lib/MiniTemplator.class.php" ;
670 $tpl = new MiniTemplator
;
671 $tpl_t = new MiniTemplator
;
673 $tpl -> readTemplateFromFile ( "templates/email_article_template.txt" );
675 $tpl -> setVariable ( 'USER_NAME' , $_SESSION [ "name" ]);
676 $tpl -> setVariable ( 'USER_EMAIL' , $user_email );
677 $tpl -> setVariable ( 'TTRSS_HOST' , $_SERVER [ "HTTP_HOST" ]);
679 // $tpl->addBlock('header');
681 $result = db_query ( $link , "SELECT link, content, title
682 FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND
683 id IN ( $param ) AND owner_uid = " . $_SESSION [ "uid" ]);
685 if ( db_num_rows ( $result ) > 1 ) {
686 $subject = __ ( "[Forwarded]" ) . " " . __ ( "Multiple articles" );
689 while ( $line = db_fetch_assoc ( $result )) {
692 $subject = __ ( "[Forwarded]" ) . " " . htmlspecialchars ( $line [ "title" ]);
694 $tpl -> setVariable ( 'ARTICLE_TITLE' , strip_tags ( $line [ "title" ]));
695 $tpl -> setVariable ( 'ARTICLE_URL' , strip_tags ( $line [ "link" ]));
697 $tpl -> addBlock ( 'article' );
700 $tpl -> addBlock ( 'email' );
703 $tpl -> generateOutputToString ( $content );
705 print "<table width='100%'><tr><td>" ;
711 print "<input dojoType= \" dijit.form.TextBox \" disabled= \" 1 \" style= \" width : 30em; \"
712 value= \" $user_name < $user_email > \" >" ;
714 print "</td></tr><tr><td>" ;
720 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" true \"
721 style= \" width : 30em; \"
722 name= \" destination \" id= \" emailArticleDlg_destination \" >" ;
724 print "<div class= \" autocomplete \" id= \" emailArticleDlg_dst_choices \"
725 style= \" z-index: 30; display : none \" ></div>" ;
727 print "</td></tr><tr><td>" ;
729 print __ ( 'Subject:' );
733 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" true \"
734 style= \" width : 30em; \"
735 name= \" subject \" value= \" $subject\" id= \" subject \" >" ;
739 print "<tr><td colspan='2'><textarea dojoType= \" dijit.form.SimpleTextarea \" style='font-size : 12px; width : 100%' rows= \" 20 \"
740 name='content'> $content </textarea>" ;
742 print "</td></tr></table>" ;
744 print "<div class='dlgButtons'>" ;
745 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('emailArticleDlg').execute() \" >" . __ ( 'Send e-mail' ). "</button> " ;
746 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('emailArticleDlg').hide() \" >" . __ ( 'Cancel' ). "</button>" ;
752 if ( $id == "generatedFeed" ) {
754 print "<title>" . __ ( 'View as RSS' ). "</title>" ;
755 print "<content><![CDATA[" ;
757 $params = explode ( ":" , $param , 3 );
758 $feed_id = db_escape_string ( $params [ 0 ]);
759 $is_cat = ( bool ) $params [ 1 ];
761 $key = get_feed_access_key ( $link , $feed_id , $is_cat );
763 $url_path = htmlspecialchars ( $params [ 2 ]) . "&key=" . $key ;
765 print __ ( "You can view this feed as RSS using the following URL:" );
767 print "<div class= \" tagCloudContainer \" >" ;
768 print "<a id='gen_feed_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
771 print "<div align='center'>" ;
773 print "<button dojoType= \" dijit.form.Button \" onclick= \" return genUrlChangeKey(' $feed_id ', ' $is_cat ') \" >" .
774 __ ( 'Generate new URL' ). "</button> " ;
776 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
777 __ ( 'Close this window' ). "</button>" ;
780 print "]]></content>" ;