finder.php
3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/**
* @package Joomla.Plugin
* @subpackage Content.finder
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Smart Search Content Plugin
*
* @since 2.5
*/
class PlgContentFinder extends JPlugin
{
/**
* Smart Search after save content method.
* Content 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 $context The context of the content passed to the plugin (added in 1.6)
* @param object $article A JTableContent object
* @param bool $isNew If the content has just been created
*
* @return void
*
* @since 2.5
*/
public function onContentAfterSave($context, $article, $isNew)
{
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('finder');
// Trigger the onFinderAfterSave event.
$dispatcher->trigger('onFinderAfterSave', array($context, $article, $isNew));
}
/**
* Smart Search before save content method.
* Content is passed by reference. Method is called before the content is saved.
*
* @param string $context The context of the content passed to the plugin (added in 1.6).
* @param object $article A JTableContent object.
* @param bool $isNew If the content is just about to be created.
*
* @return void
*
* @since 2.5
*/
public function onContentBeforeSave($context, $article, $isNew)
{
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('finder');
// Trigger the onFinderBeforeSave event.
$dispatcher->trigger('onFinderBeforeSave', array($context, $article, $isNew));
}
/**
* Smart Search after delete content method.
* Content is passed by reference, but after the deletion.
*
* @param string $context The context of the content passed to the plugin (added in 1.6).
* @param object $article A JTableContent object.
*
* @return void
*
* @since 2.5
*/
public function onContentAfterDelete($context, $article)
{
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('finder');
// Trigger the onFinderAfterDelete event.
$dispatcher->trigger('onFinderAfterDelete', array($context, $article));
}
/**
* Smart Search content state change method.
* Method to update the link information for items that have been changed
* from outside the edit screen. This is fired when the item is published,
* unpublished, archived, or unarchived from the list view.
*
* @param string $context The context for the content passed to the plugin.
* @param array $pks A list of primary key ids of the content that has changed state.
* @param integer $value The value of the state that the content has been changed to.
*
* @return void
*
* @since 2.5
*/
public function onContentChangeState($context, $pks, $value)
{
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('finder');
// Trigger the onFinderChangeState event.
$dispatcher->trigger('onFinderChangeState', array($context, $pks, $value));
}
/**
* Smart Search change category state content method.
* Method is called when the state of the category to which the
* content item belongs is changed.
*
* @param string $extension The extension whose category has been updated.
* @param array $pks A list of primary key ids of the content that has changed state.
* @param integer $value The value of the state that the content has been changed to.
*
* @return void
*
* @since 2.5
*/
public function onCategoryChangeState($extension, $pks, $value)
{
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('finder');
// Trigger the onFinderCategoryChangeState event.
$dispatcher->trigger('onFinderCategoryChangeState', array($extension, $pks, $value));
}
}