<?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   Varien
 * @package    Varien_Object
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php echo $this->template('header.phtml') ?>

<script>
function useCustomPermissions (element)
{
    if (element.value == '1') {
        disabledMode = 'block';
    } else {
        disabledMode = 'none';
    }
    document.getElementById('use_custom_permissions_mode_panel').style.display = disabledMode;
}
</script>

<h2 class="page-head">Settings</h2>
<form action="<?php echo $this->url('settingsPost') ?>" method="POST">
    <fieldset>
        <p>Magento Extensions are available in three different versions.</p>
        <ul class="disc">
            <li><strong>Stable</strong> means the extension can be used in a production environment.</li>
            <li><strong>Beta</strong> means the extension is not recommended for use in a production environment.</li>
            <li><strong>Alpha</strong> means the extension is still in development.</li>
        </ul>
        <p>Please note: extensions are provided as is. Make sure to backup your data before installing new extensions.</p>
        <table cellspacing="0" class="form-list">
            <tr>
                <td class="label">Preferred State:</td>
                <td class="value">
                    <select id="preferred_state" name="preferred_state" style="width:150px;">
                        <option value="stable" <?php if ($this->get('state')=='stable'):?>selected="selected"<?php endif ?>>Stable</option>
                        <option value="beta" <?php if ($this->get('state')=='beta'):?>selected="selected"<?php endif ?>>Beta</option>
                        <option value="alpha" <?php if ($this->get('state')=='alpha'):?>selected="selected"<?php endif ?>>Alpha</option>
                    </select>
                </td>
            </tr>
            <!--
            <tr>
                <td class="label">Magento Installation Directory:</td>
                <td class="value"><input name="mage_dir" value="<?php echo htmlentities($this->get('mage_dir'))?>" style="width:250px;"/></td>
            </tr>
            -->
        </table>
        <p>Permission to create new files and folders.</p>
        <table cellspacing="0" class="form-list">
            <tr>
                <td class="label">Use custom permissions:</td>
                <td class="value">
                    <select onchange="useCustomPermissions(this)" id="use_custom_permissions_mode" name="use_custom_permissions_mode" style="width:150px;">
                        <option value="1" <?php if ($this->get('use_custom_permissions_mode')=='1'):?>selected="selected"<?php endif ?>>Yes</option>
                        <option value="0" <?php if ($this->get('use_custom_permissions_mode')=='0'):?>selected="selected"<?php endif ?>>No</option>
                    </select>
                </td>
            </tr>
        </table>
        <table cellspacing="0" class="form-list" id="use_custom_permissions_mode_panel" <?php if ($this->get('use_custom_permissions_mode')=='0'):?>style="display:none;"<?php endif ?>>
            <tr>
                <td class="label">Folders:</td>
                <td class="value">
                    <input id="mkdir_mode" name="mkdir_mode" value="<?php echo($this->get('mkdir_mode'));?>" style="width:50px;" type="text"></input>
                </td>
            </tr>
            <tr>
                <td class="label">Files:</td>
                <td class="value">
                    <input id="chmod_file_mode" name="chmod_file_mode" value="<?php echo($this->get('chmod_file_mode'));?>" style="width:50px;" type="text"></input>
                </td>
            </tr>
            <tr>
                <td class="label">Executable files:</td>
                <td class="value">
                    <input id="chmod_file_mode_executable" name="chmod_file_mode_executable" value="<?php echo($this->get('chmod_file_mode_executable'));?>" style="width:50px;" type="text"></input>
                </td>
            </tr>
        </table>

        <p><button type="submit">Save Settings</button></p>
    </fieldset>
</form>

<?php echo $this->template('footer.phtml') ?>

