primo commit
This commit is contained in:
10
plugins/quickicon/jem/jem.php
Normal file
10
plugins/quickicon/jem/jem.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
|
||||
class PlgQuickiconJem extends CMSPlugin
|
||||
{
|
||||
// This file is intentionally left empty as we're using a service provider.
|
||||
// It's here to ensure Joomla recognizes this as a valid plugin.
|
||||
}
|
||||
25
plugins/quickicon/jem/jem.xml
Normal file
25
plugins/quickicon/jem/jem.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" group="quickicon" method="upgrade">
|
||||
<name>plg_quickicon_jem</name>
|
||||
<creationDate>June 2024</creationDate>
|
||||
<author>JEM Community</author>
|
||||
<authorEmail>info@joomlaeventmanager.net</authorEmail>
|
||||
<authorUrl>https://www.joomlaeventmanager.net</authorUrl>
|
||||
<copyright>copyright (C) 2013-2024 joomlaeventmanager.net</copyright>
|
||||
<license>https://www.gnu.org/licenses/gpl-3.0 GNU/GPL</license>
|
||||
<version>4.3.1</version>
|
||||
<description>PLG_QUICKICON_JEM_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\Quickicon\Jem</namespace>
|
||||
<scriptfile>script.php</scriptfile>
|
||||
<files>
|
||||
<filename plugin="jem">jem.php</filename>
|
||||
<filename>script.php</filename>
|
||||
<folder>services</folder>
|
||||
<folder>src</folder>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_quickicon_jem.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_quickicon_jem.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
13
plugins/quickicon/jem/language/en-GB/plg_quickicon_jem.ini
Normal file
13
plugins/quickicon/jem/language/en-GB/plg_quickicon_jem.ini
Normal file
@ -0,0 +1,13 @@
|
||||
; @package JEM
|
||||
; @subpackage JEM QuckIcon Plugin
|
||||
; @copyright (C) 2013-2024 joomlaeventmanager.net
|
||||
; @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
|
||||
;
|
||||
; All translations can be found at https://app.transifex.com/jemproject/
|
||||
; Please join the translation team if you want to contribute your changes to the translations
|
||||
;
|
||||
; Note: All ini files need to be saved as UTF-8, no BOM
|
||||
|
||||
PLG_QUICKICON_JEM="JEM - Quick Icon Plugin"
|
||||
PLG_QUICKICON_JEM_JEM="JEM Events"
|
||||
PLG_QUICKICON_JEM_XML_DESCRIPTION="Displays a quick icon for JEM on the admin dashboard"
|
||||
@ -0,0 +1,12 @@
|
||||
; @package JEM
|
||||
; @subpackage JEM QuckIcon Plugin
|
||||
; @copyright (C) 2013-2024 joomlaeventmanager.net
|
||||
; @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
|
||||
;
|
||||
; All translations can be found at https://app.transifex.com/jemproject/
|
||||
; Please join the translation team if you want to contribute your changes to the translations
|
||||
;
|
||||
; Note: All ini files need to be saved as UTF-8, no BOM
|
||||
|
||||
PLG_QUICKICON_JEM="JEM - Quick Icon Plugin"
|
||||
PLG_QUICKICON_JEM_XML_DESCRIPTION="Displays a quick icon for JEM on the admin dashboard"
|
||||
22
plugins/quickicon/jem/script.php
Normal file
22
plugins/quickicon/jem/script.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Installer\InstallerScript;
|
||||
|
||||
class PlgQuickiconJemInstallerScript extends InstallerScript
|
||||
{
|
||||
public function postflight($type, $parent)
|
||||
{
|
||||
if ($type === 'install' || $type === 'discover_install') {
|
||||
$db = \Joomla\CMS\Factory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('enabled') . ' = 1')
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('jem'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('quickicon'));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
plugins/quickicon/jem/services/provider.php
Normal file
28
plugins/quickicon/jem/services/provider.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Extension\PluginInterface;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\Quickicon\Jem\Extension\Jem;
|
||||
|
||||
return new class implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Jem(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('quickicon', 'jem')
|
||||
);
|
||||
$plugin->setApplication(\Joomla\CMS\Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
31
plugins/quickicon/jem/src/Extension/Jem.php
Normal file
31
plugins/quickicon/jem/src/Extension/Jem.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Joomla\Plugin\Quickicon\Jem\Extension;
|
||||
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class Jem extends CMSPlugin
|
||||
{
|
||||
protected $autoloadLanguage = true;
|
||||
|
||||
public function onGetIcons($context)
|
||||
{
|
||||
if ($context !== 'mod_quickicon' || !$this->getApplication()->getIdentity()->authorise('core.manage', 'com_jem')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
[
|
||||
'link' => 'index.php?option=com_jem',
|
||||
'linkadd' => 'index.php?option=com_jem&task=event.add',
|
||||
'image' => 'icon-calendar',
|
||||
'icon' => 'icon-calendar',
|
||||
'text' => Text::_('PLG_QUICKICON_JEM_JEM'),
|
||||
'id' => 'plg_quickicon_jem'
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user