2021-10-14 14:31:00 +00:00
< ? php
2021-12-16 13:15:09 +00:00
/**
* @ package Joomla . Component . Builder
*
* @ created 30 th April , 2015
* @ author Llewellyn van der Merwe < https :// dev . vdm . io >
* @ git Joomla Component Builder < https :// git . vdm . dev / joomla / Component - Builder - Pro >
* @ copyright Copyright ( C ) 2015 Vast Development Method . All rights reserved .
* @ license GNU General Public License version 2 or later ; see LICENSE . txt
2021-10-14 14:31:00 +00:00
*/
// No direct access to this file
defined ( '_JEXEC' ) or die ( 'Restricted access' );
/**
* Content - Componentbuilder Privacy Tabs script file .
*
* @ package PlgContentComponentbuilderPrivacyTabs
*/
class plgContentComponentbuilderPrivacyTabsInstallerScript
{
/**
* Called before any type of action
*
* @ param string $route Which action is happening ( install | uninstall | discover_install | update )
* @ param JAdapterInstance $adapter The object responsible for running this script
*
* @ return boolean True on success
*/
public function preflight ( $route , JAdapterInstance $adapter )
{
// get application
$app = JFactory :: getApplication ();
// the default for both install and update
$jversion = new JVersion ();
if ( ! $jversion -> isCompatible ( '3.8.0' ))
{
$app -> enqueueMessage ( 'Please upgrade to at least Joomla! 3.8.0 before continuing!' , 'error' );
return false ;
}
if ( 'install' === $route )
{
// check that componentbuilder is installed
$pathToCore = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php' ;
if ( ! JFile :: exists ( $pathToCore ))
{
2021-12-16 13:15:09 +00:00
$app -> enqueueMessage ( 'JCB must first be installed from <a href="https://git.vdm.dev/joomla/Component-Builder-Pro/" target="_blank">Joomla Component Builder</a>.' , 'error' );
2021-10-14 14:31:00 +00:00
return false ;
}
}
return true ;
}
}