Component-Builder/admin/compiler/joomla_3/script.php

124 lines
4.0 KiB
PHP
Raw Normal View History

2016-01-30 20:28:43 +00:00
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.modal');
jimport('joomla.installer.installer');
jimport('joomla.installer.helper');
/**
* Script File of ###Component### Component
*/
class com_###component###InstallerScript
{
/**
* method to install the component
*
* @return void
*/
function install($parent)
{
}
/**
* method to uninstall the component
*
* @return void
*/
function uninstall($parent)
{###UNINSTALLSCRIPT###
// little notice as after service, in case of bad experience with component.
echo '<h2>Did something go wrong? Are you disappointed?</h2>
<p>Please let me know at <a href="mailto:###AUTHOREMAIL###">###AUTHOREMAIL###</a>.
<br />We at ###COMPANYNAME### are committed to building extensions that performs proficiently! You can help us, really!
<br />Send me your thoughts on improvements that is needed, trust me, I will be very grateful!
<br />Visit us at <a href="###AUTHORWEBSITE###" target="_blank">###AUTHORWEBSITE###</a> today!</p>';
}
/**
* method to update the component
*
* @return void
*/
function update($parent)
{
}
/**
* method to run before an install/update/uninstall method
*
* @return void
*/
function preflight($type, $parent)
{
// get application
$app = JFactory::getApplication();
// is redundant ...hmmm
2016-01-30 20:28:43 +00:00
if ($type == 'uninstall')
{
2016-01-30 20:28:43 +00:00
return true;
}
// the default for both install and update
2016-01-30 20:28:43 +00:00
$jversion = new JVersion();
if (!$jversion->isCompatible('3.6.0'))
2016-01-30 20:28:43 +00:00
{
$app->enqueueMessage('Please upgrade to at least Joomla! 3.6.0 before continuing!', 'error');
2016-01-30 20:28:43 +00:00
return false;
}
// do any updates needed
if ($type == 'update')
{###PREUPDATESCRIPT###
}
// do any install needed
if ($type == 'install')
{###PREINSTALLSCRIPT###
}
2016-01-30 20:28:43 +00:00
}
/**
* method to run after an install/update/uninstall method
*
* @return void
*/
function postflight($type, $parent)
{
// set the default component settings
if ($type == 'install')
{###POSTINSTALLSCRIPT###
2016-01-30 20:28:43 +00:00
}
// do any updates needed
if ($type == 'update')
{###POSTUPDATESCRIPT###
2016-01-30 20:28:43 +00:00
}
}
}