Skip to content

Commit

Permalink
change to kicktemp.shop structure
Browse files Browse the repository at this point in the history
  • Loading branch information
tecpromotion committed Apr 9, 2024
1 parent a922e27 commit 3459f64
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<form>
<fields name="params">
<fieldset name="task_params">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<extension type="plugin" group="task" method="upgrade">
<name>PLG_TASK_KICKMANAGEARTICLE</name>
<creationDate>[DATE]</creationDate>
Expand All @@ -8,8 +8,13 @@
<copyright>[COPYRIGHT]</copyright>
<license>[LICENSE]</license>
<version>[VERSION]</version>
<changelogurl>https://raw.githubusercontent.com/Kicktemp/plg_task_kickmanagearticle/main/changelog.xml</changelogurl>
<description>PLG_TASK_KICKMANAGEARTICLE_XML_DESCRIPTION</description>
<changelogurl>https://kicktemp.shop/changelog/[ALIAS]</changelogurl>
<description><![CDATA[
<h2>Kick Manage Article Task Plugin</h2>
<p>Version [VERSION] from [DATE]</p>
<p>More Information on <a href="https://github.com/Kicktemp/plg_task_kickmanagearticle#readme" target="_blank" title="github.com/Kicktemp/plg_task_kickmanagearticle" rel="noopener noreferrer">GitHub.com/Kicktemp/plg_task_kickmanagearticle</a>
]]>
</description>
<namespace path="src">Kicktemp\Plugin\Task\ManageArticle</namespace>
<scriptfile>script.php</scriptfile>
<files>
Expand All @@ -21,7 +26,7 @@
</config>
<updateservers>
<server type="extension" priority="1" name="[PROJECT_NAME]">
https://raw.githubusercontent.com/Kicktemp/plg_task_kickmanagearticle/main/update.xml
https://kicktemp.shop/update/[ALIAS]
</server>
</updateservers>
</extension>
53 changes: 43 additions & 10 deletions src/structure/plugins/task/kickmanagearticle/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,69 @@
* @package [PACKAGE_NAME]
*
* @author [AUTHOR] <[AUTHOR_EMAIL]>
* @copyright [AUTHOR_URL]
* @copyright [COPYRIGHT]
* @license [LICENSE]
* @link [AUTHOR_URL]
*/

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Installer\InstallerScript;

/**
* KickManageArticle script file.
*
* @package plg_task_kickmanagearticle
* @since 1.0.0
*/
class plgTaskKickManageArticleInstallerScript
class plgTaskKickManageArticleInstallerScript extends InstallerScript
{
public function __construct()
/**
* Minimum PHP version required to install the extension
*
* @var string
* @since 3.6
*/
protected $minimumPhp = '7.2.5';

/**
* Minimum Joomla! version required to install the extension
*
* @var string
* @since 3.6
*/
protected $minimumJoomla = '4.0';

/**
* @param $type
* @param $parent
* @return true|void
*/
public function preflight($type, $parent)
{
if (!in_array($type, ['install', 'update'])) {
return true;
}
}

/**
* @param $install_type
* @param $parent
* @return true|void
*/
public function postflight($install_type, $parent)
{
// Define the minimum versions to be supported.
$this->minimumJoomla = '4.0';
$this->minimumPhp = '7.2.5';
if (!in_array($install_type, ['install', 'update']))
{
return true;
}

$this->dir = __DIR__;
$this->removeFiles();
}

/**
* Called on installation
*
* @return boolean True on success
* @return void
*/
public function install() {
Factory::getDBO()->setQuery("UPDATE #__extensions SET enabled = 1 WHERE type = 'plugin' AND folder = 'task' AND element = 'kickmanagearticle'")->execute();
Expand Down

0 comments on commit 3459f64

Please sign in to comment.