mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-01-08 11:09:15 +00:00
use Modalbox library for popup dialogs
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
$id = $_REQUEST["id"];
|
||||
$param = db_escape_string($_REQUEST["param"]);
|
||||
|
||||
print "<dlg id=\"$id\">";
|
||||
|
||||
if ($id == "importOpml") {
|
||||
print "<div id=\"infoBoxTitle\">".__('OPML Import')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('OPML Import')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<div class=\"prefFeedCatHolder\">";
|
||||
|
||||
@@ -58,15 +60,16 @@
|
||||
print "parent.opmlImportHandler(this)";
|
||||
print "</script>";
|
||||
|
||||
print "</div></div>";
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "editPrefProfiles") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Settings Profiles')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Settings Profiles')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<div><input id=\"fadd_profile\"
|
||||
onkeypress=\"return filterCR(event, addPrefProfile)\"
|
||||
@@ -153,15 +156,16 @@
|
||||
print "<button onclick=\"return closeInfoBox()\">".
|
||||
__('Close this window')."</button>";
|
||||
|
||||
print "</div></div>";
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "pubOPMLUrl") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Public OPML URL')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Public OPML URL')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
$url_path = opml_publish_url($link);
|
||||
|
||||
@@ -179,15 +183,16 @@
|
||||
print "<button onclick=\"return closeInfoBox()\">".
|
||||
__('Close this window')."</button>";
|
||||
|
||||
print "</div></div>";
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "explainError") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Notice')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Notice')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<div class=\"errorExplained\">";
|
||||
|
||||
@@ -227,15 +232,16 @@
|
||||
print "<button onclick=\"return closeInfoBox()\"".
|
||||
__('Close this window')."</button>";
|
||||
|
||||
print "</div></div>";
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "quickAddFeed") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Subscribe to Feed')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Subscribe to Feed')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<form id='feed_add_form' onsubmit='return false'>";
|
||||
|
||||
@@ -295,15 +301,17 @@
|
||||
onclick=\"return subscribeToFeed()\">".__('Subscribe')."</button>
|
||||
<button onclick=\"return displayDlg('feedBrowser')\">".__('More feeds')."</button>
|
||||
<button onclick=\"return closeInfoBox()\">".__('Cancel')."</button></div>";
|
||||
|
||||
return;
|
||||
|
||||
print "]]></content>";
|
||||
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "feedBrowser") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Feed Browser')."</div>";
|
||||
print "<title>".__('Feed Browser')."</title>";
|
||||
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
$browser_search = db_escape_string($_REQUEST["search"]);
|
||||
|
||||
@@ -352,14 +360,14 @@
|
||||
<button style='display : none' id='feed_archive_remove' onclick=\"feedArchiveRemove()\">".__('Remove')."</button>
|
||||
<button onclick=\"closeInfoBox()\" >".__('Cancel')."</button></div>";
|
||||
|
||||
print "</div>";
|
||||
return;
|
||||
print "]]></content>";
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "search") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Search')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Search')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<form id='search_form' onsubmit='return false'>";
|
||||
|
||||
@@ -433,9 +441,9 @@
|
||||
<button onclick=\"javascript:closeInfoBox(true)\">".__('Cancel')."</button>
|
||||
</div>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
|
||||
}
|
||||
|
||||
@@ -443,8 +451,8 @@
|
||||
|
||||
$active_feed_id = db_escape_string($_REQUEST["param"]);
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Create Filter')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Create Filter')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<form id=\"filter_add_form\" onsubmit='return false'>";
|
||||
|
||||
@@ -550,17 +558,17 @@
|
||||
print "<button onclick=\"return closeInfoBox()\">".__('Cancel').
|
||||
"</button>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
// print "</td></tr></table>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "feedUpdateErrors") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Update Errors')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Update Errors')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print __("These feeds have not been updated because of errors:");
|
||||
|
||||
@@ -581,15 +589,15 @@
|
||||
print "<button onclick=\"return closeInfoBox()\">".
|
||||
__('Close this window')."</button>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "editArticleTags") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Edit Tags')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Edit Tags')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<form id=\"tag_edit_form\" onsubmit='return false'>";
|
||||
|
||||
@@ -618,14 +626,14 @@
|
||||
print "<button onclick=\"return editTagsSave()\">".__('Save')."</button> ";
|
||||
print "<button onclick=\"return closeInfoBox()\">".__('Cancel')."</button>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "printTagCloud") {
|
||||
print "<div id=\"infoBoxTitle\">".__('Tag Cloud')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Tag Cloud')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print __("Showing most popular tags ")." (<a
|
||||
href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>";
|
||||
@@ -641,15 +649,15 @@
|
||||
__('Close this window')."</button>";
|
||||
print "</div>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "emailArticle") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Forward article by email')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('Forward article by email')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<form id=\"article_email_form\" onsubmit='return false'>";
|
||||
|
||||
@@ -754,15 +762,15 @@
|
||||
print "<button onclick=\"return emailArticleDo()\">".__('Send e-mail')."</button> ";
|
||||
print "<button onclick=\"return closeInfoBox()\">".__('Cancel')."</button>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
if ($id == "generatedFeed") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('View as RSS')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<title>".__('View as RSS')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
$params = explode(":", $param, 3);
|
||||
$feed_id = db_escape_string($params[0]);
|
||||
@@ -786,15 +794,12 @@
|
||||
print "<button onclick=\"return closeInfoBox()\">".
|
||||
__('Close this window')."</button>";
|
||||
|
||||
print "</div></div>";
|
||||
print "</div>";
|
||||
print "]]></content>";
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
print "<div id='infoBoxTitle'>Internal Error</div>
|
||||
<div id='infoBoxContents'>
|
||||
<p>Unknown dialog <b>$id</b></p>
|
||||
</div></div>";
|
||||
|
||||
print "</dlg>";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -58,114 +58,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
/* if ($subop == "massSubscribe") {
|
||||
$ids = split(",", db_escape_string($_REQUEST["ids"]));
|
||||
|
||||
$subscribed = array();
|
||||
|
||||
foreach ($ids as $id) {
|
||||
|
||||
if ($mode == 1) {
|
||||
$result = db_query($link, "SELECT feed_url,title FROM ttrss_feeds
|
||||
WHERE id = '$id'");
|
||||
} else if ($mode == 2) {
|
||||
$result = db_query($link, "SELECT * FROM ttrss_archived_feeds
|
||||
WHERE id = '$id' AND owner_uid = " . $_SESSION["uid"]);
|
||||
$orig_id = db_escape_string(db_fetch_result($result, 0, "id"));
|
||||
$site_url = db_escape_string(db_fetch_result($result, 0, "site_url"));
|
||||
}
|
||||
|
||||
$feed_url = db_escape_string(db_fetch_result($result, 0, "feed_url"));
|
||||
$title = db_escape_string(db_fetch_result($result, 0, "title"));
|
||||
|
||||
$title_orig = db_fetch_result($result, 0, "title");
|
||||
|
||||
$result = db_query($link, "SELECT id FROM ttrss_feeds WHERE
|
||||
feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]);
|
||||
|
||||
if (db_num_rows($result) == 0) {
|
||||
if ($mode == 1) {
|
||||
$result = db_query($link,
|
||||
"INSERT INTO ttrss_feeds (owner_uid,feed_url,title,cat_id)
|
||||
VALUES ('".$_SESSION["uid"]."', '$feed_url', '$title', NULL)");
|
||||
} else if ($mode == 2) {
|
||||
$result = db_query($link,
|
||||
"INSERT INTO ttrss_feeds (id,owner_uid,feed_url,title,cat_id,site_url)
|
||||
VALUES ('$orig_id','".$_SESSION["uid"]."', '$feed_url', '$title', NULL, '$site_url')");
|
||||
}
|
||||
array_push($subscribed, $title_orig);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($subscribed) > 0) {
|
||||
$msg = "<b>".__('Subscribed to feeds:')."</b>".
|
||||
"<ul class=\"nomarks\">";
|
||||
|
||||
foreach ($subscribed as $title) {
|
||||
$msg .= "<li>$title</li>";
|
||||
}
|
||||
$msg .= "</ul>";
|
||||
|
||||
print format_notice($msg);
|
||||
}
|
||||
|
||||
return;
|
||||
} */
|
||||
|
||||
/* if ($subop == "browse") {
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Feed Browser')."</div>";
|
||||
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
|
||||
$browser_search = db_escape_string($_REQUEST["search"]);
|
||||
|
||||
//print "<p>".__("Showing top 25 registered feeds, sorted by popularity:")."</p>";
|
||||
|
||||
print "<form onsubmit='return false;' display='inline' name='feed_browser' id='feed_browser'>";
|
||||
|
||||
print "
|
||||
<div style='float : right'>
|
||||
<img style='display : none'
|
||||
id='feed_browser_spinner' src='images/indicator_white.gif'>
|
||||
<input name=\"search\" size=\"20\" type=\"search\"
|
||||
onchange=\"javascript:updateFeedBrowser()\" value=\"$browser_search\">
|
||||
<button onclick=\"javascript:updateFeedBrowser()\">".__('Search')."</button>
|
||||
</div>";
|
||||
|
||||
print " <select name=\"mode\" onchange=\"updateFeedBrowser()\">
|
||||
<option value='1'>" . __('Popular feeds') . "</option>
|
||||
<option value='2'>" . __('Feed archive') . "</option>
|
||||
</select> ";
|
||||
|
||||
print __("limit:");
|
||||
|
||||
print " <select name=\"limit\" onchange='updateFeedBrowser()'>";
|
||||
|
||||
foreach (array(25, 50, 100, 200) as $l) {
|
||||
$issel = ($l == $limit) ? "selected" : "";
|
||||
print "<option $issel>$l</option>";
|
||||
}
|
||||
|
||||
print "</select> ";
|
||||
|
||||
print "<p>";
|
||||
|
||||
$owner_uid = $_SESSION["uid"];
|
||||
|
||||
print "<ul class='browseFeedList' id='browseFeedList'>";
|
||||
print_feed_browser($link, $search, 25);
|
||||
print "</ul>";
|
||||
|
||||
print "<div align='center'>
|
||||
<button onclick=\"feedBrowserSubscribe()\">".__('Subscribe')."</button>
|
||||
<button onclick=\"closeInfoBox()\" >".__('Cancel')."</button></div>";
|
||||
|
||||
print "</div>";
|
||||
return;
|
||||
} */
|
||||
|
||||
if ($subop == "editfeed") {
|
||||
header("Content-Type: text/xml");
|
||||
|
||||
print "<dlg id=\"$subop\">";
|
||||
print "<title>".__('Feed Editor')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
$feed_id = db_escape_string($_REQUEST["id"]);
|
||||
|
||||
$result = db_query($link,
|
||||
@@ -184,10 +83,6 @@
|
||||
$feed_icon = "";
|
||||
}
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Feed Editor')."</div>";
|
||||
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
|
||||
print "<form id=\"edit_feed_form\" onsubmit=\"return false\">";
|
||||
|
||||
print "<input type=\"hidden\" name=\"id\" value=\"$feed_id\">";
|
||||
@@ -402,16 +297,19 @@
|
||||
<button onclick=\"return feedEditCancel()\">".__('Cancel')."</button>
|
||||
</div>";
|
||||
|
||||
print "]]></content></dlg>";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($subop == "editfeeds") {
|
||||
|
||||
$feed_ids = db_escape_string($_REQUEST["ids"]);
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Multiple Feed Editor')."</div>";
|
||||
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
|
||||
header("Content-Type: text/xml");
|
||||
print "<dlg id=\"$subop\">";
|
||||
print "<title>".__('Multiple Feed Editor')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<form id=\"batch_edit_feed_form\" onsubmit=\"return false\">";
|
||||
|
||||
@@ -555,6 +453,8 @@
|
||||
onclick=\"return feedEditCancel()\" value=\"".__('Cancel')."\">
|
||||
</div>";
|
||||
|
||||
print "]]></content></dlg>";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -954,10 +854,10 @@
|
||||
|
||||
}
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Category editor')."</div>";
|
||||
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
|
||||
header("Content-Type: text/xml");
|
||||
print "<dlg id=\"$subop\">";
|
||||
print "<title>".__('Category editor')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
if ($action == "add") {
|
||||
|
||||
@@ -1047,7 +947,7 @@
|
||||
print "<button onclick=\"selectTab('feedConfig')\">".
|
||||
__('Close this window')."</button></div>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content></dlg>";
|
||||
|
||||
return;
|
||||
|
||||
@@ -1189,8 +1089,6 @@
|
||||
|
||||
if (db_num_rows($result) != 0) {
|
||||
|
||||
// print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
|
||||
|
||||
print "<p><table width=\"100%\" cellspacing=\"0\"
|
||||
class=\"prefFeedList\" id=\"prefFeedList\">";
|
||||
print "<tr><td class=\"selectPrompt\" colspan=\"8\">".
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
|
||||
$filter_id = db_escape_string($_REQUEST["id"]);
|
||||
|
||||
header("Content-Type: text/xml");
|
||||
print "<dlg id=\"$subop\">";
|
||||
print "<title>".__('Filter Editor')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
$result = db_query($link,
|
||||
"SELECT * FROM ttrss_filters WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]);
|
||||
|
||||
@@ -20,9 +25,6 @@
|
||||
$enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled"));
|
||||
$inverse = sql_bool_to_bool(db_fetch_result($result, 0, "inverse"));
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('Filter Editor')."</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
|
||||
print "<form id=\"filter_edit_form\" onsubmit='return false'>";
|
||||
|
||||
print "<input type=\"hidden\" name=\"op\" value=\"pref-filters\">";
|
||||
@@ -158,7 +160,7 @@
|
||||
print "<button onclick=\"return filterEditCancel()\">".
|
||||
__('Cancel')."</button>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content></dlg>";
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -278,8 +280,6 @@
|
||||
$sort = "reg_exp";
|
||||
}
|
||||
|
||||
// print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
|
||||
|
||||
$result = db_query($link, "SELECT id,description
|
||||
FROM ttrss_filter_types ORDER BY description");
|
||||
|
||||
|
||||
@@ -12,11 +12,14 @@
|
||||
|
||||
if ($subop == "user-details") {
|
||||
|
||||
header("Content-Type: text/xml");
|
||||
print "<dlg id=\"$subop\">";
|
||||
|
||||
$uid = sprintf("%d", $_REQUEST["id"]);
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('User details')."</div>";
|
||||
print "<title>".__('User details')."</title>";
|
||||
|
||||
print "<div class='infoBoxContents'>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
$result = db_query($link, "SELECT login,
|
||||
".SUBSTRING_FOR_DATE."(last_login,1,16) AS last_login,
|
||||
@@ -96,18 +99,20 @@
|
||||
<button onclick=\"closeInfoBox()\">".__("Close this window").
|
||||
"</button></div>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content></dlg>";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($subop == "edit") {
|
||||
|
||||
header("Content-Type: text/xml");
|
||||
|
||||
$id = db_escape_string($_REQUEST["id"]);
|
||||
|
||||
print "<div id=\"infoBoxTitle\">".__('User Editor')."</div>";
|
||||
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
print "<dlg id=\"$subop\">";
|
||||
print "<title>".__('User Editor')."</title>";
|
||||
print "<content><![CDATA[";
|
||||
|
||||
print "<form id=\"user_edit_form\" onsubmit='return false'>";
|
||||
|
||||
@@ -180,7 +185,7 @@
|
||||
<button onclick=\"return userEditCancel()\">".
|
||||
__('Cancel')."</button></div>";
|
||||
|
||||
print "</div>";
|
||||
print "]]></content></dlg>";
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -410,8 +415,6 @@
|
||||
|
||||
if (db_num_rows($result) > 0) {
|
||||
|
||||
// print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
|
||||
|
||||
print "<p><table width=\"100%\" cellspacing=\"0\"
|
||||
class=\"prefUserList\" id=\"prefUserList\">";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user