Permalink
Browse files

Move upgrade results to dedicated page and add link into the tools box

  • Loading branch information...
1 parent 42dd8b0 commit 07624ff4d8aaedcb24b670f573811b2285966a65 @markkevans markkevans committed with haraldpdl Feb 27, 2010
@@ -30,6 +30,7 @@
'<a href="' . tep_href_link(FILENAME_NEWSLETTERS) . '" class="menuBoxContentLink">' . BOX_TOOLS_NEWSLETTER_MANAGER . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_SEC_DIR_PERMISSIONS) . '" class="menuBoxContentLink">' . BOX_TOOLS_SEC_DIR_PERMISSIONS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_SERVER_INFO) . '" class="menuBoxContentLink">' . BOX_TOOLS_SERVER_INFO . '</a><br>' .
+ '<a href="' . tep_href_link(FILENAME_VERSION_CHECK) . '" class="menuBoxContentLink">' . BOX_TOOLS_VERSION_CHECK . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_WHOS_ONLINE) . '" class="menuBoxContentLink">' . BOX_TOOLS_WHOS_ONLINE . '</a>');
}
@@ -49,6 +49,7 @@
define('FILENAME_STATS_PRODUCTS_VIEWED', 'stats_products_viewed.php');
define('FILENAME_TAX_CLASSES', 'tax_classes.php');
define('FILENAME_TAX_RATES', 'tax_rates.php');
+ define('FILENAME_VERSION_CHECK', 'version_check.php');
define('FILENAME_WHOS_ONLINE', 'whos_online.php');
define('FILENAME_ZONES', 'zones.php');
?>
@@ -108,6 +108,7 @@ function tep_date_raw($date, $reverse = false) {
define('BOX_TOOLS_NEWSLETTER_MANAGER', 'Newsletter Manager');
define('BOX_TOOLS_SEC_DIR_PERMISSIONS', 'Security Directory Permissions');
define('BOX_TOOLS_SERVER_INFO', 'Server Info');
+define('BOX_TOOLS_VERSION_CHECK', 'Upgrade Check');
define('BOX_TOOLS_WHOS_ONLINE', 'Who\'s Online');
// localizaion box text in includes/boxes/localization.php
@@ -14,11 +14,5 @@
define('ADMIN_INDEX_UPDATE_CHECK_DATE', 'Last Checked on');
define('ADMIN_INDEX_UPDATE_CHECK_NEVER', 'Never');
define('ADMIN_INDEX_UPDATE_CHECK_NOW', 'Check Now');
-define('ADMIN_INDEX_UPDATE_RUNNING_LATEST', 'You are running the latest version of osCommerce');
-define('ADMIN_INDEX_UPDATE_UPGRADES_AVAILABLE', 'A new version of osCommerce is available for download.');
-
-define('ADMIN_INDEX_UPDATE_UPGRADES_VERSION', 'Version');
-define('ADMIN_INDEX_UPDATE_UPGRADES_RELEASED', 'Release Date');
-define('ADMIN_INDEX_UPDATE_UPGRADES_DOWNLOAD', 'Download');
?>
@@ -0,0 +1,28 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2010 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Version Checker');
+
+define('TABLE_HEADING_VERSION', 'Version');
+define('TABLE_HEADING_RELEASED', 'Release Date');
+
+define('TEXT_RELEASE_NOTES', 'View Release Annoucement / Download');
+
+define('TITLE_CURRENT_VERSION', 'Currently Running:');
+
+
+define('VERSION_RUNNING_LATEST', 'You are running the latest version of osCommerce');
+define('VERSION_UPGRADES_AVAILABLE', 'A new version of osCommerce is available for download.');
+
+define('ERROR_COULD_NOT_CONNECT', 'Could not connect to osCommerce to check for new versions. Please try again later.');
+
+?>
@@ -10,33 +10,14 @@
Released under the GNU General Public License
*/
-$last_update_check = LAST_UPDATE_CHECK_TIME;
-$check_version = false;
-if (isset($HTTP_GET_VARS['version_check'])) {
- $check_version = true;
- $upgrade_versions = array();
- $current_version = trim(file_get_contents(DIR_FS_CATALOG . '/includes/version.php'));
- $major_version = substr($current_version, 0, 1);
- $versions = @file('http://www.oscommerce.com/version/online_merchant/' . $major_version, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- if (is_array($versions) && count($versions) > 0) {
- foreach ($versions as $version) {
- $arrversion = explode('|', $version);
- if ( version_compare($current_version, $arrversion[0], '<') ) {
- $upgrade_versions[] = $arrversion;
- }
- }
- }
- $last_update_check = time();
- tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $last_update_check . "' where configuration_key = 'LAST_UPDATE_CHECK_TIME'");
-}
+ $last_update_check = LAST_UPDATE_CHECK_TIME;
-if (!empty($last_update_check)) {
- $date_last_checked = date('F j, Y, H:i:s', $last_update_check);
-} else {
- $date_last_checked = ADMIN_INDEX_UPDATE_CHECK_NEVER;
-}
+ if (!empty($last_update_check)) {
+ $date_last_checked = date('F j, Y, H:i:s', $last_update_check);
+ } else {
+ $date_last_checked = ADMIN_INDEX_UPDATE_CHECK_NEVER;
+ }
?>
-
<table border="0" width="100%" cellspacing="0" cellpadding="4">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo ADMIN_INDEX_UPDATE_CHECK_TITLE; ?></td>
@@ -45,37 +26,7 @@
<?php
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .
' <td class="dataTableContent" align="left">' . ADMIN_INDEX_UPDATE_CHECK_DATE . ': ' . $date_last_checked . '</td>' .
- ' <td class="dataTableContent" align="right"><a href="' . tep_href_link(FILENAME_DEFAULT, 'version_check=now') . '">' . ADMIN_INDEX_UPDATE_CHECK_NOW . '</a></td>' .
+ ' <td class="dataTableContent" align="right"><a href="' . tep_href_link(FILENAME_VERSION_CHECK) . '">' . ADMIN_INDEX_UPDATE_CHECK_NOW . '</a></td>' .
' </tr>';
?>
-</table>
-
-<?php
-if ($check_version == true) {
-?>
-<table border="0" width="100%" cellspacing="0" cellpadding="4">
- <tr class="dataTableHeadingRow">
- <td class="dataTableHeadingContent"><?php echo ADMIN_INDEX_UPDATE_UPGRADES_VERSION; ?></td>
- <td class="dataTableHeadingContent"><?php echo ADMIN_INDEX_UPDATE_UPGRADES_RELEASED; ?></td>
- <td class="dataTableHeadingContent"></td>
- </tr>
-
-<?php
- if (count($upgrade_versions) > 0 ) {
- foreach ($upgrade_versions as $upgrade) {
- echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .
- ' <td class="dataTableContent">' . $upgrade[0] . '</td>' .
- ' <td class="dataTableContent" style="white-space: nowrap;">' . date("F j, Y", strtotime($upgrade[1])) . '</td>' .
- ' <td class="dataTableContent" align="right" style="white-space: nowrap;"><a href="' . $upgrade[2] . '" target="_blank">' . ADMIN_INDEX_UPDATE_UPGRADES_DOWNLOAD . '</a></td>' .
- ' </tr>';
- }
- } else {
- echo ' <tr class="dataTableRow">' .
- ' <td class="dataTableContent" colspan="3">' . ADMIN_INDEX_UPDATE_RUNNING_LATEST . '</td>' .
- ' </tr>';
- }
-?>
-</table>
-<?php
-}
-?>
+</table>
@@ -0,0 +1,126 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2010 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ require('includes/application_top.php');
+
+ $check_version = true;
+ $upgrade_versions = array();
+ $current_version = trim(file_get_contents(DIR_FS_CATALOG . '/includes/version.php'));
+ $major_version = substr($current_version, 0, 1);
+ $versions = @file('http://www.oscommerce.com/version/online_merchant/' . $major_version, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
+ if (is_array($versions) && count($versions) > 0) {
+ foreach ($versions as $version) {
+ $arrversion = explode('|', $version);
+ if ( version_compare($current_version, $arrversion[0], '<') ) {
+ $upgrade_versions[] = $arrversion;
+ }
+ }
+
+ if (count($upgrade_versions) > 0) {
+ $messageStack->add(VERSION_UPGRADES_AVAILABLE, 'error');
+ } else {
+ $messageStack->add(VERSION_RUNNING_LATEST, 'success');
+ }
+ } else {
+ $messageStack->add(ERROR_COULD_NOT_CONNECT, 'error');
+ }
+
+ $last_update_check = time();
+ tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $last_update_check . "' where configuration_key = 'LAST_UPDATE_CHECK_TIME'");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+ <tr>
+ <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+ </table></td>
+<!-- body_text //-->
+ <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+ <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td><table border="0" cellspacing="0" cellpadding="3">
+ <tr>
+ <td class="smallText"><b><?php echo TITLE_CURRENT_VERSION; ?></b></td>
+ <td class="smallText"><?php echo $current_version; ?></td>
+ </tr>
+ </table></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+ </tr>
+ <tr>
+ <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr class="dataTableHeadingRow">
+ <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_VERSION; ?></td>
+ <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_RELEASED; ?></td>
+ <td class="dataTableHeadingContent"></td>
+ </tr>
+
+<?php
+ if (count($upgrade_versions) > 0 ) {
+ foreach ($upgrade_versions as $upgrade) {
+?>
+ <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
+ <td class="dataTableContent"><?php echo $upgrade[0]; ?></td>
+ <td class="dataTableContent"><?php echo date('F j, Y', mktime(0, 0, 0, substr($upgrade[1], 4, 2), substr($upgrade[1], 6, 2), substr($upgrade[1], 0, 4))); ?></td>
+ <td class="dataTableContent"><?php echo '<a href="' . $upgrade[2] . '" target="_blank">' . TEXT_RELEASE_NOTES . '</a>'; ?></td>
+ </tr>
+<?php
+ }
+ }
+?>
+ </table></td>
+ </tr>
+ </table></td>
+ </tr>
+ </table></td>
+<!-- body_text_eof //-->
+ </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

0 comments on commit 07624ff

Please sign in to comment.