forked from mitydigital/joomla-item-helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mityitemhelper.php
42 lines (36 loc) · 946 Bytes
/
mityitemhelper.php
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
<?php
/**
* @package MityItemHelper
* @subpackage plg_content_mityitemhelper
*
* @copyright Copyright (C) 2020, Mity Digital. All rights reserved.
* @license GNU General Public License version 3
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
use Mity\ItemHelper;
/**
* Mity Item Helper
*
* @package ${NAMESPACE}
* @subpackage Plugins
*
* @since version
*/
class plgContentMityitemhelper extends JPlugin
{
public function onContentPrepare($context, &$item, &$params, $page = 0)
{
// Don't run this plugin when the content is being indexed
if ($context === 'com_finder.indexer') {
return true;
}
if (is_object($item)) {
// require the Mity Item Helper
require_once('ItemHelper.php');
// process the item
ItemHelper::process($item);
}
return true;
}
}