OnAfterXXXXSave()
are Joomla events that are handled by area specific plugins.
You can either write a plugin to respond to standard Joomla events or you can add support for plugins to a component you've written.
As you can see from that list there is no event associated with com_categories
however spelunking the /administrator/com_categories
directory I can see that category.php
triggers onContentBeforeSave()
and onContentAfterSave()
in the save()
of CategoriesModelCategory
(i.e. models/category.php
).
class CategoriesModelCategory extends JModelAdmin
{
:
public function save($data)
{
$dispatcher = JEventDispatcher::getInstance();
:
// Trigger the onContentBeforeSave event.
$result = $dispatcher->trigger($this->event_before_save, array($this->option . '.' . $this->name, &$table, $isNew));
:
:
// Trigger the onContentAfterSave event.
$dispatcher->trigger($this->event_after_save, array($this->option . '.' . $this->name, &$table, $isNew));
Based on that, I would start with a content plugin (tutorial) and adapt it to your use case.