forked from elinw/Finder-HISTORICAL-PURPOSES-No-maintained
-
Notifications
You must be signed in to change notification settings - Fork 0
/
finderintegration.patch
119 lines (110 loc) · 4.23 KB
/
finderintegration.patch
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
Index: administrator/components/com_categories/models/category.php
===================================================================
--- administrator/components/com_categories/models/category.php (revision 22142)
+++ administrator/components/com_categories/models/category.php (working copy)
@@ -329,8 +329,9 @@
$pk = (!empty($data['id'])) ? $data['id'] : (int)$this->getState($this->getName().'.id');
$isNew = true;
- // Include the content plugins for the on save events.
+ // Include the content and finder plugins for the on save events.
JPluginHelper::importPlugin('content');
+ JPluginHelper::importPlugin('finder');
// Load the row if saving an existing category.
if ($pk > 0) {
@@ -405,6 +406,34 @@
}
/**
+ * Method to change the published state of one or more records.
+ *
+ * @param array $pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 2.5
+ */
+ function publish(&$pks, $value = 1)
+ {
+ if (parent::publish($pks, $value)) {
+ // Initialise variables.
+ $dispatcher = JDispatcher::getInstance();
+ $extension = JRequest::getCmd('extension');
+
+ // Include the content and finder plugins for the change of category state event.
+ JPluginHelper::importPlugin('content');
+ JPluginHelper::importPlugin('finder');
+
+ // Trigger the onCategoryChangeState event.
+ $dispatcher->trigger('onCategoryChangeState', array($extension, $pks, $value));
+
+ return true;
+ }
+ }
+
+ /**
* Method rebuild the entire nested set tree.
*
* @return boolean False on failure or error, true otherwise.
Index: libraries/joomla/application/component/modeladmin.php
===================================================================
--- libraries/joomla/application/component/modeladmin.php (revision 22142)
+++ libraries/joomla/application/component/modeladmin.php (working copy)
@@ -531,8 +531,9 @@
$pks = (array) $pks;
$table = $this->getTable();
- // Include the content plugins for the on delete events.
+ // Include the content and finder plugins for the on delete events.
JPluginHelper::importPlugin('content');
+ JPluginHelper::importPlugin('finder');
// Iterate the items to delete each one.
foreach ($pks as $i => $pk) {
@@ -719,8 +720,9 @@
$table = $this->getTable();
$pks = (array) $pks;
- // Include the content plugins for the change of state event.
+ // Include the content and finder plugins for the change of state event.
JPluginHelper::importPlugin('content');
+ JPluginHelper::importPlugin('finder');
// Access checks.
foreach ($pks as $i => $pk) {
@@ -840,8 +842,9 @@
$pk = (!empty($data[$key])) ? $data[$key] : (int)$this->getState($this->getName().'.id');
$isNew = true;
- // Include the content plugins for the on save events.
+ // Include the content and finder plugins for the on save events.
JPluginHelper::importPlugin('content');
+ JPluginHelper::importPlugin('finder');
// Allow an exception to be thrown.
try
Index: plugins/content/emailcloak/emailcloak.php
===================================================================
--- plugins/content/emailcloak/emailcloak.php (revision 22142)
+++ plugins/content/emailcloak/emailcloak.php (working copy)
@@ -29,6 +29,11 @@
*/
public function onContentPrepare($context, &$row, &$params, $page = 0)
{
+ // Don't run this plugin when the content is being indexed
+ if ($context == 'com_finder.indexer') {
+ return true;
+ }
+
if (is_object($row)) {
return $this->_cloak($row->text, $params);
}
Index: plugins/content/loadmodule/loadmodule.php
===================================================================
--- plugins/content/loadmodule/loadmodule.php (revision 22142)
+++ plugins/content/loadmodule/loadmodule.php (working copy)
@@ -26,6 +26,11 @@
*/
public function onContentPrepare($context, &$article, &$params, $page = 0)
{
+ // Don't run this plugin when the content is being indexed
+ if ($context == 'com_finder.indexer') {
+ return true;
+ }
+
// simple performance check to determine whether bot should process further
if (strpos($article->text, 'loadposition') === false && strpos($article->text, 'loadmodule') === false) {
return true;