X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=modules%2Fpopup-dialog.php;h=13abc947f1febcfca57b7b9844f3f4a76d94721d;hb=667a82727cd95cc75e006b8509b6249e3f7f46e6;hp=fe8bf5e01ca6cce7b6a833de323a27ff02b0081e;hpb=44d0e7742b05a43b69e3296596d581f4e5d825dc;p=tt-rss.git diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index fe8bf5e0..13abc947 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -1,45 +1,228 @@ "; - print "
".__('Notice')."
"; - print "
"; + if ($id == "importOpml") { + print "
"; + header("Content-Type: text/html"); # required for iframe - if ($param == 1) { - print __("Update daemon is enabled in configuration, but daemon - process is not running, which prevents all feeds from updating. Please - start the daemon process or contact instance owner."); + $owner_uid = $_SESSION["uid"]; + + db_query($link, "BEGIN"); - $stamp = (int)read_stampfile("update_daemon.stamp"); + /* create Imported feeds category just in case */ - print "

" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); + $result = db_query($link, "SELECT id FROM + ttrss_feed_categories WHERE title = 'Imported feeds' AND + owner_uid = '$owner_uid' LIMIT 1"); + if (db_num_rows($result) == 0) { + db_query($link, "INSERT INTO ttrss_feed_categories + (title,owner_uid) + VALUES ('Imported feeds', '$owner_uid')"); + } + + db_query($link, "COMMIT"); + + /* Handle OPML import by DOMXML/DOMDocument */ + + if (function_exists('domxml_open_file')) { + print "

"; + } else if (PHP_VERSION >= 5) { + print ""; + } else { + print_error(__("DOMXML extension is not found. It is required for PHP versions below 5.")); } - if ($param == 2) { - $msg = check_for_update($link, false); + print "
"; + + print "
"; + print ""; + print "
"; + + print "
"; + + //return; + } + + if ($id == "editPrefProfiles") { + + print "
"; + +# TODO: depends on selectTableRows() being broken for this list +# print "
". +# "" . __('Select').""; +# print "
"; +# print "
".__('All')."
"; +# print "
".__('None')."
"; +# print "
"; + +# print "
"; + print " +
"; + +# print "
"; + + + $result = db_query($link, "SELECT title,id FROM ttrss_settings_profiles + WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title"); + + print "
"; + + print "
"; - if (!$msg) { - print __("You are running the latest version of Tiny Tiny RSS. The - fact that you are seeing this dialog is probably a bug."); + print ""; + + print ""; #odd + + print ""; + + if (!$_SESSION["profile"]) { + $is_active = __("(active)"); + } else { + $is_active = ""; + } + + print ""; + + print ""; + + $lnum = 1; + + while ($line = db_fetch_assoc($result)) { + + $class = ($lnum % 2) ? "even" : "odd"; + + $profile_id = $line["id"]; + $this_row_id = "id=\"FCATR-$profile_id\""; + + print ""; + + $edit_title = htmlspecialchars($line["title"]); + + print ""; + + if ($_SESSION["profile"] == $line["id"]) { + $is_active = __("(active)"); } else { - print $msg; + $is_active = ""; } + print ""; + + print ""; + + ++$lnum; + } + + print "
" . + __("Default profile") . " $is_active
" . $edit_title . + " + $is_active
"; + print "
"; + print "
"; + + print "
+
+ + +
"; + + print ""; + print "
"; + + } + + if ($id == "pubOPMLUrl") { + + print "".__('Public OPML URL').""; + print ""; + print "$url_path"; + print ""; + + print "
"; + + print " "; + + print ""; + + print "
"; + print "]]>
"; + + //return; + } + + if ($id == "explainError") { + + print "".__('Notice').""; + print ""; + + if ($param == 1) { + print __("Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner."); + + $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); + + print "

" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); + } if ($param == 3) { - print __("TT-RSS has detected that update daemon is taking too long to - perform a feed update. This could indicate a problem like crash - or a hang. Please check the daemon process or contact instance - owner."); + print __("Update daemon is taking too long to perform a feed update. This could indicate a problem like crash or a hang. Please check the daemon process or contact instance owner."); - $stamp = (int)read_stampfile("update_daemon.stamp"); + $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); - print "

" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); + print "

" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); } @@ -47,133 +230,169 @@ print "

"; - print ""; + print ""; print "
"; + print "]]>
"; - return; + //return; } if ($id == "quickAddFeed") { - print "
".__('Subscribe to Feed')."
"; - print "
"; - - print "
"; - - print ""; - print ""; - print ""; + print ""; + print ""; print "
".__("Feed")."
"; print "
"; - print __("URL:") . " "; + print ""; - print ""; - - print "
"; + print "
"; if (get_pref($link, 'ENABLE_FEED_CATS')) { print __('Place in category:') . " "; - print_feed_cat_select($link, "cat_id"); + print_feed_cat_select($link, "cat", false, 'dojoType="dijit.form.Select"'); } print "
"; + print '"; */ + print "