[zi-cvs] packages/com.zzoss.zic packages_confirm.php,1.3,1.4
[email protected] Tue, 10 Feb 2004 04:22:16 -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-serv32454/com.zzoss.zic
Modified Files:
packages_confirm.php
Log Message:
nicer output in table with icons for each installation action (install, update, remove, download)
Index: packages_confirm.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_confirm.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** packages_confirm.php 9 Feb 2004 18:16:10 -0000 1.3
--- packages_confirm.php 10 Feb 2004 12:22:14 -0000 1.4
***************
*** 28,91 ****
/***************************************************************************
- * SCRIPT SPECIFIC FUNCTIONS *
- ***************************************************************************/
-
- function displayPackages($packages_display, $value, $label, $remote_filter = false) {
- global $zi_registry, $process;
-
- $packages_resolve = $zi_registry->getPackagesResolve();
- $process = false;
- $packages = $zi_registry->getPackages();
- $first = true;
- if(is_array($packages_display)) {
- foreach($packages_display as $key=>$val) {
- $name = $packages_resolve[$key];
- $package = $packages[$name];
- if( ($val==$value) && (!$remote_filter || ($remote_filter && $package["install"]["type"] == 'remote')) ) {
- if($first) {
- ?>
- <h2><?php echo $label; ?></h2>
- <table class="list">
- <tr>
- <th align="left">Package</th>
- <th align="center">Version</th>
- </tr>
- <?php
- $first = false;
- }
- $package_name_full = $package['name'];
- if(strlen($package_name_full) > 72){
- $package_name_short = substr($package_name_full, 0, 69).'...';
- } else {
- $package_name_short = $package_name_full;
- }
- ?>
- <tr>
- <td>
- <a title="<?php echo $package_name_full; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $key; ?>&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 $key; ?>&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>
- <td align="center"><?php echo $package["release"]["version"]; ?></td>
- </tr>
- <?php
- }
- }
- if(!$first) {
- $process = true;
- }
- ?>
- </table>
- <?php
- }
- return !($first);
- }
-
- /***************************************************************************
* STARTUP *
! ***************************************************************************/
!
! // load previous selection
! $a = $zi_registry->getPackagesActions();
// initialise widget class of installer
--- 28,33 ----
/***************************************************************************
* STARTUP *
! ***************************************************************************/
// initialise widget class of installer
***************
*** 98,104 ****
// default next link
$link_next = 'packages_dependencies.php';
- // default do not process
- $process = false;
$application = $zi_registry->getApplication();
$application_settings = $zi_registry->getApplicationSettings();
--- 40,47 ----
// default next link
$link_next = 'packages_dependencies.php';
+ // Register all packages
+ $zi_registry->registerPackages();
+
$application = $zi_registry->getApplication();
$application_settings = $zi_registry->getApplicationSettings();
***************
*** 110,139 ****
include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
?>
! <h1>Confirm Actions</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>
! <span class="label">Root:</span> <?php echo $application_settings['application_root']; ?><br/>
! <span class="label">URL:</span> <?php echo $application_settings['application_url']; ?><br/>
! <span class="label">Relative:</span> <?php echo $application_settings['application_url_rel']; ?><br/>
! <span class="label">Demo Mode:</span> <?php if(isset($application_settings['application_demo']) && $application_settings['application_demo'] == 'on'){ echo 'yes'; } else { echo 'no'; } ?>
! </p>
<?php
! // show packages
! displayPackages($a, 'R', 'Removing');
! displayPackages($a, 'U', 'Updating');
! $download = displayPackages($a, 'I', 'Downloading', true);
! displayPackages($a, 'I', 'Installing');
!
// so are there any packages to process
! if(!$process) {
$link_next = 'packages.php';
- echo '<p>No package action selected.</p>';
}
! ?>
! <br clear="all"/>
! <?php
! if($download) {
$link_next = 'packages_download.php';
}
--- 53,100 ----
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') {
! ?>
! <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>Packages Actions</h2>
! <?php
! require_once 'ZZOSS_Portlet/Package.php';
! $portlet_pkg = new ZZOSS_PortletPackage;
! $portlet_pkg->setRegistry($zi_registry);
! $portlet_pkg->showActions();
// so are there any packages to process
! if(!$portlet_pkg->hasActions()) {
$link_next = 'packages.php';
}
!
! if($portlet_pkg->hasDownloads()) {
$link_next = 'packages_download.php';
}
***************
*** 141,145 ****
$link_next .= zi_form_querystr();
}
! if($process) {
$zi_buttons['ok'] = $link_next;
}
--- 102,106 ----
$link_next .= zi_form_querystr();
}
! if($portlet_pkg->hasActions()) {
$zi_buttons['ok'] = $link_next;
}
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn