]>
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 importOpml () {
20 header ( "Content-Type: text/html" ); # required for iframe
22 print __ ( "If you have imported labels and/or filters, you might need to reload preferences to see your new data." ) . "</p>" ;
24 print "<div class= \" prefFeedOPMLHolder \" >" ;
25 $owner_uid = $_SESSION [ "uid" ];
27 db_query ( $this -> link
, "BEGIN" );
29 print "<ul class='nomarks'>" ;
31 $opml = new Opml ( $this -> link
, $_REQUEST );
33 $opml -> opml_import ( $_SESSION [ "uid" ]);
35 db_query ( $this -> link
, "COMMIT" );
40 print "<div align='center'>" ;
41 print "<button dojoType= \" dijit.form.Button \"
42 onclick= \" dijit.byId('opmlImportDlg').execute() \" >" .
43 __ ( 'Close this window' ). "</button>" ;
51 function editPrefProfiles () {
52 print "<div dojoType= \" dijit.Toolbar \" >" ;
54 print "<div dojoType= \" dijit.form.DropDownButton \" >" .
55 "<span>" . __ ( 'Select' ). "</span>" ;
56 print "<div dojoType= \" dijit.Menu \" style= \" display: none; \" >" ;
57 print "<div onclick= \" selectTableRows('prefFeedProfileList', 'all') \"
58 dojoType= \" dijit.MenuItem \" >" . __ ( 'All' ). "</div>" ;
59 print "<div onclick= \" selectTableRows('prefFeedProfileList', 'none') \"
60 dojoType= \" dijit.MenuItem \" >" . __ ( 'None' ). "</div>" ;
63 print "<div style= \" float : right \" >" ;
65 print "<input name= \" newprofile \" dojoType= \" dijit.form.ValidationTextBox \"
67 <button dojoType= \" dijit.form.Button \"
68 onclick= \" dijit.byId('profileEditDlg').addProfile() \" >" .
69 __ ( 'Create profile' ). "</button></div>" ;
73 $result = db_query ( $this -> link
, "SELECT title,id FROM ttrss_settings_profiles
74 WHERE owner_uid = " . $_SESSION [ "uid" ]. " ORDER BY title" );
76 print "<div class= \" prefFeedCatHolder \" >" ;
78 print "<form id= \" profile_edit_form \" onsubmit= \" return false \" >" ;
80 print "<table width= \" 100% \" class= \" prefFeedProfileList \"
81 cellspacing= \" 0 \" id= \" prefFeedProfileList \" >" ;
83 print "<tr class= \" placeholder \" id= \" FCATR-0 \" >" ; #odd
85 print "<td width='5%' align='center'><input
87 onclick='toggleSelectRow2(this);'
88 dojoType= \" dijit.form.CheckBox \"
89 type= \" checkbox \" ></td>" ;
91 if (! $_SESSION [ "profile" ]) {
92 $is_active = __ ( "(active)" );
98 __ ( "Default profile" ) . " $is_active </span></td>" ;
104 while ( $line = db_fetch_assoc ( $result )) {
106 $class = ( $lnum %
2 ) ?
"even" : "odd" ;
108 $profile_id = $line [ "id" ];
109 $this_row_id = "id= \" FCATR- $profile_id\" " ;
111 print "<tr class= \" placeholder \" $this_row_id >" ;
113 $edit_title = htmlspecialchars ( $line [ "title" ]);
115 print "<td width='5%' align='center'><input
116 onclick='toggleSelectRow2(this);'
117 id='FCATC- $profile_id '
118 dojoType= \" dijit.form.CheckBox \"
119 type= \" checkbox \" ></td>" ;
121 if ( $_SESSION [ "profile" ] == $line [ "id" ]) {
122 $is_active = __ ( "(active)" );
127 print "<td><span dojoType= \" dijit.InlineEditBox \"
128 width= \" 300px \" autoSave= \" false \"
129 profile-id= \" $profile_id\" >" . $edit_title .
130 "<script type= \" dojo/method \" event= \" onChange \" args= \" item \" >
134 content: {op: 'rpc', method: 'saveprofile',
136 id: this.srcNodeRef.getAttribute('profile-id')},
137 load: function(response) {
138 elem.attr('value', response);
142 </span> $is_active </td>" ;
153 print "<div class='dlgButtons'>
154 <div style='float : left'>
155 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').removeSelected() \" >" .
156 __ ( 'Remove selected profiles' ). "</button>
157 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').activateProfile() \" >" .
158 __ ( 'Activate profile' ). "</button>
161 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').hide() \" >" .
162 __ ( 'Close this window' ). "</button>" ;
167 function pubOPMLUrl () {
168 print "<title>" . __ ( 'Public OPML URL' ). "</title>" ;
169 print "<content><![CDATA[" ;
171 $url_path = Opml
:: opml_publish_url ( $this -> link
);
173 print __ ( "Your Public OPML URL is:" );
175 print "<div class= \" tagCloudContainer \" >" ;
176 print "<a id='pub_opml_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
179 print "<div align='center'>" ;
181 print "<button dojoType= \" dijit.form.Button \" onclick= \" return opmlRegenKey() \" >" .
182 __ ( 'Generate new URL' ). "</button> " ;
184 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
185 __ ( 'Close this window' ). "</button>" ;
188 print "]]></content>" ;
193 function explainError () {
194 print "<title>" . __ ( 'Notice' ). "</title>" ;
195 print "<content><![CDATA[" ;
197 print "<div class= \" errorExplained \" >" ;
199 if ( $this -> param
== 1 ) {
200 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." );
202 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
204 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
208 if ( $this -> param
== 3 ) {
209 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." );
211 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
213 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
219 print "<div align='center'>" ;
221 print "<button onclick= \" return closeInfoBox() \" >" .
222 __ ( 'Close this window' ). "</button>" ;
225 print "]]></content>" ;
230 function quickAddFeed () {
231 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
232 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" addfeed \" >" ;
234 print "<div class= \" dlgSec \" >" . __ ( "Feed or site URL" ). "</div>" ;
235 print "<div class= \" dlgSecCont \" >" ;
237 print "<div style='float : right'>
238 <img style='display : none'
239 id='feed_add_spinner' src='" .
240 theme_image ( $this -> link
, 'images/indicator_white.gif' ). "'></div>" ;
242 print "<input style= \" font-size : 16px; width : 20em; \"
243 placeHolder= \" " . __ ( "Feed or site URL" ). " \"
244 dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \" name= \" feed \" id= \" feedDlg_feedUrl \" >" ;
248 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' )) {
249 print __ ( 'Place in category:' ) . " " ;
250 print_feed_cat_select ( $this -> link
, "cat" , false , 'dojoType="dijit.form.Select"' );
255 print '<div id="feedDlg_feedsContainer" style="display : none">
257 <div class="dlgSec">' . __ ( 'Available feeds' ) . '</div>
258 <div class="dlgSecCont">' .
259 '<select id="feedDlg_feedContainerSelect"
260 dojoType="dijit.form.Select" size="3">
261 <script type="dojo/method" event="onChange" args="value">
262 dijit.byId("feedDlg_feedUrl").attr("value", value);
267 print "<div id='feedDlg_loginContainer' style='display : none'>
269 <div class= \" dlgSec \" >" . __ ( "Authentication" ). "</div>
270 <div class= \" dlgSecCont \" >" .
272 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
273 placeHolder= \" " . __ ( "Login" ). " \"
274 style= \" width : 10em; \" > " .
276 placeHolder= \" " . __ ( "Password" ). " \"
277 dojoType= \" dijit.form.TextBox \" type='password'
278 style= \" width : 10em; \" name='pass' \" >
282 print "<div style= \" clear : both \" >
283 <input type= \" checkbox \" name= \" need_auth \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
284 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
285 <label for= \" feedDlg_loginCheck \" >" .
286 __ ( 'This feed requires authentication.' ). "</div>" ;
290 print "<div class= \" dlgButtons \" >
291 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>" ;
293 if (!( defined ( '_DISABLE_FEED_BROWSER' ) && _DISABLE_FEED_BROWSER
)) {
294 print "<button dojoType= \" dijit.form.Button \" onclick= \" return feedBrowser() \" >" . __ ( 'More feeds' ). "</button>" ;
297 print "<button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
303 function feedBrowser () {
304 if ( defined ( '_DISABLE_FEED_BROWSER' ) && _DISABLE_FEED_BROWSER
) return ;
306 $browser_search = db_escape_string ( $_REQUEST [ "search" ]);
308 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
309 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" updateFeedBrowser \" >" ;
311 print "<div dojoType= \" dijit.Toolbar \" >
312 <div style='float : right'>
313 <img style='display : none'
314 id='feed_browser_spinner' src='" .
315 theme_image ( $this -> link
, 'images/indicator_white.gif' ). "'>
316 <input name= \" search \" dojoType= \" dijit.form.TextBox \" size= \" 20 \" type= \" search \"
317 onchange= \" dijit.byId('feedBrowserDlg').update() \" value= \" $browser_search\" >
318 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').update() \" >" . __ ( 'Search' ). "</button>
321 print " <select name= \" mode \" dojoType= \" dijit.form.Select \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >
322 <option value='1'>" . __ ( 'Popular feeds' ) . "</option>
323 <option value='2'>" . __ ( 'Feed archive' ) . "</option>
328 print " <select dojoType= \" dijit.form.Select \" name= \" limit \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >" ;
330 foreach ( array ( 25 , 50 , 100 , 200 ) as $l ) {
331 $issel = ( $l == $limit ) ?
"selected= \" 1 \" " : "" ;
332 print "<option $issel value= \" $l\" > $l </option>" ;
339 $owner_uid = $_SESSION [ "uid" ];
341 require_once "feedbrowser.php" ;
343 print "<ul class='browseFeedList' id='browseFeedList'>" ;
344 print make_feed_browser ( $this -> link
, $search , 25 );
347 print "<div align='center'>
348 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
349 <button dojoType= \" dijit.form.Button \" style='display : none' id='feed_archive_remove' onclick= \" dijit.byId('feedBrowserDlg').removeFromArchive() \" >" . __ ( 'Remove' ). "</button>
350 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').hide() \" >" . __ ( 'Cancel' ). "</button></div>" ;
355 $this -> params
= explode ( ":" , db_escape_string ( $_REQUEST [ "param" ]), 2 );
357 $active_feed_id = sprintf ( " %d " , $this -> params
[ 0 ]);
358 $is_cat = $this -> params
[ 1 ] != "false" ;
360 print "<div class= \" dlgSec \" >" . __ ( 'Look for' ). "</div>" ;
362 print "<div class= \" dlgSecCont \" >" ;
364 print "<input dojoType= \" dijit.form.ValidationTextBox \"
365 style= \" font-size : 16px; width : 20em; \"
366 required= \" 1 \" name= \" query \" type= \" search \" value=''>" ;
368 print "<hr/>" . __ ( 'Limit search to:' ). " " ;
370 print "<select name= \" search_mode \" dojoType= \" dijit.form.Select \" >
371 <option value= \" all_feeds \" >" . __ ( 'All feeds' ). "</option>" ;
373 $feed_title = getFeedTitle ( $this -> link
, $active_feed_id );
376 $feed_cat_title = getFeedCatTitle ( $this -> link
, $active_feed_id );
378 $feed_cat_title = getCategoryTitle ( $this -> link
, $active_feed_id );
381 if ( $active_feed_id && ! $is_cat ) {
382 print "<option selected= \" 1 \" value= \" this_feed \" > $feed_title </option>" ;
384 print "<option disabled= \" 1 \" value= \" false \" >" . __ ( 'This feed' ). "</option>" ;
388 $cat_preselected = "selected= \" 1 \" " ;
391 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' ) && ( $active_feed_id > 0 ||
$is_cat )) {
392 print "<option $cat_preselected value= \" this_cat \" > $feed_cat_title </option>" ;
394 //print "<option disabled>".__('This category')."</option>";
401 print "<div class= \" dlgButtons \" >" ;
403 if (! SPHINX_ENABLED
) {
404 print "<div style= \" float : left \" >
405 <a class= \" visibleLink \" target= \" _blank \" href= \" http://tt-rss.org/wiki/SearchSyntax \" >Search syntax</a>
409 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').execute() \" >" . __ ( 'Search' ). "</button>
410 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
414 function editArticleTags () {
416 print __ ( "Tags for this article (separated by commas):" ). "<br>" ;
418 $tags = get_article_tags ( $this -> link
, $this -> param
);
420 $tags_str = join ( ", " , $tags );
422 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" id \" value= \" $this ->param \" >" ;
423 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
424 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" setArticleTags \" >" ;
426 print "<table width='100%'><tr><td>" ;
428 print "<textarea dojoType= \" dijit.form.SimpleTextarea \" rows='4'
429 style='font-size : 12px; width : 100%' id= \" tags_str \"
430 name='tags_str'> $tags_str </textarea>
431 <div class= \" autocomplete \" id= \" tags_choices \"
432 style= \" display:none \" ></div>" ;
434 print "</td></tr></table>" ;
436 print "<div class='dlgButtons'>" ;
438 print "<button dojoType= \" dijit.form.Button \"
439 onclick= \" dijit.byId('editTagsDlg').execute() \" >" . __ ( 'Save' ). "</button> " ;
440 print "<button dojoType= \" dijit.form.Button \"
441 onclick= \" dijit.byId('editTagsDlg').hide() \" >" . __ ( 'Cancel' ). "</button>" ;
446 function printTagCloud () {
447 print "<title>" . __ ( 'Tag Cloud' ). "</title>" ;
448 print "<content><![CDATA[" ;
450 print "<div class= \" tagCloudContainer \" >" ;
452 // from here: http://www.roscripts.com/Create_tag_cloud-71.html
454 $query = "SELECT tag_name, COUNT(post_int_id) AS count
455 FROM ttrss_tags WHERE owner_uid = " . $_SESSION [ "uid" ]. "
456 GROUP BY tag_name ORDER BY count DESC LIMIT 50" ;
458 $result = db_query ( $this -> link
, $query );
462 while ( $line = db_fetch_assoc ( $result )) {
463 $tags [ $line [ "tag_name" ]] = $line [ "count" ];
466 if ( count ( $tags ) == 0 ){ return ; }
470 $max_size = 32 ; // max font size in pixels
471 $min_size = 11 ; // min font size in pixels
473 // largest and smallest array values
474 $max_qty = max ( array_values ( $tags ));
475 $min_qty = min ( array_values ( $tags ));
477 // find the range of values
478 $spread = $max_qty - $min_qty ;
479 if ( $spread == 0 ) { // we don't want to divide by zero
483 // set the font-size increment
484 $step = ( $max_size - $min_size ) / ( $spread );
486 // loop through the tag array
487 foreach ( $tags as $key => $value ) {
488 // calculate font-size
489 // find the $value in excess of $min_qty
490 // multiply by the font-size increment ($size)
491 // and add the $min_size set above
492 $size = round ( $min_size +
(( $value - $min_qty ) * $step ));
494 $key_escaped = str_replace ( "'" , " \\ '" , $key );
496 echo "<a href= \" javascript:viewfeed(' $key_escaped ') \" style= \" font-size: " .
497 $size . "px \" title= \" $value articles tagged with " .
498 $key . '">' . $key . '</a> ' ;
505 print "<div align='center'>" ;
506 print "<button dojoType= \" dijit.form.Button \"
507 onclick= \" return closeInfoBox() \" >" .
508 __ ( 'Close this window' ). "</button>" ;
511 print "]]></content>" ;
514 function printTagSelect () {
516 print "<title>" . __ ( 'Select item(s) by tags' ) . "</title>" ;
517 print "<content><![CDATA[" ;
519 print __ ( "Match:" ). " " .
520 "<input class= \" noborder \" dojoType= \" dijit.form.RadioButton \" type= \" radio \" checked value= \" any \" name= \" tag_mode \" id= \" tag_mode_any \" >" ;
521 print "<label for= \" tag_mode_any \" >" . __ ( "Any" ). "</label>" ;
523 print "<input class= \" noborder \" dojoType= \" dijit.form.RadioButton \" type= \" radio \" value= \" all \" name= \" tag_mode \" id= \" tag_mode_all \" >" ;
524 print "<label for= \" tag_mode_all \" >" . __ ( "All tags." ). "</input>" ;
526 print "<select id= \" all_tags \" name= \" all_tags \" title= \" " . __ ( 'Which Tags?' ) . " \" multiple= \" multiple \" size= \" 10 \" style= \" width : 100% \" >" ;
527 $result = db_query ( $this -> link
, "SELECT DISTINCT tag_name FROM ttrss_tags WHERE owner_uid = " . $_SESSION [ 'uid' ]. "
528 AND LENGTH(tag_name) <= 30 ORDER BY tag_name ASC" );
530 while ( $row = db_fetch_assoc ( $result )) {
531 $tmp = htmlspecialchars ( $row [ "tag_name" ]);
532 print "<option value= \" " . str_replace ( " " , " %20 " , $tmp ) . " \" > $tmp </option>" ;
537 print "<div align='right'>" ;
538 print "<button dojoType= \" dijit.form.Button \" onclick= \" viewfeed(get_all_tags($('all_tags')),
539 get_radio_checked($('tag_mode'))); \" >" . __ ( 'Display entries' ) . "</button>" ;
541 print "<button dojoType= \" dijit.form.Button \"
542 onclick= \" return closeInfoBox() \" >" .
543 __ ( 'Close this window' ) . "</button>" ;
546 print "]]></content>" ;
549 function generatedFeed () {
551 print "<title>" . __ ( 'View as RSS' ). "</title>" ;
552 print "<content><![CDATA[" ;
554 $this -> params
= explode ( ":" , $this -> param
, 3 );
555 $feed_id = db_escape_string ( $this -> params
[ 0 ]);
556 $is_cat = ( bool ) $this -> params
[ 1 ];
558 $key = get_feed_access_key ( $this -> link
, $feed_id , $is_cat );
560 $url_path = htmlspecialchars ( $this -> params
[ 2 ]) . "&key=" . $key ;
562 print "<div class= \" dialogNotice \" >" . __ ( "You can view this feed as RSS using the following URL:" ) . "</div>" ;
564 print "<div class= \" tagCloudContainer \" >" ;
565 print "<a id='gen_feed_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
568 print "<div align='center'>" ;
570 print "<button dojoType= \" dijit.form.Button \" onclick= \" return genUrlChangeKey(' $feed_id ', ' $is_cat ') \" >" .
571 __ ( 'Generate new URL' ). "</button> " ;
573 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
574 __ ( 'Close this window' ). "</button>" ;
577 print "]]></content>" ;
582 function newVersion () {
584 $version_data = check_for_update ( $this -> link
);
585 $version = $version_data [ 'version' ];
586 $id = $version_data [ 'version_id' ];
588 if ( $version && $id ) {
589 print "<div class='tagCloudContainer'>" ;
591 print T_sprintf ( "New version of Tiny Tiny RSS is available ( %s )." ,
596 $details = "http://tt-rss.org/redmine/versions/ $id " ;
597 $download = "http://tt-rss.org/#Download" ;
599 print "<p align='center'>" . __ ( "You can update using built-in updater in the Preferences or by using update.php" ). "</p>" ;
601 print "<div style='text-align : center'>" ;
602 print "<button dojoType= \" dijit.form.Button \"
603 onclick= \" return window.open(' $details ') \" >" . __ ( "Details" ). "</button>" ;
604 print "<button dojoType= \" dijit.form.Button \"
605 onclick= \" return window.open(' $download ') \" >" . __ ( "Download" ). "</button>" ;
606 print "<button dojoType= \" dijit.form.Button \"
607 onclick= \" return dijit.byId('newVersionDlg').hide() \" >" .
608 __ ( 'Close this window' ). "</button>" ;
611 print "<div class='tagCloudContainer'>" ;
613 print "<p align='center'>" . __ ( "Error receiving version information or no new version available." ). "</p>" ;
617 print "<div style='text-align : center'>" ;
618 print "<button dojoType= \" dijit.form.Button \"
619 onclick= \" return dijit.byId('newVersionDlg').hide() \" >" .
620 __ ( '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 batchSubscribe () {
708 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
709 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" batchaddfeeds \" >" ;
711 print "<table width='100%'><tr><td>
712 " . __ ( "Add one valid RSS feed per line (no feed detection is done)" ). "
713 </td><td align='right'>" ;
714 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' )) {
715 print __ ( 'Place in category:' ) . " " ;
716 print_feed_cat_select ( $this -> link
, "cat" , false , 'dojoType="dijit.form.Select"' );
718 print "</td></tr><tr><td colspan='2'>" ;
720 style='font-size : 12px; width : 100%; height: 200px;'
721 placeHolder= \" " . __ ( "Feeds to subscribe, One per line" ). " \"
722 dojoType= \" dijit.form.SimpleTextarea \" required= \" 1 \" name= \" feeds \" ></textarea>" ;
724 print "</td></tr><tr><td colspan='2'>" ;
726 print "<div id='feedDlg_loginContainer' style='display : none'>
728 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
729 placeHolder= \" " . __ ( "Login" ). " \"
730 style= \" width : 10em; \" > " .
732 placeHolder= \" " . __ ( "Password" ). " \"
733 dojoType= \" dijit.form.TextBox \" type='password'
734 style= \" width : 10em; \" name='pass' \" >" .
737 print "</td></tr><tr><td colspan='2'>" ;
739 print "<div style= \" clear : both \" >
740 <input type= \" checkbox \" name= \" need_auth \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
741 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
742 <label for= \" feedDlg_loginCheck \" >" .
743 __ ( 'Feeds require authentication.' ). "</div>" ;
747 print "</td></tr></table>" ;
749 print "<div class= \" dlgButtons \" >
750 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('batchSubDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
751 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('batchSubDlg').hide() \" >" . __ ( 'Cancel' ). "</button>