ossystem.php
1.69 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
<?php
/**
* @package OSSystem
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2016 Open Source Training, LLC. All rights reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die();
use Alledia\Framework\Joomla\Extension;
use Alledia\Framework;
use Alledia\OSSystem;
include_once 'include.php';
if (defined('OSSYSTEM_LOADED')) {
/**
* OSSystem System Plugin
*
*/
class PlgSystemOSSystem extends Extension\AbstractPlugin
{
/**
* Library namespace
*
* @var string
*/
protected $namespace = 'OSSystem';
public function onAfterRender()
{
$app = Framework\Factory::getApplication();
$option = $app->input->getCmd('option');
$extension = $app->input->getCmd('extension', null);
// Execute only in admin and in the com_categories component
if ($app->getName() === 'administrator'
&& $option === 'com_categories'
&& $extension !== 'com_content'
&& !empty($extension)
) {
OSSystem\Helper::addCustomFooterIntoNativeComponentOutput($extension);
}
}
/**
* This method looks for a backup of cacert.pem file created
* by an prior release of this plugin, restoring it if found.
*
* @return void
*/
public function onAfterInitialise()
{
$app = Framework\Factory::getApplication();
if ($app->getName() === 'administrator') {
OSSystem\Helper::revertCARootFileToOriginal();
}
}
}
}