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"];
/* 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."));
- }
-
+ print "<ul class='nomarks'>";
+ require_once "opml.php";
+ opml_import_domdoc($this->link, $owner_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>";
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");
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>";
$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>";
" <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>";
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\">";
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"csrf_token\" value=\"".$_SESSION['csrf_token']."\">";
$result = db_query($this->link, "SELECT id,description
FROM ttrss_filter_types ORDER BY description");
print "<hr/>";
print __("in") . " ";
+
+ print "<span id='filterDlg_feeds'>";
print_feed_select($this->link, "feed_id", $active_feed_id,
'dojoType="dijit.form.FilteringSelect"');
+ print "</span>";
+
+ print "<span id='filterDlg_cats' style='display : none'>";
+ print_feed_cat_select($this->link, "cat_id", $active_cat_id,
+ 'dojoType="dijit.form.FilteringSelect"');
+ print "</span>";
print "</div>";
<label for=\"enabled\">".__('Enabled')."</label><hr/>";
print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\">
- <label for=\"inverse\">".__('Inverse match')."</label>";
+ <label for=\"inverse\">".__('Inverse match')."</label><hr/>";
+
+ print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"cat_filter\" id=\"cat_filter\" onchange=\"filterDlgCheckCat(this)\">
+ <label for=\"cat_filter\">".__('Apply to category')."</label><hr/>";
+
print "</div>";
print __("These feeds have not been updated with new content for 3 months (oldest first):");
+ 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('prefInactiveFeedList', 'all')\"
+ dojoType=\"dijit.MenuItem\">".__('All')."</div>";
+ print "<div onclick=\"selectTableRows('prefInactiveFeedList', 'none')\"
+ dojoType=\"dijit.MenuItem\">".__('None')."</div>";
+ print "</div></div>";
+ print "</div>"; #toolbar
+
print "<div class=\"inactiveFeedHolder\">";
print "<table width=\"100%\" cellspacing=\"0\" id=\"prefInactiveFeedList\">";
$feed_id = $line["id"];
$this_row_id = "id=\"FUPDD-$feed_id\"";
- print "<tr class=\"\" $this_row_id>";
+ # class needed for selectTableRows()
+ print "<tr class=\"placeholder\" $this_row_id>";
$edit_title = htmlspecialchars($line["title"]);
+ # id needed for selectTableRows()
print "<td width='5%' align='center'><input
onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\"
- type=\"checkbox\"></td>";
+ type=\"checkbox\" id=\"FUPDC-$feed_id\"></td>";
print "<td>";
print "<a class=\"visibleLink\" href=\"#\" ".
$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 dojoType=\"dijit.Toolbar\">";
+ print "<div dojoType=\"dijit.form.DropDownButton\">".
+ "<span>" . __('Select')."</span>";
+ print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
+ print "<div onclick=\"selectTableRows('prefErrorFeedList', 'all')\"
+ dojoType=\"dijit.MenuItem\">".__('All')."</div>";
+ print "<div onclick=\"selectTableRows('prefErrorFeedList', 'none')\"
+ dojoType=\"dijit.MenuItem\">".__('None')."</div>";
+ print "</div></div>";
+ print "</div>"; #toolbar
+
print "<div class=\"inactiveFeedHolder\">";
print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">";
$feed_id = $line["id"];
$this_row_id = "id=\"FUPDD-$feed_id\"";
- print "<tr class=\"\" $this_row_id>";
+ # class needed for selectTableRows()
+ print "<tr class=\"placeholder\" $this_row_id>";
$edit_title = htmlspecialchars($line["title"]);
+ # id needed for selectTableRows()
print "<td width='5%' align='center'><input
onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\"
- type=\"checkbox\"></td>";
+ type=\"checkbox\" id=\"FUPDC-$feed_id\"></td>";
print "<td>";
print "<a class=\"visibleLink\" href=\"#\" ".
return;
}
+ function dataImport() {
+ header("Content-Type: text/html"); # required for iframe
+
+ print "<div style='text-align : center'>";
+
+ if (is_file($_FILES['export_file']['tmp_name'])) {
+
+ perform_data_import($this->link, $_FILES['export_file']['tmp_name'], $_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 "<button dojoType=\"dijit.form.Button\"
+ onclick=\"dijit.byId('dataImportDlg').hide()\">".
+ __('Close this window')."</button>";
+
+ print "</div>";
+
+ }
+
+ 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\">";
+
+ 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 "</td></tr><tr><td colspan='2'>";
+
+ 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'\">".
+ " <p class='insensitive'>".__("OAuth will be used automatically for Twitter feeds.")."</p>
+ </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>";
+ }
+
}
?>