<?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@magentocommerce.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.magentocommerce.com for more information.
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>

<script type="text/javascript">
function addRow(container, template)
{
    Element.insert($(container), {bottom: '<tr>' + $(template).innerHTML + '</tr>'});
}

function removeRow(button, selector)
{
    Element.remove($(button).up(selector));
}

function showHideFiles(button, selector, filesClass)
{
    $(button).up(selector).select('[class="'+filesClass+'"]').map(Element.toggle);
}


function loadPackage()
{
    var package = prompt('Please enter package name');
    if (!package) return false;
    var url = '<?php echo $this->getUrl('*/*/load') ?>';
    location.href = url+(url.indexOf('?')==-1 ? '?':'&')+'id='+package;
}

function saveAsPackage()
{
    _defaultPackageName = '';
    if ($('_packagefile_name')) {
        _defaultPackageName = $('_packagefile_name').getValue();
    } else if ($('_packagename')) {
        _defaultPackageName = $('_packagename').getValue();
    }
    var package = prompt('Please enter package file name', _defaultPackageName);
    if (!package) return false;
    if ($('_packagefile_name')) {
        $('_packagefile_name').value = package;
    }
    return editForm.submit();
}

function createPackage()
{
    $('_create').value = 1;
    editForm.submit();
}

function resetPackage()
{
    location.href = '<?php echo $this->getUrl('*/*/reset') ?>';
}
</script>

<style type="text/css">
.table-editable { border:solid 1px #CCC; background:#FAFAFA; padding:5px; margin-bottom:5px; }
.table-editable th { border-bottom:solid 1px #CCC; text-align:center; }
.table-editable th, .table-editable td { padding:1px 3px; vertical-align:middle; }
.table-editable select { height:19px; }
</style>

<div class="entry-edit">
    <input type="hidden" id="_create" name="_create" />
    <?php echo $this->getFormHtml() ?>
</div>
