Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe MessagesModel
+ Graphe d'héritage de MessagesModel:

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
 

Description détaillée

Model class to manage postinstall messages

Depuis
3.2

Documentation des fonctions membres

◆ addPostInstallationMessage()

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.

Voir également
FOFTemplateUtils::parsePath() for RAD path format. Joomla! will include this file before calling the condition_method. Example: admin://components/com_foobar/helpers/postinstall.php

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.

Voir également
FOFTemplateUtils::parsePath() for RAD path format. Joomla! will include this file before calling the function defined in the action key below. Example: admin://components/com_foobar/helpers/postinstall.php

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

Paramètres
array$optionsSee description
Renvoie
$this
Exceptions

Références $db, $helper, $key, $options, $query, $this, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ archiveMessage()

archiveMessage (   $id)

Archives specified post-install message

Paramètres
integer$idThe message id
Renvoie
void
Depuis
4.2.0

Références $db, $id, $query, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ getComponentOptions()

getComponentOptions ( )

Get the dropdown options for the list of component with post-installation messages

Depuis
3.4
Renvoie
array Compatible with JHtmlSelect::genericList

Références $db, $options, $query, HTMLHelper\_(), Factory\getApplication(), Joomla\Database\getDatabase(), JPATH_SITE, et null.

◆ getExtensionName()

getExtensionName (   $eid)

Returns the name of an extension, as registered in the #__extensions table

Paramètres
integer$eidThe extension ID
Renvoie
string The extension name
Depuis
3.2

Références $basePath, $db, $extension, $lang, $query, Text\_(), Factory\getApplication(), Joomla\Database\getDatabase(), ParameterType\INTEGER, JPATH_ADMINISTRATOR, et JPATH_SITE.

◆ getItem()

getItem (   $id)

Gets an item with the given id from the database

Paramètres
integer$idThe item id
Renvoie
Object
Depuis
3.2

Références $db, $id, $query, $result, Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ getJoomlaFilesExtensionId()

getJoomlaFilesExtensionId ( )

Returns the library extension ID.

Renvoie
integer
Depuis
4.0.0

Références ExtensionHelper\getExtensionRecord().

◆ hideMessages()

hideMessages (   $eid)

Hides all messages for an extension

Paramètres
integer$eidThe extension ID whose messages we'll hide
Renvoie
mixed False if we fail, a db cursor otherwise
Depuis
3.8.7

Références $db, $query, $result, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ onProcessList()

onProcessList ( $resultArray)
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.

Paramètres
array&$resultArrayA list of items to process
Renvoie
void
Depuis
3.2

Références $hash, $helper, $item, $key, $result, File\exists(), Factory\getApplication(), JPATH_ADMINISTRATOR, et JPATH_SITE.

◆ populateState()

populateState ( )
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.

Renvoie
void
Note
Calling getState in this method will result in recursion.
Depuis
4.0.0

Références Factory\getApplication(), Joomla\CMS\MVC\Model\populateState(), et Joomla\CMS\MVC\Model\setState().

◆ republishMessage()

republishMessage (   $id)

Republishes specified post-install message

Paramètres
integer$idThe message id
Renvoie
void
Depuis
4.2.0

Références $db, $id, $query, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ resetMessages()

resetMessages (   $eid)

Resets all messages for an extension

Paramètres
integer$eidThe extension ID whose messages we'll reset
Renvoie
mixed False if we fail, a db cursor otherwise
Depuis
3.2

Références $db, $query, $result, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ unpublishMessage()

unpublishMessage (   $id)

Unpublishes specified post-install message

Paramètres
integer$idThe message id
Renvoie
void

Références $db, $id, $query, Factory\getCache(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.


La documentation de cette classe a été générée à partir du fichier suivant :