-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.php
52 lines (44 loc) · 912 Bytes
/
script.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
<?php
/**
* Seblod Admin Template
*
* @version 2.x
* @package admin
* @author Denys D. Nosov ([email protected])
* @copyright (C) 2018-2023 by Denys D. Nosov (https://joomla-ua.org)
* @license GNU General Public License version 2 or later; see LICENSE.md
*
**/
use Joomla\CMS\Factory;
use Joomla\Filesystem\Folder;
defined('_JEXEC') or die;
class Pkg_AdminInstallerScript
{
/**
* @return bool
*
* @throws \Exception
* @since 7.0
*/
public function preflight()
{
$app = Factory::getApplication();
if(version_compare(JVERSION, '4.0', 'lt'))
{
$app->enqueueMessage('Update for Joomla! 4.0 +', 'error');
return false;
}
$path = JPATH_SITE . '/templates/admin/';
$folders = [
$path . 'app'
];
foreach($folders as $folder)
{
if(file_exists($folder) && is_dir($folder))
{
Folder::delete($folder);
}
}
return true;
}
}