Class Mage_Core_Model_Design_Package

Description

Magento

NOTICE OF LICENSE

This source file is subject to the Open Software License (OSL 3.0) that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://opensource.org/licenses/osl-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 [email protected] 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.

Located in /Core/Model/Design/Package.php (line 28)


	
			
Class Constant Summary
BASE_PACKAGE = 'base'
DEFAULT_AREA = 'frontend'
DEFAULT_PACKAGE = 'default'
DEFAULT_THEME = 'default'
FALLBACK_THEME = 'default'
Variable Summary
string $_area
mixed $_config
string $_name
string $_rootDir
string $_theme
Method Summary
static void getPackageByUserAgent ( $rules, [string $regexpsConfigPath = 'path_mock'])
string beforeMergeCss (string $file, string $contents)
void designPackageExists ( $packageName, [ $area = self::DEFAULT_AREA])
unknown getArea ()
void getBaseDir ( $params)
void getDefaultTheme ()
string getFallbackTheme ()
string getFilename (string $file,  $params)
void getLayoutFilename ( $file, [ $params = array()])
void getLocaleBaseDir ([ $params = array()])
void getLocaleFileName ( $file, [ $params = array()])
string getMergedCssUrl ($files $files)
string getMergedJsUrl ($files $files)
array getPackageList ()
string getPackageName ()
void getSkinBaseDir ([ $params = array()])
void getSkinBaseUrl ([ $params = array()])
string getSkinUrl ([string $file = null], [ $params = array()])
string|integer|Mage_Core_Model_Store getStore ()
void getTemplateFilename ( $file, [ $params = array()])
void getTheme ( $type)
string getThemeList ([string $package = null])
array setAllGetOld (array $storePackageArea)
void updateParamDefaults ( &$params)
string|false validateFile (string $file,  $params)
mixed _checkUserAgentAgainstRegexps (string $regexpsConfigPath)
string _cssMergerImportCallback (array $match)
string _cssMergerUrlCallback (array $match)
string _fallback (string $file,  &$params, [ $fallbackScheme = array(array())])
void _initMergerDir (string $dirRelativeName, [bool $cleanup = false])
bool|string _mergeFiles ( $srcFiles, [string|false $targetFile = false], [bool $mustMerge = false], [callback $beforeMergeCallback = null], [array|string $extensionsFilter = array()])
string _prepareUrl (string $uri)
string _renderFilename (array $file,  $params)
void _setCallbackFileDir (string $file)
Variables
string $_area (line 55)

Package area

  • access: protected
string $_callbackFileDir (line 83)

Directory of the css file

Using only to transmit additional parametr in callback functions

  • access: protected
mixed $_config = null (line 85)
  • access: protected
string $_name (line 62)

Package name

  • access: protected
string $_rootDir (line 76)

Package root directory

  • access: protected
bool $_shouldFallback = true (line 92)

Whether theme/skin hierarchy should be checked via fallback mechanism

  • access: protected
string|integer|Mage_Core_Model_Store $_store = null (line 48)

Current Store for generation ofr base_dir and base_url

  • access: protected
string $_theme (line 69)

Package theme

  • access: protected
Methods
static method getPackageByUserAgent (line 585)

Return package name based on design exception rules

  • access: public
static void getPackageByUserAgent ( $rules, [string $regexpsConfigPath = 'path_mock'])
  • array $rules: - design exception rules
  • string $regexpsConfigPath
beforeMergeCss (line 734)

Before merge css callback function

  • access: public
string beforeMergeCss (string $file, string $contents)
  • string $file
  • string $contents
cleanMergedJsCss (line 694)

Remove all merged js/css files

  • access: public
bool cleanMergedJsCss ()
designPackageExists (line 213)
  • access: public
void designPackageExists ( $packageName, [ $area = self::DEFAULT_AREA])
  • $packageName
  • $area
getArea (line 136)

Retrieve package area

  • access: public
unknown getArea ()
getBaseDir (line 295)
  • access: public
void getBaseDir ( $params)
  • array $params
getDefaultTheme (line 270)
  • access: public
void getDefaultTheme ()
getFallbackTheme (line 434)

Default theme getter

  • access: public
string getFallbackTheme ()
getFilename (line 417)

Use this one to get existing file name with fallback to default

$params['_type'] is required

  • access: public
string getFilename (string $file,  $params)
  • string $file
  • array $params
getLayoutFilename (line 439)
  • access: public
void getLayoutFilename ( $file, [ $params = array()])
  • $file
  • array $params
getLocaleBaseDir (line 312)
  • access: public
void getLocaleBaseDir ([ $params = array()])
  • array $params
getLocaleFileName (line 451)
  • access: public
void getLocaleFileName ( $file, [ $params = array()])
  • $file
  • array $params
getMergedCssUrl (line 630)

Merge specified css files and return URL to the merged file on success

  • access: public
string getMergedCssUrl ($files $files)
  • $files $files
getMergedJsUrl (line 611)

Merge specified javascript files and return URL to the merged file on success

  • access: public
string getMergedJsUrl ($files $files)
  • $files $files
getPackageList (line 490)

Design packages list getter

  • access: public
array getPackageList ()
getPackageName (line 205)

Retrieve package name

  • access: public
string getPackageName ()
getSkinBaseDir (line 303)
  • access: public
void getSkinBaseDir ([ $params = array()])
  • array $params
getSkinBaseUrl (line 322)
  • access: public
void getSkinBaseUrl ([ $params = array()])
  • array $params
getSkinUrl (line 464)

Get skin file url

  • access: public
string getSkinUrl ([string $file = null], [ $params = array()])
  • string $file
  • array $params
getStore (line 111)

Retrieve store

  • access: public
string|integer|Mage_Core_Model_Store getStore ()
getTemplateFilename (line 445)
  • access: public
void getTemplateFilename ( $file, [ $params = array()])
  • $file
  • array $params
getTheme (line 245)
  • access: public
void getTheme ( $type)
  • $type
getThemeList (line 501)

Design package (optional) themes list getter

  • access: public
string getThemeList ([string $package = null])
  • string $package
setAllGetOld (line 182)

Set store/package/area at once, and get respective values, that were before

$storePackageArea must be assoc array. The keys may be: 'store', 'package', 'area'

  • access: public
array setAllGetOld (array $storePackageArea)
  • array $storePackageArea
setArea (line 125)

Set package area

  • access: public
Mage_Core_Model_Design_Package setArea (string $area)
  • string $area
setPackageName (line 151)

Set package name In case of any problem, the default will be set.

  • access: public
Mage_Core_Model_Design_Package setPackageName ([string $name = ''])
  • string $name
setStore (line 100)

Set store

  • access: public
Mage_Core_Model_Design_Package setStore (string|integer|Mage_Core_Model_Store $store)
setTheme (line 226)

Declare design package theme params

Polymorph method: 1) if 1 parameter specified, sets everything to this value 2) if 2 parameters, treats 1st as key and 2nd as value

  • access: public
updateParamDefaults (line 275)
  • access: public
void updateParamDefaults ( &$params)
  • array &$params
validateFile (line 345)

Check whether requested file exists in specified theme params

Possible params:

  • _type: layout|template|skin|locale
  • _package: design package, if not set = default
  • _theme: if not set = default
  • _file: path relative to theme root

  • see: Mage_Core_Model_Config::getBaseDir
  • access: public
string|false validateFile (string $file,  $params)
  • string $file
  • array $params
_checkUserAgentAgainstRegexps (line 554)

Get regex rules from config and check user-agent against them

Rules must be stored in config as a serialized array(['regexp']=>'...', ['value'] => '...') Will return false or found string.

  • access: protected
mixed _checkUserAgentAgainstRegexps (string $regexpsConfigPath)
  • string $regexpsConfigPath
_cssMergerImportCallback (line 764)

Callback function replaces relative links for @import matches in css file

  • access: protected
string _cssMergerImportCallback (array $match)
  • array $match
_cssMergerUrlCallback (line 778)

Callback function replaces relative links for url() matches in css file

  • access: protected
string _cssMergerUrlCallback (array $match)
  • array $match
_fallback (line 392)

Check for files existence by specified scheme

If fallback enabled, the first found file will be returned. Otherwise the base package / default theme file, regardless of found or not. If disabled, the lookup won't be performed to spare filesystem calls.

  • access: protected
string _fallback (string $file,  &$params, [ $fallbackScheme = array(array())])
  • string $file
  • array &$params
  • array $fallbackScheme
_initMergerDir (line 708)

Make sure merger dir exists and writeable Also can clean it up

  • access: protected
void _initMergerDir (string $dirRelativeName, [bool $cleanup = false])
  • string $dirRelativeName
  • bool $cleanup
_mergeFiles (line 667)

Merges files into one and saves it into DB (if DB file storage is on)

bool|string _mergeFiles ( $srcFiles, [string|false $targetFile = false], [bool $mustMerge = false], [callback $beforeMergeCallback = null], [array|string $extensionsFilter = array()])
  • array $srcFiles
  • string|false $targetFile: - file path to be written
  • bool $mustMerge
  • callback $beforeMergeCallback
  • array|string $extensionsFilter
_prepareUrl (line 793)

Prepare url for css replacement

  • access: protected
string _prepareUrl (string $uri)
  • string $uri
_renderFilename (line 362)

Get filename by specified theme parameters

  • access: protected
string _renderFilename (array $file,  $params)
  • array $file
  • $params $params
_setCallbackFileDir (line 752)

Set file dir for css file

  • access: protected
void _setCallbackFileDir (string $file)
  • string $file
Class Constants
BASE_PACKAGE = 'base' (line 33)
DEFAULT_AREA = 'frontend' (line 30)
DEFAULT_PACKAGE = 'default' (line 31)
DEFAULT_THEME = 'default' (line 32)
FALLBACK_THEME = 'default' (line 38)
  • deprecated: after 1.4.0.0-alpha3

Documentation generated on Fri, 11 Feb 2011 17:09:30 +0200 by phpDocumentor 1.4.3