]>
git.wh0rd.org - tt-rss.git/blob - modules/popup-dialog.php
2 function module_popup_dialog ( $link ) {
4 $param = db_escape_string ( $_REQUEST [ "param" ]);
8 print "<div id= \" infoBoxTitle \" >" . __ ( 'Published Articles' ). "</div>" ;
9 print "<div class= \" infoBoxContents \" >" ;
11 $url_path = article_publish_url ( $link );
13 print __ ( "Your Published articles feed URL is:" );
15 print "<div class= \" tagCloudContainer \" >" ;
16 print "<a id='pub_feed_url' href=' $url_path ' target='_blank'> $url_path </a>" ;
19 print "<div align='center'>" ;
21 print "<button onclick= \" return pubRegenKey() \" >" .
22 __ ( 'Generate new URL' ). "</button> " ;
24 print "<input class= \" button \"
25 type= \" submit \" onclick= \" return closeInfoBox() \"
26 value= \" " . __ ( 'Close this window' ). " \" >" ;
33 if ( $id == "explainError" ) {
35 print "<div id= \" infoBoxTitle \" >" . __ ( 'Notice' ). "</div>" ;
36 print "<div class= \" infoBoxContents \" >" ;
38 print "<div class= \" errorExplained \" >" ;
41 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." );
43 $stamp = ( int ) read_stampfile ( "update_daemon.stamp" );
45 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
50 $msg = check_for_update ( $link );
53 print __ ( "You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug." );
61 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." );
63 $stamp = ( int ) read_stampfile ( "update_daemon.stamp" );
65 print "<p>" . __ ( "Last update:" ) . " " . date ( "Y.m.d, G:i" , $stamp );
71 print "<div align='center'>" ;
73 print "<input class= \" button \"
74 type= \" submit \" onclick= \" return visitOfficialSite() \"
75 value= \" " . __ ( 'Visit official site' ). " \" > " ;
77 print "<input class= \" button \"
78 type= \" submit \" onclick= \" return closeInfoBox() \"
79 value= \" " . __ ( 'Close this window' ). " \" >" ;
86 if ( $id == "quickAddFeed" ) {
88 print "<div id= \" infoBoxTitle \" >" . __ ( 'Subscribe to Feed' ). "</div>" ;
89 print "<div class= \" infoBoxContents \" >" ;
91 print "<form id='feed_add_form' onsubmit='return false'>" ;
93 print "<input type= \" hidden \" name= \" op \" value= \" pref-feeds \" >" ;
94 print "<input type= \" hidden \" name= \" subop \" value= \" add \" >" ;
95 print "<input type= \" hidden \" name= \" from \" value= \" tt-rss \" >" ;
97 print "<div class= \" dlgSec \" >" . __ ( "Feed" ). "</div>" ;
98 print "<div class= \" dlgSecCont \" >" ;
100 print __ ( "URL:" ) . " " ;
102 print "<input size= \" 40 \"
103 onkeypress= \" return filterCR(event, subscribeToFeed) \"
104 name= \" feed_url \" ></td></tr>" ;
108 if ( get_pref ( $link , 'ENABLE_FEED_CATS' )) {
109 print __ ( 'Place in category:' ) . " " ;
110 print_feed_cat_select ( $link , "cat_id" );
115 print "<div id='fadd_login_container' style='display:none'>
117 <div class= \" dlgSec \" >" . __ ( "Authentication" ). "</div>
118 <div class= \" dlgSecCont \" >" .
120 __ ( 'Login:' ) . " <input name='auth_login' size= \" 20 \"
121 onkeypress= \" return filterCR(event, subscribeToFeed) \" > " .
122 __ ( 'Password:' ) . "<input type='password'
123 name='auth_pass' size= \" 20 \"
124 onkeypress= \" return filterCR(event, subscribeToFeed) \" >
128 print "<div style= \" clear : both \" >
129 <input type= \" checkbox \" id= \" fadd_login_check \"
130 onclick='checkboxToggleElement(this, \" fadd_login_container \" )'>
131 <label for= \" fadd_login_check \" >" .
132 __ ( 'This feed requires authentication.' ). "</div>" ;
136 print "<div class= \" dlgButtons \" >
137 <button class= \" button \" id= \" fadd_submit_btn \"
138 onclick= \" return subscribeToFeed() \" >" . __ ( 'Subscribe' ). "</button>
139 <button onclick= \" return browseFeeds() \" >" . __ ( 'More feeds' ). "</button>
140 <button onclick= \" return closeInfoBox() \" >" . __ ( 'Cancel' ). "</button></div>" ;
145 if ( $id == "search" ) {
147 print "<div id= \" infoBoxTitle \" >" . __ ( 'Search' ). "</div>" ;
148 print "<div class= \" infoBoxContents \" >" ;
150 print "<form id='search_form' onsubmit='return false'>" ;
152 #$active_feed_id = db_escape_string($_REQUEST["param"]);
154 $params = split ( ":" , db_escape_string ( $_REQUEST [ "param" ]));
156 $active_feed_id = sprintf ( " %d " , $params [ 0 ]);
157 $is_cat = $params [ 1 ] == "true" ;
159 print "<div class= \" dlgSec \" >" . __ ( 'Look for' ). "</div>" ;
161 print "<div class= \" dlgSecCont \" >" ;
163 print "<input name= \" query \" size= \" 20 \" type= \" search \" value=''>" ;
165 print " " . __ ( 'match on' ). " " ;
167 $search_fields = array (
168 "title" => __ ( "Title" ),
169 "content" => __ ( "Content" ),
170 "both" => __ ( "Title or content" ));
172 print_select_hash ( "match_on" , 3 , $search_fields );
175 print "<br/>" . __ ( 'Limit search to:' ). " " ;
177 print "<select name= \" search_mode \" >
178 <option value= \" all_feeds \" >" . __ ( 'All feeds' ). "</option>" ;
180 $feed_title = getFeedTitle ( $link , $active_feed_id );
183 $feed_cat_title = getFeedCatTitle ( $link , $active_feed_id );
185 $feed_cat_title = getCategoryTitle ( $link , $active_feed_id );
188 if ( $active_feed_id && ! $is_cat ) {
189 print "<option selected value= \" this_feed \" > $feed_title </option>" ;
191 print "<option disabled>" . __ ( 'This feed' ). "</option>" ;
195 $cat_preselected = "selected" ;
198 if ( get_pref ( $link , 'ENABLE_FEED_CATS' ) && ( $active_feed_id > 0 ||
$is_cat )) {
199 print "<option $cat_preselected value= \" this_cat \" > $feed_cat_title </option>" ;
201 //print "<option disabled>".__('This category')."</option>";
210 print "<div class= \" dlgButtons \" >
211 <button onclick= \" javascript:search() \" >" . __ ( 'Search' ). "</button>
212 <button onclick= \" javascript:searchCancel() \" >" . __ ( 'Cancel' ). "</button>
221 if ( $id == "quickAddFilter" ) {
223 $active_feed_id = db_escape_string ( $_REQUEST [ "param" ]);
225 print "<div id= \" infoBoxTitle \" >" . __ ( 'Create Filter' ). "</div>" ;
226 print "<div class= \" infoBoxContents \" >" ;
228 print "<form id= \" filter_add_form \" onsubmit='return false'>" ;
230 print "<input type= \" hidden \" name= \" op \" value= \" pref-filters \" >" ;
231 print "<input type= \" hidden \" name= \" quiet \" value= \" 1 \" >" ;
232 print "<input type= \" hidden \" name= \" subop \" value= \" add \" >" ;
234 $result = db_query ( $link , "SELECT id,description
235 FROM ttrss_filter_types ORDER BY description" );
237 $filter_types = array ();
239 while ( $line = db_fetch_assoc ( $result )) {
240 //array_push($filter_types, $line["description"]);
241 $filter_types [ $line [ "id" ]] = __ ( $line [ "description" ]);
244 print "<div class= \" dlgSec \" >" . __ ( "Match" ). "</div>" ;
246 print "<div class= \" dlgSecCont \" >" ;
248 print "<span id= \" filter_dlg_date_mod_box \" style= \" display : none \" >" ;
249 print __ ( "Date" ) . " " ;
251 $filter_params = array (
252 "before" => __ ( "before" ),
253 "after" => __ ( "after" ));
255 print_select_hash ( "filter_date_modifier" , "before" , $filter_params );
257 print " </span>" ;
259 print "<input onkeypress= \" return filterCR(event, createFilter) \"
260 name= \" reg_exp \" size= \" 30 \" value= \" $reg_exp\" >" ;
262 print "<span id= \" filter_dlg_date_chk_box \" style= \" display : none \" >" ;
263 print " <input class= \" button \"
264 type= \" submit \" onclick= \" return filterDlgCheckDate() \"
265 value= \" " . __ ( 'Check it' ). " \" >" ;
268 print "<br/> " . __ ( "on field" ) . " " ;
269 print_select_hash ( "filter_type" , 1 , $filter_types ,
270 'onchange="filterDlgCheckType(this)"' );
274 print __ ( "in" ) . " " ;
275 print_feed_select ( $link , "feed_id" , $active_feed_id );
279 print "<div class= \" dlgSec \" >" . __ ( "Perform Action" ). "</div>" ;
281 print "<div class= \" dlgSecCont \" >" ;
283 print "<select name= \" action_id \"
284 onchange= \" filterDlgCheckAction(this) \" >" ;
286 $result = db_query ( $link , "SELECT id,description FROM ttrss_filter_actions
289 while ( $line = db_fetch_assoc ( $result )) {
290 printf ( "<option value=' %d '> %s </option>" , $line [ "id" ], __ ( $line [ "description" ]));
295 print "<span id= \" filter_dlg_param_box \" style= \" display : none \" >" ;
296 print " " . __ ( "with parameters:" ) . " " ;
297 print "<input size= \" 20 \"
298 onkeypress= \" return filterCR(event, createFilter) \"
299 name= \" action_param \" >" ;
301 print_label_select ( $link , "action_param_label" , $action_param );
305 print " " ; // tiny layout hack
309 print "<div class= \" dlgSec \" >" . __ ( "Options" ). "</div>" ;
310 print "<div class= \" dlgSecCont \" >" ;
312 print "<div style= \" line-height : 100% \" >" ;
314 print "<input type= \" checkbox \" name= \" enabled \" id= \" enabled \" checked= \" 1 \" >
315 <label for= \" enabled \" >" . __ ( 'Enabled' ). "</label><br/>" ;
317 print "<input type= \" checkbox \" name= \" inverse \" id= \" inverse \" >
318 <label for= \" inverse \" >" . __ ( 'Inverse match' ). "</label>" ;
325 print "<div class= \" dlgButtons \" >" ;
327 print "<button onclick= \" return createFilter() \" >" .
328 __ ( 'Create' ). "</button> " ;
330 print "<button onclick= \" return closeInfoBox() \" >" . __ ( 'Cancel' ).
335 // print "</td></tr></table>";
340 if ( $id == "feedUpdateErrors" ) {
342 print "<div id= \" infoBoxTitle \" >" . __ ( 'Update Errors' ). "</div>" ;
343 print "<div class= \" infoBoxContents \" >" ;
345 print __ ( "These feeds have not been updated because of errors:" );
347 $result = db_query ( $link , "SELECT id,title,feed_url,last_error
348 FROM ttrss_feeds WHERE last_error != '' AND owner_uid = " . $_SESSION [ "uid" ]);
350 print "<ul class='feedErrorsList'>" ;
352 while ( $line = db_fetch_assoc ( $result )) {
353 print "<li><b>" . $line [ "title" ] . "</b> (" . $line [ "feed_url" ] . "): " .
354 "<em>" . $line [ "last_error" ] . "</em>" ;
359 print "<div align='center'>" ;
361 print "<input class= \" button \"
362 type= \" submit \" onclick= \" return closeInfoBox() \"
363 value= \" " . __ ( 'Close' ). " \" >" ;
370 if ( $id == "editArticleTags" ) {
372 print "<div id= \" infoBoxTitle \" >" . __ ( 'Edit Tags' ). "</div>" ;
373 print "<div class= \" infoBoxContents \" >" ;
375 print "<form id= \" tag_edit_form \" onsubmit='return false'>" ;
377 print __ ( "Tags for this article (separated by commas):" ). "<br>" ;
379 $tags = get_article_tags ( $link , $param );
381 $tags_str = join ( ", " , $tags );
383 print "<table width='100%'>" ;
385 print "<tr><td colspan='2'><input type= \" hidden \" name= \" id \" value= \" $param\" ></td></tr>" ;
387 print "<tr><td colspan='2'><textarea rows='4' class='iedit' id='tags_str'
388 name='tags_str'> $tags_str </textarea>
389 <div class= \" autocomplete \" id= \" tags_choices \"
390 style= \" display:none \" ></div>
397 print "<div align='right'>" ;
399 print "<button onclick= \" return editTagsSave() \" >" . __ ( 'Save' ). "</button> " ;
400 print "<button onclick= \" return closeInfoBox() \" >" . __ ( 'Cancel' ). "</button>" ;
407 if ( $id == "printTagCloud" ) {
408 print "<div id= \" infoBoxTitle \" >" . __ ( 'Tag Cloud' ). "</div>" ;
409 print "<div class= \" infoBoxContents \" >" ;
411 print __ ( "Showing most popular tags " ). " (<a
412 href='javascript:toggleTags(true)'>" . __ ( 'more tags' ). "</a>):<br/>" ;
414 print "<div class= \" tagCloudContainer \" >" ;
416 printTagCloud ( $link );
420 print "<div align='center'>" ;
421 print "<button onclick= \" return closeInfoBox() \" >" .
422 __ ( 'Close this window' ). "</button>" ;
430 /* if ($id == "offlineDownload") {
431 print "<div id=\"infoBoxTitle\">".__('Download articles')."</div>";
432 print "<div class=\"infoBoxContents\">";
434 print "<form name='download_ops_form' id='download_ops_form'>";
436 print "<div class=\"dlgSec\">".__("Download")."</div>";
438 print "<div class=\"dlgSecCont\">";
446 print_select_hash("amount", 50, $amount);
448 print " " . __("latest articles for offline reading.");
452 print "<input checked='yes' type='checkbox' name='unread_only' id='unread_only'>";
453 print "<label for='unread_only'>".__('Only include unread articles')."</label>";
459 print "<div class=\"dlgButtons\">
460 <input class=\"button\"
461 type=\"submit\" onclick=\"return initiate_offline_download(0, this)\" value=\"".__('Download')."\">
462 <input class=\"button\"
463 type=\"submit\" onclick=\"return closeInfoBox()\"
464 value=\"".__('Cancel')."\"></div>";
472 print "<div id='infoBoxTitle'>Internal Error</div>
473 <div id='infoBoxContents'>
474 <p>Unknown dialog <b> $id </b></p>