Location: PHPKode > projects > ZZ/OSS Installer > zic-1.1.0dev1/installer/bundle.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: bundle.php,v 1.2 2004/04/03 16:15:48 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;
        
        if(strlen($_FILES['bundle']['tmp_name'])){
            $data_dir = $zi_registry->getDir();
            $data_dir_dev = 'bundles'.DIRECTORY_SEPARATOR;
            if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){
                $data_dir_dev = $data_dir_dev.'dev'.DIRECTORY_SEPARATOR;
            }
            if (move_uploaded_file($_FILES['bundle']['tmp_name'], $data_dir.$_FILES['bundle']['name'] )) {
                // Extract the bundled installer.
                require_once 'ZZOSS_Package/Package.php';
                ZZOSS_Package::extractBundle($data_dir.$_FILES['bundle']['name'], $data_dir, $data_dir_dev);
            }
        }
	}
	   
    /***************************************************************************   
    * PAGE CONTENT                                                             *   
    ***************************************************************************/   
	
	require_once 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
    
    ?><h1>Import Bundle</h1>
    
    <p>Upload an application bundle to add it to the list of applications.</p>
    <p><span class="label">Bundle: </span><input type="file" name="bundle"/></p>
    
    <?php
    $zi_buttons['ok'] = "applications.php".zi_form_querystr();
    //$zi_buttons['back'] = "applications.php".zi_form_querystr();
       
	require_once 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';

?>
Return current item: ZZ/OSS Installer