]> git.wh0rd.org Git - tt-rss.git/commitdiff
tweak new version notification stuff
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 23 Jan 2009 05:53:31 +0000 (06:53 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 23 Jan 2009 05:53:31 +0000 (06:53 +0100)
functions.php
images/new_version.png
modules/popup-dialog.php
modules/pref-prefs.php
tt-rss.css
tt-rss.js
tt-rss.php

index d920498c7e5f21f8bf38bde8443a576ff42a3b23..23144f535b12ad4b59aa66a96c39e15b8688e17b 100644 (file)
                return array($tmp, $headlines_count, $affected_ids, $tmp_t);
        }
 
-       function check_for_update($link, $brief_fmt = true) {
+       function check_for_update($link) {
                $releases_feed = "http://tt-rss.org/releases.rss";
 
                if (!CHECK_FOR_NEW_VERSION || $_SESSION["access_level"] < 10) {
                        }
 
                        if (version_compare(VERSION, $latest_version) == -1) {
-                               if ($brief_fmt) {
-                                       return format_notice("<a href=\"javascript:showBlockElement('milestoneDetails')\">      
-                                               New version of Tiny-Tiny RSS ($latest_version) is available (click for details)</a>
-                                               <div id=\"milestoneDetails\">$content</div>");
-                               } else {
-                                       return "New version of Tiny-Tiny RSS ($latest_version) is available:
-                                               <div class='milestoneDetails'>$content</div>
-                                               Visit <a target=\"_blank\" href=\"http://tt-rss.org/\">official site</a> for
-                                               download and update information.";      
-                               }
-
-                       }                       
+                               return sprintf("New version of Tiny-Tiny RSS (%s) is available:", 
+                                       $latest_version)."<div class='milestoneDetails'>$content</div>";
+                       } else {
+                               return false;
+                       }       
                }
        }
 
index 769369066d45d9007fbfe312e92d811c7ca8a47b..3956089b510c8e6d5af16ce048e263b24f9f4dfb 100644 (file)
Binary files a/images/new_version.png and b/images/new_version.png differ
index d6ed68855ef8f7d1e629de9871938cf23fe5ffe0..465d3bcd9cdb6ed8caf8c659d74a47e0c29587a1 100644 (file)
@@ -8,10 +8,10 @@
                        print "<div id=\"infoBoxTitle\">".__('Notice')."</div>";
                        print "<div class=\"infoBoxContents\">";
 
+                       print "<div class=\"errorExplained\">";
+
                        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.");
+                               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)read_stampfile("update_daemon.stamp");
 
                        }
 
                        if ($param == 2) {
-                               $msg = check_for_update($link, false);
+                               $msg = check_for_update($link);
 
                                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 __("You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug.");
                                } else {
                                        print $msg;
                                }
                        }
 
                        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");
 
                        }
 
                        print "</div>";
-
+                       
                        print "<div align='center'>";
 
+                       print "<input class=\"button\"
+                               type=\"submit\" onclick=\"return visitOfficialSite()\" 
+                               value=\"".__('Visit official site')."\"> ";
+
                        print "<input class=\"button\"
                                type=\"submit\" onclick=\"return closeInfoBox()\" 
                                value=\"".__('Close this window')."\">";
 
-                       print "</div>";
+                       print "</div></div>";
 
                        return;
                }
index 80a63cb9e6a10d65d26f22d5aece5f4bd9abbf47..a09c7f20c34fc5ed4029b2bc1472e61eb50af929 100644 (file)
 
                } else {
 
-//                     print check_for_update($link);
-
                        set_pref($link, "_PREFS_ACTIVE_TAB", "genConfig");
 
                        if (!SINGLE_USER_MODE) {
index 137ea8927d877558470a13b919623049a56d1402..9ecc38801db7c738abeaf707208a2f58ca0cda6f 100644 (file)
@@ -1156,6 +1156,13 @@ div.tagCloudContainer {
        text-align : center;
 }
 
+div.errorExplained {
+       border : 1px solid #99d67a;
+       background-color : white;
+       margin : 5px 0px 5px 0px;
+       padding : 5px;
+}
+
 ul.feedErrorsList {
        height : 300px;
        overflow : auto;
@@ -1728,6 +1735,7 @@ a.feedUpdErrLink {
 #newVersionIcon {
        vertical-align : middle;
        cursor : pointer;
+       margin-left : 10px;
 }
 
 a.helpLinkPic {
index 37b6a47b26f9addcb1a523a1c7e229aec6e9ce87..1717cfbe27ad430d7c95df385ced05cf4ed88079 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1419,4 +1419,6 @@ function addLabel() {
        }
 }
 
-
+function visitOfficialSite() {
+       window.open("http://tt-rss.org/");
+}
index f01723f3dc1afcbad77f2c228827a4596ce356bc..f56c143104237e6794a44525751590afeac22c94 100644 (file)
@@ -108,6 +108,7 @@ window.onload = init;
 
 <div id="header">
        <div class="topLinks">
+
        <?php if (!SINGLE_USER_MODE) { ?>
                        <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
        <?php } ?>
@@ -123,8 +124,9 @@ window.onload = init;
        <?php } ?>
 
        <img id="newVersionIcon" style="display:none;" onclick="javascript:explainError(2)" 
-               src="images/new_version.png" title="New version is available!
+               src="images/new_version.png" title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>
                alt="new_version_icon"/>
+
        </div>
        <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>   
 </div>