-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcleanedit.php
62 lines (54 loc) · 1.18 KB
/
cleanedit.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* @package cleanedit
* @author Brian Teeman
* @copyright (C) 2021 - Brian Teeman
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die;
use Joomla\CMS\Plugin\CMSPlugin;
/**
* Clean Edit Plugin by Brian Teeman
*
* @since 1.0.0
*/
class plgSystemCleanedit extends CMSPlugin
{
/**
* Application object.
*
* @var \Joomla\CMS\Application\CMSApplication
* @since 1.0.0
*/
protected $app;
/**
* Load plugin language files automatically
*
* @var boolean
* @since 1.0.0
*/
protected $autoloadLanguage = true;
/**
* Let the plugin do its magic
*
* @return void
*
* @since 1.0.0
*/
function onAfterRoute() {
$input = $this->app->input;
$option = $input->getCmd('option', '');
$aid = (int) $input->getInt('a_id', 0);
$layout = $input->getCmd('layout', '');
$tid = (int) $this->params->get('edittemplateid', 0);
$mode = (boolean) $this->params->get('editmode', false);
if ($option === 'com_content' && $layout === 'edit' && $aid > 0)
{
$input->set('templateStyle', $tid);
if ($mode)
{
$input->set('tmpl', 'component');
}
}
}
}