Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.
/ cfi Public archive

Commit 8a3f55e

Browse files
authored
v1.0.15
1 parent d01b16b commit 8a3f55e

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CFI
22

3-
![Version](https://img.shields.io/badge/VERSION-1.0.14-0366d6.svg?style=for-the-badge)
3+
![Version](https://img.shields.io/badge/VERSION-1.0.15-0366d6.svg?style=for-the-badge)
44
![Joomla!](https://img.shields.io/badge/Joomla!-3.7+-1A3867.svg?style=for-the-badge)
55
![Php](https://img.shields.io/badge/php-5.6+-8892BF.svg?style=for-the-badge)
66

README.ru.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CFI
22

3-
![Version](https://img.shields.io/badge/VERSION-1.0.14-0366d6.svg?style=for-the-badge)
3+
![Version](https://img.shields.io/badge/VERSION-1.0.15-0366d6.svg?style=for-the-badge)
44
![Joomla!](https://img.shields.io/badge/Joomla!-3.7+-1A3867.svg?style=for-the-badge)
55
![Php](https://img.shields.io/badge/php-5.6+-8892BF.svg?style=for-the-badge)
66

cfi.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,29 @@ class PlgSystemCfi extends CMSPlugin
4747
private $file = null;
4848
private $cp;
4949
private $fieldPlugins;
50+
private $isAdmin;
5051

5152
protected $autoloadLanguage = true;
5253

5354
public function __construct(&$subject, $config)
5455
{
5556
parent::__construct($subject, $config);
57+
58+
if (Version::MAJOR_VERSION > 3) {
59+
$this->isAdmin = Factory::$application->getName() === 'administrator';
60+
} else {
61+
$this->isAdmin = Factory::getApplication()->isClient('administrator');
62+
}
63+
5664
$this->initConstruct();
5765
}
5866

5967
private function initConstruct($ajax = false)
6068
{
69+
if (!$this->isAdmin) {
70+
return;
71+
}
72+
6173
if (Version::MAJOR_VERSION > 3) {
6274
$this->app = Factory::getContainer()->get(Joomla\CMS\Application\AdministratorApplication::class);
6375
$this->appConfig = $this->app->getConfig();
@@ -70,10 +82,6 @@ private function initConstruct($ajax = false)
7082
$this->db = Factory::getDbo();
7183
}
7284

73-
if (!$this->app->isClient('administrator')) {
74-
return;
75-
}
76-
7785
$this->doc = Factory::getDocument();
7886

7987
if ($ajax) {
@@ -117,7 +125,7 @@ private function initConstruct($ajax = false)
117125

118126
public function onBeforeRender()
119127
{
120-
if (!$this->app->isClient('administrator') || $this->doc->getType() != 'html') {
128+
if (!$this->isAdmin || $this->doc->getType() != 'html') {
121129
return;
122130
}
123131

@@ -138,7 +146,7 @@ public function onBeforeRender()
138146

139147
public function onAfterRender()
140148
{
141-
if (!$this->app->isClient('administrator') || $this->doc->getType() != 'html') {
149+
if (!$this->isAdmin || $this->doc->getType() != 'html') {
142150
return;
143151
}
144152

cfi.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<extension version="3.7" type="plugin" group="system" method="upgrade">
33
<name>PLG_CFI</name>
4-
<version>1.0.14</version>
5-
<creationDate>Oktober 2022</creationDate>
4+
<version>1.0.15</version>
5+
<creationDate>December 2022</creationDate>
66
<author>Aleksey A. Morozov</author>
77
<authorEmail>alekvolsk@yandex.ru</authorEmail>
88
<authorUrl>https://alekvolsk.pw</authorUrl>

0 commit comments

Comments
 (0)