[zi-cvs] packages/com.zzoss.zic bundle.php,NONE,1.1 installer.php,NONE,1.1 installer_remove.php,NONE,1.1 installer_user.php,NONE,1.1 package_add.php,NONE,1.1 packages_reset.php,NONE,1.1 application_delete.php,1.3,1.4 application_done.php,1.8,1.9 application_profile.php,1.5,1.6 application_settings.php,1.6,1.7 application_update.php,1.3,1.4 applications.php,1.10,1.11 dev_application_import.php,1.4,1.5 dev_bundle.php,1.3,1.4 dev_bundle_instant.php,1.5,1.6 dev_import_xml.php,1.1,1.2 dev_package.php,1.1,1.2 dev_package_xml.php,1.3,1.4 info.php,1.4,1.5 info_changelog.php,1.5,1.6 online_update_process.php,1.1,1.2 packages.php,1.8,1.9 packages_auto.php,1.1,1.2 packages_confirm.php,1.5,1.6 packages_dependencies.php,1.7,1.8 packages_download.php,1.6,1.7 packages_process.php,1.5,1.6 packages_sources.php,1.5,1.6 packages_sources_downloads.php,1.2,1.3 plugins_process.php,1.4,1.5

[email protected] Fri, 05 Mar 2004 06:25:43 -0800
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8129/com.zzoss.zic

Modified Files:
	application_delete.php application_done.php 
	application_profile.php application_settings.php 
	application_update.php applications.php 
	dev_application_import.php dev_bundle.php 
	dev_bundle_instant.php dev_import_xml.php dev_package.php 
	dev_package_xml.php info.php info_changelog.php 
	online_update_process.php packages.php packages_auto.php 
	packages_confirm.php packages_dependencies.php 
	packages_download.php packages_process.php 
	packages_sources.php packages_sources_downloads.php 
	plugins_process.php 
Added Files:
	bundle.php installer.php installer_remove.php 
	installer_user.php package_add.php packages_reset.php 
Log Message:
new plugin architecture in installer

--- NEW FILE: 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.1 2004/03/05 14:25:25 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';

?>
--- NEW FILE: installer.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: installer.php,v 1.1 2004/03/05 14:25:25 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';

	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
	
?>
<h1>Reset Options</h1>
<?php
    //$zi_buttons['back'] = 'applications.php?mode=dev';
	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
--- NEW FILE: installer_remove.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: installer_remove.php,v 1.1 2004/03/05 14:25:25 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';

    /***************************************************************************   
    * PAGE CONTENT                                                             *   
    ***************************************************************************/   

	if(isset($_REQUEST["action"])) {
		switch($_REQUEST["action"]) {
			// reset installer
			case 'reset_installer':
                $zi_setup->rmDataDir();
    			$msg .= 'removed '.$GLOBALS['ZI']['installer_data_dir']."\n";
				break;
		}
		$msg .= 'done.';
	}
	
	function zi_process()
	{
		// nothing to process
	}

	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
	
?>
<h1>Remove Installer</h1>
<?php
if(isset($msg)) {
	echo '<textarea style="width:95%;height: 100px" readonly>'.$msg.'</textarea>';
}
?>
<p>[<a href="<?php echo $_SERVER["PHP_SELF"].'?action=reset_installer'; ?>" title="Reset Installer">Reset Installer</a>]</p>
<p>Reset installer to initial state (all data gets lost).</p>
<?php
    //$zi_buttons['back'] = 'applications.php?mode=dev';
	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
--- NEW FILE: installer_user.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: installer_user.php,v 1.1 2004/03/05 14:25:25 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';

    /***************************************************************************   
    * PAGE CONTENT                                                             *   
    ***************************************************************************/   

	if(isset($_REQUEST["action"])) {
		switch($_REQUEST["action"]) {
			// remove login data
			case 'reset_login':
                $msg .= dev_remove($GLOBALS['ZI']['installer_data_dir'].'.htpasswd');
				break;
		}
		$msg .= 'done.';
	}

	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';	
?>
<h1>Manage User</h1><?php
if(isset($msg)) {
	echo '<textarea style="width:95%;height: 100px" readonly>'.$msg.'</textarea>';
}
?><p>[<a href="<?php echo $_SERVER["PHP_SELF"].'?action=reset_login'; ?>" title="Reset Login">Reset Login</a>]</p>
<p>Trigger a new autentication request.</p>
<?php
    //$zi_buttons['back'] = 'applications.php?mode=dev';
	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
--- NEW FILE: package_add.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: package_add.php,v 1.1 2004/03/05 14:25:25 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';
	
	function zi_process()
	{
        // TODO:
        // - validate input (e.g. relative path for baseinstalldir)
        // - check that only one src has been specified for package
        // - check if package already exists and ask if it should be overwritten
        
        global $zi_registry;
        
        // In case the application is not registered yet, then we create the data directories.
        if(!is_dir($zi_registry->getApplicationPath())){
            ZZOSS_InstallerRegistry::mkDirsApplication($zi_registry->getApplicationPath());
        }
        
        if(isset($_FILES['ZI_VALUES']['tmp_name']['archive_local']) && strlen($_FILES['ZI_VALUES']['tmp_name']['archive_local'])){
            $data_dir = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
            if (!move_uploaded_file($_FILES['ZI_VALUES']['tmp_name']['archive_local'], $data_dir.$_FILES['ZI_VALUES']['name']['archive_local'] )) {
                // raise error
                PEAR::raiseError('Cannot move uploaded file.');
            }
        } elseif(isset($_REQUEST['ZI_VALUES']['src_local'])){
            // Check if there's a package.xml
            // TODO: check if package.xml is valid
            if(!file_exists($_REQUEST['ZI_VALUES']['src_local'].DIRECTORY_SEPARATOR.'package.xml')){
                $_REQUEST['ZI_LOCATION_NEXT'] = $_SERVER['PHP_SELF'].zi_form_querystr()
                    .'&warning='.rawurlencode('Package XML is missing')
                    .'&ZI_VALUES[src_local]='.$_REQUEST['ZI_VALUES']['src_local'];
            }
        }
	}
	
	/***************************************************************************   
    * STARTUP                                                             	   *   
    ***************************************************************************/   
    
	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
    //print_r($_REQUEST);
    
    $is_app = true;
    
    // WORKAROUND: We explicitly need to set the application name from query string here,
    // otherwise, always the first application in the applications array will be returned.
    if(!$application = $zi_registry->getApplication($_REQUEST['application'])){
        // The application data path does not exits.
        // This is usually caused when the installer itself is developed without
        // having it not yet installed properly, i.e. without plugins installed.
        $is_app = false;
    }
    //$application = $zi_registry->getApplicationById($_REQUEST['id']);
    //$zi_registry->setApplication($application['name'].' '.$application['release']['version']);
    $pkg_type = NULL;
    if(isset($_REQUEST['type'])){
        $pkg_type = $_REQUEST['type'];
    }
    if($pkg_type == 'plugins'){
        ?>
        <h1>Add Plugin</h1>
        <?php
    } else {
        ?>
        <h1>Add Package</h1>
        <?php
    }
    
    if(isset($_REQUEST['warning'])){
        ?>
        <div class="warning"><?php echo $_REQUEST['warning']; ?></div>
        <?php
    }
    
    if(!$is_app){
        ?>
        <div class="warning">Application not registered.</div>
        <?php
    } else {
        ?>
        <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
        <?php
    }
    
    // installer widget class
	require_once 'ZZOSS_Installer/Widget.php';
	$zi_widget = new ZZOSS_InstallerWidget;
?>
    <table class="form">
    <?php
    echo $zi_widget->add('text', 'Base Install Directory:', 'baseinstalldir', array('info' => 'The build directory. Please specify a relative path or leave empty.'));
    echo $zi_widget->add('file', 'Local Archive:', 'archive_local', array('info' => 'Upload a package .tgz from your local harddisc ...'));
    if($GLOBALS['ZI']['mode'] == 'dev') {
        echo $zi_widget->add('text', 'Remote Archive:', 'archive_remote', array('info' => '... or download a package .tgz ...'));
        echo $zi_widget->add('text', 'Local Source:', 'src_local', array('info' => '... or specify the path to the local package sources.'));
    }
        ?>
    </table>
<br clear="all"/>
<?php
	$zi_buttons['next'] = "packages.php".zi_form_querystr();
	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
--- NEW FILE: packages_reset.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: packages_reset.php,v 1.1 2004/03/05 14:25:25 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';

    function zi_default()
    {
        global $zi_registry;
        
        $regfile = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'bundle_downloads.reg';
        $_REQUEST['ZI_VALUES'] = ZZOSS_InstallerUtils::unserializeFromFile($regfile);
        
        return $_REQUEST;
    }

    /***************************************************************************   
    * PAGE CONTENT                                                             *   
    ***************************************************************************/   

    $application = $zi_registry->getApplication();
    
    include 'themes/'.$GLOBALS['ZI']['theme'].'/header_popup.php';
    ?>
    <h1>Packages Sources</h1>
    <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
    <p>
    <?php
    $pkg_type = 'package';
    if(isset($_REQUEST['type'])){
        $pkg_type = $_REQUEST['type'];
    }
    require_once 'ZZOSS_Config/Config.php';
    $application = ZZOSS_Config::prepareNumeric($application, array($pkg_type));
    $packages = $application['release'][$pkg_type.'s'][$pkg_type];
    
    if(!is_array($packages) || !count($packages)){
        ?>
        <div class="warning">No packages defined in application.xml</div>
        <?php
    } else {
        if(!isset($_REQUEST['dev']) || $_REQUEST['dev'] != 'bundle'){
            $bundle_dir = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
        } else {
            $bundle_dir = $zi_registry->getApplicationPath().'bundle'.DIRECTORY_SEPARATOR;
            if(is_dir($bundle_dir)){
                System::rm(array('-rf', $bundle_dir));
            }
            System::mkdir(array('-p', $bundle_dir));
        }
        
        // Remove previously installed packages and their registries
        $dir_installed = $zi_registry->getApplicationPath().$pkg_type.'s_installed';
        if(is_dir($dir_installed)){
            System::rm(array('-rf', $dir_installed));
            System::mkDir($dir_installed);
        }

        if($pkg_type == 'plugin'){
            $dir_plugins_re = $zi_registry->getApplicationPath().'plugins_re';
            if(is_dir($dir_plugins_re)){
                System::rm(array('-rf', $dir_plugins_re));
                System::mkDir($dir_plugins_re);
            }
            $zi_registry->unsetPlugins();
        }
            
        ?>
        <h2>Installed <?php echo ucfirst($pkg_type); ?>s</h2>
        <div class="warning">Removed installed <?php echo ucfirst($pkg_type); ?>s.</div>
        <?php
        
        $app_settings = $zi_registry->getApplicationSettings();
        $log = array();
        
        require_once 'ZZOSS_Package/Package.php';
        $pkg_obj = new ZZOSS_Package;
        if(!$pkg_obj->packageSources($bundle_dir, $packages, $app_settings)){
            ?>
            <div class="warning">No package sources defined.</div>
            <?php
        } else {
            $log = $pkg_obj->getLog();
            if(strlen($log)){
                ?>
                <h2>Local <?php echo ucfirst($pkg_type); ?>s</h2>
                
                <div class="warning">Rebuilt <?php echo ucfirst($pkg_type); ?>s from sources.</div>
                
                <textarea cols="60" rows="20" wrap="off"><?php
                echo $log;
                ?></textarea>
                <?php
            }
            
            // If the package is not available locally, download it from the
            // location specified in the packages.xml.
            if($pkg_obj->hasUnprocessedPkgs()){
                $zi_buttons['next'] = 'packages_sources_downloads.php'.zi_form_querystr();
                // installer widget class
                require_once 'ZZOSS_Installer/Widget.php';
                $zi_widget = new ZZOSS_InstallerWidget;
                if(isset($zi_errors)){
                    $zi_widget->setErrors($zi_errors);
                }
                ?>
                <h2>Remote Packages</h2>
                <p>Please provide the URL to the download location of each package.</p>
                <table border="0" cellspacing="0" cellpadding="4">
                <?php
                //print_r($packages);
                //$zi_registry->registerPackages();
                //$pkgs_available = $zi_registry->getPackages();
                //print_r($pkgs_available);
                $pkgs_unprocessed = $pkg_obj->getUnprocessedPkgs();
                foreach($pkgs_unprocessed as $pos => $package){
                    $package_unique = $package['@']['name'].'-'.$package['@']['version'];
                    echo $zi_widget->add('text', $package_unique, $package_unique, array('validation' => 'not empty'));
                }
                ?>
                </table>
                <?php
            }
        }
    }
    ?>
    </p>
    <?php
    $zi_buttons['reload_parent'] = true;
	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer_popup.php';
?>


Index: application_done.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/application_done.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** application_done.php	11 Feb 2004 14:38:40 -0000	1.8
--- application_done.php	5 Mar 2004 14:25:24 -0000	1.9
***************
*** 66,70 ****
  ?>
  <h1>Installation Done</h1>
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
  <p><a href="<?php echo $app_settings['application_url']; ?>" target="_blank" title="<?php echo $application['summary'].'-'.$application['release']['version']; ?>"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/window_new.png" border="0" alt="View Application" title="View Application" align="absmiddle"> View Application</a><br/>
--- 66,70 ----
  ?>
  <h1>Installation Done</h1>
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
  <p><a href="<?php echo $app_settings['application_url']; ?>" target="_blank" title="<?php echo $application['summary'].'-'.$application['release']['version']; ?>"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/window_new.png" border="0" alt="View Application" title="View Application" align="absmiddle"> View Application</a><br/>

Index: application_profile.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/application_profile.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** application_profile.php	11 Feb 2004 10:42:37 -0000	1.5
--- application_profile.php	5 Mar 2004 14:25:24 -0000	1.6
***************
*** 83,87 ****
  	<h1>Installation Profile</h1>
  
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
  <table border="0" cellspacing="0" cellpadding="4">
--- 83,87 ----
  	<h1>Installation Profile</h1>
  
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
  <table border="0" cellspacing="0" cellpadding="4">

Index: application_settings.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/application_settings.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** application_settings.php	9 Feb 2004 18:16:10 -0000	1.6
--- application_settings.php	5 Mar 2004 14:25:24 -0000	1.7
***************
*** 57,65 ****
          $zi_registry->updateApplicationSettingsById($_REQUEST['id'], $_REQUEST["ZI_VALUES"]);
          
!         // This is our first, the "virgin" installation.
!         // So we register it by saying which installer installed it.
!         // Both are correlated to each other by their absolute root path.
!         // application_root => installer_root
!         $zi_registry->setApplicationInstalledBy($_REQUEST['ZI_VALUES']['application_root'], getcwd());
  	}
  
--- 57,67 ----
          $zi_registry->updateApplicationSettingsById($_REQUEST['id'], $_REQUEST["ZI_VALUES"]);
          
!         if($_REQUEST['dev'] != 'bundle'){
!             // This is our first, the "virgin" installation.
!             // So we register it by saying which installer installed it.
!             // Both are correlated to each other by their absolute root path.
!             // application_root => installer_root
!             $zi_registry->setApplicationInstalledBy($_REQUEST['ZI_VALUES']['application_root'], getcwd());
!         }
  	}
  
***************
*** 107,111 ****
  		if($application_settings = $zi_registry->getApplicationSettingsById($_REQUEST['id'])){
              $_REQUEST['ZI_VALUES'] = $application_settings;
!             if(!strlen($_REQUEST['ZI_VALUES']['application_root'])){
                  return default_paths($dev_mode);
              }
--- 109,113 ----
  		if($application_settings = $zi_registry->getApplicationSettingsById($_REQUEST['id'])){
              $_REQUEST['ZI_VALUES'] = $application_settings;
!             if(!isset($_REQUEST['ZI_VALUES']['application_root'])){
                  return default_paths($dev_mode);
              }
***************
*** 154,158 ****
  <h1>Installation Paths</h1>
  <h2>
! <a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
  <?php
--- 156,160 ----
  <h1>Installation Paths</h1>
  <h2>
! <a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
  <?php

Index: application_update.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/application_update.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** application_update.php	29 Jan 2004 14:09:16 -0000	1.3
--- application_update.php	5 Mar 2004 14:25:25 -0000	1.4
***************
*** 84,88 ****
      }
      ?>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
      <p><span class="label">Load Bundle: </span><input type="file" name="bundle"/></p>
--- 84,88 ----
      }
      ?>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
      <p><span class="label">Load Bundle: </span><input type="file" name="bundle"/></p>

Index: applications.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/applications.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** applications.php	12 Feb 2004 10:36:41 -0000	1.10
--- applications.php	5 Mar 2004 14:25:25 -0000	1.11
***************
*** 46,103 ****
                  ZZOSS_Package::extractBundle($data_dir.$_FILES['bundle']['name'], $data_dir, $data_dir_dev);
              }
-         } else if(isset($_REQUEST['a'])){
-             $split = split('_', $_REQUEST['a']);
-             $distribution = substr(strstr($_REQUEST['a'], '_'.$split[1]), 3);
-             // compose query string
-             $_REQUEST['id'] = $split[0];
-             $_REQUEST['distribution'] = $distribution;
-             $zi_registry->setDistribution($distribution);
-             $_REQUEST['application'] = $zi_registry->getApplicationNameById($_REQUEST['id']);
-             
-             $action = $split[1];
-             
-             if(isset($_REQUEST['mode']) && !$_REQUEST['mode'] == 'dev'){
-                 if(strlen($action)) {
-                     switch($action){
-                         case  'I':
-                             $_REQUEST["ZI_LOCATION_NEXT"] = 'application_settings.php'.zi_form_querystr();
-                             break;
-                         case  'R':
-                             $_REQUEST["ZI_LOCATION_NEXT"] = 'application_delete.php'.zi_form_querystr();
-                             break;
-                         case 'U':
-                             $_REQUEST["ZI_LOCATION_NEXT"] = 'application_update.php'.zi_form_querystr();
-                             break;
-                         case 'P':
-                             $_REQUEST["ZI_LOCATION_NEXT"] = 'packages.php'.zi_form_querystr();
-                             break;
-                     }
-                 }
-             } else {
-                 switch($split[1]){
-                     case 'i':
-                         $_REQUEST["ZI_LOCATION_NEXT"] = 'application_settings.php'.zi_form_querystr();
-                         break;
-                     case 'b':
-                         $bundle_dir = 
-                             $zi_registry->getDistributionPath().'applications'.DIRECTORY_SEPARATOR.
-                             $_REQUEST['application'].DIRECTORY_SEPARATOR.'bundle'.DIRECTORY_SEPARATOR;
-                         if(!is_dir($bundle_dir)){
-                             $_REQUEST["ZI_LOCATION_NEXT"] = 'application_settings.php'.zi_form_querystr().'&dev=bundle';
-                         } else {
-                             $_REQUEST["ZI_LOCATION_NEXT"] = 'dev_bundle.php'.zi_form_querystr();
-                         }
-                         break;
-                     case 'u':
-                         $_REQUEST["ZI_LOCATION_NEXT"] = 'dev_application_import.php'.zi_form_querystr();
-                         break;
-                     case 'R':
-                         $_REQUEST["ZI_LOCATION_NEXT"] = 'application_delete.php'.zi_form_querystr();
-                         break;
-                 }
-             }
          }
  	}
  	
      /***************************************************************************   
      * PAGE CONTENT                                                             *   
--- 46,88 ----
                  ZZOSS_Package::extractBundle($data_dir.$_FILES['bundle']['name'], $data_dir, $data_dir_dev);
              }
          }
  	}
  	
+     // Check for actions
+     if(isset($_REQUEST['action']) && strlen($_REQUEST['action'])){
+         $action_redirect = '';
+         
+         switch($_REQUEST['action']){
+             case  'install':
+                 $action_redirect = 'application_settings.php'.zi_form_querystr();
+                 break;
+             case  'remove':
+                 $action_redirect = 'application_delete.php'.zi_form_querystr();
+                 break;
+             case 'update':
+                 $action_redirect = 'application_update.php'.zi_form_querystr();
+                 break;
+             case 'packages':
+                 $action_redirect = 'packages.php'.zi_form_querystr();
+                 break;
+             case 'bundle':
+                 $bundle_dir = 
+                     $zi_registry->getDistributionPath().'applications'.DIRECTORY_SEPARATOR.
+                     $_REQUEST['application'].DIRECTORY_SEPARATOR.'bundle'.DIRECTORY_SEPARATOR;
+                 if(!is_dir($bundle_dir)){
+                     $action_redirect = 'application_settings.php'.zi_form_querystr().'&dev=bundle';
+                 } else {
+                     $action_redirect = 'dev_bundle.php'.zi_form_querystr();
+                 }
+                 break;
+             case 'descriptors':
+                 $action_redirect = 'dev_application_import.php'.zi_form_querystr();
+                 break;
+         }
+         
+         header('Location: '.$action_redirect);
+         exit;
+     }
+     
      /***************************************************************************   
      * PAGE CONTENT                                                             *   
***************
*** 105,109 ****
  	
  	require_once 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
! 	
      if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev') {
          ?><h1>Develop Applications</h1><?php
--- 90,94 ----
  	
  	require_once 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
!     
      if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev') {
          ?><h1>Develop Applications</h1><?php
***************
*** 111,127 ****
          ?><h1>Manage Applications</h1><?php
      }
-     ?>
-     <p><span class="label">Load Bundle: </span><input type="file" name="bundle"/><!--<br/>
-         Upload an application bundle to add it to the list of applications.--></p>
-     <?php
-     if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev') {
-         ?>
-         <p>
-             [<a href="dev_import_xml.php?mode=dev" title="Import XML">Import XML</a>] 
-             [<a href="dev_package.php?mode=dev" title="Package Tools">Package Tools</a>] 
-             [<a href="dev_reset_data.php?mode=dev" title="Reset Data">Reset Data</a>]
-         </p>
-         <?php
-     }
      
      // Single Distribution Mode
--- 96,99 ----
***************
*** 152,174 ****
                  <table class="list">
                      <tr>
-                         <?php
-                         if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){
-                             ?>
-                             <th align="left">Action</th>
-                             <?php
-                         } else {
-                             ?>
-                             <th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/run.png" border="0" alt="Install" title="Install"></th>
-                             <th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/package.png" border="0" alt="Packages" title="Packages"></th>
-                             <th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/rebuild.png" border="0" alt="Update" title="Update"></th>
-                             <!--<th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/package_settings.png" border="0" alt="Reconfigure" title="Reconfigure"></th>-->
-                             <th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/trashcan_empty.png" border="0" alt="Remove" title="Remove"></th>
-                             <?php
-                         }
-                         ?>
                          <th align="left">Application</th>
!                         <!-- <th align="center">Distribution</th> -->
!                         <th align="left">Available</th>
!                         <th align="left">Installed</th>
                      </tr>
                      <?php
--- 124,131 ----
                  <table class="list">
                      <tr>
                          <th align="left">Application</th>
!                         <th align="center">Available</th>
!                         <th align="center">Installed</th>
!                         <th align="center">Actions</th>
                      </tr>
                      <?php
***************
*** 192,282 ****
                              $zi_registry->removeApplication($application['name'].'-'.$application['release']['version']);
                          }
                      } else {
                          $options = array();
!                         if(isset($_REQUEST["loadSelection"]))  {
!                             switch($a[$application["id"]]) {
!                                 case 'R':	$options["remove"] = ' checked ';
!                                             break;
!                                 case 'U' :	$options["update"] = ' checked ';
!                                             break;
!                                 case 'I' :	$options["install"] = ' checked ';
!                                             break;
!                                 default:	$options["blank"] = ' checked ';
!                                             break;
!                             }
                          }
                          
!                         $options["install"] = '';
!                         $options['packages'] = $options["update"] = '';
!                         $options["reconfigure"] = '';
!                         $options["remove"] = '';
!                         $options["install_prefix"] = '';
!                         $options['packages_prefix'] = $options["update_prefix"] = '';
!                         $options["reconfigure_prefix"] = '';
!                         $options["remove_prefix"] = '';
!                         
!                         if(!isset($application["installed"]) || !strlen($application["installed"])) {
!                             $application["installed"] = '-';
!                             $options['packages'] = $options["update"] = ' disabled';
!                             $options['packages_prefix'] = $options["update_prefix"] = '_disabled';
!                             $options["reconfigure"] = ' disabled';
!                             $options["reconfigure_prefix"] = '_disabled';
!                             //$options["remove"] = ' disabled';
!                             //$options["remove_prefix"] = '_disabled';
!                             if(!isset($_REQUEST["loadSelection"])) {
!                                 $options["blank"] = ' checked ';
!                             }
!                             $installed = false;
!                         } else {
!                             if($application["installed"] == $application["release"]["version"]) {
!                                 $installed = true;
!                                 /*$options["update"] = ' disabled';
!                                 $options["update_prefix"] = '_disabled';*/
!                                 $options["install"] = ' disabled';
!                                 $options["install_prefix"] = '_disabled';
!                                 if(!isset($_REQUEST["loadSelection"])) {
!                                     $options["blank"] = ' checked ';
!                                 }
!                             } else {
!                                 $installed = false;
!                                 $options["install"] = ' disabled';
!                                 $options["install_prefix"] = '_disabled';
!                                 if(!isset($_REQUEST["loadSelection"])) {
!                                     $options["update"] = ' checked ';
!                                 }
!                             }
                          }
                          if($installed){
                              $highlight = ' class="highlight"';
                          }
                          echo '<tr>';
                              
-                             if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){
                                  ?>
                                  <td<?php echo $highlight; ?>>
!                                     <p>
!                                         <input type="radio" name="a" value="<?php echo $application["id"].'_i_'.$distribution['name'].'-'.$distribution['release']['version']; ?>">Install<br/>
!                                         <input type="radio" name="a" value="<?php echo $application["id"].'_u_'.$distribution['name'].'-'.$distribution['release']['version']; ?>">Update XML<br/>
!                                         <input type="radio" name="a" value="<?php echo $application["id"].'_b_'.$distribution['name'].'-'.$distribution['release']['version']; ?>">Bundle<br/>
!                                         <input type="radio" name="a" value="<?php echo $application["id"].'_R_'.$distribution['name'].'-'.$distribution['release']['version']; ?>">Delete
!                                     </p>
!                                 </td>
!                                 <?php
!                             } else {
!                                 echo '<td align="center" valign="middle"'.$highlight.'><input type="radio" name="a'.$options["install_prefix"].'"'.$options["install"].' value="'.$application["id"].'_I_'.$distribution['name'].'-'.$distribution['release']['version'].'" title="Install"></td>';
!                                 echo '<td align="center" valign="middle"'.$highlight.'><input type="radio" name="a'.$options["packages_prefix"].'"'.$options["packages"].' value="'.$application["id"].'_P_'.$distribution['name'].'-'.$distribution['release']['version'].'" title="Packages"></td>';
!                                 echo '<td align="center" valign="middle"'.$highlight.'><input type="radio" name="a'.$options["update_prefix"].'"'.$options["update"].' value="'.$application["id"].'_U_'.$distribution['name'].'-'.$distribution['release']['version'].'" title="Update"></td>';
!                                 echo '<!--<td align="center" valign="middle"'.$highlight.'><input type="radio" name="a'.$options["reconfigure_prefix"].'"'.$options["reconfigure"].' value="'.$application["id"].'_C_'.$distribution['name'].'-'.$distribution['release']['version'].'" title="Reconfigure"></td>-->';
!                                 echo '<td align="center" valign="middle"'.$highlight.'><input type="radio" name="a'.$options["remove_prefix"].'"'.$options["remove"].' value="'.$application["id"].'_R_'.$distribution['name'].'-'.$distribution['release']['version'].'" title="Remove"></td>';
!                             }
!                                 ?>
!                                 <td<?php echo $highlight; ?>><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&distribution=<?php echo rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&distribution=<?php echo  rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"]; ?>"><?php echo $application["summary"]; ?></a>
!                                 <?php
!                                 if($installed){
!                                     $app_settings = $zi_registry->getApplicationSettings($application['name'].'-'.$application['release']['version']);
!                                     ?> <a href="<?php echo $app_settings['application_url']; ?>" title="View Application" target="_blank"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/window_new.png" border="0" alt="View Application" title="View Application" align="absmiddle"></a>
!                                     <a href="log.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&application=<?php echo $application["name"].'-'.$application["release"]['version']; ?>&distribution=<?php echo rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>" onclick="javascript:window.open('log.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&application=<?php echo $application["name"].'-'.$application["release"]['version']; ?>&distribution=<?php echo rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>', 'LogFile', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="Log File"><img src="themes/share/icons/org.kde.icon
 s.crystalsvg/16x16/log.png" border="0" alt="Installation Log" title="Installation Log" align="absmiddle"></a><?php
!                                 }
!                             ?>
                                  </td>
                              <!-- <td<?php echo $highlight; ?>><?php echo $distribution['summary']; ?></td> -->
--- 149,190 ----
                              $zi_registry->removeApplication($application['name'].'-'.$application['release']['version']);
                          }
+                     } elseif (
+                             (isset($_REQUEST['mode']) && $_REQUEST['mode'] != 'dev') &&
+                             $GLOBALS['ZI']['installer_distribution'] == $distribution['name'].'-'.$distribution['release']['version'] &&
+                             $GLOBALS['ZI']['installer_application'] == $application['name'].'-'.$application['release']['version']
+                             ){
+                             // Don't show the installer
+                             if(count($applications) == 1){
+                                 // The installer is the only application in this distribution, so don't show the
+                                 // distribution.
+                                 $hasApplications = false;
+                             }
                      } else {
                          $options = array();
!                         $installed = false;
!                                              
!                         if(
!                             isset($application["installed"]) &&
!                             $application["installed"] == $application["release"]["version"]
!                             ) {
!                             $installed = true;
                          }
                          
!                         // detect development mode
!                         $is_dev = false;
!                         if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){
!                             $is_dev = true;
                          }
+                         
                          if($installed){
                              $highlight = ' class="highlight"';
+                         } else {
+                             $application["installed"] = '-';
                          }
                          echo '<tr>';
                              
                                  ?>
                                  <td<?php echo $highlight; ?>>
!                                     <a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&distribution=<?php echo rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&distribution=<?php echo  rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"]; ?>"><?php echo $application["summary"]; ?></a>
                                  </td>
                              <!-- <td<?php echo $highlight; ?>><?php echo $distribution['summary']; ?></td> -->
***************
*** 289,292 ****
--- 197,255 ----
                              
                              echo '</td>';
+                             ?>
+                             <td align="left"<?php echo $highlight; ?>>
+                                 <div class="actions">
+                                     <?php
+                                     $querystr = '?id='.$application['id'].'&application='.$application['name'].'-'.$application['release']['version'].'&distribution='.$distribution['name'].'-'.$distribution['release']['version'];
+                                     if(isset($_REQUEST['mode'])){
+                                         $querystr .= '&mode='.$_REQUEST['mode'];
+                                     }
+                                     
+                                     if($is_dev || !$installed){
+                                         ?>
+                                         <a href="<?php echo $_SERVER['PHP_SELF'].$querystr; ?>&action=install"/>
+                                         <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/run.png" align="absmiddle" border="0" alt="Install" title="Install"></a><?php
+                                     }
+                                     ?> <?php
+                                     if($installed){
+                                         ?>
+                                         <a href="<?php echo $_SERVER['PHP_SELF'].$querystr; ?>&action=options">
+                                         <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/package_settings.png" align="absmiddle" border="0" alt="Options" title="Options"></a><?php
+                                     }
+                                     ?> <?php
+                                     if($installed){
+                                         ?>
+                                         <a href="<?php echo $_SERVER['PHP_SELF'].$querystr; ?>&action=packages">
+                                         <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/package.png" align="absmiddle" border="0" alt="Packages" title="Packages"></a><?php
+                                     }
+                                     ?> <?php
+                                     if($installed){
+                                         ?>
+                                         <a href="<?php echo $_SERVER['PHP_SELF'].$querystr; ?>&action=update">
+                                         <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/rebuild.png" align="absmiddle" border="0" alt="Update" title="Update"></a><?php
+                                     }
+                                     ?> <?php
+                                     if($is_dev){
+                                         ?>
+                                         <a href="<?php echo $_SERVER['PHP_SELF'].$querystr; ?>&action=descriptors">
+                                         <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/make.png" align="absmiddle" border="0" alt="Descriptors" title="Descriptors"></a><?php
+                                     }
+                                     ?>  <?php
+                                     if($is_dev){
+                                         ?>
+                                         <a href="<?php echo 'dev_bundle.php'.$querystr; ?>&action=bundle">
+                                         <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/kpackage.png" align="absmiddle" border="0" alt="Bundle" title="Bundle"></a><?php
+                                     }
+                                     ?> <?php
+                                     if($installed){
+                                         $app_settings = $zi_registry->getApplicationSettings($application['name'].'-'.$application['release']['version']);
+                                         ?> <a href="<?php echo $app_settings['application_url']; ?>" title="View Application" target="_blank"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/window_new.png" border="0" alt="View Application" title="View Application" align="absmiddle"></a>
+                                         <a href="log.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&application=<?php echo $application["name"].'-'.$application["release"]['version']; ?>&distribution=<?php echo rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>" onclick="javascript:window.open('log.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application["id"]; ?>&application=<?php echo $application["name"].'-'.$application["release"]['version']; ?>&distribution=<?php echo rawurlencode($distribution['name'].'-'.$distribution['release']['version']); ?>', 'LogFile', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="Log File"><img src="themes/share/icons/org.kde.
 icons.crystalsvg/16x16/log.png" border="0" alt="Installation Log" title="Installation Log" align="absmiddle"></a><?php
+                                     }
+                                     ?> <a href="<?php echo $_SERVER['PHP_SELF'].$querystr; ?>&action=remove">
+                                     <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/trashcan_empty.png" border="0" alt="Remove" title="Remove" align="absmiddle"></a>
+                                 </div>
+                             </td>
+                             <?php
                          echo '</tr>';
                          ?>

Index: dev_application_import.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_application_import.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** dev_application_import.php	9 Feb 2004 18:16:10 -0000	1.4
--- dev_application_import.php	5 Mar 2004 14:25:25 -0000	1.5
***************
*** 53,57 ****
          global $zi_registry, $zi_errors;
          
!         $zi_registry->setDir($GLOBALS['ZI']['installer_data_dir_dev']);
          
  		require_once 'ZZOSS_Config/Config.php';
--- 53,59 ----
          global $zi_registry, $zi_errors;
          
!         if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){
!             $zi_registry->setDir($GLOBALS['ZI']['installer_data_dir_dev']);
!         }
          
  		require_once 'ZZOSS_Config/Config.php';
***************
*** 106,111 ****
      ***************************************************************************/   
      
-     $application = $zi_registry->getApplication();
-     
  	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
  	
--- 108,111 ----
***************
*** 118,124 ****
  ?>
  <h1>Add Application</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
! 
! <table border="0" width="100%">
  <?php
  echo $zi_widget->add('text', 'Distribution XML:', 'path_distribution_xml');
--- 118,130 ----
  ?>
  <h1>Add Application</h1>
! <?php
! if(isset($_REQUEST['distributions']) && isset($_REQUEST['application'])){
!     $application = $zi_registry->getApplication();
!     ?>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $application['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
!     <?php
! }
! ?>
! <table border="0">
  <?php
  echo $zi_widget->add('text', 'Distribution XML:', 'path_distribution_xml');

Index: dev_bundle.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_bundle.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dev_bundle.php	29 Jan 2004 14:09:16 -0000	1.3
--- dev_bundle.php	5 Mar 2004 14:25:25 -0000	1.4
***************
*** 103,107 ****
      ?>
      <h1>Application Bundle</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      
      <?php
--- 103,107 ----
      ?>
      <h1>Application Bundle</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      
      <?php

Index: dev_bundle_instant.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_bundle_instant.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** dev_bundle_instant.php	9 Feb 2004 18:16:10 -0000	1.5
--- dev_bundle_instant.php	5 Mar 2004 14:25:25 -0000	1.6
***************
*** 139,143 ****
      ?>
      <h1>Instant Bundle</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      
      <?php
--- 139,143 ----
      ?>
      <h1>Instant Bundle</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      
      <?php

Index: dev_import_xml.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_import_xml.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** dev_import_xml.php	4 Jan 2004 17:11:34 -0000	1.1
--- dev_import_xml.php	5 Mar 2004 14:25:25 -0000	1.2
***************
*** 32,45 ****
  <h1>Import XML</h1>
  
! <!--
! <p>
!     [<a href="dev_distribution_import.php" title="Import Distribution">Import Distribution</a>]<br/>
!     Add a distribution by importing its distribution.xml.
! </p>
! -->
! <p>
!     [<a href="dev_application_import.php?mode=dev" title="Add Application">Add Application</a>]<br/>
!     Add an application by importing its distribution.xml, and application.xml.
! </p>
  <?php
  	$zi_buttons['back'] = 'applications.php?mode=dev';
--- 32,37 ----
  <h1>Import XML</h1>
  
! <p>[<a href="dev_application_import.php?mode=dev" title="Add Application">Add Application</a>]</p>
! <p>Add an application by importing its distribution.xml, and application.xml.</p>
  <?php
  	$zi_buttons['back'] = 'applications.php?mode=dev';

Index: dev_package.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_package.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** dev_package.php	22 Dec 2003 17:19:58 -0000	1.1
--- dev_package.php	5 Mar 2004 14:25:25 -0000	1.2
***************
*** 34,41 ****
  ?>
  <h1>Develop Package</h1>
! <p>
!     [<a href="dev_package_xml.php?mode=dev" title="Create package.xml">Create package.xml</a>]<br/>
!     Create a package.xml descriptor.
! </p>
  <?php
  	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
--- 34,40 ----
  ?>
  <h1>Develop Package</h1>
! 
! <p>[<a href="dev_package_xml.php?mode=dev" title="Create package.xml">Create package.xml</a>]</p>
! <p>Create a package.xml descriptor.</p>
  <?php
  	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';

Index: dev_package_xml.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_package_xml.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** dev_package_xml.php	9 Feb 2004 18:16:10 -0000	1.3
--- dev_package_xml.php	5 Mar 2004 14:25:25 -0000	1.4
***************
*** 30,35 ****
      ?>
      <h1>Create package.xml</h1>
      <?php
!     if(is_array($_REQUEST['ZI_VALUES'])){
          $filter_dirs = explode(',',$_REQUEST['ZI_VALUES']['filter_dirs']);
          // TODO: .bak
--- 30,39 ----
      ?>
      <h1>Create package.xml</h1>
+ 
      <?php
!     if(!isset($_REQUEST['ZI_VALUES']) || !is_array($_REQUEST['ZI_VALUES'])){
!         $_REQUEST['ZI_VALUES']['filter_dirs'] = 'CVS';
!         $_REQUEST['ZI_VALUES']['filter_files'] = '/[~#]$/i';
!     } else {
          $filter_dirs = explode(',',$_REQUEST['ZI_VALUES']['filter_dirs']);
          // TODO: .bak
***************
*** 55,61 ****
          }
          
-     } else {
-         $_REQUEST['ZI_VALUES']['filter_dirs'] = 'CVS';
-         $_REQUEST['ZI_VALUES']['filter_files'] = '/[~#]$/i';
      }
      
--- 59,62 ----

Index: info.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/info.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** info.php	29 Jan 2004 14:09:16 -0000	1.4
--- info.php	5 Mar 2004 14:25:25 -0000	1.5
***************
*** 118,122 ****
              $header = 'Application';
              // load selected package
!             $application = $zi_registry->getApplicationById($_REQUEST["id"]);
              // make those items a numeric array where more than one element with the same name occurs
              // on the same level
--- 118,128 ----
              $header = 'Application';
              // load selected package
!             if(isset($_REQUEST["id"])){
!                 $application = $zi_registry->getApplicationById($_REQUEST["id"]);
!             } elseif(isset($_REQUEST['distribution']) && isset($_REQUEST['application'])){
!                 $application = $zi_registry->getApplication($_REQUEST['application'], $_REQUEST['distribution']);
!             } else {
!                 PEAR::raiseError('Cannot identify application');
!             }
              // make those items a numeric array where more than one element with the same name occurs
              // on the same level
***************
*** 124,129 ****
--- 130,137 ----
              $info = ZZOSS_Config::prepareNumeric($application, array('license', 'maintainer', 'holder'));
              break;
+         case 'plugin':
          case 'package':
              $header = 'Package';
+             $zi_registry->setPackageType($_REQUEST['type']);
              $info = $zi_registry->getPackageById($_REQUEST["id"]);
              if($info["install"]["type"] == 'remote') {

Index: info_changelog.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/info_changelog.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** info_changelog.php	9 Feb 2004 18:16:10 -0000	1.5
--- info_changelog.php	5 Mar 2004 14:25:25 -0000	1.6
***************
*** 123,127 ****
              $header = 'Application';
              // load selected package
!             $application = $zi_registry->getApplicationById($_REQUEST["id"]);
              // make those items a numeric array where more than one element with the same name occurs
              // on the same level
--- 123,133 ----
              $header = 'Application';
              // load selected package
!             if(isset($_REQUEST["id"])){
!                 $application = $zi_registry->getApplicationById($_REQUEST["id"]);
!             } elseif(isset($_REQUEST['distribution']) && isset($_REQUEST['application'])){
!                 $application = $zi_registry->getApplication($_REQUEST['application'], $_REQUEST['distribution']);
!             } else {
!                 PEAR::raiseError('Cannot identify application');
!             }
              // make those items a numeric array where more than one element with the same name occurs
              // on the same level

Index: online_update_process.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/online_update_process.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** online_update_process.php	22 Dec 2003 17:19:58 -0000	1.1
--- online_update_process.php	5 Mar 2004 14:25:25 -0000	1.2
***************
*** 69,73 ****
  
  	$file = 'data/installer/remote_application.xml';
! 	$remote_application_xml = new ZZOSS_Config(array('numeric' => array('package')));
  	$remote_application_xml->setFile($file);
  	$remote_application = $remote_application_xml->query('/application');
--- 69,73 ----
  
  	$file = 'data/installer/remote_application.xml';
! 	$remote_application_xml = new ZZOSS_Config(array('numeric' => array('package', 'plugin')));
  	$remote_application_xml->setFile($file);
  	$remote_application = $remote_application_xml->query('/application');

Index: packages.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** packages.php	12 Feb 2004 10:36:41 -0000	1.8
--- packages.php	5 Mar 2004 14:25:25 -0000	1.9
***************
*** 39,42 ****
--- 39,49 ----
  	{
          global $zi_registry;
+         
+         $pkg_type = 'package';
+         if(isset($_REQUEST['type'])){
+             $pkg_type = $_REQUEST['type'];
+         }
+         $zi_registry->setPackageType($pkg_type);
+         
          $actions = array();
          
***************
*** 61,68 ****
  	}
  	
- 	// load package selection if back button was pressed
- 	//if(isset($_REQUEST["loadSelection"])) {
- 		$a = $zi_registry->getPackagesActions();
- 	//}
  	if(ZI_DEBUG){
          ZZOSS_Debug::log('Script', $zi_registry->getApplicationPath(), __FILE__, __LINE__);
--- 68,71 ----
***************
*** 75,226 ****
      //print_r($_REQUEST);
      
      // WORKAROUND: We explicitly need to set the application name from query string here,
      // otherwise, always the first application in the applications array will be returned.
!     $application = $zi_registry->getApplication($_REQUEST['application']);
      //$application = $zi_registry->getApplicationById($_REQUEST['id']);
      //$zi_registry->setApplication($application['name'].' '.$application['release']['version']);
      ?>
!     <h1>Application Packages</h1>
!     
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
!     <?php
      
!     // Register all packages
!     $zi_registry->registerPackages();
      
!     $packages = $zi_registry->getPackages();
! 
! // loop packages array displaying each package
! if(is_array($packages) && count($packages)) {
! ?>
!     <h2>Packages</h2>
!     <table class="list">
!         <tr>
!             <th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/run.png" border="0" alt="Install" title="Install"></th>
!             <th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/rebuild.png" border="0" alt="Update" title="Update"></th>
!             <th align="center"><img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/trashcan_empty.png" border="0" alt="Remove" title="Remove"></th>
!             <th align="center">&nbsp;</th>
!             <th align="left">Package</th>
!             <!-- <th align="center">Distribution</th> -->
!             <th align="left">Available</th>
!             <th align="left">Installed</th>
!         </tr>
! <?php
! 	foreach($packages as $package) {
! 		$options = array();
! 
!         $options["install"] = '';
!         $options["update"] = '';
!         $options["reconfigure"] = '';
!         $options["remove"] = '';
!         $options["install_prefix"] = '';
!         $options["update_prefix"] = '';
!         $options["reconfigure_prefix"] = '';
!         $options["remove_prefix"] = '';
!         $options["blank_prefix"] = '';
!         $options["blank"] = '';
! 
! 		if(is_array($a) && count($a))  {
!             if(!isset($a[$package["id"]]) || $a[$package["id"]] == 'N'){
!                 $options["blank"] = ' checked ';
!             } else {
!                 switch($a[$package["id"]]) {
!                     case 'R':
!                         $options["remove"] = ' checked ';
!                         break;
!                     case 'U':
!                         $options["update"] = ' checked ';
!                         break;
!                     case 'I':
!                         $options["install"] = ' checked ';
!                         break;
!                 }
!             }
! 		}
!         
! 		if(!isset($package["installed"]) || !strlen($package["installed"])) {
! 			$package["installed"] = '-';
! 			$options["update"] = ' disabled';
! 			$options["update_prefix"] = '_disabled';
! 			$options["remove"] = ' disabled';
! 			$options["remove_prefix"] = '_disabled';
! 			if($package["install"]["required"] == true) {
! 				$options["install"] = ' checked';
! 				$options["blank"] = ' disabled';
! 				$options["blank_prefix"] = '_disabled';
! 			} elseif(!isset($_REQUEST["loadSelection"])) {
! 				$options["blank"] = ' checked ';
! 			}
! 			$modified = true;
! 		} else {
! 			if($package["installed"] == $package["release"]["version"]) {
! 				$modified = false;
!                 /*
! 				$options["update"] = ' disabled';
! 				$options["update_prefix"] = '_disabled';*/
! 				$options["install"] = ' disabled';
! 				$options["install_prefix"] = '_disabled';
! 				if(!isset($_REQUEST["loadSelection"])) {
! 					$options["blank"] = ' checked ';
! 				}
! 				if($package["install"]["required"] == true) {
! 					$options["remove"] = ' disabled';
! 					$options["remove_prefix"] = '_disabled';
! 				}
! 			} else {
! 				$modified = true;
! 				$options["install"] = ' disabled';
! 				$options["install_prefix"] = '_disabled';
! 				if(!isset($_REQUEST["loadSelection"])) {
! 					$options["update"] = ' checked ';
! 				}
! 			}
! 		}
! 
! 		if($modified){
! 			$bgcolor = ' class="highlight"';
! 		} else {
! 			$bgcolor = '';
! 		}
! 
! 		echo '<tr>';
! 			echo '<td align="center" valign="middle"'.$bgcolor.'><input type="radio" name="a'.$options["install_prefix"].'['.$package["id"].']"'.$options["install"].' value="I" title="Install"></td>';
! 			echo '<td align="center" valign="middle"'.$bgcolor.'><input type="radio" name="a'.$options["update_prefix"].'['.$package["id"].']"'.$options["update"].' value="U" title="Update"></td>';
! 			echo '<td align="center" valign="middle"'.$bgcolor.'><input type="radio" name="a'.$options["remove_prefix"].'['.$package["id"].']"'.$options["remove"].' value="R" title="Remove"></td>';
! 			echo '<td align="center" valign="middle"'.$bgcolor.'><input type="radio" name="a'.$options["blank_prefix"].'['.$package["id"].']" '.$options["blank"].' value="N" title="Status Quo"></td>';
!             ?>
!             <td<?php echo $bgcolor; ?>>
!                 <?php
!                 
!                 $package_name_full = $package["name"];
!                 if(strlen($package_name_full) > 32){
!                     $package_name_short = substr($package_name_full, 0, 29).'...';
!                 } else {
!                     $package_name_short = $package_name_full;
!                 }
!                 
!                 ?>
!                 <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package["id"]; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package["id"]; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'PackageInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank"><?php
!                 echo $package_name_short;
!                 ?></a><br/><?php echo $package['summary']; ?>
!             </td>
!             <?php
!                 echo '<td'.$bgcolor.'>'.$package["release"]["version"];
!                 ?>
!                 <?php
!                 if($package["installed"] == '-' && $package["install"]["type"] == 'remote') {
!                     echo '<img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/network.png" align="absmiddle" border="0" alt="Download" title="Download">';
!                 }
!                 echo '</td>';
!                 
!                 echo '<td'.$bgcolor.'>'.$package["installed"].'</td>';
!         
! 		echo '</tr>';
! 	}
! 	?>
! 	</table><?php
! } else {
! 	echo 'There are no packages available.';
! }
  ?>
  <br clear="all"/>
--- 78,123 ----
      //print_r($_REQUEST);
      
+     $is_app = true;
+     
      // WORKAROUND: We explicitly need to set the application name from query string here,
      // otherwise, always the first application in the applications array will be returned.
!     if(!$application = $zi_registry->getApplication($_REQUEST['application'])){
!         // The application data path does not exits.
!         // This is usually caused when the installer itself is developed without
!         // having it not yet installed properly, i.e. without plugins installed.
!         $is_app = false;
!     }
      //$application = $zi_registry->getApplicationById($_REQUEST['id']);
      //$zi_registry->setApplication($application['name'].' '.$application['release']['version']);
+     $pkg_type = 'package';
+     if(isset($_REQUEST['type'])){
+         $pkg_type = $_REQUEST['type'];
+     }
+ 
      ?>
!     <h1>Application <?php echo ucfirst($pkg_type); ?>s</h1>
      
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      
!     <h2><?php echo ucfirst($pkg_type); ?>s</h2>
!     <p>[<a href="package_add.php<?php echo zi_form_querystr(); ?>">Add <?php echo ucfirst($pkg_type); ?></a>]<?php
!     if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){ 
!         ?>&nbsp;
!         [<a href="packages_reset.php<?php echo zi_form_querystr(); ?>" onclick="javascript:if(confirm('This will undo all previous installation work. Are you sure you want to continue?')){window.open('packages_reset.php<?php echo zi_form_querystr(); ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');}void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>">Reset <?php echo ucfirst($pkg_type); ?>s</a>]
!         <?php
!     }
!     ?>
!     </p>
!     <?php
!     if(!$is_app){
!         ?>
!         <div class="warning">Application not registered.</div>
!         <?php
!     } else {
!         require_once 'ZZOSS_Portlet/Package.php';
!         $portlet_pkg = new ZZOSS_PortletPackage;
!         $portlet_pkg->setRegistry($zi_registry);
!         $portlet_pkg->showList($pkg_type);
!     }
  ?>
  <br clear="all"/>

Index: packages_auto.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_auto.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** packages_auto.php	4 Jan 2004 13:26:55 -0000	1.1
--- packages_auto.php	5 Mar 2004 14:25:25 -0000	1.2
***************
*** 33,36 ****
--- 33,42 ----
  	$a = array();
      
+     $pkg_type = 'package';
+     if(isset($_REQUEST['type'])){
+         $pkg_type = $_REQUEST['type'];
+     }
+     
+     $zi_registry->setPackageType($pkg_type);
      $zi_registry->registerPackages();
      $packages = $zi_registry->getPackages();

Index: packages_confirm.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_confirm.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** packages_confirm.php	12 Feb 2004 10:36:41 -0000	1.5
--- packages_confirm.php	5 Mar 2004 14:25:25 -0000	1.6
***************
*** 67,73 ****
      }
  	
      // Register all packages
      $zi_registry->registerPackages();
!     
      $application = $zi_registry->getApplication();
      $application_settings = $zi_registry->getApplicationSettings();
--- 67,80 ----
      }
  	
+     $pkg_type = 'package';
+     if(isset($_REQUEST['type'])){
+         $pkg_type = $_REQUEST['type'];
+     }
+     /*
+     $zi_registry->setPackageType($pkg_type);
+     
      // Register all packages
      $zi_registry->registerPackages();
!     */
      $application = $zi_registry->getApplication();
      $application_settings = $zi_registry->getApplicationSettings();
***************
*** 76,98 ****
      * PAGE CONTENT                                                             *   
      ***************************************************************************/   
! 	
  	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
  ?>
! <h1>Confirm Installation</h1>
  
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
! <h2>Application Paths</h2>
! <table border="0" cellspacing="0" cellpadding="4">
! <?php
!     $_REQUEST['ZI_VALUES'] = $application_settings;
  
-     $widget = 'path';
- 	echo $zi_widget->add($widget, 'Root', 'application_root', array('validation' => 'not empty', 'disabled' => true));
-     echo $zi_widget->add('checkbox', 'Create Directory', 'application_root_create', array('disabled' => true));
- 	echo $zi_widget->add($widget, 'URL', 'application_url', array('validation' => 'not empty', 'disabled' => true));
- 	echo $zi_widget->add($widget, 'Relative', 'application_url_rel', array('validation' => 'not empty', 'disabled' => true));
- ?>
- </table>
  <?php
     if($GLOBALS['ZI']['mode'] == 'dev') {
          ?>
--- 83,110 ----
      * PAGE CONTENT                                                             *   
      ***************************************************************************/   
!     
!     ob_start();
  	include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
  ?>
! <h1>Confirm Actions</h1>
  
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  
  <?php
+ if($pkg_type != 'plugin'){
+     ?>
+     <h2>Application Paths</h2>
+     <table border="0" cellspacing="0" cellpadding="4">
+     <?php
+         $_REQUEST['ZI_VALUES'] = $application_settings;
+     
+         $widget = 'path';
+         echo $zi_widget->add($widget, 'Root', 'application_root', array('validation' => 'not empty', 'disabled' => true));
+         echo $zi_widget->add('checkbox', 'Create Directory', 'application_root_create', array('disabled' => true));
+         echo $zi_widget->add($widget, 'URL', 'application_url', array('validation' => 'not empty', 'disabled' => true));
+         echo $zi_widget->add($widget, 'Relative', 'application_url_rel', array('validation' => 'not empty', 'disabled' => true));
+     ?>
+     </table>
+     <?php
     if($GLOBALS['ZI']['mode'] == 'dev') {
          ?>
***************
*** 110,121 ****
          <?php
      }
! ?>
! <h2>Packages Actions</h2>
  <?php
      require_once 'ZZOSS_Portlet/Package.php';
      $portlet_pkg = new ZZOSS_PortletPackage;
      $portlet_pkg->setRegistry($zi_registry);
!     $portlet_pkg->showActions();
  	
      // default next link
  	$link_next = 'packages_dependencies.php'.zi_form_querystr();
--- 122,137 ----
          <?php
      }
! }
!     ?>
! <h2><?php echo ucfirst($pkg_type); ?>s</h2>
  <?php
      require_once 'ZZOSS_Portlet/Package.php';
      $portlet_pkg = new ZZOSS_PortletPackage;
      $portlet_pkg->setRegistry($zi_registry);
!     $portlet_pkg->showActions($pkg_type);
  	
+     $output = ob_get_contents();
+     ob_end_clean();
+     
      // default next link
  	$link_next = 'packages_dependencies.php'.zi_form_querystr();
***************
*** 123,134 ****
      // so are there any packages to process
  	if(!$portlet_pkg->hasActions()) {
! 		$link_next = 'packages.php';
  	}
  
  	if($portlet_pkg->hasDownloads()) {
  		$link_next = 'packages_download.php'.zi_form_querystr();
  	}
      
  	if($portlet_pkg->hasActions()) {
  		$zi_buttons['ok'] = $link_next;
  	}
--- 139,159 ----
      // so are there any packages to process
  	if(!$portlet_pkg->hasActions()) {
!         if($pkg_type == 'plugin'){
!             $_REQUEST['type'] = 'package';
!             $link_next = 'packages.php'.zi_form_querystr();
!         } else {
!             $link_next = 'packages.php';
!         }
!         header('Location: '.$link_next);
!         exit;
  	}
  
  	if($portlet_pkg->hasDownloads()) {
+         echo $output;
  		$link_next = 'packages_download.php'.zi_form_querystr();
  	}
      
  	if($portlet_pkg->hasActions()) {
+         echo $output;
  		$zi_buttons['ok'] = $link_next;
  	}

Index: packages_dependencies.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_dependencies.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** packages_dependencies.php	12 Feb 2004 10:36:41 -0000	1.7
--- packages_dependencies.php	5 Mar 2004 14:25:25 -0000	1.8
***************
*** 34,37 ****
--- 34,44 ----
      {
          global $zi_registry;
+         
+         $pkg_type = 'package';
+         if(isset($_REQUEST['type'])){
+             $pkg_type = $_REQUEST['type'];
+         }
+         $zi_registry->setPackageType($pkg_type);
+         
          $action_deps = $zi_registry->getPackagesActionsDeps();
          $zi_registry->updatePackagesActions($action_deps);
***************
*** 45,48 ****
--- 52,61 ----
  	$link_next = 'packages_process.php'.zi_form_querystr();
  	
+     $pkg_type = 'package';
+     if(isset($_REQUEST['type'])){
+         $pkg_type = $_REQUEST['type'];
+     }
+     $zi_registry->setPackageType($pkg_type);
+     
      $packages = $zi_registry->getPackages();
      $packages_resolve = $zi_registry->getPackagesResolve();
***************
*** 102,106 ****
  ?>
  	<h1>Packages Dependencies</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  <?php
  if($zi_deps->isError()){
--- 115,119 ----
  ?>
  	<h1>Packages Dependencies</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  <?php
  if($zi_deps->isError()){
***************
*** 158,162 ****
              $package['name'] = $pkgs_needed_by['name'];
              $package["release"]["version"] = $pkgs_needed_by['version'];
!             $pkgs_needed_by = $pkgs_needed_by['needed_by'];
          }
          
--- 171,175 ----
              $package['name'] = $pkgs_needed_by['name'];
              $package["release"]["version"] = $pkgs_needed_by['version'];
!             //$pkgs_needed_by = $pkgs_needed_by['needed_by'];
          }
          
***************
*** 172,176 ****
              if(!$zi_deps->hasUndefinedPackages()){
                  ?>
!             <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'PackageInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank">
              <?php
              }
--- 185,189 ----
              if(!$zi_deps->hasUndefinedPackages()){
                  ?>
!             <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=<?php echo $pkg_type; ?>&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=<?php echo $pkg_type; ?>&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'PackageInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank">
              <?php
              }
***************
*** 203,210 ****
                  }
                  ?>
!                 <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'PackageInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank"><?php
!                 echo $package_name_short.'-'.$package['release']['version']; ?></a><br/></td><?php
              }
              ?>
          </tr>
          <?php
--- 216,224 ----
                  }
                  ?>
!                 <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=<?php echo $pkg_type; ?>&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=<?php echo $pkg_type; ?>&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'PackageInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank"><?php
!                 echo $package_name_short.'-'.$package['release']['version']; ?></a><br/><?php
              }
              ?>
+             </td>
          </tr>
          <?php

Index: packages_download.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_download.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** packages_download.php	12 Feb 2004 10:36:41 -0000	1.6
--- packages_download.php	5 Mar 2004 14:25:25 -0000	1.7
***************
*** 43,46 ****
--- 43,52 ----
              global $zi_registry;
              
+             $pkg_type = 'package';
+             if(isset($_REQUEST['type'])){
+                 $pkg_type = $_REQUEST['type'];
+             }
+             $zi_registry->setPackageType($pkg_type);
+             
              $items = array();
              
***************
*** 151,154 ****
--- 157,166 ----
      ***************************************************************************/   
  	
+     $pkg_type = 'package';
+     if(isset($_REQUEST['type'])){
+         $pkg_type = $_REQUEST['type'];
+     }
+     $zi_registry->setPackageType($pkg_type);
+     
  	// load previous selection
  	$a =  $zi_registry->getPackagesActions();
***************
*** 173,177 ****
      ?>
      <h1>Download Packages</h1>
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  <?php
  $result = downloadPackages($a);
--- 185,189 ----
      ?>
      <h1>Download Packages</h1>
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
  <?php
  $result = downloadPackages($a);

Index: packages_process.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_process.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** packages_process.php	12 Feb 2004 10:36:41 -0000	1.5
--- packages_process.php	5 Mar 2004 14:25:25 -0000	1.6
***************
*** 47,87 ****
  		$step = $_REQUEST["step"];
  	}
- 	/*
-     // For testing, include default filerole handlers
-     $plugins_install['role']['role']['php'] = array(
-         'default' => array(
-             'com.zzoss.zic.plugin.filelist-1.0' => 'role_php.php'
-             )
-         );
-     $plugins_remove['role']['role']['php'] = array(
-         'default' => array(
-             'com.zzoss.zic.plugin.filelist-1.0' => 'role_php.php'
-             )
-         );
-         
-     $plugins_install['role']['role'][''] = array(
-         'default' => array(
-             'com.zzoss.zic.plugin.filelist-1.0' => 'role_php.php'
-             )
-         );
-     $plugins_install['role']['role']['test'] = array(
-         'default' => array(
-             'com.zzoss.zic.plugin.filelist-1.0' => 'role_php.php'
-             )
-         );
-     $plugins_install['role']['role']['data'] = array(
-         'default' => array(
-             'com.zzoss.zic.plugin.filelist-1.0' => 'role_php.php'
-             )
-         );
      
!     $plugins_install['install'] = array(
!         'default' => array(
!             'com.zzoss.zic.plugin.config' => 'install.php'
!                 )
!             );
!     
!     $zi_registry->setPlugins($plugins_install, $plugins_remove);
!     */
      // Register all packages again, because there might be
      // new ones from download.
--- 47,57 ----
  		$step = $_REQUEST["step"];
  	}
      
!     $pkg_type = 'package';
!     if(isset($_REQUEST['type'])){
!         $pkg_type = $_REQUEST['type'];
!     }
!     $zi_registry->setPackageType($pkg_type);
! 
      // Register all packages again, because there might be
      // new ones from download.
***************
*** 95,114 ****
      echo '</pre>';
      */
-     System::mkdir(array('-p', 'plugins'.DIRECTORY_SEPARATOR));
-     System::mkdir(array('-p', $zi_registry->getApplicationPath().'data'.DIRECTORY_SEPARATOR));
-     
      // Create the install destination directory.
      $app_settings = $zi_registry->getApplicationSettings();
      //echo 'settings: '.$app_settings['application_root'];
      
      require_once 'ZZOSS_Plugin/Plugin.php';
      $plugin = new ZZOSS_Plugin;
      if($plugin->setQueue($queue)){
!         $plugin->setDestDir($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
!         $plugin->setSource($app_settings['source_1']);
!         $plugin->setSource($app_settings['source_2']);
!         $plugin->setSource($app_settings['source_3']);
!         $plugin->setSource($app_settings['source_4']);
!         $plugin->setSource($app_settings['source_5']);
          $plugin->setSource($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
          $plugin->setRegistry($zi_registry);
--- 65,108 ----
      echo '</pre>';
      */
      // Create the install destination directory.
      $app_settings = $zi_registry->getApplicationSettings();
      //echo 'settings: '.$app_settings['application_root'];
      
+     if($pkg_type == 'plugin'){
+         // Location of plugins runtime environment
+         $pkgs_root = $zi_registry->getApplicationPath().'plugins_re'.DIRECTORY_SEPARATOR;
+     } else {
+         $pkgs_root = $app_settings['application_root'];
+     }
+     
+     System::mkdir(array('-p', $pkgs_root));
+     
      require_once 'ZZOSS_Plugin/Plugin.php';
      $plugin = new ZZOSS_Plugin;
      if($plugin->setQueue($queue)){
!         $plugin->setDestDir($pkgs_root);
!         
!         // Location where plugins store their data
!         $pkgs_data = $zi_registry->getApplicationPath().'data'.DIRECTORY_SEPARATOR.$pkg_type.DIRECTORY_SEPARATOR;
!         if(!is_dir($pkgs_data)){
!             System::mkdir(array('-p', $pkgs_data));
!         }
!         $plugin->setDataDir($pkgs_data);
!         
!         if(isset($app_settings['source_1'])){
!             $plugin->setSource($app_settings['source_1']);
!         }
!         if(isset($app_settings['source_2'])){
!             $plugin->setSource($app_settings['source_2']);
!         }
!         if(isset($app_settings['source_3'])){
!             $plugin->setSource($app_settings['source_3']);
!         }
!         if(isset($app_settings['source_4'])){
!             $plugin->setSource($app_settings['source_4']);
!         }
!         if(isset($app_settings['source_5'])){
!             $plugin->setSource($app_settings['source_5']);
!         }
          $plugin->setSource($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
          $plugin->setRegistry($zi_registry);
***************
*** 126,131 ****
  	}
      
  	// go to process build packages
! 	header('Location: plugins_process.php'.zi_form_querystr().'&step='.$step);
  	exit;
  ?>
\ No newline at end of file
--- 120,138 ----
  	}
      
+     /*if($pkg_type == 'plugin'){
+         $step_next = $step + 1;
+         if($plugin->isStep($step_next)) {
+             $url_next = 'plugins_process.php'.zi_form_querystr().'&step='.$step_next;
+             //$url_next = 'packages_process.php'.zi_form_querystr().'&step='.$step_next;
+         } else {
+             $_REQUEST['type'] = 'package';
+             $url_next = 'packages.php'.zi_form_querystr();
+         }
+     } else {*/
+         $url_next = 'plugins_process.php'.zi_form_querystr().'&step='.$step;
+     //}
+     
  	// go to process build packages
! 	header('Location: '.$url_next);
  	exit;
  ?>
\ No newline at end of file

Index: packages_sources.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_sources.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** packages_sources.php	9 Feb 2004 18:16:10 -0000	1.5
--- packages_sources.php	5 Mar 2004 14:25:25 -0000	1.6
***************
*** 30,35 ****
      {
          $log = '';
!         $downloads = $_REQUEST['ZI_VALUES'];
!         if(is_array($downloads) && count($downloads)){
              
              $_REQUEST['ZI_LOCATION_NEXT'] = 'packages_sources_downloads.php'.zi_form_querystr();
--- 30,37 ----
      {
          $log = '';
!         
!         if(isset($_REQUEST['ZI_VALUES']) && is_array($_REQUEST['ZI_VALUES']) && count($_REQUEST['ZI_VALUES'])){
!             
!             $downloads = $_REQUEST['ZI_VALUES'];
              
              $_REQUEST['ZI_LOCATION_NEXT'] = 'packages_sources_downloads.php'.zi_form_querystr();
***************
*** 37,41 ****
              global $zi_registry;
              
!             if($_REQUEST['dev'] != 'bundle'){
                  $bundle_dir = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
              } else {
--- 39,43 ----
              global $zi_registry;
              
!             if(!isset($_REQUEST['dev']) || $_REQUEST['dev'] != 'bundle'){
                  $bundle_dir = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
              } else {
***************
*** 90,99 ****
      ?>
      <h1>Packages Sources</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      <?php
      require_once 'ZZOSS_Config/Config.php';
!     $application = ZZOSS_Config::prepareNumeric($application, array('package'));
      $packages = $application['release']['packages']['package'];
      
      if(!is_array($packages) || !count($packages)){
          ?>
--- 92,112 ----
      ?>
      <h1>Packages Sources</h1>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
!     <p>
      <?php
      require_once 'ZZOSS_Config/Config.php';
!     $application = ZZOSS_Config::prepareNumeric($application, array('package', 'plugin'));
      $packages = $application['release']['packages']['package'];
      
+     // check for plugins
+     $has_plugins = false;
+     if(
+         isset($application['release']['plugins']['plugin']) &&
+         is_array($application['release']['plugins']['plugin'])
+         ){
+         $has_plugins = true;
+         $packages = array_merge($packages, $application['release']['plugins']['plugin']);
+         }
+     
      if(!is_array($packages) || !count($packages)){
          ?>
***************
*** 101,105 ****
          <?php
      } else {
!         if($_REQUEST['dev'] != 'bundle'){
              $bundle_dir = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
          } else {
--- 114,118 ----
          <?php
      } else {
!         if(!isset($_REQUEST['dev']) || $_REQUEST['dev'] != 'bundle'){
              $bundle_dir = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
          } else {
***************
*** 116,168 ****
          require_once 'ZZOSS_Package/Package.php';
          $pkg_obj = new ZZOSS_Package;
!         $pkg_obj->packageSources($bundle_dir, $packages, $app_settings);
!         
!         $log = $pkg_obj->getLog();
!         if(strlen($log)){
!             ?>
!             <h2>Local Packages</h2>
!             <textarea cols="60" rows="20" wrap="off"><?php
!             echo $log;
!             ?></textarea>
!             <?php
!         }
!         
!         // If the package is not available locally, download it from the
!         // location specified in the packages.xml.
!         if($pkg_obj->hasUnprocessedPkgs()){
!             $zi_buttons['next'] = 'packages_sources_downloads.php'.zi_form_querystr();
!             // installer widget class
!             require_once 'ZZOSS_Installer/Widget.php';
!             $zi_widget = new ZZOSS_InstallerWidget;
!             if(isset($zi_errors)){
!                 $zi_widget->setErrors($zi_errors);
!             }
!             ?>
!             <h2>Remote Packages</h2>
!             <p>Please provide the URL to the download location of each package.</p>
!             <table border="0" cellspacing="0" cellpadding="4">
!             <?php
!             //print_r($packages);
!             //$zi_registry->registerPackages();
!             //$pkgs_available = $zi_registry->getPackages();
!             //print_r($pkgs_available);
!             $pkgs_unprocessed = $pkg_obj->getUnprocessedPkgs();
!             foreach($pkgs_unprocessed as $pos => $package){
!                 $package_unique = $package['@']['name'].'-'.$package['@']['version'];
!                 echo $zi_widget->add('text', $package_unique, $package_unique, array('validation' => 'not empty'));
!             }
              ?>
!             </table>
              <?php
          } else {
!             if($_REQUEST['dev'] == 'bundle'){
!                 $zi_buttons['next'] = 'dev_bundle_process.php'.zi_form_querystr();
              } else {
!                 $zi_buttons['next'] = 'packages.php'.zi_form_querystr();
              }
          }
      }
!     
!     if($_REQUEST['dev'] == 'bundle'){
          $zi_buttons['back'] = 'application_settings.php'.zi_form_querystr().'&dev=bundle';
      } else {
--- 129,190 ----
          require_once 'ZZOSS_Package/Package.php';
          $pkg_obj = new ZZOSS_Package;
!         if(!$pkg_obj->packageSources($bundle_dir, $packages, $app_settings)){
              ?>
!             <div class="warning">No package sources defined.</div>
              <?php
          } else {
!             $log = $pkg_obj->getLog();
!             if(strlen($log)){
!                 ?>
!                 <h2>Local Packages</h2>
!                 <textarea cols="60" rows="20" wrap="off"><?php
!                 echo $log;
!                 ?></textarea>
!                 <?php
!             }
!             
!             // If the package is not available locally, download it from the
!             // location specified in the packages.xml.
!             if($pkg_obj->hasUnprocessedPkgs()){
!                 $zi_buttons['next'] = 'packages_sources_downloads.php'.zi_form_querystr();
!                 // installer widget class
!                 require_once 'ZZOSS_Installer/Widget.php';
!                 $zi_widget = new ZZOSS_InstallerWidget;
!                 if(isset($zi_errors)){
!                     $zi_widget->setErrors($zi_errors);
!                 }
!                 ?>
!                 <h2>Remote Packages</h2>
!                 <p>Please provide the URL to the download location of each package.</p>
!                 <table border="0" cellspacing="0" cellpadding="4">
!                 <?php
!                 //print_r($packages);
!                 //$zi_registry->registerPackages();
!                 //$pkgs_available = $zi_registry->getPackages();
!                 //print_r($pkgs_available);
!                 $pkgs_unprocessed = $pkg_obj->getUnprocessedPkgs();
!                 foreach($pkgs_unprocessed as $pos => $package){
!                     $package_unique = $package['@']['name'].'-'.$package['@']['version'];
!                     echo $zi_widget->add('text', $package_unique, $package_unique, array('validation' => 'not empty'));
!                 }
!                 ?>
!                 </table>
!                 <?php
              } else {
!                 if(isset($_REQUEST['dev']) && $_REQUEST['dev'] == 'bundle'){
!                     $zi_buttons['next'] = 'dev_bundle_process.php'.zi_form_querystr();
!                 } else {
!                     if($has_plugins){
!                         $_REQUEST['type'] = 'plugin';
!                     }
!                     $zi_buttons['next'] = 'packages.php'.zi_form_querystr();
!                 }
              }
          }
      }
!     ?>
!     </p>
!     <?php
!     if(isset($_REQUEST['dev']) && $_REQUEST['dev'] == 'bundle'){
          $zi_buttons['back'] = 'application_settings.php'.zi_form_querystr().'&dev=bundle';
      } else {

Index: packages_sources_downloads.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_sources_downloads.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** packages_sources_downloads.php	21 Jan 2004 18:16:14 -0000	1.2
--- packages_sources_downloads.php	5 Mar 2004 14:25:25 -0000	1.3
***************
*** 41,45 ****
      }
      ?>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      <textarea cols="60" rows="20" wrap="off"><?php
          $logfile = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'bundle_downloads.log';
--- 41,45 ----
      }
      ?>
!     <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
      <textarea cols="60" rows="20" wrap="off"><?php
          $logfile = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'bundle_downloads.log';

Index: plugins_process.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/plugins_process.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** plugins_process.php	9 Feb 2004 18:16:10 -0000	1.4
--- plugins_process.php	5 Mar 2004 14:25:25 -0000	1.5
***************
*** 39,53 ****
          global $zi_registry;
          
          $app_settings = $zi_registry->getApplicationSettings();
          
          $queue = $zi_registry->getPackagesQueue();
          include_once 'ZZOSS_Plugin/Plugin.php';
          $plugin = new ZZOSS_Plugin;
!         $plugin->setDestDir($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
!         $plugin->setSource($app_settings['source_1']);
!         $plugin->setSource($app_settings['source_2']);
!         $plugin->setSource($app_settings['source_3']);
!         $plugin->setSource($app_settings['source_4']);
!         $plugin->setSource($app_settings['source_5']);
          $plugin->setSource($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
          $plugin->setQueue($queue);
--- 39,86 ----
          global $zi_registry;
          
+         $pkg_type = 'package';
+         if(isset($_REQUEST['type'])){
+             $pkg_type = $_REQUEST['type'];
+         }
+         $zi_registry->setPackageType($pkg_type);
+         
+         // Create the install destination directory.
          $app_settings = $zi_registry->getApplicationSettings();
+         //echo 'settings: '.$app_settings['application_root'];
+         
+         if($pkg_type == 'plugin'){
+             // Location of plugins runtime environment
+             $pkgs_root = $zi_registry->getApplicationPath().'plugins_re'.DIRECTORY_SEPARATOR;
+         } else {
+             $pkgs_root = $app_settings['application_root'];
+         }
          
          $queue = $zi_registry->getPackagesQueue();
          include_once 'ZZOSS_Plugin/Plugin.php';
          $plugin = new ZZOSS_Plugin;
!         $plugin->setDestDir($pkgs_root);
!         
!         // Location where plugins store their data
!         $pkgs_data = $zi_registry->getApplicationPath().'data'.DIRECTORY_SEPARATOR.$pkg_type.DIRECTORY_SEPARATOR;
!         if(!is_dir($pkgs_data)){
!             System::mkdir(array('-p', $pkgs_data));
!         }
!         $plugin->setDataDir($pkgs_data);
!         
!         if(isset($app_settings['source_1'])){
!             $plugin->setSource($app_settings['source_1']);
!         }
!         if(isset($app_settings['source_2'])){
!             $plugin->setSource($app_settings['source_2']);
!         }
!         if(isset($app_settings['source_3'])){
!             $plugin->setSource($app_settings['source_3']);
!         }
!         if(isset($app_settings['source_4'])){
!             $plugin->setSource($app_settings['source_4']);
!         }
!         if(isset($app_settings['source_5'])){
!             $plugin->setSource($app_settings['source_5']);
!         }
          $plugin->setSource($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
          $plugin->setQueue($queue);
***************
*** 59,62 ****
--- 92,100 ----
          echo '</pre>';
          */
+         // write installation log
+         $fp = fopen($zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'packages.log',"a");
+         fputs($fp,$plugin->getLog());
+         fclose($fp);
+         
          // Display errors.
          echo $plugin->getOutput();
***************
*** 71,94 ****
  	
  	/***************************************************************************   
-     * SCRIPT SPECIFIC FUNCTIONS                                       	   	   *   
-     ***************************************************************************/   
- 
- 	function setIncludePath() {
- 		global $ZZOSS_INSTALLER;
- 		// read installation type data
- 		$file = $ZZOSS_INSTALLER["application_path"].'installer/application_settings.reg';
- 		$config = ZZOSS_InstallerUtils::unserializeFromFile( $file );
- 		$include_path_app = $config['ZI_VALUES']['include_path_lib'];
- 		if (substr(PHP_OS, 0, 3) == 'WIN') {
- 			$del = ';';
- 		} else {
- 			$del = ':';
- 		}
- 		// get include path of installer
- 		$include_path_installer = ini_get('include_path');
- 		ini_set('include_path', $include_path_installer.$del.$include_path_app);
- 	}
- 
- 	/***************************************************************************   
      * STARTUP                                                             	   *   
      ***************************************************************************/   
--- 109,112 ----
***************
*** 100,113 ****
      }
  	*/
      $app_settings = $zi_registry->getApplicationSettings();
      
      $queue = $zi_registry->getPackagesQueue();
      $plugin = new ZZOSS_Plugin;
!     $plugin->setDestDir($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
!     $plugin->setSource($app_settings['source_1']);
!     $plugin->setSource($app_settings['source_2']);
!     $plugin->setSource($app_settings['source_3']);
!     $plugin->setSource($app_settings['source_4']);
!     $plugin->setSource($app_settings['source_5']);
      $plugin->setSource($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
      $plugin->setQueue($queue);
--- 118,164 ----
      }
  	*/
+     $pkg_type = 'package';
+     if(isset($_REQUEST['type'])){
+         $pkg_type = $_REQUEST['type'];
+     }
+     $zi_registry->setPackageType($pkg_type);
+     
+     // Create the install destination directory.
      $app_settings = $zi_registry->getApplicationSettings();
+     //echo 'settings: '.$app_settings['application_root'];
+     
+     if($pkg_type == 'plugin'){
+         // Location of plugins runtime environment
+         $pkgs_root = $zi_registry->getApplicationPath().'plugins_re'.DIRECTORY_SEPARATOR;
+     } else {
+         $pkgs_root = $app_settings['application_root'];
+     }
      
      $queue = $zi_registry->getPackagesQueue();
      $plugin = new ZZOSS_Plugin;
!     $plugin->setDestDir($pkgs_root);
!     
!     // Location where plugins store their data
!     $pkgs_data = $zi_registry->getApplicationPath().'data'.DIRECTORY_SEPARATOR.$pkg_type.DIRECTORY_SEPARATOR;
!     if(!is_dir($pkgs_data)){
!         System::mkdir(array('-p', $pkgs_data));
!     }
!     $plugin->setDataDir($pkgs_data);
!     
!     if(isset($app_settings['source_1'])){
!         $plugin->setSource($app_settings['source_1']);
!     }
!     if(isset($app_settings['source_2'])){
!         $plugin->setSource($app_settings['source_2']);
!     }
!     if(isset($app_settings['source_3'])){
!         $plugin->setSource($app_settings['source_3']);
!     }
!     if(isset($app_settings['source_4'])){
!         $plugin->setSource($app_settings['source_4']);
!     }
!     if(isset($app_settings['source_5'])){
!         $plugin->setSource($app_settings['source_5']);
!     }
      $plugin->setSource($zi_registry->getApplicationPath().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR);
      $plugin->setQueue($queue);
***************
*** 125,129 ****
  		$url_next = 'packages_process.php'.zi_form_querystr().'&step='.$step_next;
  	} else {
! 		$url_next = 'application_done.php'.zi_form_querystr();
  	}
  	
--- 176,184 ----
  		$url_next = 'packages_process.php'.zi_form_querystr().'&step='.$step_next;
  	} else {
!         if(isset($_REQUEST['type']) && $_REQUEST['type'] == 'plugin'){
!             $url_next = 'packages.php'.zi_form_querystr();
!         } else {
!             $url_next = 'application_done.php'.zi_form_querystr();
!         }
  	}
  	
***************
*** 144,148 ****
  		<h1>Build Packages</h1>
          
!         <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
          
  		<?php echo $plugin->getOutput(); ?>
--- 199,203 ----
  		<h1>Build Packages</h1>
          
!         <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
          
  		<?php echo $plugin->getOutput(); ?>



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click