Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Compiler_Adminhtml_Compiler_ProcessController
  • Mage_Compiler_Block_Process
  • Mage_Compiler_Helper_Data
  • Mage_Compiler_Model_Process
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Compiler
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: 
 28: /**
 29:  * Manage currency block
 30:  *
 31:  * @category    Mage
 32:  * @package     Mage_Compiler
 33:  * @author      Magento Core Team <core@magentocommerce.com>
 34:  */
 35: class Mage_Compiler_Block_Process extends Mage_Adminhtml_Block_Template
 36: {
 37:     /**
 38:      * Compilation process object
 39:      *
 40:      * @var Mage_Compiler_Model_Process
 41:      */
 42:     protected $_process;
 43:     protected $_validationResult;
 44: 
 45: 
 46:     protected function _construct()
 47:     {
 48:         $this->_process = Mage::getModel('compiler/process');
 49:         $this->_validationResult = $this->_process->validate();
 50:         return parent::_construct();
 51:     }
 52: 
 53:     /**
 54:      * Get compilation process object
 55:      *
 56:      * @return Mage_Compiler_Model_Process
 57:      */
 58:     public function getProcess()
 59:     {
 60:         return $this->_process;
 61:     }
 62: 
 63:     protected function _prepareLayout()
 64:     {
 65:         $this->setChild('run_button',
 66:             $this->getLayout()->createBlock('adminhtml/widget_button')
 67:                 ->setData(array(
 68:                     'label'     => Mage::helper('compiler')->__('Run Compilation Process'),
 69:                     'onclick'   => 'compilationForm.submit();',
 70:                     'class'     => 'save'
 71:         )));
 72: 
 73:         if (defined('COMPILER_INCLUDE_PATH')) {
 74:             $this->setChild('change_status_button',
 75:                 $this->getLayout()->createBlock('adminhtml/widget_button')
 76:                     ->setData(array(
 77:                         'label'     => Mage::helper('compiler')->__('Disable'),
 78:                         'onclick' => 'setLocation(\'' . $this->getUrl('*/compiler_process/disable') . '\')',
 79:                         'class'     => 'save'
 80:             )));
 81:         } else {
 82:             $this->setChild('change_status_button',
 83:                 $this->getLayout()->createBlock('adminhtml/widget_button')
 84:                     ->setData(array(
 85:                         'label'     => Mage::helper('compiler')->__('Enable'),
 86:                         'onclick' => 'setLocation(\'' . $this->getUrl('*/compiler_process/enable') . '\')',
 87:                         'class'     => 'save'
 88:             )));
 89:         }
 90: 
 91:         return parent::_prepareLayout();
 92:     }
 93: 
 94:     /**
 95:      * Get page header text
 96:      *
 97:      * @return string
 98:      */
 99:     protected function getHeader()
100:     {
101:         return Mage::helper('compiler')->__('Compilation');
102:     }
103: 
104:     public function getChangeStatusButtonHtml()
105:     {
106:         if ($this->getCollectedFilesCount()) {
107:             return $this->getChildHtml('change_status_button');
108:         }
109:         return '';
110:     }
111: 
112:     /**
113:      * Get html code of rum button
114:      *
115:      * @return string
116:      */
117:     protected function getRunButtonHtml()
118:     {
119:         return $this->getChildHtml('run_button');
120:     }
121: 
122:     /**
123:      * Get process run url
124:      *
125:      * @return string
126:      */
127:     public function getRunFormAction()
128:     {
129:         return $this->getUrl('*/compiler_process/recompile');
130:     }
131: 
132:     /**
133:      * Check if compilation proecss is allowed
134:      *
135:      * @return bool
136:      */
137:     public function canRunCompilation()
138:     {
139:         return empty($this->_validationResult);
140:     }
141: 
142:     /**
143:      * Get messages block
144:      *
145:      * @return Mage_Core_Block_Messages
146:      */
147:     public function getMessagesBlock()
148:     {
149:         $block = $this->getLayout()->createBlock('core/messages');
150:         foreach ($this->_validationResult as $message) {
151:             $block->addError($message);
152:         }
153:         return $block;
154:     }
155: 
156:     public function getCompilationList()
157:     {
158:         return $this->getProcess()->getCompileClassList();
159:     }
160: 
161:     public function arrToSting($arr)
162:     {
163:         return implode("\n", $arr);
164:     }
165: 
166:     public function getCompilerState()
167:     {
168:         if ($this->getCollectedFilesCount() > 0) {
169:             return $this->__('Compiled');
170:         } else {
171:             return $this->__('Not Compiled');
172:         }
173:     }
174: 
175:     public function getCompilerStatus()
176:     {
177:         if (defined('COMPILER_INCLUDE_PATH')) {
178:             return $this->__('Enabled');
179:         } else {
180:             return $this->__('Disabled');
181:         }
182:     }
183: 
184:     public function getCollectedFilesCount()
185:     {
186:         if (!$this->hasData('collected_files_count')) {
187:             $this->setData('collected_files_count', $this->getProcess()->getCollectedFilesCount());
188:         }
189:         return $this->_getData('collected_files_count');
190:     }
191: 
192:     public function getCompiledFilesCount()
193:     {
194:         if (!$this->hasData('compiled_files_count')) {
195:             $this->setData('compiled_files_count', $this->getProcess()->getCompiledFilesCount());
196:         }
197:         return $this->_getData('compiled_files_count');
198:     }
199: }
200: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0