Mage_Core_Model_App_Area Class Reference

List of all members.

Public Member Functions

 __construct ($areaCode, $application)
 getApplication ()
 load ($part=null)

Public Attributes

const AREA_GLOBAL = 'global'
const AREA_FRONTEND = 'frontend'
const AREA_ADMIN = 'admin'
const PART_CONFIG = 'config'
const PART_EVENTS = 'events'
const PART_TRANSLATE = 'translate'
const PART_DESIGN = 'design'

Protected Member Functions

 _loadPart ($part)
 _initConfig ()
 _initEvents ()
 _initTranslate ()
 _initDesign ()

Protected Attributes

 $_loadedParts
 $_code
 $_application


Detailed Description

Application area nodel

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Area.php.


Constructor & Destructor Documentation

__construct ( areaCode,
application 
)

Definition at line 64 of file Area.php.

00065     {
00066         $this->_code = $areaCode;
00067         $this->_application = $application;
00068     }


Member Function Documentation

_initConfig (  )  [protected]

Definition at line 131 of file Area.php.

00132     {
00133 
00134     }

_initDesign (  )  [protected]

Definition at line 149 of file Area.php.

00150     {
00151         $designPackage = Mage::getSingleton('core/design_package');
00152         if ($designPackage->getArea() != self::AREA_FRONTEND)
00153             return;
00154 
00155         $currentStore = Mage::app()->getStore()->getStoreId();
00156 
00157         $designChange = Mage::getSingleton('core/design')
00158             ->loadChange($currentStore);
00159 
00160         if ($designChange->getData()) {
00161             $designPackage->setPackageName($designChange->getPackage())
00162                 ->setTheme($designChange->getTheme());
00163         }
00164     }

_initEvents (  )  [protected]

Definition at line 136 of file Area.php.

00137     {
00138         Mage::app()->addEventArea($this->_code);
00139         #Mage::app()->getConfig()->loadEventObservers($this->_code);
00140         return $this;
00141     }

_initTranslate (  )  [protected]

Definition at line 143 of file Area.php.

00144     {
00145         Mage::app()->getTranslator()->init($this->_code);
00146         return $this;
00147     }

_loadPart ( part  )  [protected]

Loading part of area

Parameters:
string $part
Returns:
Mage_Core_Model_App_Area

Definition at line 106 of file Area.php.

00107     {
00108         if (isset($this->_loadedParts[$part])) {
00109             return $this;
00110         }
00111         Varien_Profiler::start('mage::dispatch::controller::action::predispatch::load_area::'.$this->_code.'::'.$part);
00112         switch ($part) {
00113             case self::PART_CONFIG:
00114                 $this->_initConfig();
00115                 break;
00116             case self::PART_EVENTS:
00117                 $this->_initEvents();
00118                 break;
00119             case self::PART_TRANSLATE:
00120                 $this->_initTranslate();
00121                 break;
00122             case self::PART_DESIGN:
00123                 $this->_initDesign();
00124                 break;
00125         }
00126         $this->_loadedParts[$part] = true;
00127         Varien_Profiler::stop('mage::dispatch::controller::action::predispatch::load_area::'.$this->_code.'::'.$part);
00128         return $this;
00129     }

getApplication (  ) 

Retrieve area application

Returns:
Mage_Core_Model_App

Definition at line 75 of file Area.php.

00076     {
00077         return $this->_application;
00078     }

load ( part = null  ) 

Load area data

Parameters:
string|null $part
Returns:
Mage_Core_Model_App_Area

Definition at line 86 of file Area.php.

00087     {
00088         if (is_null($part)) {
00089             $this->_loadPart(self::PART_CONFIG)
00090                 ->_loadPart(self::PART_EVENTS)
00091                 ->_loadPart(self::PART_DESIGN)
00092                 ->_loadPart(self::PART_TRANSLATE);
00093         }
00094         else {
00095             $this->_loadPart($part);
00096         }
00097         return $this;
00098     }


Member Data Documentation

$_application [protected]

Definition at line 62 of file Area.php.

$_code [protected]

Definition at line 55 of file Area.php.

$_loadedParts [protected]

Definition at line 48 of file Area.php.

const AREA_ADMIN = 'admin'

Definition at line 36 of file Area.php.

const AREA_FRONTEND = 'frontend'

Definition at line 35 of file Area.php.

const AREA_GLOBAL = 'global'

Definition at line 34 of file Area.php.

const PART_CONFIG = 'config'

Definition at line 38 of file Area.php.

const PART_DESIGN = 'design'

Definition at line 41 of file Area.php.

const PART_EVENTS = 'events'

Definition at line 39 of file Area.php.

const PART_TRANSLATE = 'translate'

Definition at line 40 of file Area.php.


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

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