]>
git.wh0rd.org - tt-rss.git/blob - classes/dlg.php
d13a9ecb6891d8b1859ef073a7d9f76c3a7cdc04
2 class Dlg
extends Handler_Protected
{
5 function before ( $method ) {
6 if ( parent
:: before ( $method )) {
7 header ( "Content-Type: text/html" ); # required for iframe
9 $this -> param
= db_escape_string ( $this -> link
, $_REQUEST [ "param" ]);
15 function importOpml () {
16 print __ ( "If you have imported labels and/or filters, you might need to reload preferences to see your new data." ) . "</p>" ;
18 print "<div class= \" prefFeedOPMLHolder \" >" ;
19 $owner_uid = $_SESSION [ "uid" ];
21 db_query ( $this -> link
, "BEGIN" );
23 print "<ul class='nomarks'>" ;
25 $opml = new Opml ( $this -> link
, $_REQUEST );
27 $opml -> opml_import ( $_SESSION [ "uid" ]);
29 db_query ( $this -> link
, "COMMIT" );
34 print "<div align='center'>" ;
35 print "<button dojoType= \" dijit.form.Button \"
36 onclick= \" dijit.byId('opmlImportDlg').execute() \" >" .
37 __ ( 'Close this window' ). "</button>" ;
45 function editPrefProfiles () {
46 print "<div dojoType= \" dijit.Toolbar \" >" ;
48 print "<div dojoType= \" dijit.form.DropDownButton \" >" .
49 "<span>" . __ ( 'Select' ). "</span>" ;
50 print "<div dojoType= \" dijit.Menu \" style= \" display: none; \" >" ;
51 print "<div onclick= \" selectTableRows('prefFeedProfileList', 'all') \"
52 dojoType= \" dijit.MenuItem \" >" . __ ( 'All' ). "</div>" ;
53 print "<div onclick= \" selectTableRows('prefFeedProfileList', 'none') \"
54 dojoType= \" dijit.MenuItem \" >" . __ ( 'None' ). "</div>" ;
57 print "<div style= \" float : right \" >" ;
59 print "<input name= \" newprofile \" dojoType= \" dijit.form.ValidationTextBox \"
61 <button dojoType= \" dijit.form.Button \"
62 onclick= \" dijit.byId('profileEditDlg').addProfile() \" >" .
63 __ ( 'Create profile' ). "</button></div>" ;
67 $result = db_query ( $this -> link
, "SELECT title,id FROM ttrss_settings_profiles
68 WHERE owner_uid = " . $_SESSION [ "uid" ]. " ORDER BY title" );
70 print "<div class= \" prefFeedCatHolder \" >" ;
72 print "<form id= \" profile_edit_form \" onsubmit= \" return false \" >" ;
74 print "<table width= \" 100% \" class= \" prefFeedProfileList \"
75 cellspacing= \" 0 \" id= \" prefFeedProfileList \" >" ;
77 print "<tr class= \" placeholder \" id= \" FCATR-0 \" >" ; #odd
79 print "<td width='5%' align='center'><input
81 onclick='toggleSelectRow2(this);'
82 dojoType= \" dijit.form.CheckBox \"
83 type= \" checkbox \" ></td>" ;
85 if (! $_SESSION [ "profile" ]) {
86 $is_active = __ ( "(active)" );
92 __ ( "Default profile" ) . " $is_active </span></td>" ;
98 while ( $line = db_fetch_assoc ( $result )) {
100 $class = ( $lnum %
2 ) ?
"even" : "odd" ;
102 $profile_id = $line [ "id" ];
103 $this_row_id = "id= \" FCATR- $profile_id\" " ;
105 print "<tr class= \" placeholder \" $this_row_id >" ;
107 $edit_title = htmlspecialchars ( $line [ "title" ]);
109 print "<td width='5%' align='center'><input
110 onclick='toggleSelectRow2(this);'
111 id='FCATC- $profile_id '
112 dojoType= \" dijit.form.CheckBox \"
113 type= \" checkbox \" ></td>" ;
115 if ( $_SESSION [ "profile" ] == $line [ "id" ]) {
116 $is_active = __ ( "(active)" );
121 print "<td><span dojoType= \" dijit.InlineEditBox \"
122 width= \" 300px \" autoSave= \" false \"
123 profile-id= \" $profile_id\" >" . $edit_title .
124 "<script type= \" dojo/method \" event= \" onChange \" args= \" item \" >
128 content: {op: 'rpc', method: 'saveprofile',
130 id: this.srcNodeRef.getAttribute('profile-id')},
131 load: function(response) {
132 elem.attr('value', response);
136 </span> $is_active </td>" ;
147 print "<div class='dlgButtons'>
148 <div style='float : left'>
149 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').removeSelected() \" >" .
150 __ ( 'Remove selected profiles' ). "</button>
151 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').activateProfile() \" >" .
152 __ ( 'Activate profile' ). "</button>
155 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('profileEditDlg').hide() \" >" .
156 __ ( 'Close this window' ). "</button>" ;
161 function pubOPMLUrl () {
162 $url_path = Opml
:: opml_publish_url ( $this -> link
);
164 print __ ( "Your Public OPML URL is:" );
166 print "<div class= \" tagCloudContainer \" >" ;
167 print "<a id='pub_opml_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
170 print "<div align='center'>" ;
172 print "<button dojoType= \" dijit.form.Button \" onclick= \" return opmlRegenKey() \" >" .
173 __ ( 'Generate new URL' ). "</button> " ;
175 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
176 __ ( 'Close this window' ). "</button>" ;
183 function explainError () {
184 print "<div class= \" errorExplained \" >" ;
186 if ( $this -> param
== 1 ) {
187 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." );
189 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
191 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
195 if ( $this -> param
== 3 ) {
196 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." );
198 $stamp = ( int ) file_get_contents ( LOCK_DIRECTORY
. "/update_daemon.stamp" );
200 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
206 print "<div align='center'>" ;
208 print "<button onclick= \" return closeInfoBox() \" >" .
209 __ ( 'Close this window' ). "</button>" ;
216 function quickAddFeed () {
217 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
218 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" addfeed \" >" ;
220 print "<div class= \" dlgSec \" >" . __ ( "Feed or site URL" ). "</div>" ;
221 print "<div class= \" dlgSecCont \" >" ;
223 print "<div style='float : right'>
224 <img style='display : none'
225 id='feed_add_spinner' src='images/indicator_white.gif'></div>" ;
227 print "<input style= \" font-size : 16px; width : 20em; \"
228 placeHolder= \" " . __ ( "Feed or site URL" ). " \"
229 dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \" name= \" feed \" id= \" feedDlg_feedUrl \" >" ;
233 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' )) {
234 print __ ( 'Place in category:' ) . " " ;
235 print_feed_cat_select ( $this -> link
, "cat" , false , 'dojoType="dijit.form.Select"' );
240 print '<div id="feedDlg_feedsContainer" style="display : none">
242 <div class="dlgSec">' . __ ( 'Available feeds' ) . '</div>
243 <div class="dlgSecCont">' .
244 '<select id="feedDlg_feedContainerSelect"
245 dojoType="dijit.form.Select" size="3">
246 <script type="dojo/method" event="onChange" args="value">
247 dijit.byId("feedDlg_feedUrl").attr("value", value);
252 print "<div id='feedDlg_loginContainer' style='display : none'>
254 <div class= \" dlgSec \" >" . __ ( "Authentication" ). "</div>
255 <div class= \" dlgSecCont \" >" .
257 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
258 placeHolder= \" " . __ ( "Login" ). " \"
259 style= \" width : 10em; \" > " .
261 placeHolder= \" " . __ ( "Password" ). " \"
262 dojoType= \" dijit.form.TextBox \" type='password'
263 style= \" width : 10em; \" name='pass' \" >
267 print "<div style= \" clear : both \" >
268 <input type= \" checkbox \" name= \" need_auth \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
269 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
270 <label for= \" feedDlg_loginCheck \" >" .
271 __ ( 'This feed requires authentication.' ). "</div>" ;
275 print "<div class= \" dlgButtons \" >
276 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>" ;
278 if (!( defined ( '_DISABLE_FEED_BROWSER' ) && _DISABLE_FEED_BROWSER
)) {
279 print "<button dojoType= \" dijit.form.Button \" onclick= \" return feedBrowser() \" >" . __ ( 'More feeds' ). "</button>" ;
282 print "<button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('feedAddDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
288 function feedBrowser () {
289 if ( defined ( '_DISABLE_FEED_BROWSER' ) && _DISABLE_FEED_BROWSER
) return ;
291 $browser_search = db_escape_string ( $this -> link
, $_REQUEST [ "search" ]);
293 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
294 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" updateFeedBrowser \" >" ;
296 print "<div dojoType= \" dijit.Toolbar \" >
297 <div style='float : right'>
298 <img style='display : none'
299 id='feed_browser_spinner' src='images/indicator_white.gif'>
300 <input name= \" search \" dojoType= \" dijit.form.TextBox \" size= \" 20 \" type= \" search \"
301 onchange= \" dijit.byId('feedBrowserDlg').update() \" value= \" $browser_search\" >
302 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').update() \" >" . __ ( 'Search' ). "</button>
305 print " <select name= \" mode \" dojoType= \" dijit.form.Select \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >
306 <option value='1'>" . __ ( 'Popular feeds' ) . "</option>
307 <option value='2'>" . __ ( 'Feed archive' ) . "</option>
312 print " <select dojoType= \" dijit.form.Select \" name= \" limit \" onchange= \" dijit.byId('feedBrowserDlg').update() \" >" ;
314 foreach ( array ( 25 , 50 , 100 , 200 ) as $l ) {
315 $issel = ( $l == $limit ) ?
"selected= \" 1 \" " : "" ;
316 print "<option $issel value= \" $l\" > $l </option>" ;
323 $owner_uid = $_SESSION [ "uid" ];
325 require_once "feedbrowser.php" ;
327 print "<ul class='browseFeedList' id='browseFeedList'>" ;
328 print make_feed_browser ( $this -> link
, $search , 25 );
331 print "<div align='center'>
332 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
333 <button dojoType= \" dijit.form.Button \" style='display : none' id='feed_archive_remove' onclick= \" dijit.byId('feedBrowserDlg').removeFromArchive() \" >" . __ ( 'Remove' ). "</button>
334 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('feedBrowserDlg').hide() \" >" . __ ( 'Cancel' ). "</button></div>" ;
339 $this -> params
= explode ( ":" , db_escape_string ( $this -> link
, $_REQUEST [ "param" ]), 2 );
341 $active_feed_id = sprintf ( " %d " , $this -> params
[ 0 ]);
342 $is_cat = $this -> params
[ 1 ] != "false" ;
344 print "<div class= \" dlgSec \" >" . __ ( 'Look for' ). "</div>" ;
346 print "<div class= \" dlgSecCont \" >" ;
348 print "<input dojoType= \" dijit.form.ValidationTextBox \"
349 style= \" font-size : 16px; width : 20em; \"
350 required= \" 1 \" name= \" query \" type= \" search \" value=''>" ;
352 print "<hr/>" . __ ( 'Limit search to:' ). " " ;
354 print "<select name= \" search_mode \" dojoType= \" dijit.form.Select \" >
355 <option value= \" all_feeds \" >" . __ ( 'All feeds' ). "</option>" ;
357 $feed_title = getFeedTitle ( $this -> link
, $active_feed_id );
360 $feed_cat_title = getFeedCatTitle ( $this -> link
, $active_feed_id );
362 $feed_cat_title = getCategoryTitle ( $this -> link
, $active_feed_id );
365 if ( $active_feed_id && ! $is_cat ) {
366 print "<option selected= \" 1 \" value= \" this_feed \" > $feed_title </option>" ;
368 print "<option disabled= \" 1 \" value= \" false \" >" . __ ( 'This feed' ). "</option>" ;
372 $cat_preselected = "selected= \" 1 \" " ;
375 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' ) && ( $active_feed_id > 0 ||
$is_cat )) {
376 print "<option $cat_preselected value= \" this_cat \" > $feed_cat_title </option>" ;
378 //print "<option disabled>".__('This category')."</option>";
385 print "<div class= \" dlgButtons \" >" ;
387 if (! SPHINX_ENABLED
) {
388 print "<div style= \" float : left \" >
389 <a class= \" visibleLink \" target= \" _blank \" href= \" http://tt-rss.org/wiki/SearchSyntax \" >Search syntax</a>
393 print "<button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').execute() \" >" . __ ( 'Search' ). "</button>
394 <button dojoType= \" dijit.form.Button \" onclick= \" dijit.byId('searchDlg').hide() \" >" . __ ( 'Cancel' ). "</button>
398 function editArticleTags () {
400 print __ ( "Tags for this article (separated by commas):" ). "<br>" ;
402 $tags = get_article_tags ( $this -> link
, $this -> param
);
404 $tags_str = join ( ", " , $tags );
406 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" id \" value= \" $this ->param \" >" ;
407 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
408 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" setArticleTags \" >" ;
410 print "<table width='100%'><tr><td>" ;
412 print "<textarea dojoType= \" dijit.form.SimpleTextarea \" rows='4'
413 style='font-size : 12px; width : 100%' id= \" tags_str \"
414 name='tags_str'> $tags_str </textarea>
415 <div class= \" autocomplete \" id= \" tags_choices \"
416 style= \" display:none \" ></div>" ;
418 print "</td></tr></table>" ;
420 print "<div class='dlgButtons'>" ;
422 print "<button dojoType= \" dijit.form.Button \"
423 onclick= \" dijit.byId('editTagsDlg').execute() \" >" . __ ( 'Save' ). "</button> " ;
424 print "<button dojoType= \" dijit.form.Button \"
425 onclick= \" dijit.byId('editTagsDlg').hide() \" >" . __ ( 'Cancel' ). "</button>" ;
430 function printTagCloud () {
431 print "<div class= \" tagCloudContainer \" >" ;
433 // from here: http://www.roscripts.com/Create_tag_cloud-71.html
435 $query = "SELECT tag_name, COUNT(post_int_id) AS count
436 FROM ttrss_tags WHERE owner_uid = " . $_SESSION [ "uid" ]. "
437 GROUP BY tag_name ORDER BY count DESC LIMIT 50" ;
439 $result = db_query ( $this -> link
, $query );
443 while ( $line = db_fetch_assoc ( $result )) {
444 $tags [ $line [ "tag_name" ]] = $line [ "count" ];
447 if ( count ( $tags ) == 0 ){ return ; }
451 $max_size = 32 ; // max font size in pixels
452 $min_size = 11 ; // min font size in pixels
454 // largest and smallest array values
455 $max_qty = max ( array_values ( $tags ));
456 $min_qty = min ( array_values ( $tags ));
458 // find the range of values
459 $spread = $max_qty - $min_qty ;
460 if ( $spread == 0 ) { // we don't want to divide by zero
464 // set the font-size increment
465 $step = ( $max_size - $min_size ) / ( $spread );
467 // loop through the tag array
468 foreach ( $tags as $key => $value ) {
469 // calculate font-size
470 // find the $value in excess of $min_qty
471 // multiply by the font-size increment ($size)
472 // and add the $min_size set above
473 $size = round ( $min_size +
(( $value - $min_qty ) * $step ));
475 $key_escaped = str_replace ( "'" , " \\ '" , $key );
477 echo "<a href= \" javascript:viewfeed(' $key_escaped ') \" style= \" font-size: " .
478 $size . "px \" title= \" $value articles tagged with " .
479 $key . '">' . $key . '</a> ' ;
486 print "<div align='center'>" ;
487 print "<button dojoType= \" dijit.form.Button \"
488 onclick= \" return closeInfoBox() \" >" .
489 __ ( 'Close this window' ). "</button>" ;
494 function printTagSelect () {
496 print __ ( "Match:" ). " " .
497 "<input class= \" noborder \" dojoType= \" dijit.form.RadioButton \" type= \" radio \" checked value= \" any \" name= \" tag_mode \" id= \" tag_mode_any \" >" ;
498 print "<label for= \" tag_mode_any \" >" . __ ( "Any" ). "</label>" ;
500 print "<input class= \" noborder \" dojoType= \" dijit.form.RadioButton \" type= \" radio \" value= \" all \" name= \" tag_mode \" id= \" tag_mode_all \" >" ;
501 print "<label for= \" tag_mode_all \" >" . __ ( "All tags." ). "</input>" ;
503 print "<select id= \" all_tags \" name= \" all_tags \" title= \" " . __ ( 'Which Tags?' ) . " \" multiple= \" multiple \" size= \" 10 \" style= \" width : 100% \" >" ;
504 $result = db_query ( $this -> link
, "SELECT DISTINCT tag_name FROM ttrss_tags WHERE owner_uid = " . $_SESSION [ 'uid' ]. "
505 AND LENGTH(tag_name) <= 30 ORDER BY tag_name ASC" );
507 while ( $row = db_fetch_assoc ( $result )) {
508 $tmp = htmlspecialchars ( $row [ "tag_name" ]);
509 print "<option value= \" " . str_replace ( " " , " %20 " , $tmp ) . " \" > $tmp </option>" ;
514 print "<div align='right'>" ;
515 print "<button dojoType= \" dijit.form.Button \" onclick= \" viewfeed(get_all_tags($('all_tags')),
516 get_radio_checked($('tag_mode'))); \" >" . __ ( 'Display entries' ) . "</button>" ;
518 print "<button dojoType= \" dijit.form.Button \"
519 onclick= \" return closeInfoBox() \" >" .
520 __ ( 'Close this window' ) . "</button>" ;
525 function generatedFeed () {
527 $this -> params
= explode ( ":" , $this -> param
, 3 );
528 $feed_id = db_escape_string ( $this -> link
, $this -> params
[ 0 ]);
529 $is_cat = ( bool ) $this -> params
[ 1 ];
531 $key = get_feed_access_key ( $this -> link
, $feed_id , $is_cat );
533 $url_path = htmlspecialchars ( $this -> params
[ 2 ]) . "&key=" . $key ;
535 print "<h2>" . __ ( "You can view this feed as RSS using the following URL:" ). "</h2>" ;
537 print "<div class= \" tagCloudContainer \" >" ;
538 print "<a id='gen_feed_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
541 print "<div align='center'>" ;
543 print "<button dojoType= \" dijit.form.Button \" onclick= \" return genUrlChangeKey(' $feed_id ', ' $is_cat ') \" >" .
544 __ ( 'Generate new URL' ). "</button> " ;
546 print "<button dojoType= \" dijit.form.Button \" onclick= \" return closeInfoBox() \" >" .
547 __ ( 'Close this window' ). "</button>" ;
554 function newVersion () {
556 $version_data = check_for_update ( $this -> link
);
557 $version = $version_data [ 'version' ];
558 $id = $version_data [ 'version_id' ];
560 if ( $version && $id ) {
561 print "<div class='tagCloudContainer'>" ;
563 print T_sprintf ( "New version of Tiny Tiny RSS is available ( %s )." ,
568 $details = "http://tt-rss.org/redmine/versions/ $id " ;
569 $download = "http://tt-rss.org/#Download" ;
571 print "<p align='center'>" . __ ( "You can update using built-in updater in the Preferences or by using update.php" ). "</p>" ;
573 print "<div style='text-align : center'>" ;
574 print "<button dojoType= \" dijit.form.Button \"
575 onclick= \" return window.open(' $details ') \" >" . __ ( "See the release notes" ). "</button>" ;
576 print "<button dojoType= \" dijit.form.Button \"
577 onclick= \" return window.open(' $download ') \" >" . __ ( "Download" ). "</button>" ;
578 print "<button dojoType= \" dijit.form.Button \"
579 onclick= \" return dijit.byId('newVersionDlg').hide() \" >" .
580 __ ( 'Close this window' ). "</button>" ;
583 print "<div class='tagCloudContainer'>" ;
585 print "<p align='center'>" . __ ( "Error receiving version information or no new version available." ). "</p>" ;
589 print "<div style='text-align : center'>" ;
590 print "<button dojoType= \" dijit.form.Button \"
591 onclick= \" return dijit.byId('newVersionDlg').hide() \" >" .
592 __ ( 'Close this window' ). "</button>" ;
600 function customizeCSS () {
601 $value = get_pref ( $this -> link
, "USER_STYLESHEET" );
603 $value = str_replace ( "<br/>" , " \n " , $value );
605 print_notice ( 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" ));
607 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
608 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" setpref \" >" ;
609 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" key \" value= \" USER_STYLESHEET \" >" ;
611 print "<table width='100%'><tr><td>" ;
612 print "<textarea dojoType= \" dijit.form.SimpleTextarea \"
613 style='font-size : 12px; width : 100%; height: 200px;'
614 placeHolder='body#ttrssMain { font-size : 14px; };'
615 name='value'> $value </textarea>" ;
616 print "</td></tr></table>" ;
618 print "<div class='dlgButtons'>" ;
619 print "<button dojoType= \" dijit.form.Button \"
620 onclick= \" dijit.byId('cssEditDlg').execute() \" >" . __ ( 'Save' ). "</button> " ;
621 print "<button dojoType= \" dijit.form.Button \"
622 onclick= \" dijit.byId('cssEditDlg').hide() \" >" . __ ( 'Cancel' ). "</button>" ;
627 function addInstance () {
628 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" pref-instances \" >" ;
629 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" add \" >" ;
631 print "<div class= \" dlgSec \" >" . __ ( "Instance" ). "</div>" ;
633 print "<div class= \" dlgSecCont \" >" ;
637 print __ ( "URL:" ) . " " ;
639 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \"
640 placeHolder= \" " . __ ( "Instance URL" ). " \"
641 regExp='^(http|https)://.*'
642 style= \" font-size : 16px; width: 20em \" name= \" access_url \" >" ;
646 $access_key = sha1 ( uniqid ( rand (), true ));
650 print __ ( "Access key:" ) . " " ;
652 print "<input dojoType= \" dijit.form.ValidationTextBox \" required= \" 1 \"
653 placeHolder= \" " . __ ( "Access key" ). " \" regExp='\w{40}'
654 style= \" width: 20em \" name= \" access_key \" id= \" instance_add_key \"
655 value= \" $access_key\" >" ;
657 print "<p class='insensitive'>" . __ ( "Use one access key for both linked instances." );
661 print "<div class= \" dlgButtons \" >
662 <div style='float : left'>
663 <button dojoType= \" dijit.form.Button \"
664 onclick= \" return dijit.byId('instanceAddDlg').regenKey() \" >" .
665 __ ( 'Generate new key' ). "</button>
667 <button dojoType= \" dijit.form.Button \"
668 onclick= \" return dijit.byId('instanceAddDlg').execute() \" >" .
669 __ ( 'Create link' ). "</button>
670 <button dojoType= \" dijit.form.Button \"
671 onclick= \" return dijit.byId('instanceAddDlg').hide() \"\" >" .
672 __ ( 'Cancel' ). "</button></div>" ;
677 function batchSubscribe () {
678 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" op \" value= \" rpc \" >" ;
679 print "<input dojoType= \" dijit.form.TextBox \" style= \" display : none \" name= \" method \" value= \" batchaddfeeds \" >" ;
681 print "<table width='100%'><tr><td>
682 " . __ ( "Add one valid RSS feed per line (no feed detection is done)" ). "
683 </td><td align='right'>" ;
684 if ( get_pref ( $this -> link
, 'ENABLE_FEED_CATS' )) {
685 print __ ( 'Place in category:' ) . " " ;
686 print_feed_cat_select ( $this -> link
, "cat" , false , 'dojoType="dijit.form.Select"' );
688 print "</td></tr><tr><td colspan='2'>" ;
690 style='font-size : 12px; width : 100%; height: 200px;'
691 placeHolder= \" " . __ ( "Feeds to subscribe, One per line" ). " \"
692 dojoType= \" dijit.form.SimpleTextarea \" required= \" 1 \" name= \" feeds \" ></textarea>" ;
694 print "</td></tr><tr><td colspan='2'>" ;
696 print "<div id='feedDlg_loginContainer' style='display : none'>
698 " <input dojoType= \" dijit.form.TextBox \" name='login' \"
699 placeHolder= \" " . __ ( "Login" ). " \"
700 style= \" width : 10em; \" > " .
702 placeHolder= \" " . __ ( "Password" ). " \"
703 dojoType= \" dijit.form.TextBox \" type='password'
704 style= \" width : 10em; \" name='pass' \" >" .
707 print "</td></tr><tr><td colspan='2'>" ;
709 print "<div style= \" clear : both \" >
710 <input type= \" checkbox \" name= \" need_auth \" dojoType= \" dijit.form.CheckBox \" id= \" feedDlg_loginCheck \"
711 onclick='checkboxToggleElement(this, \" feedDlg_loginContainer \" )'>
712 <label for= \" feedDlg_loginCheck \" >" .
713 __ ( 'Feeds require authentication.' ). "</div>" ;
717 print "</td></tr></table>" ;
719 print "<div class= \" dlgButtons \" >
720 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('batchSubDlg').execute() \" >" . __ ( 'Subscribe' ). "</button>
721 <button dojoType= \" dijit.form.Button \" onclick= \" return dijit.byId('batchSubDlg').hide() \" >" . __ ( 'Cancel' ). "</button>