move batchSubscribe to pref-feeds

This commit is contained in:
Andrew Dolgov 2013-04-01 12:36:57 +04:00
parent 9d76e75451
commit 201bb1ca54
3 changed files with 52 additions and 50 deletions

View File

@ -268,53 +268,5 @@ class Dlg extends Handler_Protected {
} }
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'\">".
"</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>";
}
} }
?> ?>

View File

@ -3,7 +3,8 @@ class Pref_Feeds extends Handler_Protected {
function csrf_ignore($method) { function csrf_ignore($method) {
$csrf_ignored = array("index", "getfeedtree", "add", "editcats", "editfeed", $csrf_ignored = array("index", "getfeedtree", "add", "editcats", "editfeed",
"savefeedorder", "uploadicon", "feedswitherrors", "inactivefeeds"); "savefeedorder", "uploadicon", "feedswitherrors", "inactivefeeds",
"batchsubscribe");
return array_search($method, $csrf_ignored) !== false; return array_search($method, $csrf_ignored) !== false;
} }
@ -1749,5 +1750,54 @@ class Pref_Feeds extends Handler_Protected {
} }
} }
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'\">".
"</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>";
}
} }
?> ?>

View File

@ -1759,7 +1759,7 @@ function gotoExportOpml(filename, settings) {
function batchSubscribe() { function batchSubscribe() {
try { try {
var query = "backend.php?op=dlg&method=batchSubscribe"; var query = "backend.php?op=pref-feeds&method=batchSubscribe";
// overlapping widgets // overlapping widgets
if (dijit.byId("batchSubDlg")) dijit.byId("batchSubDlg").destroyRecursive(); if (dijit.byId("batchSubDlg")) dijit.byId("batchSubDlg").destroyRecursive();