]> git.wh0rd.org - tt-rss.git/blobdiff - modules/popup-dialog.php
update eclipse .settings
[tt-rss.git] / modules / popup-dialog.php
index 78962dc6c42602c82308dee18ec777cc0975e716..13abc947f1febcfca57b7b9844f3f4a76d94721d 100644 (file)
                                                var elem = this;
                                                dojo.xhrPost({
                                                        url: 'backend.php',
-                                                       content: {op: 'rpc', subop: 'saveprofile',
+                                                       content: {op: 'rpc', method: 'saveprofile',
                                                                value: this.value,
                                                                id: this.srcNodeRef.getAttribute('profile-id')},
                                                                load: function(response) {
                if ($id == "quickAddFeed") {
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"addfeed\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"addfeed\">";
 
                        print "<div class=\"dlgSec\">".__("Feed")."</div>";
                        print "<div class=\"dlgSecCont\">";
 #                              name='feed_browser' id='feed_browser'>";
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"updateFeedBrowser\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"updateFeedBrowser\">";
 
                        print "<div dojoType=\"dijit.Toolbar\">
                                <div style='float : right'>
 
                        print "</div>";
 
-                       print "<div class=\"dlgButtons\">
-                       <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button>
+                       print "<div class=\"dlgButtons\">";
+
+                       if (!SPHINX_ENABLED) {
+                               print "<div style=\"float : left\">
+                                       <a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/redmine/wiki/tt-rss/SearchSyntax\">Search syntax</a>
+                                       </div>";
+                       }
+
+                       print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button>
                        <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">".__('Cancel')."</button>
                        </div>";
                }
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-filters\">";
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"quiet\" value=\"1\">";
-                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"add\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"add\">";
 
                        $result = db_query($link, "SELECT id,description
                                FROM ttrss_filter_types ORDER BY description");
                                 name=\"reg_exp\" value=\"$reg_exp\"/>";
 
                        print "<span id=\"filterDlg_dateChkBox\" style=\"display : none\">";
-                       print "&nbsp;<button onclick=\"return filterDlgCheckDate()\">".
+                       print "&nbsp;<button dojoType=\"dijit.form.Button\"
+                               onclick=\"return filterDlgCheckDate()\">".
                                __('Check it')."</button>";
                        print "</span>";
 
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$param\">";
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setArticleTags\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setArticleTags\">";
 
                        print "<table width='100%'><tr><td>";
 
                        print "</div>";
 
                        print "]]></content>";
+               }
 
-                       //return;
+               if ($id == 'printTagSelect') {
+                       print "<title>" . __('Select item(s) by tags') . "</title>";
+                       print "<content><![CDATA[";
+
+                       print __("Match:"). "&nbsp;" .
+                                 "<input class=\"noborder\" dojoType=\"dijit.form.RadioButton\" type=\"radio\" checked value=\"any\" name=\"tag_mode\">&nbsp;Any&nbsp;";
+                       print "<input class=\"noborder\" dojoType=\"dijit.form.RadioButton\" type=\"radio\" value=\"all\" name=\"tag_mode\">&nbsp;All&nbsp;";
+                       print "&nbsp;tags.";
+
+                       print "<select id=\"all_tags\" name=\"all_tags\" title=\"" . __('Which Tags?') . "\" multiple=\"multiple\" size=\"10\" style=\"width : 100%\">";
+                       $result = db_query($link, "SELECT DISTINCT tag_name FROM ttrss_tags WHERE owner_uid = ".$_SESSION['uid']."
+                               AND LENGTH(tag_name) <= 30 ORDER BY tag_name ASC");
+
+                       while ($row = db_fetch_assoc($result)) {
+                               $tmp = htmlspecialchars($row["tag_name"]);
+                               print "<option value=\"" . str_replace(" ", "%20", $tmp) . "\">$tmp</option>";
+                       }
+
+                       print "</select>";
+
+                       print "<div align='right'>";
+                       print "<button dojoType=\"dijit.form.Button\" onclick=\"viewfeed(get_all_tags($('all_tags')),
+                               get_radio_checked($('tag_mode')));\">" . __('Display entries') . "</button>";
+                       print "&nbsp;";
+                       print "<button dojoType=\"dijit.form.Button\"
+                       onclick=\"return closeInfoBox()\">" .
+                               __('Close this window') . "</button>";
+                       print "</div>";
+
+                       print "]]></content>";
                }
 
                if ($id == "emailArticle") {
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"secretkey\" value=\"$secretkey\">";
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"sendEmail\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"sendEmail\">";
 
                        $result = db_query($link, "SELECT email, full_name FROM ttrss_users WHERE
                                id = " . $_SESSION["uid"]);
                        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");
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setpref\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setpref\">";
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"key\" value=\"USER_STYLESHEET\">";
 
                        print "<table width='100%'><tr><td>";
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$param\">";
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setNote\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setNote\">";
 
                        print "<table width='100%'><tr><td>";
                        print "<textarea dojoType=\"dijit.form.SimpleTextarea\"
 
                }
 
+               if ($id == "about") {
+                       print "<table width='100%'><tr><td align='center'>";
+                       print "<img src=\"images/logo_big.png\">";
+                       print "</td>";
+                       print "<td width='70%'>";
+
+                       print "<h1>Tiny Riny RSS</h1>
+                               <strong>Version ".VERSION."</strong>
+                               <p>Copyright &copy; 2005-".date('Y')."
+                               <a target=\"_blank\" class=\"visibleLink\"
+                               href=\"http://fakecake.org/\">Andrew Dolgov</a>
+                               and other contributors.</p>
+                               <p class=\"insensitive\">Licensed under GNU GPL version 2.</p>";
+
+                       print "<p class=\"insensitive\">
+                               <a class=\"visibleLink\" target=\"_blank\"
+                                       href=\"http://tt-rss.org/\">Official site</a> &mdash;
+                               <a href=\"http://tt-rss.org/redmine/wiki/tt-rss/Donate\"
+                               target=\"_blank\" class=\"visibleLink\">
+                               Support the project.</a></p>";
+
+                       print "</td></tr>";
+                       print "</table>";
+
+                       print "<div align='center'>";
+                       print "<button dojoType=\"dijit.form.Button\"
+                               type=\"submit\">".
+                               __('Close this window')."</button>";
+                       print "</div>";
+               }
+
+               if ($id == "addInstance") {
+
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"op\" value=\"pref-instances\">";
+                       print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"method\" value=\"add\">";
+
+                       print "<div class=\"dlgSec\">".__("Instance")."</div>";
+
+                       print "<div class=\"dlgSecCont\">";
+
+                       /* URL */
+
+                       print __("URL:") . " ";
+
+                       print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
+                               placeHolder=\"".__("Instance URL")."\"
+                               regExp='^(http|https)://.*'
+                               style=\"font-size : 16px; width: 20em\" name=\"access_url\">";
+
+                       print "<hr/>";
+
+                       $access_key = sha1(uniqid(rand(), true));
+
+                       /* Access key */
+
+                       print __("Access key:") . " ";
+
+                       print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
+                               placeHolder=\"".__("Access key")."\" regExp='\w{40}'
+                               style=\"width: 20em\" name=\"access_key\" id=\"instance_add_key\"
+                               value=\"$access_key\">";
+
+                       print "<p class='insensitive'>" . __("Use one access key for both linked instances.");
+
+                       print "</div>";
+
+                       print "<div class=\"dlgButtons\">
+                               <div style='float : left'>
+                                       <button dojoType=\"dijit.form.Button\"
+                                               onclick=\"return dijit.byId('instanceAddDlg').regenKey()\">".
+                                               __('Generate new key')."</button>
+                               </div>
+                               <button dojoType=\"dijit.form.Button\"
+                                       onclick=\"return dijit.byId('instanceAddDlg').execute()\">".
+                                       __('Create link')."</button>
+                               <button dojoType=\"dijit.form.Button\"
+                                       onclick=\"return dijit.byId('instanceAddDlg').hide()\"\">".
+                                       __('Cancel')."</button></div>";
+
+                       return;
+               }
+
+               if ($id == "shareArticle") {
+
+                       $result = db_query($link, "SELECT uuid, ref_id FROM ttrss_user_entries WHERE int_id = '$param'
+                               AND owner_uid = " . $_SESSION['uid']);
+
+                       if (db_num_rows($result) == 0) {
+                               print "Article not found.";
+                       } else {
+
+                               $uuid = db_fetch_result($result, 0, "uuid");
+                               $ref_id = db_fetch_result($result, 0, "ref_id");
+
+                               if (!$uuid) {
+                                       $uuid = db_escape_string(sha1(uniqid(rand(), true)));
+                                       db_query($link, "UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$param'
+                                               AND owner_uid = " . $_SESSION['uid']);
+                               }
+
+                               print __("You can share this article by the following unique URL:");
+
+                               $url_path = get_self_url_prefix();
+                               $url_path .= "/public.php?op=share&key=$uuid";
+
+                               print "<div class=\"tagCloudContainer\">";
+                               print "<a id='pub_opml_url' href='$url_path' target='_blank'>$url_path</a>";
+                               print "</div>";
+
+                               /* if (!label_find_id($link, __('Shared'), $_SESSION["uid"]))
+                                       label_create($link, __('Shared'), $_SESSION["uid"]);
+
+                               label_add_article($link, $ref_id, __('Shared'), $_SESSION['uid']); */
+                       }
+
+                       print "<div align='center'>";
+
+                       print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('shareArticleDlg').hide()\">".
+                               __('Close this window')."</button>";
+
+                       print "</div>";
+
+                       return;
+               }
 
                print "</dlg>";
+
        }
 ?>