Changeset 855 in ExiteCMS for trunk/administration/upgrade.php


Ignore:
Timestamp:
09/29/07 14:20:26 (5 years ago)
Author:
hverton
Message:

Changed to upgrade system to show more information about the updates, also added a panel to list the updates present that already have been installed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/upgrade.php

    r834 r855  
    2020// check for available upgrades 
    2121$upgrades = array(); 
     22$upgraded = array(); 
    2223$temp = makefilelist(PATH_ADMIN."upgrade", ".|.."); 
    2324foreach ($temp as $tempfile) { 
     
    2526    if (strlen($tempfile) != 12 || substr($tempfile,0,3) != "rev" || substr($tempfile,-4) != ".php") continue; 
    2627    $thisrev = substr($tempfile,3,5); 
    27     if (!isNum($thisrev) || $thisrev <= $settings['revision']) continue; 
    28     $upgrades[] = $tempfile; 
     28    if (!isNum($thisrev) || $thisrev <= $settings['revision']) { 
     29        $upgraded[] = $tempfile; 
     30    } else { 
     31        $upgrades[] = $tempfile; 
     32    } 
    2933} 
    3034 
    3135// set a constant to define the upgrades available 
    3236define('UPGRADES', count($upgrades)); 
     37 
     38// set a constant to define the upgrades already installed 
     39define('UPGRADED', count($upgraded)); 
    3340 
    3441// if it was called from the admin panel, continue interactively 
     
    4754    $variables = array(); 
    4855 
     56    // get some information from the upgrades already installed 
     57    if (UPGRADED) { 
     58        $revisions = array(); 
     59        // load and check the revision files 
     60        foreach ($upgraded as $revfile) { 
     61            require_once PATH_ADMIN."upgrade/".$revfile; 
     62        } 
     63        $variables['revisions_installed'] = $revisions; 
     64    } 
     65     
    4966    // check if there are upgrades available 
    5067    if (UPGRADES) { 
     
    129146    // check for newer revisions on the ExiteCMS website 
    130147    $variables['new_upgrades'] = false; 
    131      
     148 
    132149    $template_panels[] = array('type' => 'body', 'name' => 'admin.upgrade', 'template' => 'admin.upgrade.tpl', 'locale' => PATH_LOCALE.LOCALESET."admin/upgrade.php"); 
    133150    $template_variables['admin.upgrade'] = $variables; 
Note: See TracChangeset for help on using the changeset viewer.