<?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_confirm.php,v 1.11 2004/04/05 06:49:42 ordnas Exp $
@copyright Copyright © 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';
$pkg_type = 'package';
if(isset($_REQUEST['type'])){
$pkg_type = $_REQUEST['type'];
}
// check if this script is part of installation procedure
if(/*isset($_REQUEST['mode']) && ($_REQUEST['mode'] == 'dev' || $_REQUEST['mode'] == 'instant') && */!$zi_registry->isProcedure($pkg_type.'s_confirm')){
header('Location: packages_dependencies.php'.zi_form_querystr());
exit;
}
/*
function zi_process()
{
global $zi_registry;
$actions = $zi_registry->getPackagesActions();
// register packages that should be downloaded
$pkgs_remote = array();
// refresh the packages registry
$zi_registry->registerPackages();
$packages_resolve = $zi_registry->getPackagesResolve();
$packages = $zi_registry->getPackages();
foreach($actions as $key => $val) {
$name = $packages_resolve[$key];
$package = $packages[$name];
if( ($val=='I') && ($package["install"]["type"] == 'remote') ) {
$pkgs_remote[$package['name'].'-'.$package['release']['version']]['tgz'] = $package['filelist']['file']['#'];
// Do we also download the remote package XML ?
if(strlen($package['filelist']['descriptor']['#'])>2) {
$pkgs_remote[$package['name'].'-'.$package['release']['version']]['xml'] = $package['filelist']['descriptor']['#'];
}
}
}
$zi_registry->setPackagesRemote($pkgs_remote);
}
*/
/***************************************************************************
* STARTUP *
***************************************************************************/
// initialise widget class of installer
require_once 'ZZOSS_Installer/Widget.php';
$zi_widget = new ZZOSS_InstallerWidget;
if(isset($zi_errors)){
$zi_widget->setErrors($zi_errors);
}
/*
$zi_registry->setPackageType($pkg_type);
// Register all packages
$zi_registry->registerPackages();
*/
$application = $zi_registry->getApplication();
$application_settings = $zi_registry->getApplicationSettings();
/***************************************************************************
* 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(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev' ) {
?>
<h2>Packages Source Paths</h2>
<table border="0" cellspacing="0" cellpadding="4">
<?php
// additional package sources
echo $zi_widget->add('path', 'Source 1', 'source_1', array('disabled' => true));
echo $zi_widget->add('path', 'Source 2', 'source_2', array('disabled' => true));
echo $zi_widget->add('path', 'Source 3', 'source_3', array('disabled' => true));
echo $zi_widget->add('path', 'Source 4', 'source_4', array('disabled' => true));
echo $zi_widget->add('path', 'Source 5', 'source_5', array('disabled' => true));
?>
</table>
<?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();
// so are there any packages to process
if(!$portlet_pkg->hasActions()) {
if($pkg_type == 'plugin'){
$_REQUEST['type'] = 'package';
$link_next = 'packages_reset.php'.zi_form_querystr();
} else {
$link_next = 'packages.php';
}
header('Location: '.$link_next);
exit;
}
if($portlet_pkg->hasDownloads() || $portlet_pkg->hasActions()) {
echo $output;
}
if($portlet_pkg->hasDownloads()) {
$link_next = 'packages_download.php'.zi_form_querystr();
}
if($portlet_pkg->hasActions()) {
$zi_buttons['ok'] = $link_next;
}
if(isset($_REQUEST['profile']) && ($_REQUEST["profile"] == 'full' || $_REQUEST["profile"] == 'minimum')) {
$zi_buttons['back'] = "application_profile.php".zi_form_querystr();
} else {
$zi_buttons['back'] = "packages.php".zi_form_querystr();
}
include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>