Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques statiques | |
static & | getAnInstance ($option=null, $view=null, $config=array()) |
static & | getTmpInstance ($option=null, $view=null, $config=array()) |
static | addModelPath ($path, $prefix='') |
Fonctions membres protégées | |
addPath ($type, $path) | |
setPath ($type, $path) | |
setstate ($state=0) | |
setaccess ($level=0) | |
createModel ($name, $prefix='', $config=array()) | |
& | _createModel ($name, $prefix='', $config=array()) |
createView ($name, $prefix='', $type='', $config=array()) | |
& | _createView ($name, $prefix='', $type='', $config=array()) |
checkACL ($area) | |
onBeforeGenericTask ($task) | |
onBeforeApplySave (&$data) | |
onAfterApplySave () | |
onBeforeAccesspublic () | |
onBeforeAccessregistered () | |
onBeforeAccessspecial () | |
onBeforeAdd () | |
onBeforeApply () | |
onBeforeBrowse () | |
onBeforeCancel () | |
onBeforeEdit () | |
onBeforeOrderdown () | |
onBeforeOrderup () | |
onBeforePublish () | |
onBeforeRemove () | |
onBeforeSave () | |
onBeforeSavenew () | |
onBeforeSaveorder () | |
onBeforeUnpublish () | |
_csrfProtection () | |
Fonctions membres protégées statiques | |
static | createFileName ($type, $parts=array()) |
Attributs protégés | |
$autoRouting = 0 | |
$bareComponent = 'foobar' | |
$basePath | |
$cacheableTasks = array('browse', 'read') | |
$component = 'com_foobar' | |
$config = array() | |
$configProvider = null | |
$csrfProtection = 2 | |
$default_view | |
$doTask | |
$input = array() | |
$message | |
$messageType | |
$layout = null | |
$methods | |
$model_prefix | |
$modelName = null | |
$paths | |
$redirect | |
$task | |
$taskMap | |
$name | |
$view = '' | |
$viewName = null | |
$viewsCache = array() | |
$hasForm = false | |
Attributs protégés hérités de FOFUtilsObject | |
$_errors = array() | |
Fonctions membres privées | |
applySave () | |
Attributs privés | |
$_viewObject = null | |
$_modelObject = null | |
__construct | ( | $config = array() | ) |
Public constructor of the Controller class
array | $config | Optional configuration parameters |
Références $basePath, $config, $input, $r, elseif, FOFInflector\explode(), FOFPlatform\getInstance(), name, null, FOFInflector\singularize(), et view.
|
protected |
Method to load and return a model object.
string | $name | The name of the model. |
string | $prefix | Optional model prefix. |
array | $config | Configuration array for the model. Optional. |
Références $config, $name, $prefix, et FOFPlatform\getInstance().
|
protected |
Deprecated function to create a View object instance
string | $name | The name of the view, e.g. 'Items' |
string | $prefix | The prefix of the view, e.g. 'FoobarView' |
string | $type | The view type, e.g. 'html' |
array | $config | The configuration array for the view |
Références $config, $name, $prefix, $type, et FOFPlatform\getInstance().
|
protected |
Applies CSRF protection by means of a standard Joomla! token (nonce) check. Raises a 403 Access Forbidden error through the platform if the check fails.
TODO Move this check inside the platform
@return boolean True if the CSRF check is successful @throws Exception
Références elseif, FOFPlatform\getInstance(), et null.
accesspublic | ( | ) |
accessregistered | ( | ) |
accessspecial | ( | ) |
add | ( | ) |
|
static |
Adds to the stack of model paths in LIFO order.
mixed | $path | The directory (string) , or list of directories (array) to add. |
string | $prefix | A prefix for models |
Références $path, $prefix, et FOFModel\addIncludePath().
|
protected |
Adds to the search path for templates and resources.
string | $type | The path type (e.g. 'model', 'view'). |
mixed | $path | The directory string or stream array to search. |
Références $path, $type, et FOFPlatform\getInstance().
addViewPath | ( | $path | ) |
Add one or more view paths to the controller's stack, in LIFO order.
mixed | $path | The directory (string) or list of directories (array) to add. |
Références $path.
apply | ( | ) |
|
private |
archive | ( | ) |
Archive (set enabled = 2) an item.
authorise | ( | $task | ) |
Authorisation check
string | $task | The ACO Section Value to check access on. |
Références FOFPlatform\getInstance().
browse | ( | ) |
cancel | ( | ) |
Cancel the edit, check in the record and return to the Browse task
Références $url, null, FOFInflector\pluralize(), et view.
|
protected |
Checks if the current user has enough privileges for the requested ACL area.
string | $area | The ACL area, e.g. core.manage. |
Références $asset, $id, elseif, FOFPlatform\getInstance(), if, null, FOFInflector\singularize(), et view.
copy | ( | ) |
Duplicates selected items
Références $url, FOFPlatform\getInstance(), FOFInflector\pluralize(), et view.
|
staticprotected |
|
protected |
Creates a new model object
string | $name | The name of the model class, e.g. Items |
string | $prefix | The prefix of the model class, e.g. FoobarModel |
array | $config | The configuration parameters for the model class |
Références $config, $name, $prefix, elseif, FOFModel\getAnInstance(), et null.
|
protected |
Creates a View object instance and returns it
string | $name | The name of the view, e.g. Items |
string | $prefix | The prefix of the view, e.g. FoobarView |
string | $type | The type of the view, usually one of Html, Raw, Json or Csv |
array | $config | The configuration variables to use for creating the view |
Some administrative templates force format=utf (yeah, I know, what the heck, right?) when a format URL parameter does not exist in the URL. Of course there is no such thing as FOFViewUtf (why the heck would it be, there is no such thing as a format=utf in Joomla! for crying out loud) which causes a Fatal Error. So we have to detect that and force $type='html'...
Références $component, $config, $input, $name, $path, $prefix, $style, $suffix, $type, $view, elseif, FOFPlatform\getInstance(), FOFInflector\isPlural(), null, FOFInflector\pluralize(), et FOFInflector\singularize().
Default task. Assigns a model to the view and asks the view to render itself.
YOU MUST NOT USETHIS TASK DIRECTLY IN A URL. It is supposed to be used ONLY inside your code. In the URL, use task=browse instead.
bool | $cachable | Is this view cacheable? |
bool | $urlparams | Add your safe URL parameters (see further down in the code) |
string | $tpl | The name of the template file to parse |
Références $app, $document, $doTask, $groups, $key, $option, $user, $value, $view, FOFPlatform\getInstance(), et null.
edit | ( | ) |
Single record edit. The ID set in the request is passed to the model, then the form layout is used to edit the result.
Références $form, $item, $url, FOFInflector\pluralize(), et view.
execute | ( | $task | ) |
Executes a given controller task. The onBefore<task> and onAfter<task> methods are called automatically if they exist.
string | $task | The task to execute, e.g. "browse" |
Exception | Exception thrown if the onBefore<task> returns false |
Références $doTask, $task, FOFInflector\camelize(), elseif, FOFPlatform\getInstance(), null, task, et view.
Gets a static (Singleton) instance of a controller class. It loads the relevant controller file from the component's directory or, if it doesn't exist, creates a new controller object out of thin air.
string | $option | Component name, e.g. com_foobar |
string | $view | The view name, also used for the controller name |
array | $config | Configuration parameters |
getItemidURLSuffix | ( | ) |
Gets a URL suffix with the Itemid parameter. If it's not the front-end of the site, or if there is no Itemid set it returns an empty string.
Références FOFPlatform\getInstance().
getModel | ( | $name = '' , |
|
$prefix = '' , |
|||
$config = array() |
|||
) |
Method to get a model object, loading it if required.
string | $name | The model name. Optional. |
string | $prefix | The class prefix. Optional. |
array | $config | Configuration array for model. Optional. |
Références $app, $config, $item, $menu, $name, $params, $prefix, elseif, FOFPlatform\getInstance(), et task.
getName | ( | ) |
getTask | ( | ) |
Get the last task that is being performed or was most recently performed.
Références $task.
getTasks | ( | ) |
Gets the available tasks in the controller.
|
final |
Returns the default model associated with the current view
array | $config | Configuration variables for the model |
Références $config, $input, $parts, $prefix, elseif, FOFInflector\explode(), FOFInflector\implode(), FOFInflector\pluralize(), et view.
|
final |
Returns current view object
array | $config | Configuration variables for the model |
Références $config, $document, $input, $parts, $prefix, elseif, FOFInflector\explode(), FOFPlatform\getInstance(), FOFInflector\implode(), null, et view.
Gets a temporary instance of a controller object. A temporary instance is not a Singleton and can be disposed off after use.
string | $option | The component name, e.g. com_foobar |
string | $view | The view name, e.g. cpanel |
array | $config | Configuration parameters |
Try to find the path to this file. First try to find the format-specific controller file, e.g. foobar.json.php for format=json, then the regular one-size-fits-all controller
Références $className, $config, $format, $input, $option, $path, $suffix, $view, elseif, FOFConfigProvider\get(), FOFPlatform\getInstance(), null, FOFInflector\pluralize(), et FOFInflector\singularize().
Référencé par FOFDispatcher\dispatch().
getView | ( | $name = '' , |
|
$type = '' , |
|||
$prefix = '' , |
|||
$config = array() |
|||
) |
Method to get a reference to the current view and load it if necessary.
string | $name | The view name. Optional, defaults to the controller name. |
string | $type | The view type. Optional. |
string | $prefix | The class prefix. Optional. |
array | $config | Configuration array for view. Optional. |
Exception |
Références $config, $name, $prefix, $type, $view, et elseif.
hasRedirect | ( | ) |
Returns true if there is a redirect set in the controller
loadhistory | ( | ) |
Method to load a row from version history
Références $app, $key, $lang, $url, $view, null, FOFInflector\pluralize(), FOFInflector\singularize(), et view.
|
protected |
Execute something after applySave has run.
|
protected |
ACL check before changing the access level; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before changing the access level; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before changing the access level; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before adding a new record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before saving a new/modified record; override to customise
Références $id, FOFInflector\singularize(), et view.
|
protected |
Execute something before applySave is called. Return false to prevent applySave from executing.
array | &$data | The data upon which applySave will act |
|
protected |
ACL check before allowing someone to browse
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before cancelling an edit
Références $id, FOFInflector\singularize(), et view.
|
protected |
ACL check before editing a record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
A catch-all method for all tasks without a corresponding onBefore method. Applies the ACL preferences defined in fof.xml.
string | $task | The task being executed |
Références $task, FOFInflector\singularize(), et view.
|
protected |
ACL check before changing the ordering of a record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before changing the ordering of a record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before changing the publish status of a record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before removing a record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before saving a new/modified record; override to customise
Références $id, FOFInflector\singularize(), et view.
|
protected |
ACL check before saving a new/modified record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before changing the ordering of a record; override to customise
Références FOFInflector\singularize(), et view.
|
protected |
ACL check before changing the publish status of a record; override to customise
Références FOFInflector\singularize(), et view.
orderdown | ( | ) |
Moves selected items one position down the ordering list
Références $url, FOFInflector\pluralize(), et view.
orderup | ( | ) |
Moves selected items one position up the ordering list
Références $url, FOFInflector\pluralize(), et view.
publish | ( | ) |
Publish (set enabled = 1) an item.
read | ( | ) |
redirect | ( | ) |
Redirects the browser or returns false if no redirect is set.
Références $app.
registerDefaultTask | ( | $method | ) |
Register the default task to perform if a mapping is not found.
string | $method | The name of the method in the derived class to perform if a named task is not found. |
registerTask | ( | $task, | |
$method | |||
) |
Register (map) a task to a method in the class.
string | $task | The task. |
string | $method | The name of the method in the derived class to perform for this task. |
Références $task.
remove | ( | ) |
save | ( | ) |
Save the incoming data and then return to the Browse task
Références $url, FOFInflector\pluralize(), et view.
savenew | ( | ) |
saveorder | ( | ) |
|
protected |
setMessage | ( | $text, | |
$type = 'message' |
|||
) |
|
protected |
Registers a redirection with an optional message. The redirection is carried out when you use the redirect method.
string | $url | The URL to redirect to |
string | $msg | The message to be pushed to the application |
string | $type | The message type to be pushed to the application, e.g. 'error' |
Références $type, $url, elseif, FOFPlatform\getInstance(), et null.
|
protected |
Sets the published state (the enabled field) of the selected item(s)
integer | $state | The desired state. 0 is unpublished, 1 is published. |
Références $state, $url, FOFInflector\pluralize(), et view.
setThisModelName | ( | $modelName | ) |
Set the name of the model to be used by this Controller
string | $modelName | The name of the model |
setThisViewName | ( | $viewName | ) |
Set the name of the view to be used by this Controller
string | $viewName | The name of the view |
trash | ( | ) |
Trash (set enabled = -2) an item.
unpublish | ( | ) |
Unpublish (set enabled = 0) an item.
unregisterTask | ( | $task | ) |
Unregister (unmap) a task in the class.
string | $task | The task. |
Références $task.
|
private |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |