Location: PHPKode > projects > ZZ/OSS Installer > zic-1.1.0dev1/installer/online_update.php
<?php   
    /*
    Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    */
    
    /**
    @version $Id: online_update.php,v 1.1 2003/12/22 17:19:58 ordnas Exp $
    @copyright Copyright &copy; 2001-2004 ZZ/OSS GbR, http://www.zzoss.com
    @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
    */
	  
	// execute init file
	require_once 'inc/init.php';
	// installer utils
	require_once 'ZZOSS_Installer/Utils.php';
	// config xml parser
	require_once 'ZZOSS_Config/Config.php';
	
    /***************************************************************************   
    * PAGE CONTENT                                                             *   
    ***************************************************************************/   
	if($_REQUEST["performUpdate"]) {
		$file = $ZZOSS_INSTALLER["application_path"].'installer/patches.tgz';
		ZZOSS_InstallerUtils::downloadFile(
			$ZZOSS_INSTALLER["application"]["release"]["filelist"]["file"],
			$file
			);
		if(!file_exists($file)) {
			// error, since file does not exist
			$screen = 3;
		} elseif(filesize($file) < 1) {
			$screen = 2;
		} else {
			$screen = 1;
		}
	}
	
	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
	?>
	<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
	<h1>Online Update</h1>
	<?php
	switch($screen) {
		// the sucessfully-updated screen
		case 1	: 	?>
	Update sucessfully. <br/>
	Use the <a href="menu.php?ZI_VALUES[type]=packages">package manager</a> to install new updates.
					<?php
				 	break;
		// the no-updates-available screen
		case 2  :	?>
	The are no updates available.
					<?php
					break;
		// the error screen
		case 3	:	?>
	Error retrieving updates. Maybe server is down. Try later again.
					<?php
					break;
		// the default confirm screen
		default :	?>
	Press continue to check for any updates for the current application.<br/><br/>
	<input type="submit" name="performUpdate" value="Continue">	
	<br clear="all"/>
					<?php
					break;
	}
	?>
	</form>
	<?php
		if($show_next){
			$zi_buttons['next'] = "packages.php";
		}
//		$zi_buttons['back'] = "online_update_distributors.php";
		include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';

?>
Return current item: ZZ/OSS Installer