From ed47e3c418a8d23403ea10c433cbcd017cb877be Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 6 Feb 2013 20:13:44 +0400 Subject: [PATCH] new version dialog: display error when no version info available --- classes/dlg.php | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/classes/dlg.php b/classes/dlg.php index 30dfa1ce1..74eb9f633 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -585,26 +585,42 @@ class Dlg extends Handler_Protected { $version = $version_data['version']; $id = $version_data['version_id']; - print "
"; + if ($version && $id) { + print "
"; - print T_sprintf("New version of Tiny Tiny RSS is available (%s).", - "$version"); + print T_sprintf("New version of Tiny Tiny RSS is available (%s).", + "$version"); - print "
"; + print "
"; - $details = "http://tt-rss.org/redmine/versions/$id"; - $download = "http://tt-rss.org/#Download"; + $details = "http://tt-rss.org/redmine/versions/$id"; + $download = "http://tt-rss.org/#Download"; - print "

".__("You can update using built-in updater in the Preferences or by using update.php")."

"; + print "

".__("You can update using built-in updater in the Preferences or by using update.php")."

"; - print "
"; - print ""; - print ""; - print ""; + print "
"; + print ""; + print ""; + print ""; + + } else { + print "
"; + + print "

".__("Error receiving version information or no new version available.")."

"; + + print "
"; + + print "
"; + print ""; + print "
"; + + } print "
"; }