From 951906dcecb1d3c7bcf751976a03e0c196ca6db0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 14 Nov 2010 23:46:49 +0300 Subject: use Modalbox library for popup dialogs --- modules/popup-dialog.php | 119 +++++++++++++++++++++------------------- modules/pref-feeds.php | 140 +++++++---------------------------------------- modules/pref-filters.php | 12 ++-- modules/pref-users.php | 21 ++++--- 4 files changed, 99 insertions(+), 193 deletions(-) (limited to 'modules') diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index 8d3c2cee5..c018acbd8 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -3,9 +3,11 @@ $id = $_REQUEST["id"]; $param = db_escape_string($_REQUEST["param"]); + print ""; + if ($id == "importOpml") { - print "
".__('OPML Import')."
"; - print "
"; + print "".__('OPML Import').""; + print ""; @@ -58,15 +60,16 @@ print "parent.opmlImportHandler(this)"; print ""; - print "
"; + print ""; + print "]]>"; - return; + //return; } if ($id == "editPrefProfiles") { - print "
".__('Settings Profiles')."
"; - print "
"; + print "".__('Settings Profiles').""; + print "". __('Close this window').""; - print "
"; + print ""; + print "]]>"; - return; + //return; } if ($id == "pubOPMLUrl") { - print "
".__('Public OPML URL')."
"; - print "
"; + print "".__('Public OPML URL').""; + print "". __('Close this window').""; - print "
"; + print ""; + print "]]>"; - return; + //return; } if ($id == "explainError") { - print "
".__('Notice')."
"; - print "
"; + print "".__('Notice').""; + print ""; @@ -227,15 +232,16 @@ print "
"; + print ""; + print "]]>"; - return; + //return; } if ($id == "quickAddFeed") { - print "
".__('Subscribe to Feed')."
"; - print "
"; + print "".__('Subscribe to Feed').""; + print ""; @@ -295,15 +301,17 @@ onclick=\"return subscribeToFeed()\">".__('Subscribe')."
"; - - return; + + print "]]>"; + + //return; } if ($id == "feedBrowser") { - print "
".__('Feed Browser')."
"; + print "".__('Feed Browser').""; - print "
"; + print "".__('Remove')."
"; - print ""; - return; + print "]]>"; + //return; } if ($id == "search") { - print "
".__('Search')."
"; - print "
"; + print "".__('Search').""; + print ""; @@ -433,9 +441,9 @@
"; - print ""; + print "]]>"; - return; + //return; } @@ -443,8 +451,8 @@ $active_feed_id = db_escape_string($_REQUEST["param"]); - print "
".__('Create Filter')."
"; - print "
"; + print "".__('Create Filter').""; + print ""; @@ -550,17 +558,17 @@ print ""; - print "
"; + print "]]>"; // print ""; - return; + //return; } if ($id == "feedUpdateErrors") { - print "
".__('Update Errors')."
"; - print "
"; + print "".__('Update Errors').""; + print "". __('Close this window').""; - print "
"; + print "]]>"; - return; + //return; } if ($id == "editArticleTags") { - print "
".__('Edit Tags')."
"; - print "
"; + print "".__('Edit Tags').""; + print ""; @@ -618,14 +626,14 @@ print " "; print ""; - print "
"; + print "]]>"; - return; + //return; } if ($id == "printTagCloud") { - print "
".__('Tag Cloud')."
"; - print "
"; + print "".__('Tag Cloud').""; + print "".__('more tags')."):
"; @@ -641,15 +649,15 @@ __('Close this window').""; print "
"; - print ""; + print "]]>"; - return; + //return; } if ($id == "emailArticle") { - print "
".__('Forward article by email')."
"; - print "
"; + print "".__('Forward article by email').""; + print ""; @@ -754,15 +762,15 @@ print " "; print ""; - print "
"; + print "]]>"; - return; + //return; } if ($id == "generatedFeed") { - print "
".__('View as RSS')."
"; - print "
"; + print "".__('View as RSS').""; + print "". __('Close this window').""; - print "
"; + print ""; + print "]]>"; - return; + //return; } - print "
Internal Error
-
-

Unknown dialog $id

-
"; - + print "
"; } ?> diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index b2ca96fbb..38f7b5777 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -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 = "".__('Subscribed to feeds:')."". - ""; - - print format_notice($msg); - } - - return; - } */ - -/* if ($subop == "browse") { - - print "
".__('Feed Browser')."
"; - - print "
"; - - $browser_search = db_escape_string($_REQUEST["search"]); - - //print "

".__("Showing top 25 registered feeds, sorted by popularity:")."

"; - - print "
"; - - print " -
- - - -
"; - - print " "; - - print __("limit:"); - - print " "; - - print "

"; - - $owner_uid = $_SESSION["uid"]; - - print "

    "; - print_feed_browser($link, $search, 25); - print "
"; + if ($subop == "editfeed") { + header("Content-Type: text/xml"); - print "
- -
"; + print ""; + print "".__('Feed Editor').""; + print ""; - return; - } */ - - if ($subop == "editfeed") { $feed_id = db_escape_string($_REQUEST["id"]); $result = db_query($link, @@ -184,10 +83,6 @@ $feed_icon = ""; } - print "
".__('Feed Editor')."
"; - - print "
"; - print ""; print ""; @@ -402,16 +297,19 @@
"; + print "]]>
"; + return; } if ($subop == "editfeeds") { $feed_ids = db_escape_string($_REQUEST["ids"]); - - print "
".__('Multiple Feed Editor')."
"; - - print "
"; + + header("Content-Type: text/xml"); + print ""; + print "".__('Multiple Feed Editor').""; + print ""; @@ -555,6 +453,8 @@ onclick=\"return feedEditCancel()\" value=\"".__('Cancel')."\">
"; + print "]]>"; + return; } @@ -954,10 +854,10 @@ } - print "
".__('Category editor')."
"; - - print "
"; - + header("Content-Type: text/xml"); + print ""; + print "".__('Category editor').""; + print "". __('Close this window')."
"; - print "
"; + print "]]>"; return; @@ -1189,8 +1089,6 @@ if (db_num_rows($result) != 0) { -// print "
PLACEHOLDER
"; - print "

"; print "
". diff --git a/modules/pref-filters.php b/modules/pref-filters.php index d11d0eb7e..b50b0410f 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -7,6 +7,11 @@ $filter_id = db_escape_string($_REQUEST["id"]); + header("Content-Type: text/xml"); + print ""; + print "".__('Filter Editor').""; + print "".__('Filter Editor').""; - print "
"; - print ""; print ""; @@ -158,7 +160,7 @@ print ""; - print "
"; + print "]]>
"; return; } @@ -278,8 +280,6 @@ $sort = "reg_exp"; } -// print "
PLACEHOLDER
"; - $result = db_query($link, "SELECT id,description FROM ttrss_filter_types ORDER BY description"); diff --git a/modules/pref-users.php b/modules/pref-users.php index 754eb7b66..f1f25c665 100644 --- a/modules/pref-users.php +++ b/modules/pref-users.php @@ -12,11 +12,14 @@ if ($subop == "user-details") { + header("Content-Type: text/xml"); + print ""; + $uid = sprintf("%d", $_REQUEST["id"]); - print "
".__('User details')."
"; + print "".__('User details').""; - print "
"; + print "".__("Close this window"). "
"; - print ""; + print "]]>
"; return; } if ($subop == "edit") { + header("Content-Type: text/xml"); + $id = db_escape_string($_REQUEST["id"]); - print "
".__('User Editor')."
"; - - print "
"; + print ""; + print "".__('User Editor').""; + print ""; @@ -180,7 +185,7 @@
"; - print ""; + print "]]>"; return; } @@ -410,8 +415,6 @@ if (db_num_rows($result) > 0) { -// print "
PLACEHOLDER
"; - print "

"; -- cgit v1.2.3-54-g00ecf