]>
git.wh0rd.org - tt-rss.git/blob - classes/dlg.php
2 class Dlg
extends Handler_Protected
{
5 function before ( $method ) {
6 if ( parent
:: before ( $method )) {
7 header ( "Content-Type: text/xml; charset=utf-8" );
8 $this -> param
= db_escape_string ( $_REQUEST [ "param" ]);
19 function exportData () {
21 print "<p style='text-align : center' id='export_status_message'>You need to prepare exported data first by clicking the button below.</p>" ;
23 print "<div align='center'>" ;
24 print "<button dojoType= \" dijit.form.Button \"
25 onclick= \" dijit.byId('dataExportDlg').prepare() \" >" .
26 __ ( 'Prepare data' ). "</button>" ;
28 print "<button dojoType= \" dijit.form.Button \"
29 onclick= \" dijit.byId('dataExportDlg').hide() \" >" .
30 __ ( 'Close this window' ). "</button>" ;
37 function importOpml () {
38 header ( "Content-Type: text/html" ); # required for iframe
40 print __ ( "If you have imported labels and/or filters, you might need to reload preferences to see your new data." ) . "</p>" ;
42 print "<div class= \" prefFeedOPMLHolder \" >" ;
43 $owner_uid = $_SESSION [ "uid" ];
45 db_query ( $this -> link
, "BEGIN" );
47 print "<ul class='nomarks'>" ;
49 $opml = new Opml ( $this -> link
, $_REQUEST );
51 $opml -> opml_import ( $_SESSION [ "uid" ]);
53 db_query ( $this -> link
, "COMMIT" );
58 print "<div align='center'>" ;
59 print "<button dojoType= \" dijit.form.Button \"
60 onclick= \" dijit.byId('opmlImportDlg').execute() \" >" .
61 __ ( 'Close this window' ). "</button>" ;
69 function editPrefProfiles () {
70 print "<div dojoType= \" dijit.Toolbar \" >" ;
72 print "<div dojoType= \" dijit.form.DropDownButton \" >" .
73 "<span>" . __ ( 'Select' ). "</span>" ;
74 print "<div dojoType= \" dijit.Menu \" style= \" display: none; \" >" ;
75 print "<div onclick= \" selectTableRows('prefFeedProfileList', 'all') \"
76 dojoType= \" dijit.MenuItem \" >" . __ ( 'All' ). "</div>" ;
77 print "<div onclick= \" selectTableRows('prefFeedProfileList', 'none') \"
78 dojoType= \" dijit.MenuItem \" >" . __ ( 'None' ). "</div>" ;
81 print "<div style= \" float : right \" >" ;
83 print "<input name= \" newprofile \" dojoType= \" dijit.form.ValidationTextBox \"
85 <button dojoType= \" dijit.form.Button \"
86 onclick= \" dijit.byId('profileEditDlg').addProfile() \" >" .
87 __ ( 'Create profile' ). "</button></div>" ;
91 $result = db_query ( $this -> link
, "SELECT title,id FROM ttrss_settings_profiles
92 WHERE owner_uid = " . $_SESSION [ "uid" ]. " ORDER BY title" );
94 print "<div class= \" prefFeedCatHolder \" >" ;
96 print "<form id= \" profile_edit_form \" onsubmit= \" return false \" >" ;
98 print "<table width= \" 100% \" class= \" prefFeedProfileList \"
99 cellspacing= \" 0 \" id= \" prefFeedProfileList \" >" ;
101 print "<tr class= \" placeholder \" id= \" FCATR-0 \" >" ; #odd
103 print "<td width='5%' align='center'><input
105 onclick='toggleSelectRow2(this);'
106 dojoType= \" dijit.form.CheckBox \"
107 type= \" checkbox \" ></td>" ;
109 if (! $_SESSION [ "profile" ]) {
110 $is_active = __ ( "(active)" );
116 __ ( "Default profile" ) . " $is_active </span></td>" ;
122 while ( $line = db_fetch_assoc ( $result )) {
124 $class = ( $lnum %
2 ) ?
"even" : "odd" ;
126 $profile_id = $line [ "id" ];
127 $this_row_id = "id= \" FCATR- $profile_id\" " ;
129 print "<tr class= \" placeholder \" $this_row_id >" ;
131 $edit_title = htmlspecialchars ( $line [ "title" ]);
133 print "<td width='5%' align='center'><input
134 onclick='toggleSelectRow2(this);'
135 id='FCATC- $profile_id '
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', method: '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 function pubOPMLUrl () {
186 print "<title>" . __ ( 'Public OPML URL' ). "</title>" ;
187 print "<content><![CDATA[" ;
189 $url_path = opml_publish_url ( $this -> link
);
191 print __ ( "Your Public OPML URL is:" );
193 print "<div class= \" tagCloudContainer \" >" ;
194 print "<a id='pub_opml_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
197 print "<div align='center'>" ;
199 print "<button dojoType= \" dijit.form.Button \" onclick= \" return opmlRegenKey() \" >" .
200 __ ( 'Generate new URL' ). "</button> " ;
202 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
203 __ ( 'Close this window' ). "</button>" ;
206 print "]]></content>" ;
211 function explainError () {
212 print "<title>" . __ ( 'Notice' ). "</title>" ;
213 print "<content><![CDATA[" ;
215 print "<div class= \" errorExplained \" >" ;
217 if ( $this -> param
== 1 ) {
218 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." );
220 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
222 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
226 if ( $this -> param
== 3 ) {
227 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." );
229 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
231 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
237 print "<div align='center'>" ;
239 print "<button onclick= \" return closeInfoBox() \" >" .
240 __ ( 'Close this window' ). "</button>" ;
243 print "]]></content>" ;
248 function quickAddFeed () {
249 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
250 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" addfeed \" >" ;
252 print "<div class= \" dlgSec \" >" . __ ( "Feed or site URL" ). "</div>" ;
253 print "<div class= \" dlgSecCont \" >" ;
255 print "<div style='float : right'>
256 <img style='display : none'
257 id='feed_add_spinner' src='" .
258 theme_image ( $this -> link
, 'images/indicator_white.gif' ). "'></div>" ;
260 print "<input style= \" font-size : 16px; width : 20em; \"
261 placeHolder= \" " . __ ( "Feed or site URL" ). " \"
262 dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \" name= \" feed \" id= \" feedDlg_feedUrl \" >" ;
266 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' )) {
267 print __ ( 'Place in category:' ) . " " ;
268 print_feed_cat_select ( $this -> link
, "cat" , false , 'dojoType="dijit.form.Select"' );
273 print '<div id="feedDlg_feedsContainer" style="display : none">
275 <div class="dlgSec">' . __ ( 'Available feeds' ) . '</div>
276 <div class="dlgSecCont">' .
277 '<select id="feedDlg_feedContainerSelect"
278 dojoType="dijit.form.Select" size="3">
279 <script type="dojo/method" event="onChange" args="value">
280 dijit.byId("feedDlg_feedUrl").attr("value", value);
285 print "<div id='feedDlg_loginContainer' style='display : none'>
287 <div class= \" dlgSec \" >" . __ ( "Authentication" ). "</div>
288 <div class= \" dlgSecCont \" >" .
290 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
291 placeHolder= \" " . __ ( "Login" ). " \"
292 style= \" width : 10em; \" > " .
294 placeHolder= \" " . __ ( "Password" ). " \"
295 dojoType= \" dijit.form.TextBox \" type='password'
296 style= \" width : 10em; \" name='pass' \" >
300 print "<div style= \" clear : both \" >
301 <input type= \" checkbox \" name= \" need_auth \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
302 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
303 <label for= \" feedDlg_loginCheck \" >" .
304 __ ( 'This feed requires authentication.' ). "</div>" ;
308 print "<div class= \" dlgButtons \" >
309 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>" ;
311 if (!( defined ( '_DISABLE_FEED_BROWSER' ) && _DISABLE_FEED_BROWSER
)) {
312 print "<button dojoType= \" dijit.form.Button \" onclick= \" return feedBrowser() \" >" . __ ( 'More feeds' ). "</button>" ;
315 print "<button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
321 function feedBrowser () {
322 if ( defined ( '_DISABLE_FEED_BROWSER' ) && _DISABLE_FEED_BROWSER
) return ;
324 $browser_search = db_escape_string ( $_REQUEST [ "search" ]);
326 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
327 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" updateFeedBrowser \" >" ;
329 print "<div dojoType= \" dijit.Toolbar \" >
330 <div style='float : right'>
331 <img style='display : none'
332 id='feed_browser_spinner' src='" .
333 theme_image ( $this -> link
, 'images/indicator_white.gif' ). "'>
334 <input name= \" search \" dojoType= \" dijit.form.TextBox \" size= \" 20 \" type= \" search \"
335 onchange= \" dijit.byId('feedBrowserDlg').update() \" value= \" $browser_search\" >
336 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').update() \" >" . __ ( 'Search' ). "</button>
339 print " <select name= \" mode \" dojoType= \" dijit.form.Select \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >
340 <option value='1'>" . __ ( 'Popular feeds' ) . "</option>
341 <option value='2'>" . __ ( 'Feed archive' ) . "</option>
346 print " <select dojoType= \" dijit.form.Select \" name= \" limit \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >" ;
348 foreach ( array ( 25 , 50 , 100 , 200 ) as $l ) {
349 $issel = ( $l == $limit ) ?
"selected= \" 1 \" " : "" ;
350 print "<option $issel value= \" $l\" > $l </option>" ;
357 $owner_uid = $_SESSION [ "uid" ];
359 print "<ul class='browseFeedList' id='browseFeedList'>" ;
360 print make_feed_browser ( $this -> link
, $search , 25 );
363 print "<div align='center'>
364 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
365 <button dojoType= \" dijit.form.Button \" style='display : none' id='feed_archive_remove' onclick= \" dijit.byId('feedBrowserDlg').removeFromArchive() \" >" . __ ( 'Remove' ). "</button>
366 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').hide() \" >" . __ ( 'Cancel' ). "</button></div>" ;
371 $this -> params
= explode ( ":" , db_escape_string ( $_REQUEST [ "param" ]), 2 );
373 $active_feed_id = sprintf ( " %d " , $this -> params
[ 0 ]);
374 $is_cat = $this -> params
[ 1 ] != "false" ;
376 print "<div class= \" dlgSec \" >" . __ ( 'Look for' ). "</div>" ;
378 print "<div class= \" dlgSecCont \" >" ;
380 print "<input dojoType= \" dijit.form.ValidationTextBox \"
381 style= \" font-size : 16px; width : 20em; \"
382 required= \" 1 \" name= \" query \" type= \" search \" value=''>" ;
384 print "<hr/>" . __ ( 'Limit search to:' ). " " ;
386 print "<select name= \" search_mode \" dojoType= \" dijit.form.Select \" >
387 <option value= \" all_feeds \" >" . __ ( 'All feeds' ). "</option>" ;
389 $feed_title = getFeedTitle ( $this -> link
, $active_feed_id );
392 $feed_cat_title = getFeedCatTitle ( $this -> link
, $active_feed_id );
394 $feed_cat_title = getCategoryTitle ( $this -> link
, $active_feed_id );
397 if ( $active_feed_id && ! $is_cat ) {
398 print "<option selected= \" 1 \" value= \" this_feed \" > $feed_title </option>" ;
400 print "<option disabled= \" 1 \" value= \" false \" >" . __ ( 'This feed' ). "</option>" ;
404 $cat_preselected = "selected= \" 1 \" " ;
407 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' ) && ( $active_feed_id > 0 ||
$is_cat )) {
408 print "<option $cat_preselected value= \" this_cat \" > $feed_cat_title </option>" ;
410 //print "<option disabled>".__('This category')."</option>";
417 print "<div class= \" dlgButtons \" >" ;
419 if (! SPHINX_ENABLED
) {
420 print "<div style= \" float : left \" >
421 <a class= \" visibleLink \" target= \" _blank \" href= \" http://tt-rss.org/wiki/SearchSyntax \" >Search syntax</a>
425 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').execute() \" >" . __ ( 'Search' ). "</button>
426 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
430 function editArticleTags () {
432 print __ ( "Tags for this article (separated by commas):" ). "<br>" ;
434 $tags = get_article_tags ( $this -> link
, $this -> param
);
436 $tags_str = join ( ", " , $tags );
438 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" id \" value= \" $this ->param \" >" ;
439 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
440 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" setArticleTags \" >" ;
442 print "<table width='100%'><tr><td>" ;
444 print "<textarea dojoType= \" dijit.form.SimpleTextarea \" rows='4'
445 style='font-size : 12px; width : 100%' id= \" tags_str \"
446 name='tags_str'> $tags_str </textarea>
447 <div class= \" autocomplete \" id= \" tags_choices \"
448 style= \" display:none \" ></div>" ;
450 print "</td></tr></table>" ;
452 print "<div class='dlgButtons'>" ;
454 print "<button dojoType= \" dijit.form.Button \"
455 onclick= \" dijit.byId('editTagsDlg').execute() \" >" . __ ( 'Save' ). "</button> " ;
456 print "<button dojoType= \" dijit.form.Button \"
457 onclick= \" dijit.byId('editTagsDlg').hide() \" >" . __ ( 'Cancel' ). "</button>" ;
462 function printTagCloud () {
463 print "<title>" . __ ( 'Tag Cloud' ). "</title>" ;
464 print "<content><![CDATA[" ;
466 print "<div class= \" tagCloudContainer \" >" ;
468 // from here: http://www.roscripts.com/Create_tag_cloud-71.html
470 $query = "SELECT tag_name, COUNT(post_int_id) AS count
471 FROM ttrss_tags WHERE owner_uid = " . $_SESSION [ "uid" ]. "
472 GROUP BY tag_name ORDER BY count DESC LIMIT 50" ;
474 $result = db_query ( $this -> link
, $query );
478 while ( $line = db_fetch_assoc ( $result )) {
479 $tags [ $line [ "tag_name" ]] = $line [ "count" ];
482 if ( count ( $tags ) == 0 ){ return ; }
486 $max_size = 32 ; // max font size in pixels
487 $min_size = 11 ; // min font size in pixels
489 // largest and smallest array values
490 $max_qty = max ( array_values ( $tags ));
491 $min_qty = min ( array_values ( $tags ));
493 // find the range of values
494 $spread = $max_qty - $min_qty ;
495 if ( $spread == 0 ) { // we don't want to divide by zero
499 // set the font-size increment
500 $step = ( $max_size - $min_size ) / ( $spread );
502 // loop through the tag array
503 foreach ( $tags as $key => $value ) {
504 // calculate font-size
505 // find the $value in excess of $min_qty
506 // multiply by the font-size increment ($size)
507 // and add the $min_size set above
508 $size = round ( $min_size +
(( $value - $min_qty ) * $step ));
510 $key_escaped = str_replace ( "'" , " \\ '" , $key );
512 echo "<a href= \" javascript:viewfeed(' $key_escaped ') \" style= \" font-size: " .
513 $size . "px \" title= \" $value articles tagged with " .
514 $key . '">' . $key . '</a> ' ;
521 print "<div align='center'>" ;
522 print "<button dojoType= \" dijit.form.Button \"
523 onclick= \" return closeInfoBox() \" >" .
524 __ ( 'Close this window' ). "</button>" ;
527 print "]]></content>" ;
530 function printTagSelect () {
532 print "<title>" . __ ( 'Select item(s) by tags' ) . "</title>" ;
533 print "<content><![CDATA[" ;
535 print __ ( "Match:" ). " " .
536 "<input class= \" noborder \" dojoType= \" dijit.form.RadioButton \" type= \" radio \" checked value= \" any \" name= \" tag_mode \" id= \" tag_mode_any \" >" ;
537 print "<label for= \" tag_mode_any \" >" . __ ( "Any" ). "</label>" ;
539 print "<input class= \" noborder \" dojoType= \" dijit.form.RadioButton \" type= \" radio \" value= \" all \" name= \" tag_mode \" id= \" tag_mode_all \" >" ;
540 print "<label for= \" tag_mode_all \" >" . __ ( "All tags." ). "</input>" ;
542 print "<select id= \" all_tags \" name= \" all_tags \" title= \" " . __ ( 'Which Tags?' ) . " \" multiple= \" multiple \" size= \" 10 \" style= \" width : 100% \" >" ;
543 $result = db_query ( $this -> link
, "SELECT DISTINCT tag_name FROM ttrss_tags WHERE owner_uid = " . $_SESSION [ 'uid' ]. "
544 AND LENGTH(tag_name) <= 30 ORDER BY tag_name ASC" );
546 while ( $row = db_fetch_assoc ( $result )) {
547 $tmp = htmlspecialchars ( $row [ "tag_name" ]);
548 print "<option value= \" " . str_replace ( " " , " %20 " , $tmp ) . " \" > $tmp </option>" ;
553 print "<div align='right'>" ;
554 print "<button dojoType= \" dijit.form.Button \" onclick= \" viewfeed(get_all_tags($('all_tags')),
555 get_radio_checked($('tag_mode'))); \" >" . __ ( 'Display entries' ) . "</button>" ;
557 print "<button dojoType= \" dijit.form.Button \"
558 onclick= \" return closeInfoBox() \" >" .
559 __ ( 'Close this window' ) . "</button>" ;
562 print "]]></content>" ;
565 function generatedFeed () {
567 print "<title>" . __ ( 'View as RSS' ). "</title>" ;
568 print "<content><![CDATA[" ;
570 $this -> params
= explode ( ":" , $this -> param
, 3 );
571 $feed_id = db_escape_string ( $this -> params
[ 0 ]);
572 $is_cat = ( bool ) $this -> params
[ 1 ];
574 $key = get_feed_access_key ( $this -> link
, $feed_id , $is_cat );
576 $url_path = htmlspecialchars ( $this -> params
[ 2 ]) . "&key=" . $key ;
578 print "<div class= \" dialogNotice \" >" . __ ( "You can view this feed as RSS using the following URL:" ) . "</div>" ;
580 print "<div class= \" tagCloudContainer \" >" ;
581 print "<a id='gen_feed_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
584 print "<div align='center'>" ;
586 print "<button dojoType= \" dijit.form.Button \" onclick= \" return genUrlChangeKey(' $feed_id ', ' $is_cat ') \" >" .
587 __ ( 'Generate new URL' ). "</button> " ;
589 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
590 __ ( 'Close this window' ). "</button>" ;
593 print "]]></content>" ;
598 function newVersion () {
600 $version_data = check_for_update ( $this -> link
);
601 $version = $version_data [ 'version' ];
602 $id = $version_data [ 'version_id' ];
604 print "<div class='tagCloudContainer'>" ;
606 print T_sprintf ( "New version of Tiny Tiny RSS is available ( %s )." ,
611 $details = "http://tt-rss.org/redmine/versions/ $id " ;
612 $download = "http://tt-rss.org/#Download" ;
614 print "<p align='center'>" . __ ( "You can update using built-in updater in the Preferences or by using update.php" ). "</p>" ;
616 print "<div style='text-align : center'>" ;
617 print "<button dojoType= \" dijit.form.Button \"
618 onclick= \" return window.open(' $details ') \" >" . __ ( "Details" ). "</button>" ;
619 print "<button dojoType= \" dijit.form.Button \"
620 onclick= \" return window.open(' $download ') \" >" . __ ( "Download" ). "</button>" ;
621 print "<button dojoType= \" dijit.form.Button \"
622 onclick= \" return dijit.byId('newVersionDlg').hide() \" >" .
623 __ ( 'Close this window' ). "</button>" ;
628 function customizeCSS () {
629 $value = get_pref ( $this -> link
, "USER_STYLESHEET" );
631 $value = str_replace ( "<br/>" , " \n " , $value );
633 print "<div class= \" dialogNotice \" >" ;
634 print T_sprintf ( "You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target= \" _blank \" class= \" visibleLink \" href= \" %s\" >This file</a> can be used as a baseline." , "tt-rss.css" );
637 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
638 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" setpref \" >" ;
639 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" key \" value= \" USER_STYLESHEET \" >" ;
641 print "<table width='100%'><tr><td>" ;
642 print "<textarea dojoType= \" dijit.form.SimpleTextarea \"
643 style='font-size : 12px; width : 100%; height: 200px;'
644 placeHolder='body#ttrssMain { font-size : 14px; };'
645 name='value'> $value </textarea>" ;
646 print "</td></tr></table>" ;
648 print "<div class='dlgButtons'>" ;
649 print "<button dojoType= \" dijit.form.Button \"
650 onclick= \" dijit.byId('cssEditDlg').execute() \" >" . __ ( 'Save' ). "</button> " ;
651 print "<button dojoType= \" dijit.form.Button \"
652 onclick= \" dijit.byId('cssEditDlg').hide() \" >" . __ ( 'Cancel' ). "</button>" ;
657 function addInstance () {
658 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" pref-instances \" >" ;
659 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" add \" >" ;
661 print "<div class= \" dlgSec \" >" . __ ( "Instance" ). "</div>" ;
663 print "<div class= \" dlgSecCont \" >" ;
667 print __ ( "URL:" ) . " " ;
669 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \"
670 placeHolder= \" " . __ ( "Instance URL" ). " \"
671 regExp='^(http|https)://.*'
672 style= \" font-size : 16px; width: 20em \" name= \" access_url \" >" ;
676 $access_key = sha1 ( uniqid ( rand (), true ));
680 print __ ( "Access key:" ) . " " ;
682 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \"
683 placeHolder= \" " . __ ( "Access key" ). " \" regExp='\w{40}'
684 style= \" width: 20em \" name= \" access_key \" id= \" instance_add_key \"
685 value= \" $access_key\" >" ;
687 print "<p class='insensitive'>" . __ ( "Use one access key for both linked instances." );
691 print "<div class= \" dlgButtons \" >
692 <div style='float : left'>
693 <button dojoType= \" dijit.form.Button \"
694 onclick= \" return dijit.byId('instanceAddDlg').regenKey() \" >" .
695 __ ( 'Generate new key' ). "</button>
697 <button dojoType= \" dijit.form.Button \"
698 onclick= \" return dijit.byId('instanceAddDlg').execute() \" >" .
699 __ ( 'Create link' ). "</button>
700 <button dojoType= \" dijit.form.Button \"
701 onclick= \" return dijit.byId('instanceAddDlg').hide() \"\" >" .
702 __ ( 'Cancel' ). "</button></div>" ;
707 function dataImport () {
708 header ( "Content-Type: text/html" ); # required for iframe
710 print "<div style='text-align : center'>" ;
712 if ( is_file ( $_FILES [ 'export_file' ][ 'tmp_name' ])) {
714 perform_data_import ( $this -> link
, $_FILES [ 'export_file' ][ 'tmp_name' ], $_SESSION [ 'uid' ]);
717 print "<p>" . T_sprintf ( "Could not upload file. You might need to adjust upload_max_filesize
718 in PHP.ini (current value = %s )" , ini_get ( "upload_max_filesize" )) . " or use CLI import tool.</p>" ;
722 print "<button dojoType= \" dijit.form.Button \"
723 onclick= \" dijit.byId('dataImportDlg').hide() \" >" .
724 __ ( 'Close this window' ). "</button>" ;
730 function batchSubscribe () {
731 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
732 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" batchaddfeeds \" >" ;
734 print "<table width='100%'><tr><td>
735 " . __ ( "Add one valid RSS feed per line (no feed detection is done)" ). "
736 </td><td align='right'>" ;
737 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' )) {
738 print __ ( 'Place in category:' ) . " " ;
739 print_feed_cat_select ( $this -> link
, "cat" , false , 'dojoType="dijit.form.Select"' );
741 print "</td></tr><tr><td colspan='2'>" ;
743 style='font-size : 12px; width : 100%; height: 200px;'
744 placeHolder= \" " . __ ( "Feeds to subscribe, One per line" ). " \"
745 dojoType= \" dijit.form.SimpleTextarea \" required= \" 1 \" name= \" feeds \" ></textarea>" ;
747 print "</td></tr><tr><td colspan='2'>" ;
749 print "<div id='feedDlg_loginContainer' style='display : none'>
751 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
752 placeHolder= \" " . __ ( "Login" ). " \"
753 style= \" width : 10em; \" > " .
755 placeHolder= \" " . __ ( "Password" ). " \"
756 dojoType= \" dijit.form.TextBox \" type='password'
757 style= \" width : 10em; \" name='pass' \" >" .
760 print "</td></tr><tr><td colspan='2'>" ;
762 print "<div style= \" clear : both \" >
763 <input type= \" checkbox \" name= \" need_auth \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
764 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
765 <label for= \" feedDlg_loginCheck \" >" .
766 __ ( 'Feeds require authentication.' ). "</div>" ;
770 print "</td></tr></table>" ;
772 print "<div class= \" dlgButtons \" >
773 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('batchSubDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
774 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('batchSubDlg').hide() \" >" . __ ( 'Cancel' ). "</button>