<?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: menu.php,v 1.1 2003/12/22 17:19:58 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';
/***************************************************************************
* INSTALLER FRAMEWORK FUNCTIONS *
***************************************************************************/
function zi_process()
{
global $zi_registry, $ZZOSS_INSTALLER;
// only continue if valid application path
if(is_dir($ZZOSS_INSTALLER["application_path"])) {
// save the parameters for later installations
$file = $ZZOSS_INSTALLER["application_path"].'installer/installation_type.ser';
$fp = fopen($file, "w");
fputs( $fp, serialize( $_REQUEST ));
fclose( $fp );
// write the installed version if it's an update installation
if($_REQUEST['profile'] == 'update'){
$fp = fopen( $ZZOSS_INSTALLER["application_path"].'installed_version.txt', "w+");
fputs( $fp, $_REQUEST['installed_version']);
fclose( $fp );
}
}
switch($_REQUEST["ZI_VALUES"]["type"]) {
case 'packages':
$_REQUEST["ZI_LOCATION_NEXT"] = 'packages.php';
// check if system is already configured
if(!$zi_registry->isConfigured()) {
$_REQUEST["ZI_LOCATION_NEXT"] = 'menu.php';
}
break;
case 'change_global_config':
$_REQUEST["ZI_LOCATION_NEXT"] = 'config_global_paths.php';
// check if system has already applications
if($zi_registry->noApplication()) {
$_REQUEST["ZI_LOCATION_NEXT"] = 'menu.php';
}
break;
case 'change_components_config':
$_REQUEST["ZI_LOCATION_NEXT"] = 'packages_config.php';
// check if system is already configured
if(!$zi_registry->isConfigured()) {
$_REQUEST["ZI_LOCATION_NEXT"] = 'menu.php';
}
break;
case 'download':
$_REQUEST["ZI_LOCATION_NEXT"] = 'online_update.php';
// check if system is already configured
if(!$zi_registry->isConfigured()) {
$_REQUEST["ZI_LOCATION_NEXT"] = 'menu.php';
}
break;
case 'developer':
$_REQUEST["ZI_LOCATION_NEXT"] = 'developer/index.php';
if($GLOBALS['ZI']['mode'] != 'dev'){
$_REQUEST["ZI_LOCATION_NEXT"] = 'menu.php';
}
break;
case 'applications':
$_REQUEST["ZI_LOCATION_NEXT"] = 'applications.php';
break;
}
}
/***************************************************************************
* STARTUP *
***************************************************************************/
if($_REQUEST["ZI_VALUES"]["type"]) {
zi_process();
header("Location: ".$_REQUEST["ZI_LOCATION_NEXT"]);
}
/***************************************************************************
* PAGE CONTENT *
***************************************************************************/
include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
?>
<h1>Installation Menu</h1>
<?php
if($zi_registry->noApplication()) { ?>
<p>This seems to be your first execution of the installer.
Before continue, you have to choose an application to install from the application menu.</p>
<a href="menu.php?ZI_VALUES[type]=applications">Manage Applications</a>
<input type="hidden" name="ZI_VALUES[type]" value="change_global_config">
<?php } elseif(!$zi_registry->isConfigured()) { ?>
<p>This seems to be your first execution of the installer.
Before using the package manager to install new packages you have to configure the global parameters for the application.</p>
<a href="menu.php?ZI_VALUES[type]=change_global_config">Configure Application</a>
<input type="hidden" name="ZI_VALUES[type]" value="change_global_config">
<?php
} else {
?>
<p>Please choose an action on the left side.</p>
<p><b>Package Manager:</b><br/>Install/Update/Remove packages</p>
<p><b>Global Configuration:</b><br/>Configure general framework / application parameters</p>
<p><b>Components Configuration:</b><br/>Configure single components</p>
<input type="hidden" name="ZI_VALUES[type]" value="packages">
<?php }
include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>