<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
    $packages = $this->get('packages');
    $errors = $this->get('errors');
    $cnt = count($packages);
    if($cnt):
?>
Extension dependencies
<form action="<?php
    echo $this->url('connectInstallPackagePost')?>" method="post" target="connect_iframe" onsubmit="onSubmit(this)">
    <input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
    <input type="hidden" name="install_package_id" value="<?php echo $this->escapeHtml($this->get('package_id')); ?>">
    <table cellspacing="0" cellpadding="0" width="100%">
        <col width="150" />
        <col width="250" />
        <col width="150" />
        <col width="100" />
        <thead>
            <tr>
                <th class="first">Channel</th>
                <th class="first">Package Name</th>
                <th>Version</th>
                <th class="last">Status</th>
            </tr>
        </thead>
        <tbody>
        <?php foreach ($packages as $pkg): ?>
            <tr class="<?php echo $pkg['status']?>">
                <td class="first"><?php echo $pkg['channel']?></td>
                <td><?php echo $pkg['name']?></td>
                <td><?php echo $pkg['version'] . (!empty($pkg['stability']) ? ' (' . $pkg['stability'] . ')' : '')?></td>
                <td class="last"><?php echo $pkg['message']?></td>
            </tr>
        <?php endforeach;?>
        </tbody>
    </table>
    <div class="form-btn-set">
        <button class="f-right" type="submit">Proceed</button>
        <button class="f-right" style="margin-right:10px;" onclick="$('prepare_package_result').update();" type="reset">Cancel installation</button>
    </div>
</form>
<?php
endif;
if (!$cnt || !empty($errors['error'])):
    $_errors = array('error'=>array('Extension key is not valid.'));
    if(!empty($errors) && is_array($errors)) $_errors = $errors;
    $this->set('messages', $_errors)
?>
<div id="packages_failure">
    <?php echo $this->template('messages.phtml') ?>
</div>
<?php
endif;
?>
