Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
getItem ($id) | |
unpublishMessage ($id) | |
archiveMessage ($id) | |
republishMessage ($id) | |
getExtensionName ($eid) | |
resetMessages ($eid) | |
hideMessages ($eid) | |
getComponentOptions () | |
addPostInstallationMessage (array $options) | |
getJoomlaFilesExtensionId () | |
Fonctions membres publiques hérités de BaseDatabaseModel | |
__construct ($config=array(), MVCFactoryInterface $factory=null) | |
getTable ($name='', $prefix='', $options=array()) | |
isCheckedOut ($item) | |
getDbo () | |
setDbo (DatabaseInterface $db=null) | |
__get ($name) | |
Fonctions membres publiques hérités de BaseModel | |
__construct ($config=array()) | |
getName () | |
Fonctions membres publiques hérités de CMSObject | |
__construct ($properties=null) | |
__toString () | |
def ($property, $default=null) | |
get ($property, $default=null) | |
getProperties ($public=true) | |
getError ($i=null, $toString=true) | |
getErrors () | |
set ($property, $value=null) | |
setProperties ($properties) | |
setError ($error) | |
Fonctions membres publiques hérités de StatefulModelInterface | |
getState ($property=null, $default=null) | |
setState ($property, $value=null) | |
Fonctions membres publiques hérités de DispatcherAwareInterface | |
setDispatcher (DispatcherInterface $dispatcher) | |
Fonctions membres publiques hérités de CurrentUserInterface | |
setCurrentUser (User $currentUser) | |
Fonctions membres publiques hérités de CacheControllerFactoryAwareInterface | |
setCacheControllerFactory (CacheControllerFactoryInterface $factory) | |
Fonctions membres publiques hérités de DatabaseAwareInterface | |
setDatabase (DatabaseInterface $db) | |
Fonctions membres protégées | |
populateState () | |
onProcessList (&$resultArray) | |
Fonctions membres protégées hérités de BaseDatabaseModel | |
_getList ($query, $limitstart=0, $limit=0) | |
_getListCount ($query) | |
_createTable ($name, $prefix='Table', $config=array()) | |
bootComponent ($component) | |
dispatchEvent (EventInterface $event) | |
Membres hérités additionnels | |
Fonctions membres publiques statiques hérités de BaseModel | |
static | addIncludePath ($path='', $prefix='') |
Attributs protégés hérités de BaseDatabaseModel | |
$option = null | |
$event_clean_cache = null | |
Attributs protégés hérités de BaseModel | |
$name | |
Attributs protégés hérités de CMSObject | |
$_errors = array() | |
Attributs protégés statiques hérités de BaseModel | |
static | $paths |
Model class to manage postinstall messages
addPostInstallationMessage | ( | array | $options | ) |
Adds or updates a post-installation message (PIM) definition. You can use this in your post-installation script using this code:
require_once JPATH_LIBRARIES . '/fof/include.php'; FOFModel::getTmpInstance('Messages', 'PostinstallModel')->addPostInstallationMessage($options);
The $options array contains the following mandatory keys:
extension_id The numeric ID of the extension this message is for (see the #__extensions table)
type One of message, link or action. Their meaning is: message Informative message. The user can dismiss it. link The action button links to a URL. The URL is defined in the action parameter. action A PHP action takes place when the action button is clicked. You need to specify the action_file (RAD path to the PHP file) and action (PHP function name) keys. See below for more information.
title_key The Text language key for the title of this PIM. Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_TITLE
description_key The Text language key for the main body (description) of this PIM Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_DESCRIPTION
action_key The Text language key for the action button. Ignored and not required when type=message Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_ACTION
language_extension The extension name which holds the language keys used above. For example, com_foobar, mod_something, plg_system_whatever, tpl_mytemplate
language_client_id Should we load the frontend (0) or backend (1) language keys?
version_introduced Which was the version of your extension where this message appeared for the first time? Example: 3.2.1
enabled Must be 1 for this message to be enabled. If you omit it, it defaults to 1.
condition_file The RAD path to a PHP file containing a PHP function which determines whether this message should be shown to the user.
condition_method The name of a PHP function which will be used to determine whether to show this message to the user. This must be a simple PHP user function (not a class method, static method etc) which returns true to show the message and false to hide it. This function is defined in the condition_file. Example: com_foobar_postinstall_messageone_condition
When type=message no additional keys are required.
When type=link the following additional keys are required:
action The URL which will open when the user clicks on the PIM's action button Example: index.php?option=com_foobar&view=tools&task=installSampleData
When type=action the following additional keys are required:
action_file The RAD path to a PHP file containing a PHP function which performs the action of this PIM.
action The name of a PHP function which will be used to run the action of this PIM. This must be a simple PHP user function (not a class method, static method etc) which returns no result. Example: com_foobar_postinstall_messageone_action
array | $options | See description |
Références $db, $helper, $key, $options, $query, $this, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.
archiveMessage | ( | $id | ) |
Archives specified post-install message
integer | $id | The message id |
Références $db, $id, $query, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.
getComponentOptions | ( | ) |
Get the dropdown options for the list of component with post-installation messages
Références $db, $options, $query, HTMLHelper\_(), Factory\getApplication(), Joomla\Database\getDatabase(), JPATH_SITE, et null.
getExtensionName | ( | $eid | ) |
Returns the name of an extension, as registered in the #__extensions table
integer | $eid | The extension ID |
Références $basePath, $db, $extension, $lang, $query, Text\_(), Factory\getApplication(), Joomla\Database\getDatabase(), ParameterType\INTEGER, JPATH_ADMINISTRATOR, et JPATH_SITE.
getItem | ( | $id | ) |
Gets an item with the given id from the database
integer | $id | The item id |
Références $db, $id, $query, $result, Joomla\Database\getDatabase(), et ParameterType\INTEGER.
getJoomlaFilesExtensionId | ( | ) |
Returns the library extension ID.
Références ExtensionHelper\getExtensionRecord().
hideMessages | ( | $eid | ) |
Hides all messages for an extension
integer | $eid | The extension ID whose messages we'll hide |
Références $db, $query, $result, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.
|
protected |
List post-processing. This is used to run the programmatic display conditions against each list item and decide if we have to show it or not.
Do note that this a core method of the RAD Layer which operates directly on the list it's being fed. A little touch of modern magic.
array | &$resultArray | A list of items to process |
Références $hash, $helper, $item, $key, $result, File\exists(), Factory\getApplication(), JPATH_ADMINISTRATOR, et JPATH_SITE.
|
protected |
Method to auto-populate the state.
This method should only be called once per instantiation and is designed to be called on the first call to the getState() method unless the configuration flag to ignore the request is set.
Références Factory\getApplication(), Joomla\CMS\MVC\Model\populateState(), et Joomla\CMS\MVC\Model\setState().
republishMessage | ( | $id | ) |
Republishes specified post-install message
integer | $id | The message id |
Références $db, $id, $query, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.
resetMessages | ( | $eid | ) |
Resets all messages for an extension
integer | $eid | The extension ID whose messages we'll reset |
Références $db, $query, $result, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.
unpublishMessage | ( | $id | ) |
Unpublishes specified post-install message
integer | $id | The message id |
Références $db, $id, $query, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.