primo commit
This commit is contained in:
72
plugins/actionlog/conditions/conditions.php
Normal file
72
plugins/actionlog/conditions/conditions.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Conditions
|
||||
* @version 24.11.1459
|
||||
*
|
||||
* @author Peter van Westen <info@regularlabs.com>
|
||||
* @link https://regularlabs.com
|
||||
* @copyright Copyright © 2024 Regular Labs All Rights Reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
|
||||
use RegularLabs\Library\ActionLogPlugin as RL_ActionLogPlugin;
|
||||
use RegularLabs\Library\Document as RL_Document;
|
||||
use RegularLabs\Library\Extension as RL_Extension;
|
||||
use RegularLabs\Library\Language as RL_Language;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
if ( ! is_file(JPATH_LIBRARIES . '/regularlabs/regularlabs.xml')
|
||||
|| ! class_exists('RegularLabs\Library\Parameters')
|
||||
|| ! class_exists('RegularLabs\Library\DownloadKey')
|
||||
|| ! class_exists('RegularLabs\Library\ActionLogPlugin')
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! RL_Document::isJoomlaVersion(4))
|
||||
{
|
||||
RL_Extension::disable('conditions', 'plugin', 'actionlog');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (true)
|
||||
{
|
||||
class PlgActionlogConditions extends RL_ActionLogPlugin
|
||||
{
|
||||
public $name = 'CONDITIONS';
|
||||
public $alias = 'conditions';
|
||||
|
||||
public function __construct(&$subject, array $config = [])
|
||||
{
|
||||
parent::__construct($subject, $config);
|
||||
|
||||
$this->addItem('com_conditions', 'item', 'CON_ITEM');
|
||||
}
|
||||
|
||||
public function onContentAfterSave($context, $table, $isNew, $data = [])
|
||||
{
|
||||
if ($context !== 'com_conditions.condition')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
parent::onContentAfterSave($context, $table, $isNew, $data);
|
||||
}
|
||||
|
||||
public function onConditionAfterMap($data)
|
||||
{
|
||||
RL_Language::load($data->extension);
|
||||
|
||||
$item = $this->getItem($data->extension);
|
||||
$item->title = $data->item_name;
|
||||
$item->id = $data->item_id;
|
||||
|
||||
$this->option = $data->extension;
|
||||
parent::onContentAfterSave($item->context, $item, false);
|
||||
$this->option = 'com_conditions';
|
||||
}
|
||||
}
|
||||
}
|
||||
30
plugins/actionlog/conditions/conditions.xml
Normal file
30
plugins/actionlog/conditions/conditions.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension version="4" type="plugin" group="actionlog" method="upgrade">
|
||||
<name>PLG_ACTIONLOG_CONDITIONS</name>
|
||||
<description>PLG_ACTIONLOG_CONDITIONS_DESC</description>
|
||||
<version>24.11.1459</version>
|
||||
<creationDate>November 2024</creationDate>
|
||||
<author>Regular Labs (Peter van Westen)</author>
|
||||
<authorEmail>info@regularlabs.com</authorEmail>
|
||||
<authorUrl>https://regularlabs.com</authorUrl>
|
||||
<copyright>Copyright © 2024 Regular Labs - All Rights Reserved</copyright>
|
||||
<license>GNU General Public License version 2 or later</license>
|
||||
<files>
|
||||
<file plugin="conditions">conditions.php</file>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
<config>
|
||||
<fields name="params" addfieldprefix="RegularLabs\Library\Form\Field">
|
||||
<fieldset name="basic">
|
||||
<field name="@load_language_regularlabs" type="LoadLanguage" extension="plg_system_regularlabs"/>
|
||||
<field name="@load_language" type="LoadLanguage" extension="plg_system_conditions"/>
|
||||
<field name="@jcompatibility" type="JCompatibility" extension="REGULAR_LABS_LIBRARY"/>
|
||||
<field name="@license" type="License" extension="CONDITIONS"/>
|
||||
<field name="@version" type="Version" extension="CONDITIONS"/>
|
||||
<field name="@dependency" type="Dependency" label="CON_THE_COMPONENT" file="/administrator/components/com_conditions/conditions.xml"/>
|
||||
<field name="@header" type="Header" label="CONDITIONS" description="CONDITIONS_DESC"/>
|
||||
<field name="@note__settings" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_SETTINGS,<a href="index.php?option=com_conditions" target="_blank">,</a>"/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
@ -0,0 +1,21 @@
|
||||
;; @package Conditions
|
||||
;; @version 24.11.1459
|
||||
;;
|
||||
;; @author Peter van Westen <info@regularlabs.com>
|
||||
;; @link https://regularlabs.com
|
||||
;; @copyright Copyright © 2024 Regular Labs All Rights Reserved
|
||||
;; @license GNU General Public License version 2 or later
|
||||
;;
|
||||
;; @translate Want to help with translations? See: https://regularlabs.com/translate
|
||||
|
||||
PLG_ACTIONLOG_CONDITIONS="Action Log - Regular Labs - Conditions"
|
||||
PLG_ACTIONLOG_CONDITIONS_DESC="Record the actions of users for Conditions"
|
||||
CONDITIONS="Conditions"
|
||||
|
||||
CONDITIONS_DESC="With Conditions you can replace whatever you want in your entire site."
|
||||
|
||||
CON_SETTINGS="Please see the [[%1:start link%]]Conditions component[[%2:end link%]] for settings."
|
||||
CON_THE_COMPONENT="the Conditions component"
|
||||
CON_THE_SYSTEM_PLUGIN="the Conditions system plugin"
|
||||
|
||||
CON_ITEM="Conditions set"
|
||||
@ -0,0 +1,13 @@
|
||||
;; @package Conditions
|
||||
;; @version 24.11.1459
|
||||
;;
|
||||
;; @author Peter van Westen <info@regularlabs.com>
|
||||
;; @link https://regularlabs.com
|
||||
;; @copyright Copyright © 2024 Regular Labs All Rights Reserved
|
||||
;; @license GNU General Public License version 2 or later
|
||||
;;
|
||||
;; @translate Want to help with translations? See: https://regularlabs.com/translate
|
||||
|
||||
PLG_ACTIONLOG_CONDITIONS="Action Log - Regular Labs - Conditions"
|
||||
PLG_ACTIONLOG_CONDITIONS_DESC="Record the actions of users for Conditions"
|
||||
CONDITIONS="Conditions"
|
||||
21
plugins/actionlog/joomla/joomla.xml
Normal file
21
plugins/actionlog/joomla/joomla.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="actionlog" method="upgrade">
|
||||
<name>plg_actionlog_joomla</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2018-05</creationDate>
|
||||
<copyright>(C) 2018 Open Source Matters, Inc.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>3.9.0</version>
|
||||
<description>PLG_ACTIONLOG_JOOMLA_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\Actionlog\Joomla</namespace>
|
||||
<files>
|
||||
<folder plugin="joomla">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_actionlog_joomla.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_actionlog_joomla.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
50
plugins/actionlog/joomla/services/provider.php
Normal file
50
plugins/actionlog/joomla/services/provider.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Actionlog.joomla
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Extension\PluginInterface;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\User\UserFactoryInterface;
|
||||
use Joomla\Database\DatabaseInterface;
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\Actionlog\Joomla\Extension\Joomla;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.2.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Joomla(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('actionlog', 'joomla')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
$plugin->setDatabase($container->get(DatabaseInterface::class));
|
||||
$plugin->setUserFactory($container->get(UserFactoryInterface::class));
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
1354
plugins/actionlog/joomla/src/Extension/Joomla.php
Normal file
1354
plugins/actionlog/joomla/src/Extension/Joomla.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user