<?php
/*
Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
@version $Id: application_done.php,v 1.16 2004/04/06 19:51:09 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';
// let's see if a destination has been provided in the GUI procedure list.
if($zi_registry->isProcedure('_dest')){
header('Location: '.$zi_registry->getProcedure('_dest'));
exit;
}
function zi_process()
{
// Remove the Setup Wizard?
if(isset($_REQUEST["ZI_VALUES"]['remove_setup']) && $_REQUEST["ZI_VALUES"]['remove_setup'] == 'on'){
System::rm(array('-rf', getcwd()));
}
}
$application = $zi_registry->getApplication($_REQUEST['application']);
// if this is a quick install of an already installed app in dev mode,
// we redirect to the installation script
if(
isset($_REQUEST['mode']) &&
$_REQUEST['mode'] == 'dev' &&
isset($application['installed']) &&
$application['installed'] == $application['release']['version']
){
header('Location: application_install.php'.zi_form_querystr().'&msg='.rawurlencode('Installation executed'));
exit;
}
/***************************************************************************
* PAGE CONTENT *
***************************************************************************/
// if this is an update, remove the old application
if(isset($_REQUEST['update_old'])){
$zi_registry->removeApplication($_REQUEST['update_old']);
}
//print_r($application);
// Mark installation as installed.
// TODO: Do this with a kind of updateApplication() method.
/*
$applications = $zi_registry->getApplications();
$applications[$application['name'].'-'.$application['release']['version']]['installed'] = $application['release']['version'];
$zi_registry->setApplications($applications);
*/
$zi_registry->setInstalledApplication($application, $_REQUEST['application'], $_REQUEST['distribution']);
$zi_registry->unsetHiddenApplication();
$zi_registry->refreshApplications();
/*
$application = $zi_registry->getApplication($_REQUEST['application']);
print_r($application);
*/
$app_settings = $zi_registry->getApplicationSettings();
include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
?>
<h1>Installation Done</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>
<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.gif" border="0" alt="View Application" title="View Application" align="absmiddle"> View Application</a><br/>
Take a look at the installed application.</p>
<p><a href="log.php<?php echo zi_form_querystr(); ?>" onclick="javascript:window.open('log.php<?php echo zi_form_querystr(); ?>', '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.gif" border="0" alt="Installation Log" title="Installation Log" align="absmiddle"> Log File</a><br/>
Read the installation log for detailed information on the executed tasks.</p>
<?php
if($GLOBALS['ZI']['mode'] == 'setup'){
// installer widget class
require_once 'ZZOSS_Installer/Widget.php';
$zi_widget = new ZZOSS_InstallerWidget;
if(isset($zi_errors)){
$zi_widget->setErrors($zi_errors);
}
echo $zi_widget->add('checkbox', 'Remove Setup Wizard', 'remove_setup');
?>
<p>You can now remove this setup wizard.</p>
<?php
}
if($GLOBALS['ZI']['mode'] != 'setup'){
$zi_buttons['next'] = "index.php".zi_form_querystr();
} else {
$zi_buttons['ok'] = $app_settings['application_url'];
}
include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>