Mage_Compiler_Block_Process Class Reference

Inheritance diagram for Mage_Compiler_Block_Process:

Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getProcess ()
 getChangeStatusButtonHtml ()
 getRunFormAction ()
 canRunCompilation ()
 getMessagesBlock ()
 getCompilationList ()
 arrToSting ($arr)
 getCompilerState ()
 getCompilerStatus ()
 getCollectedFilesCount ()
 getCompiledFilesCount ()

Protected Member Functions

 _construct ()
 _prepareLayout ()
 getHeader ()
 getRunButtonHtml ()

Protected Attributes

 $_process
 $_validationResult


Detailed Description

Definition at line 35 of file Process.php.


Member Function Documentation

_construct (  )  [protected]

Internal constructor, that is called from real constructor

Please override this one instead of overriding real __construct constructor

Please override this one instead of overriding real __construct constructor

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 46 of file Process.php.

00047     {
00048         $this->_process = Mage::getModel('compiler/process');
00049         $this->_validationResult = $this->_process->validate();
00050         return parent::_construct();
00051     }

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 63 of file Process.php.

00064     {
00065         $this->setChild('run_button',
00066             $this->getLayout()->createBlock('adminhtml/widget_button')
00067                 ->setData(array(
00068                     'label'     => Mage::helper('compiler')->__('Run Compilation Process'),
00069                     'onclick'   => 'compilationForm.submit();',
00070                     'class'     => 'save'
00071         )));
00072 
00073         if (defined('COMPILER_INCLUDE_PATH')) {
00074             $this->setChild('change_status_button',
00075                 $this->getLayout()->createBlock('adminhtml/widget_button')
00076                     ->setData(array(
00077                         'label'     => Mage::helper('compiler')->__('Disable'),
00078                         'onclick' => 'setLocation(\'' . $this->getUrl('compiler/process/disable') . '\')',
00079                         'class'     => 'save'
00080             )));
00081         } else {
00082             $this->setChild('change_status_button',
00083                 $this->getLayout()->createBlock('adminhtml/widget_button')
00084                     ->setData(array(
00085                         'label'     => Mage::helper('compiler')->__('Enable'),
00086                         'onclick' => 'setLocation(\'' . $this->getUrl('compiler/process/enable') . '\')',
00087                         'class'     => 'save'
00088             )));
00089         }
00090 
00091         return parent::_prepareLayout();
00092     }

arrToSting ( arr  ) 

Definition at line 161 of file Process.php.

00162     {
00163         return implode("\n", $arr);
00164     }

canRunCompilation (  ) 

Check if compilation proecss is allowed

Returns:
bool

Definition at line 137 of file Process.php.

00138     {
00139         return empty($this->_validationResult);
00140     }

getChangeStatusButtonHtml (  ) 

Definition at line 104 of file Process.php.

00105     {
00106         if ($this->getCollectedFilesCount()) {
00107             return $this->getChildHtml('change_status_button');
00108         }
00109         return '';
00110     }

getCollectedFilesCount (  ) 

Definition at line 184 of file Process.php.

00185     {
00186         if (!$this->hasData('collected_files_count')) {
00187             $this->setData('collected_files_count', $this->getProcess()->getCollectedFilesCount());
00188         }
00189         return $this->_getData('collected_files_count');
00190     }

getCompilationList (  ) 

Definition at line 156 of file Process.php.

00157     {
00158         return $this->getProcess()->getCompileClassList();
00159     }

getCompiledFilesCount (  ) 

Definition at line 192 of file Process.php.

00193     {
00194         if (!$this->hasData('compiled_files_count')) {
00195             $this->setData('compiled_files_count', $this->getProcess()->getCompiledFilesCount());
00196         }
00197         return $this->_getData('compiled_files_count');
00198     }

getCompilerState (  ) 

Definition at line 166 of file Process.php.

00167     {
00168         if ($this->getCollectedFilesCount() > 0) {
00169             return $this->__('Compiled');
00170         } else {
00171             return $this->__('Not Compiled');
00172         }
00173     }

getCompilerStatus (  ) 

Definition at line 175 of file Process.php.

00176     {
00177         if (defined('COMPILER_INCLUDE_PATH')) {
00178             return $this->__('Enabled');
00179         } else {
00180             return $this->__('Disabled');
00181         }
00182     }

getHeader (  )  [protected]

Get page header text

Returns:
string

Definition at line 99 of file Process.php.

00100     {
00101         return Mage::helper('compiler')->__('Compilation (Beta)');
00102     }

getMessagesBlock (  ) 

Get messages block

Returns:
Mage_Core_Block_Messages

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 147 of file Process.php.

00148     {
00149         $block = $this->getLayout()->createBlock('core/messages');
00150         foreach ($this->_validationResult as $message) {
00151             $block->addError($message);
00152         }
00153         return $block;
00154     }

getProcess (  ) 

Get compilation process object

Returns:
Mage_Compiler_Model_Process

Definition at line 58 of file Process.php.

00059     {
00060         return $this->_process;
00061     }

getRunButtonHtml (  )  [protected]

Get html code of rum button

Returns:
string

Definition at line 117 of file Process.php.

00118     {
00119         return $this->getChildHtml('run_button');
00120     }

getRunFormAction (  ) 

Get process run url

Returns:
string

Definition at line 127 of file Process.php.

00128     {
00129         return $this->getUrl('compiler/process/recompile');
00130     }


Member Data Documentation

$_process [protected]

Definition at line 42 of file Process.php.

$_validationResult [protected]

Definition at line 43 of file Process.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:53 2009 for Magento by  doxygen 1.5.8