-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnnedittemplate.script.php
53 lines (46 loc) · 1.31 KB
/
nnedittemplate.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
53
<?php
/**
* @version 1.0.0
* @package NNEdittemplate
* @copyright 2015 Niels Nübel- NN-Medienagentur
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.nn-medienagentur.de
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Class plgSystemNNEdittemplateInstallerScript
*
* @category NNEdittemplate
* @package NNEdittemplate
* @author Niels Nübel <[email protected]>
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.nn-medienagentur.de
* @since 1.0.0
*/
class PlgSystemNNEdittemplateInstallerScript
{
/**
* Called before any type of action
*
* @param string $type type of current action
*
* @return boolean True on success
*/
public function preflight($type)
{
// make version check only when installing the plugin
if ($type != "discover_install" && $type != "install")
{
return true;
}
$version = new JVersion;
// Abort if the current Joomla release is older
if (version_compare($version->getShortVersion(), "3", 'lt'))
{
Jerror::raiseWarning(null, 'Cannot install NNEdittemplate in a Joomla release prior to 3');
return false;
}
return true;
}
}