]> git.wh0rd.org - tt-rss.git/blobdiff - classes/dlg.php
move inactiveFeeds and feedsWithErrors to pref-feeds; fix element id collisions
[tt-rss.git] / classes / dlg.php
index 55f6ea726a7f8105b041b31566d024166bbf6d6f..d6a3a0fbeb0816c464eb8d7322a78f03b4472123 100644 (file)
@@ -1,9 +1,9 @@
 <?php
-class Dlg extends Protected_Handler {
+class Dlg extends Handler_Protected {
        private $param;
 
-       function before() {
-               if (parent::before()) {
+       function before($method) {
+               if (parent::before($method)) {
                        header("Content-Type: text/xml; charset=utf-8");
                        $this->param = db_escape_string($_REQUEST["param"]);
                        print "<dlg>";
@@ -16,51 +16,46 @@ class Dlg extends Protected_Handler {
                print "</dlg>";
        }
 
+       function exportData() {
+
+               print "<p style='text-align : center' id='export_status_message'>You need to prepare exported data first by clicking the button below.</p>";
+
+               print "<div align='center'>";
+               print "<button dojoType=\"dijit.form.Button\"
+                       onclick=\"dijit.byId('dataExportDlg').prepare()\">".
+                       __('Prepare data')."</button>";
+
+               print "<button dojoType=\"dijit.form.Button\"
+                       onclick=\"dijit.byId('dataExportDlg').hide()\">".
+                       __('Close this window')."</button>";
+
+               print "</div>";
+
+
+       }
+
        function importOpml() {
                header("Content-Type: text/html"); # required for iframe
 
+               print __("If you have imported labels and/or filters, you might need to reload preferences to see your new data.") . "</p>";
+
                print "<div class=\"prefFeedOPMLHolder\">";
                $owner_uid = $_SESSION["uid"];
 
                db_query($this->link, "BEGIN");
 
-               /* create Imported feeds category just in case */
-
-               $result = db_query($this->link, "SELECT id FROM
-                       ttrss_feed_categories WHERE title = 'Imported feeds' AND
-                       owner_uid = '$owner_uid' LIMIT 1");
+               print "<ul class='nomarks'>";
 
-               if (db_num_rows($result) == 0) {
-                       db_query($this->link, "INSERT INTO ttrss_feed_categories
-                               (title,owner_uid)
-                                       VALUES ('Imported feeds', '$owner_uid')");
-               }
+               $opml = new Opml($this->link, $_REQUEST);
 
-               db_query($this->link, "COMMIT");
-
-               /* Handle OPML import by DOMXML/DOMDocument */
-
-               if (function_exists('domxml_open_file')) {
-                       print "<ul class='nomarks'>";
-                       print "<li>".__("Importing using DOMXML.")."</li>";
-                       require_once "opml_domxml.php";
-                       opml_import_domxml($this->link, $owner_uid);
-                       print "</ul>";
-               } else if (PHP_VERSION >= 5) {
-                       print "<ul class='nomarks'>";
-                       print "<li>".__("Importing using DOMDocument.")."</li>";
-                       require_once "opml_domdoc.php";
-                       opml_import_domdoc($this->link, $owner_uid);
-                       print "</ul>";
-               } else {
-                       print_error(__("DOMXML extension is not found. It is required for PHP versions below 5."));
-               }
+               $opml->opml_import($_SESSION["uid"]);
 
+               print "</ul>";
                print "</div>";
 
                print "<div align='center'>";
                print "<button dojoType=\"dijit.form.Button\"
-                       onclick=\"dijit.byId('opmlImportDlg').hide()\">".
+                       onclick=\"dijit.byId('opmlImportDlg').execute()\">".
                        __('Close this window')."</button>";
                print "</div>";
 
@@ -72,12 +67,25 @@ class Dlg extends Protected_Handler {
        function editPrefProfiles() {
                print "<div dojoType=\"dijit.Toolbar\">";
 
+               print "<div dojoType=\"dijit.form.DropDownButton\">".
+                               "<span>" . __('Select')."</span>";
+               print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
+               print "<div onclick=\"selectTableRows('prefFeedProfileList', 'all')\"
+                       dojoType=\"dijit.MenuItem\">".__('All')."</div>";
+               print "<div onclick=\"selectTableRows('prefFeedProfileList', 'none')\"
+                       dojoType=\"dijit.MenuItem\">".__('None')."</div>";
+               print "</div></div>";
+
+               print "<div style=\"float : right\">";
+
                print "<input name=\"newprofile\" dojoType=\"dijit.form.ValidationTextBox\"
                                required=\"1\">
                        <button dojoType=\"dijit.form.Button\"
                        onclick=\"dijit.byId('profileEditDlg').addProfile()\">".
                                __('Create profile')."</button></div>";
 
+               print "</div>";
+
                $result = db_query($this->link, "SELECT title,id FROM ttrss_settings_profiles
                        WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
 
@@ -88,9 +96,10 @@ class Dlg extends Protected_Handler {
                print "<table width=\"100%\" class=\"prefFeedProfileList\"
                        cellspacing=\"0\" id=\"prefFeedProfileList\">";
 
-               print "<tr class=\"\" id=\"FCATR-0\">"; #odd
+               print "<tr class=\"placeholder\" id=\"FCATR-0\">"; #odd
 
                print "<td width='5%' align='center'><input
+                       id='FCATC-0'
                        onclick='toggleSelectRow2(this);'
                        dojoType=\"dijit.form.CheckBox\"
                        type=\"checkbox\"></td>";
@@ -115,12 +124,13 @@ class Dlg extends Protected_Handler {
                        $profile_id = $line["id"];
                        $this_row_id = "id=\"FCATR-$profile_id\"";
 
-                       print "<tr class=\"\" $this_row_id>";
+                       print "<tr class=\"placeholder\" $this_row_id>";
 
                        $edit_title = htmlspecialchars($line["title"]);
 
                        print "<td width='5%' align='center'><input
                                onclick='toggleSelectRow2(this);'
+                               id='FCATC-$profile_id'
                                dojoType=\"dijit.form.CheckBox\"
                                type=\"checkbox\"></td>";
 
@@ -240,6 +250,11 @@ class Dlg extends Protected_Handler {
                print "<div class=\"dlgSec\">".__("Feed")."</div>";
                print "<div class=\"dlgSecCont\">";
 
+               print "<div style='float : right'>
+                       <img style='display : none'
+                               id='feed_add_spinner' src='".
+                               theme_image($this->link, 'images/indicator_white.gif')."'></div>";
+
                print "<input style=\"font-size : 16px; width : 20em;\"
                        placeHolder=\"".__("Feed URL")."\"
                        dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"feed\" id=\"feedDlg_feedUrl\">";
@@ -276,12 +291,13 @@ class Dlg extends Protected_Handler {
                                " <input
                                        placeHolder=\"".__("Password")."\"
                                        dojoType=\"dijit.form.TextBox\" type='password'
-                                       style=\"width : 10em;\" name='pass'\">
+                                       style=\"width : 10em;\" name='pass'\">".
+                               " <p class='insensitive'>".__("OAuth will be used automatically for Twitter feeds.")."</p>
                        </div></div>";
 
 
                print "<div style=\"clear : both\">
-                       <input type=\"checkbox\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
+                       <input type=\"checkbox\" name=\"need_auth\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
                                        onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'>
                                <label for=\"feedDlg_loginCheck\">".
                                __('This feed requires authentication.')."</div>";
@@ -289,15 +305,21 @@ class Dlg extends Protected_Handler {
                print "</form>";
 
                print "<div class=\"dlgButtons\">
-                       <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button>
-                       <button dojoType=\"dijit.form.Button\" onclick=\"return feedBrowser()\">".__('More feeds')."</button>
-                       <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button>
+                       <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button>";
+
+               if (!(defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER)) {
+                       print "<button dojoType=\"dijit.form.Button\" onclick=\"return feedBrowser()\">".__('More feeds')."</button>";
+               }
+
+               print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button>
                        </div>";
 
                //return;
        }
 
        function feedBrowser() {
+               if (defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER) return;
+
                $browser_search = db_escape_string($_REQUEST["search"]);
 
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
@@ -422,246 +444,6 @@ class Dlg extends Protected_Handler {
                </div>";
        }
 
-       function quickAddFilter() {
-               $active_feed_id = db_escape_string($_REQUEST["param"]);
-
-               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=\"method\" value=\"add\">";
-
-               $result = db_query($this->link, "SELECT id,description
-                       FROM ttrss_filter_types ORDER BY description");
-
-               $filter_types = array();
-
-               while ($line = db_fetch_assoc($result)) {
-                       //array_push($filter_types, $line["description"]);
-                       $filter_types[$line["id"]] = __($line["description"]);
-               }
-
-               print "<div class=\"dlgSec\">".__("Match")."</div>";
-
-               print "<div class=\"dlgSecCont\">";
-
-               print "<span id=\"filterDlg_dateModBox\" style=\"display : none\">";
-
-               $filter_params = array(
-                       "before" => __("before"),
-                       "after" => __("after"));
-
-               print_select_hash("filter_date_modifier", "before",
-                       $filter_params, 'dojoType="dijit.form.Select"');
-
-               print "&nbsp;</span>";
-
-               print "<input dojoType=\"dijit.form.ValidationTextBox\"
-                        required=\"true\" id=\"filterDlg_regExp\"
-                        style=\"font-size : 16px\"
-                        name=\"reg_exp\" value=\"$reg_exp\"/>";
-
-               print "<span id=\"filterDlg_dateChkBox\" style=\"display : none\">";
-               print "&nbsp;<button dojoType=\"dijit.form.Button\"
-                       onclick=\"return filterDlgCheckDate()\">".
-                       __('Check it')."</button>";
-               print "</span>";
-
-               print "<hr/>" .  __("on field") . " ";
-               print_select_hash("filter_type", 1, $filter_types,
-                       'onchange="filterDlgCheckType(this)" dojoType="dijit.form.Select"');
-
-               print "<hr/>";
-
-               print __("in") . " ";
-               print_feed_select($this->link, "feed_id", $active_feed_id,
-                       'dojoType="dijit.form.FilteringSelect"');
-
-               print "</div>";
-
-               print "<div class=\"dlgSec\">".__("Perform Action")."</div>";
-
-               print "<div class=\"dlgSecCont\">";
-
-               print "<select name=\"action_id\" dojoType=\"dijit.form.Select\"
-                       onchange=\"filterDlgCheckAction(this)\">";
-
-               $result = db_query($this->link, "SELECT id,description FROM ttrss_filter_actions
-                       ORDER BY name");
-
-               while ($line = db_fetch_assoc($result)) {
-                       printf("<option value='%d'>%s</option>", $line["id"], __($line["description"]));
-               }
-
-               print "</select>";
-
-               print "<span id=\"filterDlg_paramBox\" style=\"display : none\">";
-               print " " . __("with parameters:") . " ";
-               print "<input dojoType=\"dijit.form.TextBox\"
-                       id=\"filterDlg_actionParam\"
-                       name=\"action_param\">";
-
-               print_label_select($this->link, "action_param_label", $action_param,
-                'id="filterDlg_actionParamLabel" dojoType="dijit.form.Select"');
-
-               print "</span>";
-
-               print "&nbsp;"; // tiny layout hack
-
-               print "</div>";
-
-               print "<div class=\"dlgSec\">".__("Options")."</div>";
-               print "<div class=\"dlgSecCont\">";
-
-               print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\">
-                               <label for=\"enabled\">".__('Enabled')."</label><hr/>";
-
-               print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\">
-                       <label for=\"inverse\">".__('Inverse match')."</label>";
-
-               print "</div>";
-
-               print "<div class=\"dlgButtons\">";
-
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').test()\">".
-                       __('Test')."</button> ";
-
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').execute()\">".
-                       __('Create')."</button> ";
-
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').hide()\">".
-                       __('Cancel')."</button>";
-
-               print "</div>";
-       }
-
-       function inactiveFeeds() {
-
-               if (DB_TYPE == "pgsql") {
-                       $interval_qpart = "NOW() - INTERVAL '3 months'";
-               } else {
-                       $interval_qpart = "DATE_SUB(NOW(), INTERVAL 3 MONTH)";
-               }
-
-               $result = db_query($this->link, "SELECT ttrss_feeds.title, ttrss_feeds.site_url,
-                               ttrss_feeds.feed_url, ttrss_feeds.id, MAX(updated) AS last_article
-                       FROM ttrss_feeds, ttrss_entries, ttrss_user_entries WHERE
-                               (SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE
-                                       ttrss_entries.id = ref_id AND
-                                               ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart
-                       AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]." AND
-                               ttrss_user_entries.feed_id = ttrss_feeds.id AND
-                               ttrss_entries.id = ref_id
-                       GROUP BY ttrss_feeds.title, ttrss_feeds.id, ttrss_feeds.site_url, ttrss_feeds.feed_url
-                       ORDER BY last_article");
-
-               print __("These feeds have not been updated with new content for 3 months (oldest first):");
-
-               print "<div class=\"inactiveFeedHolder\">";
-
-               print "<table width=\"100%\" cellspacing=\"0\" id=\"prefInactiveFeedList\">";
-
-               $lnum = 1;
-
-               while ($line = db_fetch_assoc($result)) {
-
-                       $class = ($lnum % 2) ? "even" : "odd";
-                       $feed_id = $line["id"];
-                       $this_row_id = "id=\"FUPDD-$feed_id\"";
-
-                       print "<tr class=\"\" $this_row_id>";
-
-                       $edit_title = htmlspecialchars($line["title"]);
-
-                       print "<td width='5%' align='center'><input
-                               onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\"
-                               type=\"checkbox\"></td>";
-                       print "<td>";
-
-                       print "<a class=\"visibleLink\" href=\"#\" ".
-                               "title=\"".__("Click to edit feed")."\" ".
-                               "onclick=\"editFeed(".$line["id"].")\">".
-                               htmlspecialchars($line["title"])."</a>";
-
-                       print "</td><td class=\"insensitive\" align='right'>";
-                       print make_local_datetime($this->link, $line['last_article'], false);
-                       print "</td>";
-                       print "</tr>";
-
-                       ++$lnum;
-               }
-
-               print "</table>";
-               print "</div>";
-
-               print "<div class='dlgButtons'>";
-               print "<div style='float : left'>";
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('inactiveFeedsDlg').removeSelected()\">"
-                       .__('Unsubscribe from selected feeds')."</button> ";
-               print "</div>";
-
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('inactiveFeedsDlg').hide()\">".
-                       __('Close this window')."</button>";
-
-               print "</div>";
-
-       }
-
-       function feedsWithErrors() {
-               print __("These feeds have not been updated because of errors:");
-
-               $result = db_query($this->link, "SELECT id,title,feed_url,last_error,site_url
-               FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
-
-               print "<div class=\"inactiveFeedHolder\">";
-
-               print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">";
-
-               $lnum = 1;
-
-               while ($line = db_fetch_assoc($result)) {
-
-                       $class = ($lnum % 2) ? "even" : "odd";
-                       $feed_id = $line["id"];
-                       $this_row_id = "id=\"FUPDD-$feed_id\"";
-
-                       print "<tr class=\"\" $this_row_id>";
-
-                       $edit_title = htmlspecialchars($line["title"]);
-
-                       print "<td width='5%' align='center'><input
-                               onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\"
-                               type=\"checkbox\"></td>";
-                       print "<td>";
-
-                       print "<a class=\"visibleLink\" href=\"#\" ".
-                               "title=\"".__("Click to edit feed")."\" ".
-                               "onclick=\"editFeed(".$line["id"].")\">".
-                               htmlspecialchars($line["title"])."</a>: ";
-
-                       print "<span class=\"insensitive\">";
-                       print htmlspecialchars($line["last_error"]);
-                       print "</span>";
-
-                       print "</td>";
-                       print "</tr>";
-
-                       ++$lnum;
-               }
-
-               print "</table>";
-               print "</div>";
-
-               print "<div class='dlgButtons'>";
-               print "<div style='float : left'>";
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').removeSelected()\">"
-                       .__('Unsubscribe from selected feeds')."</button> ";
-               print "</div>";
-
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').hide()\">".
-                       __('Close this window')."</button>";
-
-               print "</div>";
-       }
-
        function editArticleTags() {
 
                print __("Tags for this article (separated by commas):")."<br>";
@@ -795,110 +577,6 @@ class Dlg extends Protected_Handler {
                print "]]></content>";
        }
 
-       function emailArticle() {
-
-               $secretkey = sha1(uniqid(rand(), true));
-
-               $_SESSION['email_secretkey'] = $secretkey;
-
-               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=\"method\" value=\"sendEmail\">";
-
-               $result = db_query($this->link, "SELECT email, full_name FROM ttrss_users WHERE
-                       id = " . $_SESSION["uid"]);
-
-               $user_email = htmlspecialchars(db_fetch_result($result, 0, "email"));
-               $user_name = htmlspecialchars(db_fetch_result($result, 0, "full_name"));
-
-               if (!$user_name) $user_name = $_SESSION['name'];
-
-               $_SESSION['email_replyto'] = $user_email;
-               $_SESSION['email_fromname'] = $user_name;
-
-               require_once "lib/MiniTemplator.class.php";
-
-               $tpl = new MiniTemplator;
-               $tpl_t = new MiniTemplator;
-
-               $tpl->readTemplateFromFile("templates/email_article_template.txt");
-
-               $tpl->setVariable('USER_NAME', $_SESSION["name"]);
-               $tpl->setVariable('USER_EMAIL', $user_email);
-               $tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"]);
-
-
-               $result = db_query($this->link, "SELECT link, content, title
-                       FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND
-                       id IN ($this->param) AND owner_uid = " . $_SESSION["uid"]);
-
-               if (db_num_rows($result) > 1) {
-                       $subject = __("[Forwarded]") . " " . __("Multiple articles");
-               }
-
-               while ($line = db_fetch_assoc($result)) {
-
-                       if (!$subject)
-                               $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]);
-
-                       $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"]));
-                       $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"]));
-
-                       $tpl->addBlock('article');
-               }
-
-               $tpl->addBlock('email');
-
-               $content = "";
-               $tpl->generateOutputToString($content);
-
-               print "<table width='100%'><tr><td>";
-
-               print __('From:');
-
-               print "</td><td>";
-
-               print "<input dojoType=\"dijit.form.TextBox\" disabled=\"1\" style=\"width : 30em;\"
-                               value=\"$user_name <$user_email>\">";
-
-               print "</td></tr><tr><td>";
-
-               print __('To:');
-
-               print "</td><td>";
-
-               print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"true\"
-                               style=\"width : 30em;\"
-                               name=\"destination\" id=\"emailArticleDlg_destination\">";
-
-               print "<div class=\"autocomplete\" id=\"emailArticleDlg_dst_choices\"
-                               style=\"z-index: 30; display : none\"></div>";
-
-               print "</td></tr><tr><td>";
-
-               print __('Subject:');
-
-               print "</td><td>";
-
-               print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"true\"
-                               style=\"width : 30em;\"
-                               name=\"subject\" value=\"$subject\" id=\"subject\">";
-
-               print "</td></tr>";
-
-               print "<tr><td colspan='2'><textarea dojoType=\"dijit.form.SimpleTextarea\" style='font-size : 12px; width : 100%' rows=\"20\"
-                       name='content'>$content</textarea>";
-
-               print "</td></tr></table>";
-
-               print "<div class='dlgButtons'>";
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').execute()\">".__('Send e-mail')."</button> ";
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').hide()\">".__('Cancel')."</button>";
-               print "</div>";
-
-               //return;
-       }
-
        function generatedFeed() {
 
                print "<title>".__('View as RSS')."</title>";
@@ -912,7 +590,7 @@ class Dlg extends Protected_Handler {
 
                $url_path = htmlspecialchars($this->params[2]) . "&key=" . $key;
 
-               print __("You can view this feed as RSS using the following URL:");
+               print "<div class=\"dialogNotice\">" .  __("You can view this feed as RSS using the following URL:") . "</div>";
 
                print "<div class=\"tagCloudContainer\">";
                print "<a id='gen_feed_url' href='$url_path' target='_blank'>$url_path</a>";
@@ -948,6 +626,8 @@ class Dlg extends Protected_Handler {
                $details = "http://tt-rss.org/redmine/versions/show/$id";
                $download = "http://tt-rss.org/#Download";
 
+               print "<p align='center'>".__("You can update using built-in updater in the Preferences or by using update.php")."</p>";
+
                print "<div style='text-align : center'>";
                print "<button dojoType=\"dijit.form.Button\"
                        onclick=\"return window.open('$details')\">".__("Details")."</button>";
@@ -965,7 +645,9 @@ class Dlg extends Protected_Handler {
 
                $value = str_replace("<br/>", "\n", $value);
 
+               print "<div class=\"dialogNotice\">";
                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 "</div>";
 
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setpref\">";
@@ -987,63 +669,6 @@ class Dlg extends Protected_Handler {
 
        }
 
-       function editArticleNote() {
-               $result = db_query($this->link, "SELECT note FROM ttrss_user_entries WHERE
-                       ref_id = '$this->param' AND owner_uid = " . $_SESSION['uid']);
-
-               $note = db_fetch_result($result, 0, "note");
-
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$this->param\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-               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\"
-                       style='font-size : 12px; width : 100%; height: 100px;'
-                       placeHolder='body#ttrssMain { font-size : 14px; };'
-                       name='note'>$note</textarea>";
-               print "</td></tr></table>";
-
-               print "<div class='dlgButtons'>";
-               print "<button dojoType=\"dijit.form.Button\"
-                       onclick=\"dijit.byId('editNoteDlg').execute()\">".__('Save')."</button> ";
-               print "<button dojoType=\"dijit.form.Button\"
-                       onclick=\"dijit.byId('editNoteDlg').hide()\">".__('Cancel')."</button>";
-               print "</div>";
-
-       }
-
-       function 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>";
-       }
-
        function 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\">";
@@ -1094,44 +719,75 @@ class Dlg extends Protected_Handler {
                return;
        }
 
-       function shareArticle() {
-               $result = db_query($this->link, "SELECT uuid, ref_id FROM ttrss_user_entries WHERE int_id = '$this->param'
-                       AND owner_uid = " . $_SESSION['uid']);
+       function dataImport() {
+               header("Content-Type: text/html"); # required for iframe
+
+               print "<div style='text-align : center'>";
 
-               if (db_num_rows($result) == 0) {
-                       print "Article not found.";
-               } else {
+               if (is_file($_FILES['export_file']['tmp_name'])) {
 
-                       $uuid = db_fetch_result($result, 0, "uuid");
-                       $ref_id = db_fetch_result($result, 0, "ref_id");
+                       perform_data_import($this->link, $_FILES['export_file']['tmp_name'], $_SESSION['uid']);
 
-                       if (!$uuid) {
-                               $uuid = db_escape_string(sha1(uniqid(rand(), true)));
-                               db_query($this->link, "UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$this->param'
-                                       AND owner_uid = " . $_SESSION['uid']);
-                       }
+               } else {
+                       print "<p>" . T_sprintf("Could not upload file. You might need to adjust upload_max_filesize
+                               in PHP.ini (current value = %s)", ini_get("upload_max_filesize")) . " or use CLI import tool.</p>";
 
-                       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 "<button dojoType=\"dijit.form.Button\"
+                       onclick=\"dijit.byId('dataImportDlg').hide()\">".
+                       __('Close this window')."</button>";
 
-                       print "<div class=\"tagCloudContainer\">";
-                       print "<a id='pub_opml_url' href='$url_path' target='_blank'>$url_path</a>";
-                       print "</div>";
+               print "</div>";
 
-                       /* if (!label_find_id($this->link, __('Shared'), $_SESSION["uid"]))
-                               label_create($this->link, __('Shared'), $_SESSION["uid"]);
+       }
+
+       function batchSubscribe() {
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"batchaddfeeds\">";
 
-                       label_add_article($this->link, $ref_id, __('Shared'), $_SESSION['uid']); */
+               print "<table width='100%'><tr><td>
+                       ".__("Add one valid RSS feed per line (no feed detection is done)")."
+               </td><td align='right'>";
+               if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
+                       print __('Place in category:') . " ";
+                       print_feed_cat_select($this->link, "cat", false, 'dojoType="dijit.form.Select"');
                }
+               print "</td></tr><tr><td colspan='2'>";
+               print "<textarea
+                       style='font-size : 12px; width : 100%; height: 200px;'
+                       placeHolder=\"".__("Feeds to subscribe, One per line")."\"
+                       dojoType=\"dijit.form.SimpleTextarea\" required=\"1\" name=\"feeds\"></textarea>";
 
-               print "<div align='center'>";
+               print "</td></tr><tr><td colspan='2'>";
 
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('shareArticleDlg').hide()\">".
-                       __('Close this window')."</button>";
+               print "<div id='feedDlg_loginContainer' style='display : none'>
+                               " .
+                               " <input dojoType=\"dijit.form.TextBox\" name='login'\"
+                                       placeHolder=\"".__("Login")."\"
+                                       style=\"width : 10em;\"> ".
+                               " <input
+                                       placeHolder=\"".__("Password")."\"
+                                       dojoType=\"dijit.form.TextBox\" type='password'
+                                       style=\"width : 10em;\" name='pass'\">".
+                               "</div>";
 
-               print "</div>";
+               print "</td></tr><tr><td colspan='2'>";
+
+               print "<div style=\"clear : both\">
+                       <input type=\"checkbox\" name=\"need_auth\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
+                                       onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'>
+                               <label for=\"feedDlg_loginCheck\">".
+                               __('Feeds require authentication.')."</div>";
+
+               print "</form>";
+
+               print "</td></tr></table>";
+
+               print "<div class=\"dlgButtons\">
+                       <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('batchSubDlg').execute()\">".__('Subscribe')."</button>
+                       <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('batchSubDlg').hide()\">".__('Cancel')."</button>
+                       </div>";
        }
 
 }