- md5
- 4d51dd4bd69f142481717610af3fe319
- sha1
- 487c2962d0f62660069a3e3f2b1ead5c5aef6af4
- sha256
- 03187d102829c9efff4d67c1d61d172b1292a3e3b5af30f7b557df24c5259da8
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
<?php
/**
* @version $Id: example.php 20196 2011-01-09 02:40:25Z ian $
* @package Joomla
* @subpackage Content
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.plugin.plugin');
/**
* Example Content Plugin
*
* @package Joomla
* @subpackage Content
* @since 1.5
*/
class plgContentExample extends JPlugin
{
/**
* Example after delete method.
*
* @param string The context for the content passed to the plugin.
* @param object The data relating to the content that was deleted.
* @return boolean
* @since 1.6
*/
public function onContentAfterDelete($context, $data)
{
return true;
}
/**
* Example after display content method
*
* Method is called by the view and the results are imploded and displayed in a placeholder
*
* @param string The context for the content passed to the plugin.
* @param object The content object. Note $article->text is also available
* @param object The content params
* @param int The 'page' number
* @return string
* @since 1.6
*/
public function onContentAfterDisplay($context, &$article, &$params, $limitstart)
{
$app = JFactory::getApplication();
return '';
}
/**
* Example after save content method
* Article is passed by reference, but after the save, so no changes will be saved.
* Method is called right after the content is saved
*
* @param string The context of the content passed to the plugin (added in 1.6)
* @param object A JTableContent object
* @param bool If the content is just about to be created
* @since 1.6
*/
public function onContentAfterSave($context, &$article, $isNew)
{
$app = JFactory::getApplication();
return true;
}
/**
* Example after display title method
*
* Method is called by the view and the results are imploded and displayed in a placeholder
*
* @param string The context for the content passed to the plugin.
* @param object The content object. Note $article->text is also available
* @param object The content params
* @param int The 'page' number
* @return string
* @since 1.6
*/
public function onContentAfterTitle($context, &$article, &$params, $limitstart)
{
$app = JFactory::getApplication();
return '';
}
/**
* Example before delete method.
*
* @param string The context for the content passed to the plugin.
* @param object The data relating to the content that is to be deleted.
* @return boolean
* @since 1.6
*/
public function onContentBeforeDelete($context, $data)
{
return true;
}
/**
* Example before display content method
*
* Method is called by the view and the results are imploded and displayed in a placeholder
*
* @param string The context for the content passed to the plugin.
* @param object The content object. Note $article->text is also available
* @param object The content params
* @param int The 'page' number
* @return string
* @since 1.6
*/
public function onContentBeforeDisplay($context, &$article, &$params, $limitstart)
{
$app = JFactory::getApplication();
return '';
}
/**
* Example before save content method
*
* Method is called right before content is saved into the database.
* Article object is passed by reference, so any changes will be saved!
* NOTE: Returning false will abort the save with an error.
*You can set the error by calling $article->setError($message)
*
* @param string The context of the content passed to the plugin.
* @param object A JTableContent object
* @param bool If the content is just about to be created
* @return bool If false, abort the save
* @since 1.6
*/
public function onContentBeforeSave($context, &$article, $isNew)
{
$app = JFactory::getApplication();
return true;
}
/**
* Example after delete method.
*
* @param string The context for the content passed to the plugin.
* @param array A list of primary key ids of the content that has changed state.
* @param int The value of the state that the content has been changed to.
* @return boolean
* @since 1.6
*/
public function onContentChangeState($context, $pks, $value)
{
return true;
}
/**
* Example prepare content method
*
* Method is called by the view
*
* @param string The context of the content being passed to the plugin.
* @param object The content object. Note $article->text is also available
* @param object The content params
* @param int The 'page' number
* @since 1.6
*/
public function onContentPrepare($context, &$article, &$params, $limitstart)
{
$app = JFactory::getApplication();
}
}
The same content is in 2 releases, Joomla 1.6.0 to 1.6.1. See them all, or every version of this file.