Class FOFPlatformJoomla

Description

Implements interfaces:

Part of the FOF Platform Abstraction Layer.

This implements the platform class for Joomla! 2.5 or later

  • since: 2.1

Located in /libraries/fof/platform/joomla.php (line 19)

FOFPlatform
   |
   --FOFPlatformJoomla
Method Summary
 boolean authorise (string $action, string $assetname)
 boolean authorizeAdmin (string $component)
 boolean clearCache ()
 string getCache (string $key, [string $default = null])
 array getComponentBaseDirs (string $component)
 string getTemplateOverridePath (string $component, [boolean $absolute = true])
 JUser getUser ([integer $id = null])
 mixed getUserStateFromRequest (string $key, string $request, FOFInput $input, [mixed $default = null], [string $type = 'none'], [boolean $setUserState = true])
 array getViewTemplatePaths (string $component, string $view, [string $layout = 'default'], [string $tpl = null], [boolean $strict = false])
 void importPlugin (string $type)
 boolean isBackend ()
 boolean isCli ()
 array isCliAdmin ()
 boolean isEnabled ()
 boolean isFrontend ()
 void loadTranslations (string $component)
 boolean loginUser (array $authInfo)
 boolean logoutUser ()
 array runPlugins (string $event, array $data)
 boolean setCache (string $key, string $content)
Variables
Methods
authorise (line 471)

Perform an ACL check.

boolean authorise (string $action, string $assetname)
  • string $action: The ACL privilege to check, e.g. core.edit
  • string $assetname: The asset name to check, typically the component's name

Redefinition of:
FOFPlatform::authorise()
Perform an ACL check.

Implementation of:
FOFPlatformInterface::authorise()
Perform an ACL check. Please note that FOF uses by default the Joomla! CMS convention for ACL privileges, e.g core.edit for the edit privilege.
authorizeAdmin (line 303)

Authorise access to the component in the back-end.

boolean authorizeAdmin (string $component)
  • string $component: The name of the component.

Redefinition of:
FOFPlatform::authorizeAdmin()
Authorise access to the component in the back-end.

Implementation of:
FOFPlatformInterface::authorizeAdmin()
By default FOF will only use the Controller's onBefore* methods to
clearCache (line 664)

Clears the cache of system-wide FOF data. You are supposed to call this in

your components' installation script post-installation and post-upgrade methods or whenever you are modifying the structure of database tables accessed by FOF. Please note that FOF's cache never expires and is not purged by Joomla!. You MUST use this method to manually purge the cache.

  • return: True on success
  • access: public
boolean clearCache ()

Redefinition of:
FOFPlatform::clearCache()
Clears the cache of system-wide FOF data. You are supposed to call this in

Implementation of:
FOFPlatformInterface::clearCache()
Clears the cache of system-wide FOF data. You are supposed to call this in
getCache (line 573)

Retrieves data from the cache. This is supposed to be used for system-side FOF data, not application data.

  • return: The cached value
  • access: public
string getCache (string $key, [string $default = null])
  • string $key: The key of the data to retrieve
  • string $default: The default value to return if the key is not found or the cache is not populated

Redefinition of:
FOFPlatform::getCache()
Retrieves data from the cache. This is supposed to be used for system-side FOF data, not application data.

Implementation of:
FOFPlatformInterface::getCache()
Retrieves data from the cache. This is supposed to be used for system-side FOF data, not application data.
getComponentBaseDirs (line 128)

Returns the base (root) directories for a given component.

array getComponentBaseDirs (string $component)
  • string $component: The name of the component. For Joomla! this is something like "com_example"

Redefinition of:
FOFPlatform::getComponentBaseDirs()
Returns the base (root) directories for a given component.

Implementation of:
FOFPlatformInterface::getComponentBaseDirs()
Returns the base (root) directories for a given component. The "component" is used in the sense of what we call "component" in Joomla!, "plugin" in WordPress and "module" in Drupal, i.e. an application which is running inside our main application (CMS).
getDocument (line 342)

Returns the JDocument object which handles this component's response.

JDocument getDocument ()

Redefinition of:
FOFPlatform::getDocument()
Returns the JDocument object which handles this component's response.

Implementation of:
FOFPlatformInterface::getDocument()
Returns the JDocument object which handles this component's response. You may also return null and FOF will a. try to figure out the output type by examining the "format" input parameter (or fall back to "html") and b.
getTemplateOverridePath (line 231)

Return the absolute path to the application's template overrides directory for a specific component. We will use it to look for template files instead of the regular component directorues. If the application does not have such a thing as template overrides return an empty string.

  • return: The path to the template overrides directory
  • access: public
string getTemplateOverridePath (string $component, [boolean $absolute = true])
  • string $component: The name of the component for which to fetch the overrides
  • boolean $absolute: Should I return an absolute or relative path?

Redefinition of:
FOFPlatform::getTemplateOverridePath()
Return the absolute path to the application's template overrides directory for a specific component. We will use it to look for template files instead of the regular component directorues. If the application does not have such a thing as template overrides return an empty string.

Implementation of:
FOFPlatformInterface::getTemplateOverridePath()
Return the absolute path to the application's template overrides directory for a specific component. We will use it to look for template files instead of the regular component directorues. If the application does not have such a thing as template overrides return an empty string.
getTemplateSuffixes (line 207)

Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version.

  • return: A plain array of suffixes to try in template names
  • access: public
array getTemplateSuffixes ()

Redefinition of:
FOFPlatform::getTemplateSuffixes()
Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version.

Implementation of:
FOFPlatformInterface::getTemplateSuffixes()
Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version.
getUser (line 330)

Return a user object.

JUser getUser ([integer $id = null])
  • integer $id: The user ID to load. Skip or use null to retrieve the object for the currently logged in user.

Redefinition of:
FOFPlatform::getUser()
Returns the JUser object for the current user

Implementation of:
FOFPlatformInterface::getUser()
Returns a user object.
getUserStateFromRequest (line 375)

This method will try retrieving a variable from the request (input) data.

mixed getUserStateFromRequest (string $key, string $request, FOFInput $input, [mixed $default = null], [string $type = 'none'], [boolean $setUserState = true])
  • string $key: The user state key for the variable
  • string $request: The request variable name for the variable
  • FOFInput $input: The FOFInput object with the request (input) data
  • mixed $default: The default value. Default: null
  • string $type: The filter type for the variable data. Default: none (no filtering)
  • boolean $setUserState: Should I set the user state with the fetched value?

Redefinition of:
FOFPlatform::getUserStateFromRequest()
This method will try retrieving a variable from the request (input) data.

Implementation of:
FOFPlatformInterface::getUserStateFromRequest()
This method will try retrieving a variable from the request (input) data.
getViewTemplatePaths (line 166)

Return a list of the view template paths for this component.

  • see: FOFPlatformInterface::getViewTemplateDirs()
  • access: public
array getViewTemplatePaths (string $component, string $view, [string $layout = 'default'], [string $tpl = null], [boolean $strict = false])
  • string $component: The name of the component. For Joomla! this is something like "com_example"
  • string $view: The name of the view you're looking a template for
  • string $layout: The layout name to load, e.g. 'default'
  • string $tpl: The sub-template name to load (null by default)
  • boolean $strict: If true, only the specified layout will be searched for. Otherwise we'll fall back to the 'default' layout if the specified layout is not found.

Redefinition of:
FOFPlatform::getViewTemplatePaths()
Return a list of the view template directories for this component.

Implementation of:
FOFPlatformInterface::getViewTemplatePaths()
Return a list of the view template paths for this component. The paths are in the format site:/component_name/view_name/layout_name or admin:/component_name/view_name/layout_name
importPlugin (line 428)

Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.

void importPlugin (string $type)
  • string $type: The type of the plugins to be loaded

Redefinition of:
FOFPlatform::importPlugin()
Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.

Implementation of:
FOFPlatformInterface::importPlugin()
Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.
isBackend (line 488)

Is this the administrative section of the component?

boolean isBackend ()

Redefinition of:
FOFPlatform::isBackend()
Is this the administrative section of the component?

Implementation of:
FOFPlatformInterface::isBackend()
Is this the administrative section of the component?
isCli (line 516)

Is this a component running in a CLI application?

boolean isCli ()

Redefinition of:
FOFPlatform::isCli()
Is this a component running in a CLI application?

Implementation of:
FOFPlatformInterface::isCli()
Is this a component running in a CLI application?
isCliAdmin (line 82)

Main function to detect if we're running in a CLI environment and we're admin

  • return: isCLI and isAdmin. It's not an associtive array, so we can use list.
  • access: protected
array isCliAdmin ()
isEnabled (line 30)

Is this platform enabled?

boolean isEnabled ()

Redefinition of:
FOFPlatform::isEnabled()
Is this platform enabled?

Implementation of:
FOFPlatformInterface::isEnabled()
Is this platform enabled? This is used for automatic platform detection.
isFrontend (line 502)

Is this the public section of the component?

boolean isFrontend ()

Redefinition of:
FOFPlatform::isFrontend()
Is this the public section of the component?

Implementation of:
FOFPlatformInterface::isFrontend()
Is this the public section of the component?
isGlobalFOFCacheEnabled (line 541)

Is the global FOF cache enabled?

  • access: public
boolean isGlobalFOFCacheEnabled ()

Redefinition of:
FOFPlatform::isGlobalFOFCacheEnabled()
Is the global FOF cache enabled?

Implementation of:
FOFPlatformInterface::isGlobalFOFCacheEnabled()
Is the global FOF cache enabled?
loadTranslations (line 276)

Load the translation files for a given component.

void loadTranslations (string $component)
  • string $component: The name of the component. For Joomla! this is something like "com_example"

Redefinition of:
FOFPlatform::loadTranslations()
Load the translation files for a given component.

Implementation of:
FOFPlatformInterface::loadTranslations()
Load the translation files for a given component. The "component" is used in the sense of what we call "component" in Joomla!, "plugin" in WordPress and "module" in Drupal, i.e. an application which is running inside our main application (CMS).
loginUser (line 678)

logs in a user

  • return: True on success
  • access: public
boolean loginUser (array $authInfo)
  • array $authInfo: authentification information

Redefinition of:
FOFPlatform::loginUser()
logs in a user

Implementation of:
FOFPlatformInterface::loginUser()
logs in a user
logoutUser (line 708)

logs out a user

  • return: True on success
  • access: public
boolean logoutUser ()

Redefinition of:
FOFPlatform::logoutUser()
logs out a user

Implementation of:
FOFPlatformInterface::logoutUser()
logs out a user
runPlugins (line 447)

Execute plugins (system-level triggers) and fetch back an array with their return values.

array runPlugins (string $event, array $data)
  • string $event: The event (trigger) name, e.g. onBeforeScratchMyEar
  • array $data: A hash array of data sent to the plugins as part of the trigger

Redefinition of:
FOFPlatform::runPlugins()
Execute plugins (system-level triggers) and fetch back an array with their return values.

Implementation of:
FOFPlatformInterface::runPlugins()
Execute plugins (system-level triggers) and fetch back an array with their return values.
setCache (line 555)

Saves something to the cache. This is supposed to be used for system-wide FOF data, not application data.

  • return: True on success
  • access: public
boolean setCache (string $key, string $content)
  • string $key: The key of the data to save
  • string $content: The actual data to save

Redefinition of:
FOFPlatform::setCache()
Saves something to the cache. This is supposed to be used for system-wide FOF data, not application data.

Implementation of:
FOFPlatformInterface::setCache()
Saves something to the cache. This is supposed to be used for system-wide FOF data, not application data.
supportsAjaxOrdering (line 531)

Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.

boolean supportsAjaxOrdering ()

Redefinition of:
FOFPlatform::supportsAjaxOrdering()
Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.

Implementation of:
FOFPlatformInterface::supportsAjaxOrdering()
Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.

Inherited Methods

Inherited From FOFPlatform

 FOFPlatform::authorise()
 FOFPlatform::authorizeAdmin()
 FOFPlatform::checkVersion()
 FOFPlatform::clearCache()
 FOFPlatform::forceInstance()
 FOFPlatform::getCache()
 FOFPlatform::getComponentBaseDirs()
 FOFPlatform::getDocument()
 FOFPlatform::getInstance()
 FOFPlatform::getOrdering()
 FOFPlatform::getTemplateOverridePath()
 FOFPlatform::getTemplateSuffixes()
 FOFPlatform::getUser()
 FOFPlatform::getUserStateFromRequest()
 FOFPlatform::getViewTemplatePaths()
 FOFPlatform::importPlugin()
 FOFPlatform::isBackend()
 FOFPlatform::isCli()
 FOFPlatform::isEnabled()
 FOFPlatform::isFrontend()
 FOFPlatform::isGlobalFOFCacheEnabled()
 FOFPlatform::loadTranslations()
 FOFPlatform::loginUser()
 FOFPlatform::logoutUser()
 FOFPlatform::registerPlatformPath()
 FOFPlatform::runPlugins()
 FOFPlatform::setCache()
 FOFPlatform::setErrorHandling()
 FOFPlatform::supportsAjaxOrdering()
 FOFPlatform::unregisterPlatformPath()

Documentation generated on Tue, 19 Nov 2013 15:06:10 +0100 by phpDocumentor 1.4.3