<?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) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<div class="content-header">
    <table cellspacing="0">
        <tr>
            <td style="width:50%;"><h3 class="icon-head head-compilation"><?php echo $this->getHeader() ?></h3></td>
            <td class="form-buttons">
            <?php if ($this->canRunCompilation()): ?>
                <?php echo $this->getChangeStatusButtonHtml() ?>
                <?php echo $this->getRunButtonHtml() ?>
            <?php endif;?>
            </td>
        </tr>
    </table>
</div>
<div class="entry-edit">
<form name="compilation_form" id="compilation_form" method="post" action="<?php echo $this->getRunFormAction(); ?>">
<?php echo $this->getBlockHtml('formkey')?>
<?php if (!$this->canRunCompilation()): ?>
    <div id="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
<?php endif;?>

    <div class="entry-edit-head">
        <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('compiler')->__('Compilation State') ?></h4>
    </div>
    <fieldset>
        <legend><?php echo Mage::helper('compiler')->__('Compilation State') ?></legend>
        <table cellspacing="0" class="form-list" style="width:100%">
            <tr>
                <td class="label"><label ><?php echo Mage::helper('compiler')->__('Compiler Status')?></label></td>
                <td class="value">
                    <strong><?php echo $this->getCompilerStatus()?></strong>
                </td>
            </tr>
            <tr>
                <td class="label"><label ><?php echo Mage::helper('compiler')->__('Compilation State')?></label></td>
                <td class="value">
                    <strong><?php echo $this->getCompilerState()?></strong>
                </td>
            </tr>
            <tr>
                <td class="label"><label ><?php echo Mage::helper('compiler')->__('Collected Files Count')?></label></td>
                <td class="value">
                    <strong><?php echo $this->getCollectedFilesCount() ?></strong>
                </td>
            </tr>
            <tr>
                <td class="label"><label ><?php echo Mage::helper('compiler')->__('Compiled Scopes Count')?></label></td>
                <td class="value">
                    <strong><?php echo $this->getCompiledFilesCount() ?></strong>
                </td>
            </tr>
            <tr>
                <td class="label"><label ><?php echo Mage::helper('compiler')->__('Scopes Compilation Settings')?></label></td>
                <td class="value">
                    <?php foreach($this->getCompilationList() as $_frontName => $_classNames) : ?>
                    <p>
                        <label><strong><?php echo $_frontName ?></strong></label><br />
                        <textarea style="width:70%" readonly="readonly" cols="5" rows="3"><?php echo $this->arrToSting($_classNames)?></textarea>
                    </p>
                    <?php endforeach; ?>
                </td>
            </tr>
        </table>
    </fieldset>
</form>
</div>
<script type="text/javascript">
    compilationForm = new varienForm('compilation_form');
</script>
