".gettext("At")." ".$pkg_status["last_check"]."".gettext(" no updates found.")."
Click to check for updates";
- } else {
- echo "".gettext("There are ").$pkg_status["updates"].gettext(" update(s) available.")."
(When last checked at: ".$pkg_status["last_check"]." )"."
".gettext("Click to upgrade")." | Re-check now";
- }
+ if (!isset($pkg_status) || $pkg_status["connection"]=="error") {
+ echo "".gettext("Connection Error")."
".gettext("Click to retry")."";
+ } elseif ($pkg_status["repository"]=="error") {
+ echo "".gettext("Repository Problem")."
".gettext("Click to retry")."";
+ } elseif ($pkg_status["updates"]=="0") {
+ echo "".gettext("Your system is up to date.")."
Click to check for updates";
} else {
- echo "".gettext("Click to check for updates")."";
+ echo "".gettext("There are ").$pkg_status["updates"].gettext(" update(s) available.")."
".gettext("Click to upgrade")." | Re-check now";
}
+
exit;
}
@@ -118,18 +104,14 @@ endif; ?>
-
|
Updates
|
- Fetching status
+ =gettext("Click to check for updates");?>
|
-
| =gettext("CPU Type");?> |
@@ -315,30 +297,24 @@ endforeach; ?>
}
});
}
- window.onload = function(){
- getstatus();
- }
-
- function getstatus() {
- scroll(0,0);
- var url = "/widgets/widgets/system_information.widget.php";
- var pars = 'getupdatestatus=yes';
- jQuery.ajax(
- url,
- {
+ function getstatus() {
+ scroll(0,0);
+ var url = "/widgets/widgets/system_information.widget.php";
+ var pars = 'getupdatestatus=yes';
+ jQuery.ajax(
+ url,
+ {
type: 'get',
data: pars,
complete: activitycallback
- });
- }
- function activitycallback(transport) {
- // .html() method process all script tags contained in responseText,
- // to avoid this we set the innerHTML property
- jQuery('#updatestatus').prop('innerHTML',transport.responseText);
- }
-
+ });
+ }
+
+ function activitycallback(transport) {
+ // .html() method process all script tags contained in responseText,
+ // to avoid this we set the innerHTML property
+ jQuery('#updatestatus').prop('innerHTML',transport.responseText);
+ }
//]]>
|