SM-Joomla-Starthilfen:Joomla Plugins: Unterschied zwischen den Versionen

Aus jsm-wiki.diddipoeler.de
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „Ereignisse in den Plugins System plugin 1) onBeforeRender() 2) onAfterRender() 3) onAfterRoute() 4) onAfterDispatch() These events are triggered in 'JAdminist…“)
 
Zeile 1: Zeile 1:
Ereignisse in den Plugins
=System plugin=


System plugin
#''' onBeforeRender()'''
1) onBeforeRender()
#''' onAfterRender()'''
2) onAfterRender()
#''' onAfterRoute()'''
3) onAfterRoute()
#''' onAfterDispatch()
4) onAfterDispatch()
These events are triggered in 'JAdministrator' class in file 'application.php' at location
These events are triggered in 'JAdministrator' class in file 'application.php' at location
'Joomla_base\administrator\includes'.
'Joomla_base\administrator\includes'.'''
5) onAfterInitialise()
#''' onAfterInitialise()
This event is triggered in 'JApplication' class in file 'application.php' at location
This event is triggered in 'JApplication' class in file 'application.php' at location
'Joomla_base\libraries\joomla\application'.
'Joomla_base\libraries\joomla\application'.'''


Content plugin
=Content plugin=
content events are triggered during content creation process.
content events are triggered during content creation process.
1) onContentPrepare($context, &$item, &$params, $offset)
#'''  onContentPrepare($context, &$item, &$params, $offset)
2) onContentAfterTitle($context, &$item, &$params, $offset)
#'''  onContentAfterTitle($context, &$item, &$params, $offset)
3) onContentBeforeDisplay($context, &$item, &$params, $offset)
#'''  onContentBeforeDisplay($context, &$item, &$params, $offset)
4) onContentAfterDisplay($context, &$item, &$params, $offset)
#'''  onContentAfterDisplay($context, &$item, &$params, $offset)
These events are triggered in 'ContentViewArticle' class in file 'view.html.php' at location
These events are triggered in 'ContentViewArticle' class in file 'view.html.php' at location
'Joomla_base\components\com_content\views\article'.
'Joomla_base\components\com_content\views\article'.
Zeile 25: Zeile 24:
$offset = It is the integer which determines the 'page' of the content that is to be generated.
$offset = It is the integer which determines the 'page' of the content that is to be generated.
$context - It is the context where this event was triggered(example,'com_content.article').
$context - It is the context where this event was triggered(example,'com_content.article').
5) onContentPrepareForm($form, $data)
#'''  onContentPrepareForm($form, $data)
6) onContentPrepareData($context, $data)
#'''  onContentPrepareData($context, $data)
These events are triggered in 'ContactModelContact' class in file 'contact.php' at location
These events are triggered in 'ContactModelContact' class in file 'contact.php' at location
'Joomla_base\components\com_contact\models'.
'Joomla_base\components\com_contact\models'.
Zeile 34: Zeile 33:
$context - It is the context where this event was triggered(example,'com_users.profile').
$context - It is the context where this event was triggered(example,'com_users.profile').


User plugin
=User plugin=
1) onUserLogin($response, $options)
#'''  onUserLogin($response, $options)
2) onUserLoginFailure($response)
#'''  onUserLoginFailure($response)
3) onUserLogout($parameters, $options)
#'''  onUserLogout($parameters, $options)
4) onUserLogoutFailure($parameters)
#'''  onUserLogoutFailure($parameters)
These events are triggered in 'JApplication' class in file 'application.php' at location
These events are triggered in 'JApplication' class in file 'application.php' at location
'Joomla_base\libraries\joomla\application'.
'Joomla_base\libraries\joomla\application'.
5) onUserBeforeSave($getproperties, $isNew, $properties)
#'''  onUserBeforeSave($getproperties, $isNew, $properties)
6) onUserAfterSave($getproperties, $isNew, $result, $error)
#'''  onUserAfterSave($getproperties, $isNew, $result, $error)
7) onUserBeforeDelete($getproperties)
#'''  onUserBeforeDelete($getproperties)
8) onUserAfterDelete($getproperties,$result, $error)
#'''  onUserAfterDelete($getproperties,$result, $error)
These events are triggered in 'JUser' class in file 'user.php' at location
These events are triggered in 'JUser' class in file 'user.php' at location
'Joomla_base\libraries\joomla\user'.
'Joomla_base\libraries\joomla\user'.


Authentication plugin
=Authentication plugin=
1) onUserAuthorisation($response, $options)
#'''  onUserAuthorisation($response, $options)
This event is triggered in 'JAuthentication' class in file 'authentication.php' at location
This event is triggered in 'JAuthentication' class in file 'authentication.php' at location
'Joomla_base\libraries\joomla\user'.
'Joomla_base\libraries\joomla\user'.
Zeile 55: Zeile 54:
$response = response including username of the user to authorise
$response = response including username of the user to authorise
$options = list of options
$options = list of options
2) onUserAuthorisationFailure($authorisation)
#'''  onUserAuthorisationFailure($authorisation)
This event is triggered in 'JApplication' class in file 'application.php' at location
This event is triggered in 'JApplication' class in file 'application.php' at location
'Joomla_base\libraries\joomla\application'.
'Joomla_base\libraries\joomla\application'.


Editors plugin
=Editors plugin=
1) onInit()
#'''  onInit()
2) onSave($id)
#'''  onSave($id)
3) onSetContent($id)
#'''  onSetContent($id)
4) onCustomEditorButton (editors-xtd)
#'''  onCustomEditorButton (editors-xtd)
5) onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null,
#'''  onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null,
$author = null, $params = array())
$author = null, $params = array())
6) onGetContent($id)
#'''  onGetContent($id)
7) onGetInsertMethod($name)
#'''  onGetInsertMethod($name)
Search plugin
 
1) onContentSearch($keyword,$match,$ordering,$areas)
 
2) onContentSearchAreas()
=Search plugin=
#'''  onContentSearch($keyword,$match,$ordering,$areas)
#'''  onContentSearchAreas()
These events are triggered in 'SearchModelSearch' class in file 'search.php' at location
These events are triggered in 'SearchModelSearch' class in file 'search.php' at location
'Joomla_base\components\com_search\models'.
'Joomla_base\components\com_search\models'.


Contact plugin
=Contact plugin=
These events are triggered during contact form submission. These events are triggered in
These events are triggered during contact form submission. These events are triggered in
'ContactControllerContact' class in file 'contact.php' at location
'ContactControllerContact' class in file 'contact.php' at location
'Joomla_base\components\com_contact\controllers'.
'Joomla_base\components\com_contact\controllers'.
1) onSubmitContact(&$contact, &$data) - Triggered when passed form Validation.
#'''  onSubmitContact(&$contact, &$data) - Triggered when passed form Validation.
2) onValidateContact(&$contact, &$data) - Triggered when form Validation succeeded.An example would be validating a captcha.
#'''  onValidateContact(&$contact, &$data) - Triggered when form Validation succeeded.An example would be validating a captcha.
Where,
Where,
$contact = It is reference to the person submitting contact.
$contact = It is reference to the person submitting contact.
$data = It is reference to the POST variable defined as below.
$data = It is reference to the POST variable defined as below.
$data = JRequest::getVar('jform', array(), 'post', 'array');
$data = JRequest::getVar('jform', array(), 'post', 'array');

Version vom 26. Januar 2014, 10:02 Uhr

System plugin

  1. onBeforeRender()
  2. onAfterRender()
  3. onAfterRoute()
  4. onAfterDispatch()

These events are triggered in 'JAdministrator' class in file 'application.php' at location 'Joomla_base\administrator\includes'.

  1. onAfterInitialise()

This event is triggered in 'JApplication' class in file 'application.php' at location 'Joomla_base\libraries\joomla\application'.

Content plugin

content events are triggered during content creation process.

  1. onContentPrepare($context, &$item, &$params, $offset)
  2. onContentAfterTitle($context, &$item, &$params, $offset)
  3. onContentBeforeDisplay($context, &$item, &$params, $offset)
  4. onContentAfterDisplay($context, &$item, &$params, $offset)

These events are triggered in 'ContentViewArticle' class in file 'view.html.php' at location 'Joomla_base\components\com_content\views\article'. where, $item = It is reference to the article being rendered by the view. $params = It is reference to the array of relevant parameters as determined by the view. $offset = It is the integer which determines the 'page' of the content that is to be generated. $context - It is the context where this event was triggered(example,'com_content.article').

  1. onContentPrepareForm($form, $data)
  2. onContentPrepareData($context, $data)

These events are triggered in 'ContactModelContact' class in file 'contact.php' at location 'Joomla_base\components\com_contact\models'. where, $form - It is the JForm Object to be displayed. $data - It is the object containing data for the form . $context - It is the context where this event was triggered(example,'com_users.profile').

User plugin

  1. onUserLogin($response, $options)
  2. onUserLoginFailure($response)
  3. onUserLogout($parameters, $options)
  4. onUserLogoutFailure($parameters)

These events are triggered in 'JApplication' class in file 'application.php' at location 'Joomla_base\libraries\joomla\application'.

  1. onUserBeforeSave($getproperties, $isNew, $properties)
  2. onUserAfterSave($getproperties, $isNew, $result, $error)
  3. onUserBeforeDelete($getproperties)
  4. onUserAfterDelete($getproperties,$result, $error)

These events are triggered in 'JUser' class in file 'user.php' at location 'Joomla_base\libraries\joomla\user'.

Authentication plugin

  1. onUserAuthorisation($response, $options)

This event is triggered in 'JAuthentication' class in file 'authentication.php' at location 'Joomla_base\libraries\joomla\user'. where, $response = response including username of the user to authorise $options = list of options

  1. onUserAuthorisationFailure($authorisation)

This event is triggered in 'JApplication' class in file 'application.php' at location 'Joomla_base\libraries\joomla\application'.

Editors plugin

  1. onInit()
  2. onSave($id)
  3. onSetContent($id)
  4. onCustomEditorButton (editors-xtd)
  5. onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null,

$author = null, $params = array())

  1. onGetContent($id)
  2. onGetInsertMethod($name)


Search plugin

  1. onContentSearch($keyword,$match,$ordering,$areas)
  2. onContentSearchAreas()

These events are triggered in 'SearchModelSearch' class in file 'search.php' at location 'Joomla_base\components\com_search\models'.

Contact plugin

These events are triggered during contact form submission. These events are triggered in 'ContactControllerContact' class in file 'contact.php' at location 'Joomla_base\components\com_contact\controllers'.

  1. onSubmitContact(&$contact, &$data) - Triggered when passed form Validation.
  2. onValidateContact(&$contact, &$data) - Triggered when form Validation succeeded.An example would be validating a captcha.

Where, $contact = It is reference to the person submitting contact. $data = It is reference to the POST variable defined as below. $data = JRequest::getVar('jform', array(), 'post', 'array');