![]() |
Joomla CMS
3.9.25 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.9.25 et du framework Joomla Platform intégré
|
Fonctions membres publiques | |
| preflight ($type, $parent) | |
| postflight ($type, $parent) | |
| uninstall ($parent) | |
Fonctions membres protégées | |
| copyCliFiles ($parent) | |
| renderPostInstallation ($status, $fofInstallationStatus, $strapperInstallationStatus, $parent) | |
| renderPostUninstallation ($status, $parent) | |
| bugfixDBFunctionReturnedNoError () | |
| bugfixCantBuildAdminMenus () | |
| installSubextensions ($parent) | |
| uninstallSubextensions ($parent) | |
| removeFilesAndFolders ($removeList) | |
| installFOF ($parent) | |
| installStrapper ($parent) | |
| uninstallObsoleteSubextensions ($parent) | |
| addPostInstallationMessage (array $options) | |
| _applyPostInstallationMessages () | |
| uninstallPostInstallationMessages () | |
Attributs protégés | |
| $componentName = 'com_foobar' | |
| $componentTitle = 'Foobar Component' | |
| $installation_queue | |
| $uninstallation_queue | |
| $removeFilesFree | |
| $removeFilesAllVersions | |
| $cliScriptFiles | |
| $cliSourcePath = 'cli' | |
| $fofSourcePath = 'fof' | |
| $strapperSourcePath = 'strapper' | |
| $modulesSourcePath = 'modules' | |
| $pluginsSourcePath = 'plugins' | |
| $schemaXmlPathRelative = true | |
| $schemaXmlPath = 'sql/xml' | |
| $minimumPHPVersion = '5.3.3' | |
| $minimumJoomlaVersion = '2.5.6' | |
| $maximumJoomlaVersion = '3.9.99' | |
| $isPaid = false | |
| $postInstallationMessages = array() | |
Fonctions membres privées | |
| _reallyPublishAdminMenuItems ($parent) | |
A helper class which you can use to create component installation scripts
|
protected |
Applies the post-installation messages for Joomla! 3.2 or later
Références $db, $message, $query, et FOFPlatform\getInstance().
|
private |
Make sure the Component menu items are really published!
| JInstallerAdapterComponent | $parent |
Références $db, $option, $query, et FOFPlatform\getInstance().
|
protected |
Adds or updates a post-installation message (PIM) definition for Joomla! 3.2 or later. You can use this in your post-installation script using this code:
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 JText language key for the title of this PIM Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_TITLE
description_key The JText language key for the main body (description) of this PIM Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_DESCRIPTION
action_key The JText 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 front-end (0) or back-end (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
Then 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 |
| Exception |
Références $db, $key, $options, $query, FOFPlatform\getInstance(), et FOFTemplateUtils\parsePath().
|
protected |
Joomla! 1.6+ bugfix for "Can not build admin menus"
$query = $db->getQuery(true);
$query->select('id')
->from('#__menu')
->where($db->qn('type') . ' = ' . $db->q('component'))
->where($db->qn('menutype') . ' = ' . $db->q('main'))
->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName));
$db->setQuery($query);
try
{
$ids1 = $db->loadColumn();
}
catch (Exception $exc)
{
$ids1 = array();
}
if (empty($ids1))
{
$ids1 = array();
}
$query = $db->getQuery(true);
$query->select('id')
->from('#__menu')
->where($db->qn('type') . ' = ' . $db->q('component'))
->where($db->qn('menutype') . ' = ' . $db->q('main'))
->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName . '&%'));
$db->setQuery($query);
try
{
$ids2 = $db->loadColumn();
}
catch (Exception $exc)
{
$ids2 = array();
}
if (empty($ids2))
{
$ids2 = array();
}
$ids = array_merge($ids1, $ids2);
if (!empty($ids))
{
foreach ($ids as $id)
{
$query = $db->getQuery(true);
$query->delete('#__menu')
->where($db->qn('id') . ' = ' . $db->q($id));
$db->setQuery($query);
try
{
$db->execute();
}
catch (Exception $exc)
{
Nothing } } } /*
Références $db, $id, $query, et FOFPlatform\getInstance().
|
protected |
Bugfix for "DB function returned no error"
Références $db, $id, $query, et FOFPlatform\getInstance().
|
protected |
Copies the CLI scripts into Joomla!'s cli directory
| JInstaller | $parent |
Références $script, et JPATH_ROOT.
|
protected |
Installs FOF if necessary
| JInstaller | $parent | The parent object |
Références $info, $target, JPATH_LIBRARIES, et JPATH_ROOT.
|
protected |
Installs Akeeba Strapper if necessary
| JInstaller | $parent | The parent object |
Références $info, $target, et JPATH_ROOT.
|
protected |
Installs subextensions (modules, plugins) bundled with the main extension
| JInstaller | $parent |
Références $count, $db, $folder, $module, $modules, $path, $position, $published, $query, FOFUtilsCacheCleaner\clearPluginsAndModulesCache(), et FOFPlatform\getInstance().
| postflight | ( | $type, | |
| $parent | |||
| ) |
Runs after install, update or discover_update. In other words, it executes after Joomla! has finished installing or updating your component. This is the last chance you've got to perform any additional installations, clean-up, database updates and similar housekeeping functions.
| string | $type | install, update or discover_update |
| JInstaller | $parent | Parent object |
Références elseif, FOFPlatform\getInstance(), et JPATH_ADMINISTRATOR.
| preflight | ( | $type, | |
| $parent | |||
| ) |
Joomla! pre-flight event. This runs before Joomla! installs or updates the component. This is our last chance to tell Joomla! if it should abort the installation.
| string | $type | Installation type (install, update, discover_install) |
| JInstaller | $parent | Parent object |
Références $type, $version, elseif, et JError\raiseWarning().
|
protected |
Removes obsolete files and folders
| array | $removeList | The files and directories to remove |
Références $file, $folder, et JPATH_ROOT.
|
protected |
|
protected |
| uninstall | ( | $parent | ) |
Runs on uninstallation
| JInstaller | $parent | The parent object |
Références JPATH_ADMINISTRATOR.
|
protected |
Uninstalls obsolete subextensions (modules, plugins) bundled with the main extension
| JInstaller | $parent | The parent object |
Références $db, $folder, $id, $module, $modules, FOFPlatform\getInstance(), et JLoader\import().
|
protected |
Références $db, $query, et FOFPlatform\getInstance().
|
protected |
Uninstalls subextensions (modules, plugins) bundled with the main extension
| JInstaller | $parent | The parent object |
Références $db, $folder, $id, $module, $modules, $published, FOFUtilsCacheCleaner\clearPluginsAndModulesCache(), et FOFPlatform\getInstance().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |