Location: PHPKode > projects > ZZ/OSS Installer > zic-1.1.0dev1/installer/application_update_confirm.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: application_update_confirm.php,v 1.4 2004/04/06 19:11:57 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 FRAMEWORK FUNCTIONS                                            *   
    ***************************************************************************/   
	
	function zi_process()
	{
        global $zi_registry;
        $extract_dir = $zi_registry->getApplicationPath().'update'.DIRECTORY_SEPARATOR;
        
        if(is_dir($extract_dir)){
            
            // get the application settings of the old application.
            $app_settings = $zi_registry->getApplicationSettings();
            
            ZZOSS_Package::extractDistribution($extract_dir, $zi_registry->getDir());
            
            //System::rm(array('-rf', $extract_dir));
            
            // hide this application until installed
            $zi_registry->setHiddenApplication($_REQUEST['update_new']);
            $zi_registry->refreshApplications();
            $application = $zi_registry->getApplication($_REQUEST['update_new']);
            // register old application settings for new one
            $zi_registry->updateApplicationSettings($app_settings);
            
            $_REQUEST['application'] = $application['name'].'-'.$application['release']['version'];
            //$_REQUEST['id'] = $application['id'];
            
            $procedures = array(
                        /*'settings' => 'on',*/
                        'profile' => 'on',
                        'plugins_manager' => 'on',
                        'plugins_confirm' => 'on',
                        'plugins_register' => 'hide',
                        'plugins_deps' => 'on',
                        'plugins_fileroles' => 'on',
                        'plugins_build' => 'on',
                        'packages_manager' => 'on',
                        'packages_confirm' => 'on',
                        'packages_register' => 'hide',
                        'packages_deps' => 'on',
                        'packages_fileroles' => 'on',
                        'packages_build' => 'on'
                        );
            
            if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){
                $procedures['plugins_register'] = 'on';
                $procedures['packages_register'] = 'on';
            }
            
            $zi_registry->setProcedures($procedures);
            
            $_REQUEST['ZI_LOCATION_NEXT'] = 'application_profile.php'.zi_form_querystr();
        }
	}
	
    /***************************************************************************   
    * PAGE CONTENT                                                             *   
    ***************************************************************************/   
	
	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
	?>
	<h1>Update Application</h1>
    <div class="warning">
        <?php
        if(isset($_REQUEST['error'])){
            ?>
            <?php echo $_REQUEST['error']; ?><br/><br/>
            <?php
        }
    ?>
        Are you sure, you want to update <br/>'<?php echo $_REQUEST['update_old_human'].' ('.$_REQUEST['update_old'].')'; ?>'<br/> with the application below?
    </div>
    <?php
    $extract_dir = $zi_registry->getApplicationPath().'update'.DIRECTORY_SEPARATOR;
    
    $file = $extract_dir.'application.xml';
    $config = new ZZOSS_Config;
    $config->setFile($file);
    $application = $config->query('/application');
    
    $file = $extract_dir.'distribution.xml';
    $config = new ZZOSS_Config;
    $config->setFile($file);
    $distribution = $config->query('/distribution');

    // make those items a numeric array where more than one element with the same name occurs
    // on the same level
    require_once 'ZZOSS_Config/Config.php';
    $info = ZZOSS_Config::prepareNumeric($application, array('license', 'maintainer', 'holder'));
    
	// show application information table
    include 'inc/info.php';
    $content = '';
    
    $content .= zi_info_td('Description', zi_info_text($info["description"]) );
    if(isset($_REQUEST['type']) && $_REQUEST['type'] != 'distribution'){
        $distribution = $zi_registry->getDistribution();
        $content  .= zi_info_td('Distribution', $distribution['summary'].' '.$distribution['release']['version']);
    }
	$content .= zi_info_td('UNIX Name', $info["name"] );
	$content .= zi_info_td('Version', $info["release"]["version"] );
	$content .= zi_info_td('Release Date', $info["release"]["date"] );
	$content .= zi_info_td('State', zi_info_text($info["release"]["state"]) );
    if(isset($info['homepage'])){
        $content .= zi_info_td('Homepage', zi_info_text($info['homepage']) );
    }
	$content .= zi_info_td('Licenses', zi_info_licenses($info["release"]["license"]) );
    if(isset($info["release"]["copyright"]['holder'])){
        $content .= zi_info_td('Copyrights', zi_info_copyrights($info["release"]["copyright"]['holder']) );
    }
    if(isset($info["maintainers"]["maintainer"])){
        $content .= zi_info_td('Maintainers', zi_info_maintainers($info["maintainers"]["maintainer"]) );
    }
	$content .= zi_info_td('Notes', zi_info_text($info["release"]["notes"]) );
	echo zi_info_table($info["summary"].' '. $info["release"]["version"], $content);
    ?>
    <input type="hidden" name="update_new" value="<?php echo $_REQUEST['update_new']; ?>"/>
    <input type="hidden" name="update_src" value="<?php echo $extract_dir; ?>"/>
    <?php
    
    $zi_buttons['ok'] = $zi_buttons['cancel'] = 'applications.php'.zi_form_querystr();
	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
Return current item: ZZ/OSS Installer