primo commit
This commit is contained in:
181
plugins/editors-xtd/add_attachment/add_attachment.php
Normal file
181
plugins/editors-xtd/add_attachment/add_attachment.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
/**
|
||||
* Add Attachments Button plugin
|
||||
*
|
||||
* @package Attachments
|
||||
* @subpackage Add_Attachment_Button_Plugin
|
||||
*
|
||||
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
* @link http://joomlacode.org/gf/project/attachments/frs/
|
||||
* @author Jonathan M. Cameron
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die('Restricted access');
|
||||
|
||||
jimport('joomla.plugin.plugin');
|
||||
|
||||
/**
|
||||
* Button that allows you to add attachments from the editor
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class plgButtonAdd_attachment extends JPlugin
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param &object &$subject The object to observe
|
||||
* @param array $config An array that holds the plugin configuration
|
||||
*/
|
||||
public function __construct(& $subject, $config)
|
||||
{
|
||||
parent::__construct($subject, $config);
|
||||
$this->loadLanguage();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add Attachment button
|
||||
*
|
||||
* @param string $name The name of the editor form
|
||||
* @param int $asset The asset ID for the entity being edited
|
||||
* @param int $authro The ID of the author of the entity
|
||||
*
|
||||
* @return a button
|
||||
*/
|
||||
public function onDisplay($name, $asset, $author)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Avoid displaying the button for anything except for registered parents
|
||||
$parent_type = JRequest::getCmd('option');
|
||||
if (!$parent_type) {
|
||||
return;
|
||||
}
|
||||
$parent_entity = 'default';
|
||||
$editor = 'article';
|
||||
|
||||
// Handle categories specially (since they are really com_content)
|
||||
if ($parent_type == 'com_categories') {
|
||||
$parent_type = 'com_content';
|
||||
$parent_entity = 'category';
|
||||
$editor = 'category';
|
||||
}
|
||||
|
||||
// Get the parent ID (id or first of cid array)
|
||||
// NOTE: $parent_id=0 means no id (usually means creating a new entity)
|
||||
$cid = JRequest::getVar('cid', array(0), '', 'array');
|
||||
$parent_id = 0;
|
||||
if ( count($cid) > 0 ) {
|
||||
$parent_id = (int)$cid[0];
|
||||
}
|
||||
if ( $parent_id == 0) {
|
||||
$a_id = JRequest::getInt('a_id');
|
||||
if ( !is_null($a_id) ) {
|
||||
$parent_id = (int)$a_id;
|
||||
}
|
||||
}
|
||||
if ( $parent_id == 0) {
|
||||
$nid = JRequest::getInt('id');
|
||||
if ( !is_null($nid) ) {
|
||||
$parent_id = (int)$nid;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for the special case where we are creating an article from a category list
|
||||
$item_id = JRequest::getInt('Itemid');
|
||||
$menu = $app->getMenu();
|
||||
$menu_item = $menu->getItem($item_id);
|
||||
if ( $menu_item AND ($menu_item->query['view'] == 'category') AND empty($a_id) ) {
|
||||
$parent_entity = 'article';
|
||||
$parent_id = NULL;
|
||||
}
|
||||
|
||||
// Get the article/parent handler
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
// Exit if there is no Attachments plugin to handle this parent_type
|
||||
return new JObject();
|
||||
}
|
||||
// Figure out where we are and construct the right link and set
|
||||
$uri = JFactory::getURI();
|
||||
$base_url = $uri->root(true);
|
||||
if ( $app->isAdmin() ) {
|
||||
$base_url = str_replace('/administrator','', $base_url);
|
||||
}
|
||||
|
||||
// Set up the Javascript framework
|
||||
require_once JPATH_SITE . '/components/com_attachments/javascript.php';
|
||||
AttachmentsJavascript::setupJavascript();
|
||||
|
||||
// Get the parent handler
|
||||
$parent = $apm->getAttachmentsPlugin($parent_type);
|
||||
$parent_entity = $parent->getCanonicalEntityId($parent_entity);
|
||||
|
||||
if ( $parent_id == 0 ) {
|
||||
# Last chance to get the id in extension editors
|
||||
$view = JRequest::getWord('view');
|
||||
$layout = JRequest::getWord('layout');
|
||||
$parent_id = $parent->getParentIdInEditor($parent_entity, $view, $layout);
|
||||
}
|
||||
|
||||
// Make sure we have permissions to add attachments to this article or category
|
||||
if ( !$parent->userMayAddAttachment($parent_id, $parent_entity, $parent_id == 0) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Allow remapping of parent ID (eg, for Joomfish)
|
||||
if (jimport('attachments_remapper.remapper'))
|
||||
{
|
||||
$parent_id = AttachmentsRemapper::remapParentID($parent_id, $parent_type, $parent_entity);
|
||||
}
|
||||
|
||||
// Add the regular css file
|
||||
JHtml::stylesheet('com_attachments/attachments_list.css', Array(), true);
|
||||
JHtml::stylesheet('com_attachments/add_attachment_button.css', Array(), true);
|
||||
|
||||
// Handle RTL styling (if necessary)
|
||||
$lang = JFactory::getLanguage();
|
||||
if ( $lang->isRTL() ) {
|
||||
JHtml::stylesheet('com_attachments/attachments_list_rtl.css', Array(), true);
|
||||
JHtml::stylesheet('com_attachments/add_attachment_button_rtl.css', Array(), true);
|
||||
}
|
||||
|
||||
// Load the language file from the frontend
|
||||
$lang->load('com_attachments', dirname(__FILE__));
|
||||
|
||||
// Create the [Add Attachment] button object
|
||||
$button = new JObject();
|
||||
|
||||
$link = $parent->getEntityAddUrl($parent_id, $parent_entity, 'closeme');
|
||||
$link .= '&editor=' . $editor;
|
||||
|
||||
// Finalize the [Add Attachment] button info
|
||||
$button->set('modal', true);
|
||||
$button->set('class', 'btn');
|
||||
$button->set('text', JText::_('ATTACH_ADD_ATTACHMENT'));
|
||||
|
||||
if ( $app->isAdmin() ) {
|
||||
$button_name = 'add_attachment';
|
||||
if (version_compare(JVERSION, '3.3', 'ge')) {
|
||||
$button_name = 'paperclip';
|
||||
}
|
||||
$button->set('name', $button_name);
|
||||
}
|
||||
else {
|
||||
// Needed for Joomal 2.5
|
||||
$button_name = 'add_attachment_frontend';
|
||||
if (version_compare(JVERSION, '3.3', 'ge')) {
|
||||
$button_name = 'paperclip';
|
||||
}
|
||||
$button->set('name', $button_name);
|
||||
}
|
||||
$button->set('link', $link);
|
||||
$button->set('options', "{handler: 'iframe', size: {x: 920, y: 530}}");
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
19
plugins/editors-xtd/add_attachment/add_attachment.xml
Normal file
19
plugins/editors-xtd/add_attachment/add_attachment.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" group="editors-xtd" version="2.5" method="upgrade">
|
||||
<name>plg_editors-xtd_add_attachment_btn</name>
|
||||
<version>3.2.6</version>
|
||||
<creationDate>March 26, 2018</creationDate>
|
||||
<author>Jonathan M. Cameron</author>
|
||||
<copyright>(C) 2007-2018 Jonathan M. Cameron. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
|
||||
<authorEmail>jmcameron@jmcameron.net</authorEmail>
|
||||
<authorUrl>http://joomlacode.org/gf/project/attachments/</authorUrl>
|
||||
<description>ATTACH_ADD_ATTACHMENT_BUTTON_PLUGIN_DESCRIPTION</description>
|
||||
|
||||
<files>
|
||||
<filename plugin="add_attachment">add_attachment.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
|
||||
</extension>
|
||||
1
plugins/editors-xtd/add_attachment/index.html
Normal file
1
plugins/editors-xtd/add_attachment/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,9 @@
|
||||
; en-GB.plg_editors-xtd_add_attachment.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2018 Jonathan M. Cameron, All rights reserved.
|
||||
; License http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; English translation
|
||||
|
||||
ATTACH_ADD_ATTACHMENT_BUTTON_PLUGIN_DESCRIPTION="The Add Attachment Button plugin adds a button to the article/category editor that allows you to add an attachment to an article or category while editing it."
|
||||
@ -0,0 +1,10 @@
|
||||
; en-GB.plg_editors-xtd_add_attachment.sys.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2018 Jonathan M. Cameron, All rights reserved.
|
||||
; License http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; English translation
|
||||
|
||||
ATTACH_ADD_ATTACHMENT_BUTTON_PLUGIN_DESCRIPTION="The Add Attachment Button plugin adds a button to the article/category editor that allows you to add an attachment to an article or category while editing it."
|
||||
PLG_EDITORS-XTD_ADD_ATTACHMENT_BTN="Editor Button - Add Attachment"
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
1
plugins/editors-xtd/add_attachment/language/index.html
Normal file
1
plugins/editors-xtd/add_attachment/language/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,9 @@
|
||||
; it-IT.plg_editors-xtd_add_attachment.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2013 Jonathan M. Cameron, All rights reserved.
|
||||
; License GNU GPL 3: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; Italian translation by: Piero Mattirolo (2.0, 3.0), Lemminkainen (version 1.3.4)
|
||||
|
||||
ATTACH_ADD_ATTACHMENT_BUTTON_PLUGIN_DESCRIPTION="Questo plugin aggiunge un pulsante all'editor di articoli/categorie, che ti permette di aggiungere un allegato ad un articolo o a una categoria, in fase di scrittura."
|
||||
@ -0,0 +1,10 @@
|
||||
; it-IT.plg_editors-xtd_add_attachment.sys.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2013 Jonathan M. Cameron, All rights reserved.
|
||||
; License GNU GPL 3: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; Italian translation by: Piero Mattirolo (2.0, 3.0), Lemminkainen (version 1.3.4)
|
||||
|
||||
ATTACH_ADD_ATTACHMENT_BUTTON_PLUGIN_DESCRIPTION="Questo plugin aggiunge un pulsante all'editor di articoli/categorie, che ti permette di aggiungere un allegato ad un articolo o a una categoria, in fase di scrittura."
|
||||
PLG_EDITORS-XTD_ADD_ATTACHMENT_BTN="Editor Button - Aggiungi Allegato"
|
||||
21
plugins/editors-xtd/article/article.xml
Normal file
21
plugins/editors-xtd/article/article.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_article</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2009-10</creationDate>
|
||||
<copyright>(C) 2009 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.0.0</version>
|
||||
<description>PLG_ARTICLE_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\Article</namespace>
|
||||
<files>
|
||||
<folder plugin="article">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_article.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_article.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/article/services/provider.php
Normal file
46
plugins/editors-xtd/article/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.article
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\Article\Extension\Article;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Article(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'article')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
115
plugins/editors-xtd/article/src/Extension/Article.php
Normal file
115
plugins/editors-xtd/article/src/Extension/Article.php
Normal file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.article
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\Article\Extension;
|
||||
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor Article button
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
final class Article extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$subject = $event->getButtonsRegistry();
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->loadLanguage();
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId());
|
||||
|
||||
if ($button) {
|
||||
$subject->add($button);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button
|
||||
*
|
||||
* @param string $name The name of the button to add
|
||||
*
|
||||
* @return Button|void The button options as Button object, void if ACL check fails.
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @deprecated 5.0 Use onEditorButtonsSetup event
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
$user = $this->getApplication()->getIdentity();
|
||||
|
||||
// Can create in any category (component permission) or at least in one category
|
||||
$canCreateRecords = $user->authorise('core.create', 'com_content')
|
||||
|| \count($user->getAuthorisedCategories('com_content', 'core.create')) > 0;
|
||||
|
||||
// Instead of checking edit on all records, we can use **same** check as the form editing view
|
||||
$values = (array) $this->getApplication()->getUserState('com_content.edit.article.id');
|
||||
$isEditingRecords = \count($values);
|
||||
|
||||
// This ACL check is probably a double-check (form view already performed checks)
|
||||
$hasAccess = $canCreateRecords || $isEditingRecords;
|
||||
if (!$hasAccess) {
|
||||
return;
|
||||
}
|
||||
|
||||
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&'
|
||||
. Session::getFormToken() . '=1&editor=' . $name;
|
||||
|
||||
$button = new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'modal',
|
||||
'link' => $link,
|
||||
'text' => Text::_('PLG_ARTICLE_BUTTON_ARTICLE'),
|
||||
'icon' => 'file-add',
|
||||
'iconSVG' => '<svg viewBox="0 0 32 32" width="24" height="24"><path d="M28 24v-4h-4v4h-4v4h4v4h4v-4h4v-4zM2 2h18v6h6v10h2v-10l-8-'
|
||||
. '8h-20v32h18v-2h-16z"></path></svg>',
|
||||
// This is whole Plugin name, it is needed for keeping backward compatibility
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
]
|
||||
);
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Conditional Content
|
||||
* @version 5.2.2
|
||||
*
|
||||
* @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\Document as RL_Document;
|
||||
use RegularLabs\Library\EditorButtonPlugin as RL_EditorButtonPlugin;
|
||||
use RegularLabs\Library\Extension as RL_Extension;
|
||||
|
||||
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\EditorButtonPlugin')
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! RL_Document::isJoomlaVersion(4))
|
||||
{
|
||||
RL_Extension::disable('conditionalcontent', 'plugin', 'editors-xtd');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (true)
|
||||
{
|
||||
class PlgButtonConditionalContent extends RL_EditorButtonPlugin
|
||||
{
|
||||
protected $button_icon = '<svg viewBox="0 0 24 24" style="fill:none;" width="24" height="24" fill="none" stroke="currentColor">'
|
||||
. '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" />'
|
||||
. '</svg>';
|
||||
|
||||
protected function loadScripts()
|
||||
{
|
||||
RL_Document::script('conditionalcontent.button');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="4" type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>PLG_EDITORS-XTD_CONDITIONALCONTENT</name>
|
||||
<description>PLG_EDITORS-XTD_CONDITIONALCONTENT_DESC</description>
|
||||
<version>5.2.2</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>
|
||||
<namespace path="src">RegularLabs\Plugin\EditorButton\ConditionalContent</namespace>
|
||||
<scriptfile>script.install.php</scriptfile>
|
||||
<files>
|
||||
<file plugin="conditionalcontent">conditionalcontent.php</file>
|
||||
<folder>forms</folder>
|
||||
<folder>language</folder>
|
||||
<folder>src</folder>
|
||||
<folder>tmpl</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="@license" type="License" extension="CONDITIONALCONTENT"/>
|
||||
<field name="@version" type="Version" extension="CONDITIONALCONTENT"/>
|
||||
<field name="@dependency_plugin" type="Dependency" label="COC_THE_SYSTEM_PLUGIN" file="/plugins/system/conditionalcontent/conditionalcontent.xml"/>
|
||||
<field name="@header" type="Header" label="CONDITIONALCONTENT" description="CONDITIONALCONTENT_DESC" url="https://regularlabs.com/conditionalcontent"/>
|
||||
<field name="@note__settings" type="Note" class="rl-alert alert alert-info rl-alert-light" text="COC_SETTINGS,<a href="index.php?option=com_plugins&filter[folder]=system&filter[search]=conditional Content" target="_blank">,</a>"/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
560
plugins/editors-xtd/conditionalcontent/forms/popup.xml
Normal file
560
plugins/editors-xtd/conditionalcontent/forms/popup.xml
Normal file
@ -0,0 +1,560 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config addfieldprefix="RegularLabs\Library\Form\Field">
|
||||
<fieldset name="content">
|
||||
<field name="tag_type" type="Radio" default="show" class="btn-group rl-btn-group btn-group-md" label="COC_TAG_TYPE_DESC">
|
||||
<option value="show" class="btn btn-outline-success">JSHOW</option>
|
||||
<option value="hide" class="btn btn-outline-danger">JHIDE</option>
|
||||
</field>
|
||||
<field name="content" type="Editor" default="" buttons="false" filter="JComponentHelper::filterText" label="COC_CONTENT" description="COC_CONTENT_DESC"/>
|
||||
</fieldset>
|
||||
<fieldset name="content_no_editor">
|
||||
<field name="tag_type" type="Radio" default="show" class="btn-group rl-btn-group btn-group-md" label="COC_TAG_TYPE_DESC">
|
||||
<option value="show" class="btn btn-outline-success">JSHOW</option>
|
||||
<option value="hide" class="btn btn-outline-danger">JHIDE</option>
|
||||
</field>
|
||||
<field name="content" type="Editor" editor="codemirror" default="" buttons="false" filter="JComponentHelper::filterText" label="COC_CONTENT" description="COC_CONTENT_DESC"/>
|
||||
</fieldset>
|
||||
<fieldset name="alternative">
|
||||
<field name="content_alternative" type="Editor" default="" buttons="false" filter="JComponentHelper::filterText" label="COC_ALTERNATIVE_CONTENT" description="COC_ALTERNATIVE_CONTENT_DESC"/>
|
||||
</fieldset>
|
||||
<fieldset name="alternative_no_editor">
|
||||
<field name="content_alternative" type="Editor" editor="codemirror" default="" buttons="false" filter="JComponentHelper::filterText" label="COC_ALTERNATIVE_CONTENT" description="COC_ALTERNATIVE_CONTENT_DESC"/>
|
||||
</fieldset>
|
||||
<fieldset name="conditions">
|
||||
<field name="@load_language_conditions" type="LoadLanguage" extension="com_conditions"/>
|
||||
<field name="@showon__has_conditions__a" type="ShowOn" value="has_conditions:1"/>
|
||||
<field name="condition_type" type="Radio" default="alias" class="btn-group rl-btn-group btn-group-md" label="COC_CONDITION_TYPE">
|
||||
<option value="id" class="btn btn-outline-info">JGLOBAL_FIELD_ID_LABEL</option>
|
||||
<option value="alias" class="btn btn-outline-info">JALIAS</option>
|
||||
<option value="name" class="btn btn-outline-info">JFIELD_NAME_LABEL</option>
|
||||
</field>
|
||||
<field name="@showon__has_conditions__b" type="ShowOn"/>
|
||||
<field name="@conditions" type="Condition" addfieldprefix="RegularLabs\Plugin\EditorButton\ConditionalContent\Form\Field" enable=" menu__menu_item, menu__home_page, date__date, visitor__access_level, visitor__user_group, visitor__language, agent__device, other__condition"/>
|
||||
</fieldset>
|
||||
<fieldset name="inline__a">
|
||||
<field name="@showon__use_inline__a" type="ShowOn" value="use_inline:1[AND]has_conditions:0"/>
|
||||
<field name="@note__inline_rules" type="Note" class="" title="COC_INLINE_RULES" heading="h3"/>
|
||||
<field name="matching_method" type="Radio" default="all" class="btn-group rl-btn-group" label="RL_MATCHING_METHOD" description="CON_MATCHING_METHOD_DESC,CON_ALL,CON_ALL_DESC,CON_ANY,CON_ANY_DESC" showon="has_multiple_rules:1">
|
||||
<option value="all" class="btn btn-outline-info">CON_ALL</option>
|
||||
<option value="any" class="btn btn-outline-info">CON_ANY</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<!-- MENU ITEMS -->
|
||||
<fieldset name="group__menu__a">
|
||||
<field name="@block__group__menu__a" type="Block" start="1" label="CON_MENU_ITEMS"/>
|
||||
</fieldset>
|
||||
<!-- MENU ITEMS -->
|
||||
<fieldset name="menu__menu_item">
|
||||
<field name="@block__menuitems__a" type="Block" start="1"/>
|
||||
<field name="menuitems" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_MENU_ITEMS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__menuitems__a" type="ShowOn" value="menuitems!:"/>
|
||||
<field name="menuitems__selection" type="MenuItems" multiple="true" default="" label="CON_MENU_ITEMS" hiddenLabel="true"/>
|
||||
<field name="@showon__menuitems__b" type="ShowOn"/>
|
||||
<field name="@block__menuitems__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<!-- HOMEPAGE -->
|
||||
<fieldset name="menu__home_page">
|
||||
<field name="@block__homepage__a" type="Block" start="1"/>
|
||||
<field name="homepage" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_HOME_PAGE">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__homepage__a" type="ShowOn" value="homepage!:"/>
|
||||
<field name="@note__homepage" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_HOME_PAGE_DESC"/>
|
||||
<field name="@showon__homepage__b" type="ShowOn"/>
|
||||
<field name="@block__homepage__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__menu__b">
|
||||
<field name="@block__group__menu__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__date__a">
|
||||
<!-- DATE -->
|
||||
<field name="@block__group__date__a" type="Block" start="1" label="CON_DATE_TIME"/>
|
||||
</fieldset>
|
||||
<fieldset name="date__date">
|
||||
<!-- DATE :: DATE -->
|
||||
<field name="@block__date__a" type="Block" start="1"/>
|
||||
<field name="date" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_DATE">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__date__a" type="ShowOn" value="date!:"/>
|
||||
<field name="date__comparison" type="Radio" default="after" class="btn-group rl-btn-group btn-group-md" label="">
|
||||
<option value="before" class="btn btn-outline-info">CON_DATE_BEFORE</option>
|
||||
<option value="after" class="btn btn-outline-info">CON_DATE_AFTER</option>
|
||||
<option value="between" class="btn btn-outline-info">CON_DATE_BETWEEN</option>
|
||||
</field>
|
||||
<field name="@showon__date__before_after__a" type="ShowOn" value="date__comparison!:between"/>
|
||||
<field name="date__date" type="Calendar" showtime="true" filter="user_utc" format="%Y-%m-%d %H:%M" default="" label=""/>
|
||||
<field name="@showon__date__before_after__b" type="ShowOn"/>
|
||||
<field name="@showon__date__between__a" type="ShowOn" value="date__comparison:between"/>
|
||||
<field name="date__from" type="Calendar" showtime="true" filter="user_utc" format="%Y-%m-%d %H:%M" default="" label="CON_DATE_FROM"/>
|
||||
<field name="date__to" type="Calendar" showtime="true" filter="user_utc" format="%Y-%m-%d %H:%M" default="" label="CON_DATE_TO"/>
|
||||
<field name="@showon__date__between__b" type="ShowOn"/>
|
||||
<field name="@showon__date__b" type="ShowOn"/>
|
||||
<field name="@block__date__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="date__season">
|
||||
<!-- DATE :: SEASONS -->
|
||||
<field name="@block__seasons__a" type="Block" start="1"/>
|
||||
<field name="seasons" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_SEASONS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__seasons__a" type="ShowOn" value="seasons!:"/>
|
||||
<field name="seasons__selection" type="List" multiple="true" default="" layout="joomla.form.field.list-fancy-select" label="CON_SEASONS" hiddenLabel="true">
|
||||
<option value="winter">CON_WINTER</option>
|
||||
<option value="spring">CON_SPRING</option>
|
||||
<option value="summer">CON_SUMMER</option>
|
||||
<option value="fall">CON_FALL</option>
|
||||
</field>
|
||||
<field name="@showon__seasons__b" type="ShowOn"/>
|
||||
<field name="@block__seasons__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="date__month">
|
||||
<!-- DATE :: MONTHS -->
|
||||
<field name="@block__months__a" type="Block" start="1"/>
|
||||
<field name="months" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_MONTHS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__months__a" type="ShowOn" value="months!:"/>
|
||||
<field name="months__selection" type="List" multiple="true" default="" layout="joomla.form.field.list-fancy-select" label="CON_MONTHS" hiddenLabel="true">
|
||||
<option value="january">JANUARY</option>
|
||||
<option value="february">FEBRUARY</option>
|
||||
<option value="march">MARCH</option>
|
||||
<option value="april">APRIL</option>
|
||||
<option value="may">MAY</option>
|
||||
<option value="june">JUNE</option>
|
||||
<option value="july">JULY</option>
|
||||
<option value="august">AUGUST</option>
|
||||
<option value="september">SEPTEMBER</option>
|
||||
<option value="october">OCTOBER</option>
|
||||
<option value="november">NOVEMBER</option>
|
||||
<option value="december">DECEMBER</option>
|
||||
</field>
|
||||
<field name="@showon__months__b" type="ShowOn"/>
|
||||
<field name="@block__months__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="date__day">
|
||||
<!-- DATE :: DAYS -->
|
||||
<field name="@block__days__a" type="Block" start="1"/>
|
||||
<field name="days" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_DAYS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__days__a" type="ShowOn" value="days!:"/>
|
||||
<field name="days__selection" type="List" multiple="true" default="" layout="joomla.form.field.list-fancy-select" label="CON_DAYS" hiddenLabel="true">
|
||||
<option value="monday">MONDAY</option>
|
||||
<option value="tuesday">TUESDAY</option>
|
||||
<option value="wednesday">WEDNESDAY</option>
|
||||
<option value="thursday">THURSDAY</option>
|
||||
<option value="friday">FRIDAY</option>
|
||||
<option value="saturday">SATURDAY</option>
|
||||
<option value="sunday">SUNDAY</option>
|
||||
</field>
|
||||
<field name="@showon__days__b" type="ShowOn"/>
|
||||
<field name="@block__days__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="date__time">
|
||||
<!-- DATE :: TIME -->
|
||||
<field name="@block__time__a" type="Block" start="1"/>
|
||||
<field name="time" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_TIME">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__time__a" type="ShowOn" value="time!:"/>
|
||||
<field name="time__comparison" type="Radio" default="after" class="btn-group rl-btn-group btn-group-md" label="">
|
||||
<option value="before" class="btn btn-outline-info">CON_DATE_BEFORE</option>
|
||||
<option value="after" class="btn btn-outline-info">CON_DATE_AFTER</option>
|
||||
<option value="between" class="btn btn-outline-info">CON_DATE_BETWEEN</option>
|
||||
</field>
|
||||
<field name="@showon__time__before_after__a" type="ShowOn" value="time__comparison!:between"/>
|
||||
<field name="time__time" type="Text" size="10" default="0:00" class="rl-w-5em text-right" label=""/>
|
||||
<field name="@showon__time__before_after__b" type="ShowOn"/>
|
||||
<field name="@showon__time__between__a" type="ShowOn" value="time__comparison:between"/>
|
||||
<field name="time__from" type="Text" size="10" default="0:00" class="rl-w-5em text-right" label="CON_DATE_FROM"/>
|
||||
<field name="time__to" type="Text" size="10" default="0:00" class="rl-w-5em text-right" label="CON_DATE_TO"/>
|
||||
<field name="@showon__time__between__b" type="ShowOn"/>
|
||||
<field name="@showon__time__b" type="ShowOn"/>
|
||||
<field name="@block__time__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__date__b">
|
||||
<!-- DATE (footer) -->
|
||||
<field name="@showon__group__date__a" type="ShowOn" value="date!:[OR]seasons!:[OR]months!:[OR]days!:[OR]time!:"/>
|
||||
<field name="@note__group__date" type="Note" class="rl-alert alert alert-warning" text="CON_DATE_TIME_DESC"/>
|
||||
<field name="@note__group__date__current" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_CURRENT_DATE,[date:Y-m-d H:i]"/>
|
||||
<field name="@showon__group__date__b" type="ShowOn"/>
|
||||
<field name="@block__group__date__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__content__a">
|
||||
<!-- JOOMLA CONTENT -->
|
||||
<field name="@block__group__content__a" type="Block" start="1" label="RL_JCONTENT"/>
|
||||
<field name="@load_language_content" type="LoadLanguage" extension="com_content"/>
|
||||
<field name="@load_language_content_sys" type="LoadLanguage" extension="com_content.sys"/>
|
||||
</fieldset>
|
||||
<fieldset name="content__page_type">
|
||||
<!-- JOOMLA CONTENT :: PAGE TYPES -->
|
||||
<field name="@block__contentpagetypes__a" type="Block" start="1"/>
|
||||
<field name="contentpagetypes" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_PAGE_TYPES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__contentpagetypes__a" type="ShowOn" value="contentpagetypes!:"/>
|
||||
<field name="contentpagetypes__selection" type="List" multiple="true" default="" layout="joomla.form.field.list-fancy-select" label="CON_PAGE_TYPES" hiddenLabel="true">
|
||||
<option value="archive">COM_CONTENT_ARCHIVE_VIEW_DEFAULT_TITLE</option>
|
||||
<option value="article">COM_CONTENT_ARTICLE_VIEW_DEFAULT_TITLE</option>
|
||||
<option value="categories">COM_CONTENT_CATEGORIES_VIEW_DEFAULT_TITLE</option>
|
||||
<option value="categoryblog">COM_CONTENT_CATEGORY_VIEW_BLOG_TITLE</option>
|
||||
<option value="category">COM_CONTENT_CATEGORY_VIEW_DEFAULT_TITLE</option>
|
||||
<option value="featured">COM_CONTENT_FEATURED_VIEW_DEFAULT_TITLE</option>
|
||||
<option value="form">COM_CONTENT_FORM_VIEW_DEFAULT_TITLE</option>
|
||||
</field>
|
||||
<field name="@showon__contentpagetypes__b" type="ShowOn"/>
|
||||
<field name="@block__contentpagetypes__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="content__category">
|
||||
<!-- JOOMLA CONTENT :: CATEGORIES -->
|
||||
<field name="@block__categories__a" type="Block" start="1"/>
|
||||
<field name="categories" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_CATEGORIES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__categories__a" type="ShowOn" value="categories!:"/>
|
||||
<field name="categories__selection" type="ContentCategories" multiple="true" default="" label="CON_CATEGORIES" hiddenLabel="true"/>
|
||||
<field name="@showon__categories__b" type="ShowOn"/>
|
||||
<field name="@block__categories__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="content__article__id">
|
||||
<!-- JOOMLA CONTENT :: ARTICLES -->
|
||||
<field name="@block__articles__a" type="Block" start="1"/>
|
||||
<field name="articles" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_ARTICLES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__articles__a" type="ShowOn" value="articles!:"/>
|
||||
<field name="articles__selection" type="ContentArticles" multiple="true" default="" label="CON_ARTICLES" hiddenLabel="true"/>
|
||||
<field name="@showon__articles__b" type="ShowOn"/>
|
||||
<field name="@block__articles__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="content__article__featured">
|
||||
<!-- JOOMLA CONTENT :: ARTICLE FEATURED -->
|
||||
<field name="@block__featured__a" type="Block" start="1"/>
|
||||
<field name="featured" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_ARTICLE_FEATURED">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@block__featured__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="content__article__status">
|
||||
<!-- JOOMLA CONTENT :: ARTICLE PUBLISH STATE -->
|
||||
<field name="@block__article_status__a" type="Block" start="1"/>
|
||||
<field name="article_status" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_ARTICLE_STATUS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__article_status__a" type="ShowOn" value="article_status!:"/>
|
||||
<field name="article_status__selection" type="List" multiple="true" default="1" layout="joomla.form.field.list-fancy-select" label="CON_ARTICLE_STATUS" hiddenLabel="true">
|
||||
<option value="published">JPUBLISHED</option>
|
||||
<option value="unpublished">JUNPUBLISHED</option>
|
||||
<option value="archived">JARCHIVED</option>
|
||||
<option value="trashed">JTRASHED</option>
|
||||
</field>
|
||||
<field name="@showon__article_status__b" type="ShowOn"/>
|
||||
<field name="@block__article_status__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="content__article__date">
|
||||
<!-- JOOMLA CONTENT :: ARTICLE DATE -->
|
||||
<field name="@block__article_date__a" type="Block" start="1"/>
|
||||
<field name="article_date" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_ARTICLE_DATE">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__article_date__a" type="ShowOn" value="article_date!:"/>
|
||||
<field name="article_date__type" type="List" default="created" layout="joomla.form.field.list-fancy-select" label="CON_ARTICLE_DATE" hiddenLabel="true">
|
||||
<option value="created">COM_CONTENT_FIELD_CREATED_LABEL</option>
|
||||
<option value="modified">JGLOBAL_FIELD_MODIFIED_LABEL</option>
|
||||
<option value="publish_up">COM_CONTENT_FIELD_PUBLISH_UP_LABEL</option>
|
||||
<option value="publish_down">COM_CONTENT_FIELD_PUBLISH_DOWN_LABEL</option>
|
||||
</field>
|
||||
<field name="article_date__comparison" type="Radio" default="after" class="btn-group rl-btn-group btn-group-md" label="">
|
||||
<option value="before" class="btn btn-outline-info">CON_DATE_BEFORE</option>
|
||||
<option value="after" class="btn btn-outline-info">CON_DATE_AFTER</option>
|
||||
<option value="between" class="btn btn-outline-info">CON_DATE_BETWEEN</option>
|
||||
</field>
|
||||
<field name="@showon__article_date__before_after__a" type="ShowOn" value="article_date__comparison!:between"/>
|
||||
<field name="article_date__date" type="Calendar" showtime="true" filter="user_utc" format="%Y-%m-%d %H:%M" default="" label=""/>
|
||||
<field name="@showon__article_date__before_after__b" type="ShowOn"/>
|
||||
<field name="@showon__article_date__between__a" type="ShowOn" value="article_date__comparison:between"/>
|
||||
<field name="article_date__from" type="Calendar" showtime="true" filter="user_utc" format="%Y-%m-%d %H:%M" default="" label="CON_DATE_FROM"/>
|
||||
<field name="article_date__to" type="Calendar" showtime="true" filter="user_utc" format="%Y-%m-%d %H:%M" default="" label="CON_DATE_TO"/>
|
||||
<field name="@showon__article_date__between__b" type="ShowOn"/>
|
||||
<field name="@showon__article_date__b" type="ShowOn"/>
|
||||
<field name="@block__article_date__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="content__article__author">
|
||||
<!-- JOOMLA CONTENT :: ARTICLE AUTHORS -->
|
||||
<field name="@block__article_authors__a" type="Block" start="1"/>
|
||||
<field name="article_authors" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_ARTICLE_AUTHORS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__article_authors__a" type="ShowOn" value="article_authors!:"/>
|
||||
<field name="article_authors__selection" type="Users" multiple="true" show_current="true" default="" username_as_value="true" label="CON_ARTICLE_AUTHORS" hiddenLabel="true"/>
|
||||
<field name="@showon__article_authors__b" type="ShowOn"/>
|
||||
<field name="@block__article_authors__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__content__b">
|
||||
<field name="@block__group__content__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__visitor__a">
|
||||
<!-- VISITORS -->
|
||||
<field name="@block__group__visitor__a" type="Block" start="1" label="CON_VISITORS"/>
|
||||
</fieldset>
|
||||
<fieldset name="visitor__user">
|
||||
<!-- USERS -->
|
||||
<field name="@block__user__a" type="Block" start="1"/>
|
||||
<field name="users" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_USERS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__users__a" type="ShowOn" value="users!:"/>
|
||||
<field name="users__selection" type="Users" multiple="true" default="" username_as_value="true" label="CON_USERS" hiddenLabel="true"/>
|
||||
<field name="@showon__users__b" type="ShowOn"/>
|
||||
<field name="@block__users__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="visitor__access_level">
|
||||
<!-- ACCESS LEVEL -->
|
||||
<field name="@block__accesslevels__a" type="Block" start="1"/>
|
||||
<field name="accesslevels" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_ACCESS_LEVELS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__accesslevels__a" type="ShowOn" value="accesslevels!:"/>
|
||||
<field name="accesslevels__selection" type="AccessLevels" multiple="true" default="" text_as_value="true" label="CON_ACCESS_LEVELS" hiddenLabel="true"/>
|
||||
<field name="@showon__accesslevels__b" type="ShowOn"/>
|
||||
<field name="@block__accesslevels__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="visitor__user_group">
|
||||
<!-- USER GROUPS -->
|
||||
<field name="@block__usergroups__a" type="Block" start="1"/>
|
||||
<field name="usergroups" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_USER_GROUPS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__usergroups__a" type="ShowOn" value="usergroups!:"/>
|
||||
<field name="usergroups__selection" type="UserGroups" multiple="true" notregistered="1" default="" text_as_value="true" label="CON_USER_GROUPS" hiddenLabel="true"/>
|
||||
<field name="@showon__usergroups__b" type="ShowOn"/>
|
||||
<field name="@block__usergroups__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="visitor__language">
|
||||
<!-- LANGUAGES -->
|
||||
<field name="@block__languages__a" type="Block" start="1"/>
|
||||
<field name="languages" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_LANGUAGES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__languages__a" type="ShowOn" value="languages!:"/>
|
||||
<field name="languages__selection" type="Languages" multiple="true" default="" label="CON_LANGUAGES" hiddenLabel="true"/>
|
||||
<field name="@showon__languages__b" type="ShowOn"/>
|
||||
<field name="@block__languages__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="agent__device">
|
||||
<!-- DEVICES -->
|
||||
<field name="@block__devices__a" type="Block" start="1"/>
|
||||
<field name="devices" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_DEVICES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__devices__a" type="ShowOn" value="devices!:"/>
|
||||
<field name="devices__selection" type="List" multiple="true" default="" layout="joomla.form.field.list-fancy-select" label="CON_DEVICES" hiddenLabel="true">
|
||||
<option value="desktop">CON_DEVICES_DESKTOP</option>
|
||||
<option value="tablet">CON_DEVICES_TABLET</option>
|
||||
<option value="mobile">CON_DEVICES_MOBILE</option>
|
||||
</field>
|
||||
<field name="@note__devices" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_DEVICES_DESC"/>
|
||||
<field name="@showon__devices__b" type="ShowOn"/>
|
||||
<field name="@block__devices__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="visitor__ip">
|
||||
<!-- IPS -->
|
||||
<field name="@block__ips__a" type="Block" start="1"/>
|
||||
<field name="ips" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_IPS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__ips__a" type="ShowOn" value="ips!:"/>
|
||||
<field name="ips__selection" type="Textarea" default="" label="CON_IPS" hiddenLabel="true"/>
|
||||
<field name="@note__ips" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_IPS_DESC"/>
|
||||
<field name="@showon__ips__b" type="ShowOn"/>
|
||||
<field name="@block__ips__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__visitor__b">
|
||||
<field name="@block__group__visitor__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__geo__a">
|
||||
<!-- GEO LOCATION -->
|
||||
<field name="@block__group__geo__a" type="Block" start="1" label="CON_GEOLOCATION"/>
|
||||
<field name="has_geoip_library" type="IsInstalled" extension="geoip" extension_type="library"/>
|
||||
<field name="@showon__geo__1a" type="ShowOn" value="continents!:[OR]countries!:[OR]regions!:[OR]postalcodes!:"/>
|
||||
<field name="@note__geo__no_geoip_library" type="Note" class="rl-alert alert alert-danger" text="CON_GEO_NO_GEOIP_LIBRARY,<a href="https://regularlabs.com/geoip" class="btn btn-sm btn-success" target="_blank">,</a>" showon="has_geoip_library:0"/>
|
||||
<field name="@showon__geo__1b" type="ShowOn"/>
|
||||
</fieldset>
|
||||
<fieldset name="geo__continent">
|
||||
<!-- GEO LOCATION :: CONTINENTS -->
|
||||
<field name="@block__continents__a" type="Block" start="1"/>
|
||||
<field name="continents" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_CONTINENTS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__continents__a" type="ShowOn" value="continents!:"/>
|
||||
<field name="continents__selection" type="Geo" group="continents" multiple="true" default="" text_as_value="true" label="CON_CONTINENTS" hiddenLabel="true"/>
|
||||
<field name="@showon__continents__b" type="ShowOn"/>
|
||||
<field name="@block__continents__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="geo__country">
|
||||
<!-- GEO LOCATION :: COUNTRIES -->
|
||||
<field name="@block__countries__a" type="Block" start="1"/>
|
||||
<field name="countries" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_COUNTRIES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__countries__a" type="ShowOn" value="countries!:"/>
|
||||
<field name="countries__selection" type="Geo" group="countries" multiple="true" default="" text_as_value="true" label="CON_COUNTRIES" hiddenLabel="true"/>
|
||||
<field name="@showon__countries__b" type="ShowOn"/>
|
||||
<field name="@block__countries__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="geo__postal_code">
|
||||
<!-- GEO LOCATION :: POSTAL CODES -->
|
||||
<field name="@block__postalcodes__a" type="Block" start="1"/>
|
||||
<field name="postalcodes" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_POSTAL_CODES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__postalcodes__a" type="ShowOn" value="postalcodes!:"/>
|
||||
<field name="postalcodes__selection" type="Textarea" default="" label="CON_POSTAL_CODES" hiddenLabel="true"/>
|
||||
<field name="@note__postalcodes" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_POSTAL_CODES_DESC,<a href="https://www.maxmind.com/en/locate-my-ip-address/" target="_blank">,</a>"/>
|
||||
<field name="@showon__postalcodes__b" type="ShowOn"/>
|
||||
<field name="@block__postalcodes__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__geo__b">
|
||||
<!-- GEO LOCATION (footer) -->
|
||||
<field name="@showon__geo__2a" type="ShowOn" value="continents!:[OR]countries!:[OR]regions!:[OR]postalcodes!:"/>
|
||||
<field name="@note__geo__info" type="GeoInformation" showon="has_geoip_library:1"/>
|
||||
<field name="@note__geo" type="Note" class="rl-alert alert alert-warning" text="CON_GEO_DESC"/>
|
||||
<field name="@note__geo__has_geoip_library" type="Note" class="text-muted" text="CON_GEO_GEOIP_COPYRIGHT_DESC,<a href="http://www.maxmind.com" target="_blank">http://www.maxmind.com</a>" showon="has_geoip_library:1"/>
|
||||
<field name="@showon__geo__2b" type="ShowOn"/>
|
||||
<field name="@block__group__geo__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__other__a">
|
||||
<!-- MISCELLANEOUS -->
|
||||
<field name="@block__group__other__a" type="Block" start="1" label="CON_MISCELLANEOUS"/>
|
||||
</fieldset>
|
||||
<fieldset name="other__tag">
|
||||
<!-- TAGS -->
|
||||
<field name="@block__tags__a" type="Block" start="1"/>
|
||||
<field name="tags" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_TAGS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__tags__a" type="ShowOn" value="tags!:"/>
|
||||
<field name="tags__selection" type="Tags" multiple="true" default="" text_as_value="true" label="CON_TAGS" hiddenLabel="true"/>
|
||||
<field name="@showon__tags__b" type="ShowOn"/>
|
||||
<field name="@block__tags__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="other__component">
|
||||
<!-- COMPONENTS -->
|
||||
<field name="@block__components__a" type="Block" start="1"/>
|
||||
<field name="components" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_COMPONENTS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__components__a" type="ShowOn" value="components!:"/>
|
||||
<field name="components__selection" type="Components" multiple="true" admin="true" show_content="true" default="" no_com_prefix="true" label="CON_COMPONENTS" hiddenLabel="true"/>
|
||||
<field name="@showon__components__b" type="ShowOn"/>
|
||||
<field name="@block__components__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="other__template">
|
||||
<!-- TEMPLATES -->
|
||||
<field name="@block__templates__a" type="Block" start="1"/>
|
||||
<field name="templates" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_TEMPLATES">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__templates__a" type="ShowOn" value="templates!:"/>
|
||||
<field name="templates__selection" type="Templates" multiple="true" default="" label="CON_TEMPLATES" hiddenLabel="true"/>
|
||||
<field name="@showon__templates__b" type="ShowOn"/>
|
||||
<field name="@block__templates__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="other__url">
|
||||
<!-- URLS -->
|
||||
<field name="@block__urls__a" type="Block" start="1"/>
|
||||
<field name="urls" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_URLS">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__urls__a" type="ShowOn" value="urls!:"/>
|
||||
<field name="urls__selection" type="Textarea" default="" label="CON_URLS" hiddenLabel="true"/>
|
||||
<field name="@note__urls" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_URLS_DESC"/>
|
||||
<field name="@showon__urls__b" type="ShowOn"/>
|
||||
<field name="@block__urls__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="other__php">
|
||||
<!-- PHP -->
|
||||
<field name="@block__php__a" type="Block" start="1"/>
|
||||
<field name="php" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group" label="CON_PHP">
|
||||
<option value="" class="btn btn-outline-info">CON_IGNORE</option>
|
||||
<option value="include" class="btn btn-outline-success">CON_INCLUDE</option>
|
||||
<option value="exclude" class="btn btn-outline-danger">CON_EXCLUDE</option>
|
||||
</field>
|
||||
<field name="@showon__php__a" type="ShowOn" value="php!:"/>
|
||||
<field name="php__selection" type="Editor" editor="codemirror" height="120" default="" label="CON_PHP" hiddenLabel="true"/>
|
||||
<field name="@note__php" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_PHP_DESC,<pre>return ( $user->name == 'Peter van Westen' );</pre>"/>
|
||||
<field name="@showon__php__b" type="ShowOn"/>
|
||||
<field name="@block__php__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="group__other__b">
|
||||
<field name="@block__group__other__b" type="Block" end="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="inline__b">
|
||||
<field name="@note__more_in_condition_set" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_MORE_IN_CONDITION_SET"/>
|
||||
<field name="@note__more_in_pro" type="Note" class="rl-alert alert alert-info rl-alert-light" text="CON_MORE_IN_PRO,<a href="https://regularlabs.com/conditionalcontent/features" target="_blank">,</a>"/>
|
||||
<field name="@showon__use_inline__b" type="ShowOn"/>
|
||||
</fieldset>
|
||||
<fieldset name="messages">
|
||||
<field name="has_multiple_rules" type="Hidden" default="0"/>
|
||||
<field name="@showon__use_inline__c" type="ShowOn" value="use_inline:1[AND]has_conditions:0"/>
|
||||
<field name="@note__consider_condition_set" type="Note" class="rl-alert alert alert-warning rl-alert-light" text="CON_CONSIDER_CONDITION_SET" showon="has_multiple_rules:1"/>
|
||||
<field name="@showon__use_inline__d" type="ShowOn"/>
|
||||
</fieldset>
|
||||
</config>
|
||||
@ -0,0 +1,17 @@
|
||||
;; @package Conditional Content
|
||||
;; @version 5.2.2
|
||||
;;
|
||||
;; @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_EDITORS-XTD_CONDITIONALCONTENT="Button - Regular Labs - Conditional Content"
|
||||
PLG_EDITORS-XTD_CONDITIONALCONTENT_DESC="Conditional Content - restrict content based on your conditions in Joomla!"
|
||||
CONDITIONALCONTENT="Conditional Content"
|
||||
CONDITIONALCONTENT_DESC="With Conditional Content you can control the display of your content based on your conditions."
|
||||
|
||||
COC_SETTINGS="Please see the [[%1:start link%]]Conditional Content system plugin[[%2:end link%]] for settings."
|
||||
COC_THE_SYSTEM_PLUGIN="the Conditional Content system plugin"
|
||||
@ -0,0 +1,14 @@
|
||||
;; @package Conditional Content
|
||||
;; @version 5.2.2
|
||||
;;
|
||||
;; @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_EDITORS-XTD_CONDITIONALCONTENT="Button - Regular Labs - Conditional Content"
|
||||
PLG_EDITORS-XTD_CONDITIONALCONTENT_DESC="Conditional Content - restrict content based on your conditions in Joomla!"
|
||||
CONDITIONALCONTENT="Conditional Content"
|
||||
CONDITIONALCONTENT_DESC="With Conditional Content you can control the display of your content based on your conditions."
|
||||
@ -0,0 +1,17 @@
|
||||
;; @package Conditional Content
|
||||
;; @version 5.2.2
|
||||
;;
|
||||
;; @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_EDITORS-XTD_CONDITIONALCONTENT="Pulsante - Regular Labs - Conditional Content"
|
||||
PLG_EDITORS-XTD_CONDITIONALCONTENT_DESC="Conditional Content - Limita il contenuto Joomla! in base alle tue condizioni."
|
||||
CONDITIONALCONTENT="Conditional Content"
|
||||
CONDITIONALCONTENT_DESC="Con Conditional Content puoi controllare la visualizzazione del tuo contenuto in base alle tue condizioni."
|
||||
|
||||
COC_SETTINGS="Per favore leggi [[%1:start link%]]Conditional Content system plugin[[%2:end link%]] per le impostazioni."
|
||||
COC_THE_SYSTEM_PLUGIN="il Conditional Content system plugin"
|
||||
@ -0,0 +1,14 @@
|
||||
;; @package Conditional Content
|
||||
;; @version 5.2.2
|
||||
;;
|
||||
;; @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_EDITORS-XTD_CONDITIONALCONTENT="Pulsante - Regular Labs - Conditional Content"
|
||||
PLG_EDITORS-XTD_CONDITIONALCONTENT_DESC="Conditional Content - Limita il contenuto Joomla! in base alle tue condizioni."
|
||||
CONDITIONALCONTENT="Conditional Content"
|
||||
CONDITIONALCONTENT_DESC="Con Conditional Content puoi controllare la visualizzazione del tuo contenuto in base alle tue condizioni."
|
||||
58
plugins/editors-xtd/conditionalcontent/script.install.php
Normal file
58
plugins/editors-xtd/conditionalcontent/script.install.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Conditional Content
|
||||
* @version 5.2.2
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Filesystem\File as JFile;
|
||||
use Joomla\CMS\Filesystem\Folder as JFolder;
|
||||
|
||||
class PlgEditorsXtdConditionalContentInstallerScript
|
||||
{
|
||||
public function postflight($install_type, $adapter)
|
||||
{
|
||||
if ( ! in_array($install_type, ['install', 'update']))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
self::deleteJoomla3Files();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static function delete($files = [])
|
||||
{
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if (is_dir($file))
|
||||
{
|
||||
JFolder::delete($file);
|
||||
}
|
||||
|
||||
if (is_file($file))
|
||||
{
|
||||
JFile::delete($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function deleteJoomla3Files()
|
||||
{
|
||||
self::delete(
|
||||
[
|
||||
JPATH_SITE . '/plugins/editors-xtd/conditionalcontent/fields.xml',
|
||||
JPATH_SITE . '/plugins/editors-xtd/conditionalcontent/helper.php',
|
||||
JPATH_SITE . '/plugins/editors-xtd/conditionalcontent/popup.php',
|
||||
JPATH_SITE . '/plugins/editors-xtd/conditionalcontent/popup.tmpl.php',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,232 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Conditional Content
|
||||
* @version 5.2.2
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
namespace RegularLabs\Plugin\EditorButton\ConditionalContent\Form\Field;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text as JText;
|
||||
use Joomla\CMS\Object\CMSObject as JCMSObject;
|
||||
use RegularLabs\Component\Conditions\Administrator\Helper\Helper;
|
||||
use RegularLabs\Component\Conditions\Administrator\Model\ItemModel;
|
||||
use RegularLabs\Library\Document as RL_Document;
|
||||
use RegularLabs\Library\Form\FormField as RL_FormField;
|
||||
use RegularLabs\Library\Language as RL_Language;
|
||||
use RegularLabs\Library\ShowOn as RL_ShowOn;
|
||||
|
||||
class ConditionField extends RL_FormField
|
||||
{
|
||||
private $enabled_types;
|
||||
|
||||
public function getCondition()
|
||||
{
|
||||
return (new ItemModel)->getConditionByExtensionItem(
|
||||
$this->extension,
|
||||
$this->item_id,
|
||||
false,
|
||||
$this->enabled_types
|
||||
);
|
||||
}
|
||||
|
||||
protected function getButtonUrl($view, $task = '', $layout = 'modal')
|
||||
{
|
||||
return 'index.php?option=com_conditions'
|
||||
. '&view=' . $view
|
||||
. ($task ? '&task=' . $view . '.' . $task : '')
|
||||
. '&extension=conditionalcontent'
|
||||
. '&enabled_types=' . $this->enabled_types
|
||||
. '&layout=' . $layout
|
||||
. '&tmpl=component';
|
||||
}
|
||||
|
||||
protected function getInput()
|
||||
{
|
||||
$this->enabled_types = $this->get('enable', '');
|
||||
$this->enabled_types = str_replace(' ', '', $this->enabled_types);
|
||||
|
||||
RL_Language::load('com_conditions', JPATH_ADMINISTRATOR);
|
||||
RL_Document::script('regularlabs.regular');
|
||||
RL_Document::script('conditions.script');
|
||||
|
||||
$html = [];
|
||||
$html[] = '<input type="hidden" name="' . $this->getName('has_conditions') . '" id="' . $this->getId('', 'has_conditions') . '" value="0">';
|
||||
$html[] = '<input type="hidden" name="' . $this->getName('condition_id') . '" id="' . $this->getId('', 'condition_id') . '" value="">';
|
||||
$html[] = '<input type="hidden" name="' . $this->getName('condition_alias') . '" id="' . $this->getId('', 'condition_alias') . '" value="">';
|
||||
$html[] = '<input type="hidden" name="' . $this->getName('condition_name') . '" id="' . $this->getId('', 'condition_name') . '" value="">';
|
||||
$html[] = '<input type="hidden" name="' . $this->getName('use_inline') . '" id="' . $this->getId('', 'use_inline') . '" value="1">';
|
||||
$html[] = '<div id="rules_summary" class="position-relative">';
|
||||
$html[] = '<div id="rules_summary_message" class="alert alert-warning hidden">'
|
||||
. '</div>';
|
||||
$html[] = $this->getButtons();
|
||||
$html[] = '<div id="rules_summary_content" class="mt-4">';
|
||||
$html[] = '</div >';
|
||||
$html[] = '</div >';
|
||||
|
||||
return implode('', $html);
|
||||
}
|
||||
|
||||
protected function getLabel()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
private function addSaveButtons(&$options)
|
||||
{
|
||||
$modal = 'this.closest(\'.modal-content\')';
|
||||
$iframe = $modal . '.querySelector(\'.modal-body > iframe\')';
|
||||
$hide_self = 'this.classList.add(\'hidden\');';
|
||||
$save = $hide_self . $modal . ' && ' . $iframe . ' && ' . $iframe . '.contentWindow.Joomla.submitbutton(\'item.save\')';
|
||||
|
||||
$options = [
|
||||
...$options,
|
||||
'keyboard' => false,
|
||||
'backdrop' => 'static',
|
||||
'confirm2Text' => JText::_('JSAVE'),
|
||||
'confirm2Callback' => $save,
|
||||
'confirm2Class' => 'btn btn-success hidden conditions-button',
|
||||
'confirm2Icon' => 'save',
|
||||
];
|
||||
}
|
||||
|
||||
private function getButton($name, $text, $link, $icon, $class = 'primary', $options = [])
|
||||
{
|
||||
$button = new JCMSObject;
|
||||
$button->name = $this->id . '_' . $name;
|
||||
$button->text = JText::_($text);
|
||||
$button->icon = $icon;
|
||||
$button->class = 'btn-' . $class . ' mb-1';
|
||||
$button->options = $options;
|
||||
|
||||
if ($link)
|
||||
{
|
||||
$button->link = $link;
|
||||
}
|
||||
|
||||
return $button;
|
||||
}
|
||||
|
||||
private function getButtonCreate()
|
||||
{
|
||||
$options = [];
|
||||
$this->addSaveButtons($options);
|
||||
|
||||
return $this->renderButtonAndModal(
|
||||
'create',
|
||||
'CON_BUTTON_CREATE',
|
||||
$this->getButtonUrl('item', 'modaledit', 'modal_edit'),
|
||||
'file-add',
|
||||
'success',
|
||||
$options
|
||||
);
|
||||
}
|
||||
|
||||
private function getButtonInline()
|
||||
{
|
||||
$button = $this->getButton('inline',
|
||||
'COC_BUTTON_INLINE',
|
||||
'',
|
||||
'code',
|
||||
'warning'
|
||||
);
|
||||
$button->onclick = 'RegularLabs.ConditionalContentPopup.setInline();';
|
||||
|
||||
return $this->getRenderer('regularlabs.buttons.button')
|
||||
->addIncludePath(JPATH_SITE . '/libraries/regularlabs/layouts')
|
||||
->render($button);
|
||||
}
|
||||
|
||||
private function getButtonSelect()
|
||||
{
|
||||
if ( ! Helper::thereAreConditions())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->renderButton(
|
||||
'select',
|
||||
'CON_BUTTON_SELECT',
|
||||
$this->getButtonUrl('items', ''),
|
||||
'hand-pointer'
|
||||
);
|
||||
}
|
||||
|
||||
private function getButtons()
|
||||
{
|
||||
$html = [
|
||||
$this->getButtonSelect(),
|
||||
$this->getButtonCreate(),
|
||||
RL_ShowOn::open('use_inline:0[OR]has_conditions:1')
|
||||
. $this->getButtonInline()
|
||||
. RL_ShowOn::close(),
|
||||
|
||||
$this->getModalSelect(),
|
||||
];
|
||||
|
||||
return implode('<br>', $html);
|
||||
}
|
||||
|
||||
private function getModalButton($name, $text, $link, $icon, $class = 'primary', $options = [])
|
||||
{
|
||||
$button = $this->getButton($name, $text, $link, $icon, $class, $options);
|
||||
|
||||
$button->modal = true;
|
||||
$button->options = [
|
||||
'height' => '400px',
|
||||
'width' => '800px',
|
||||
'bodyHeight' => '70',
|
||||
'modalWidth' => '80',
|
||||
... $button->options,
|
||||
];
|
||||
|
||||
return $button;
|
||||
}
|
||||
|
||||
private function getModalSelect()
|
||||
{
|
||||
return $this->renderModal(
|
||||
'select',
|
||||
'CON_BUTTON_SELECT',
|
||||
$this->getButtonUrl('items', ''),
|
||||
'hand-pointer'
|
||||
);
|
||||
}
|
||||
|
||||
private function renderButton($name, $text, $link, $icon, $class = 'primary', $options = [])
|
||||
{
|
||||
$button = $this->getModalButton($name, $text, $link, $icon, $class, $options);
|
||||
|
||||
return $this->getRenderer('regularlabs.buttons.button')
|
||||
->addIncludePath(JPATH_SITE . '/libraries/regularlabs/layouts')
|
||||
->render($button);
|
||||
}
|
||||
|
||||
private function renderButtonAndModal(
|
||||
$name,
|
||||
$text,
|
||||
$link,
|
||||
$icon,
|
||||
$class = 'primary',
|
||||
$options = []
|
||||
)
|
||||
{
|
||||
return $this->renderButton($name, $text, $link, $icon, $class, $options)
|
||||
. $this->renderModal($name, $text, $link, $icon, $class, $options);
|
||||
}
|
||||
|
||||
private function renderModal($name, $text, $link, $icon, $class = 'primary', $options = [])
|
||||
{
|
||||
$button = $this->getModalButton($name, $text, $link, $icon, $class, $options);
|
||||
|
||||
return $this->getRenderer('regularlabs.buttons.modal')
|
||||
->addIncludePath(JPATH_SITE . '/libraries/regularlabs/layouts')
|
||||
->render($button);
|
||||
}
|
||||
}
|
||||
55
plugins/editors-xtd/conditionalcontent/src/Popup.php
Normal file
55
plugins/editors-xtd/conditionalcontent/src/Popup.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Conditional Content
|
||||
* @version 5.2.2
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
namespace RegularLabs\Plugin\EditorButton\ConditionalContent;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Form\Form as JForm;
|
||||
use RegularLabs\Library\Document as RL_Document;
|
||||
use RegularLabs\Library\EditorButtonPopup as RL_EditorButtonPopup;
|
||||
use RegularLabs\Library\Input as RL_Input;
|
||||
use RegularLabs\Library\RegEx as RL_RegEx;
|
||||
|
||||
class Popup extends RL_EditorButtonPopup
|
||||
{
|
||||
protected $extension = 'conditionalcontent';
|
||||
protected $require_core_auth = false;
|
||||
|
||||
protected function loadScripts()
|
||||
{
|
||||
$params = $this->getParams();
|
||||
|
||||
$this->editor_name = RL_Input::getString('editor', 'text');
|
||||
// Remove any dangerous character to prevent cross site scripting
|
||||
$this->editor_name = RL_RegEx::replace('[\'\";\s]', '', $this->editor_name);
|
||||
|
||||
RL_Document::scriptOptions([
|
||||
'tag_show' => $params->tag_show ?? 'show',
|
||||
'tag_hide' => $params->tag_hide ?? 'hide',
|
||||
'tag_characters' => explode('.', $params->tag_characters),
|
||||
'editor_name' => $this->editor_name,
|
||||
], 'conditionalcontent_button');
|
||||
|
||||
RL_Document::script('regularlabs.regular');
|
||||
RL_Document::script('regularlabs.admin-form');
|
||||
RL_Document::script('regularlabs.admin-form-descriptions');
|
||||
RL_Document::script('conditionalcontent.popup');
|
||||
|
||||
$xmlfile = dirname(__FILE__, 2) . '/forms/popup.xml';
|
||||
|
||||
$this->form = new JForm('conditionalcontent');
|
||||
$this->form->loadFile($xmlfile, 1, '//config');
|
||||
|
||||
$script = "document.addEventListener('DOMContentLoaded', function(){RegularLabs.ConditionalContentPopup.init()});";
|
||||
RL_Document::scriptDeclaration($script, 'Conditional Content Button', true, 'after');
|
||||
}
|
||||
}
|
||||
135
plugins/editors-xtd/conditionalcontent/tmpl/popup.php
Normal file
135
plugins/editors-xtd/conditionalcontent/tmpl/popup.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Conditional Content
|
||||
* @version 5.2.2
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper as JHtml;
|
||||
use Joomla\CMS\Language\Text as JText;
|
||||
use RegularLabs\Library\ArrayHelper as RL_Array;
|
||||
use RegularLabs\Library\Parameters as RL_Parameters;
|
||||
|
||||
$rule_types = [
|
||||
'menu' => [
|
||||
'menu__menu_item',
|
||||
'menu__home_page',
|
||||
],
|
||||
|
||||
'date' => [
|
||||
'date__date',
|
||||
],
|
||||
|
||||
|
||||
'visitor' => [
|
||||
'visitor__access_level',
|
||||
'visitor__user_group',
|
||||
'visitor__language',
|
||||
'agent__device',
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
$disabled_rule_types = RL_Array::toArray(RL_Parameters::getComponent('conditions')->disabled_rule_types);
|
||||
|
||||
foreach ($rule_types as $group => $types)
|
||||
{
|
||||
foreach ($types as $i => $type)
|
||||
{
|
||||
if (in_array($type, $disabled_rule_types))
|
||||
{
|
||||
unset($rule_types[$group][$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($rule_types as $group => $types)
|
||||
{
|
||||
if (empty($types))
|
||||
{
|
||||
unset($rule_types[$group]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form action="index.php" id="adminForm" name="conditionalcontentForm" method="post"
|
||||
class="rl-form labels-sm">
|
||||
<div class="container-fluid container-main">
|
||||
<div class="row">
|
||||
<div class="fixed-top d-lg-none">
|
||||
<button type="button" class="btn btn-success mb-4 w-100"
|
||||
onclick="RegularLabs.ConditionalContentPopup.insertText();window.parent.Joomla.Modal.getCurrent().close();">
|
||||
<span class="icon-file-import" aria-hidden="true"></span>
|
||||
<?php echo JText::_('RL_INSERT'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="pt-5 d-lg-none"></div>
|
||||
|
||||
<div class="col-lg-6 border-end">
|
||||
<input type="hidden" name="type" id="type" value="url">
|
||||
<?php echo JHtml::_('uitab.startTabSet', 'main', ['active' => 'tab-content']); ?>
|
||||
|
||||
<?php echo JHtml::_('uitab.addTab', 'main', 'tab-content', JText::_('COC_CONTENT')); ?>
|
||||
<div class="form-vertical">
|
||||
<?php echo $this->form->renderFieldset($this->params->use_editors ? 'content' : 'content_no_editor'); ?>
|
||||
</div>
|
||||
<?php echo JHtml::_('uitab.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('uitab.addTab', 'main', 'tab-alternative', JText::_('COC_ALTERNATIVE_CONTENT')); ?>
|
||||
<div class="form-vertical">
|
||||
<?php echo $this->form->renderFieldset($this->params->use_editors ? 'alternative' : 'alternative_no_editor'); ?>
|
||||
</div>
|
||||
<?php echo JHtml::_('uitab.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('uitab.addTab', 'main', 'tab-conditions', JText::_('COC_CONDITIONS')); ?>
|
||||
<?php echo $this->form->renderFieldset('conditions'); ?>
|
||||
|
||||
<div id="inline_rules">
|
||||
<?php
|
||||
|
||||
echo $this->form->renderFieldset('inline__a');
|
||||
|
||||
foreach ($rule_types as $group => $types)
|
||||
{
|
||||
echo $this->form->renderFieldset('group__' . $group . '__a');
|
||||
|
||||
foreach ($types as $type)
|
||||
{
|
||||
echo $this->form->renderFieldset($type);
|
||||
}
|
||||
|
||||
echo $this->form->renderFieldset('group__' . $group . '__b');
|
||||
}
|
||||
|
||||
echo $this->form->renderFieldset('inline__b');
|
||||
?>
|
||||
</div>
|
||||
<?php echo JHtml::_('uitab.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('uitab.endTabSet'); ?>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="position-sticky" style="top:1.25rem;">
|
||||
<button type="button" class="btn btn-success mb-4 w-100 hidden d-lg-block"
|
||||
onclick="RegularLabs.ConditionalContentPopup.insertText();window.parent.Joomla.Modal.getCurrent().close();">
|
||||
<span class="icon-file-import" aria-hidden="true"></span>
|
||||
<?php echo JText::_('RL_INSERT'); ?>
|
||||
</button>
|
||||
<fieldset class="options-form mt-2 position-relative">
|
||||
<legend class="mb-1"><?php echo JText::_('JGLOBAL_PREVIEW'); ?></legend>
|
||||
<span id="preview_spinner" class="rl-spinner hidden"></span>
|
||||
<div id="preview_code" class="hidden"></div>
|
||||
</fieldset>
|
||||
<?php echo $this->form->renderFieldset('messages'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
21
plugins/editors-xtd/contact/contact.xml
Normal file
21
plugins/editors-xtd/contact/contact.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_contact</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2016-10</creationDate>
|
||||
<copyright>(C) 2016 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.7.0</version>
|
||||
<description>PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\Contact</namespace>
|
||||
<files>
|
||||
<folder plugin="contact">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_contact.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_contact.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/contact/services/provider.php
Normal file
46
plugins/editors-xtd/contact/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.contact
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\Contact\Extension\Contact;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Contact(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'contact')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
112
plugins/editors-xtd/contact/src/Extension/Contact.php
Normal file
112
plugins/editors-xtd/contact/src/Extension/Contact.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.contact
|
||||
*
|
||||
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\Contact\Extension;
|
||||
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor Contact button
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
final class Contact extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$subject = $event->getButtonsRegistry();
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId());
|
||||
|
||||
if ($button) {
|
||||
$subject->add($button);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button
|
||||
*
|
||||
* @param string $name The name of the button to add
|
||||
*
|
||||
* @return Button|void The button options as Button object
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @deprecated 5.0 Use onEditorButtonsSetup event
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
$user = $this->getApplication()->getIdentity();
|
||||
|
||||
if (
|
||||
$user->authorise('core.create', 'com_contact')
|
||||
|| $user->authorise('core.edit', 'com_contact')
|
||||
|| $user->authorise('core.edit.own', 'com_contact')
|
||||
) {
|
||||
$this->loadLanguage();
|
||||
|
||||
// The URL for the contacts list
|
||||
$link = 'index.php?option=com_contact&view=contacts&layout=modal&tmpl=component&'
|
||||
. Session::getFormToken() . '=1&editor=' . $name;
|
||||
|
||||
$button = new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'modal',
|
||||
'link' => $link,
|
||||
'text' => Text::_('PLG_EDITORS-XTD_CONTACT_BUTTON_CONTACT'),
|
||||
'icon' => 'address',
|
||||
'iconSVG' => '<svg viewBox="0 0 448 512" width="24" height="24"><path d="M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c'
|
||||
. '0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 1'
|
||||
. '2-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-228-32c35.3 0 64 28.7'
|
||||
. ' 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H118.4C106 384 96 375.4 96 364.'
|
||||
. '8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z">'
|
||||
. '</path></svg>',
|
||||
// This is whole Plugin name, it is needed for keeping backward compatibility
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
]
|
||||
);
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
}
|
||||
68
plugins/editors-xtd/eventcalendar/eventcalendar.php
Normal file
68
plugins/editors-xtd/eventcalendar/eventcalendar.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: eventcalendar.php 14401 2010-01-26 14:10:00Z louis $
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
* Joomla! is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses.
|
||||
* See COPYRIGHT.php for copyright notices and details.
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die( 'Restricted access' );
|
||||
|
||||
jimport( 'joomla.plugin.plugin' );
|
||||
|
||||
/**
|
||||
* Editor EventCalendar buton
|
||||
*
|
||||
* @package Editors-xtd
|
||||
* @since 1.5
|
||||
*/
|
||||
class plgButtonEventCalendar extends JPlugin
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access protected
|
||||
* @param object $subject The object to observe
|
||||
* @param array $config An array that holds the plugin configuration
|
||||
* @since 1.5
|
||||
*/
|
||||
public function __construct(& $subject, $config)
|
||||
{
|
||||
parent::__construct($subject, $config);
|
||||
$this->loadLanguage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button
|
||||
*
|
||||
* @return array A two element array of (imageName, textToInsert)
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
$doc = JFactory::getDocument();
|
||||
$template = $app->getTemplate();
|
||||
|
||||
|
||||
$link = 'index.php?option=com_cpeventcalendar&task=insert&view=insert&e_name='.$name;
|
||||
|
||||
JHTML::_('behavior.modal');
|
||||
|
||||
$button = new JObject();
|
||||
$button->class = 'btn';
|
||||
$button->set('modal', true);
|
||||
$button->set('link', $link);
|
||||
$button->set('text', JText::_('EventCalendar'));
|
||||
$button->set('name', 'blank');
|
||||
$button->set('options', "{handler: 'iframe', size: {x: 400, y: 220}}");
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
16
plugins/editors-xtd/eventcalendar/eventcalendar.xml
Normal file
16
plugins/editors-xtd/eventcalendar/eventcalendar.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="1.7" type="plugin" group="editors-xtd">
|
||||
<name>Button - Event Calendar</name>
|
||||
<author>Codepeople</author>
|
||||
<creationDate>Julio 2011</creationDate>
|
||||
<copyright>Copyright (C) 2011 Codepeople. All rights reserved.</copyright>
|
||||
<license>GNU/GPL http://www.gnu.org/copyleft/gpl.html</license>
|
||||
<authorEmail>info@joomlacalendars.com</authorEmail>
|
||||
<authorUrl>www.joomlacalendars.org</authorUrl>
|
||||
<version>1.0</version>
|
||||
<description>Insert Event Calendar placeholders in article contents</description>
|
||||
<files>
|
||||
<filename plugin="eventcalendar">eventcalendar.php</filename>
|
||||
</files>
|
||||
<params />
|
||||
</extension>
|
||||
21
plugins/editors-xtd/fields/fields.xml
Normal file
21
plugins/editors-xtd/fields/fields.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_fields</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2017-02</creationDate>
|
||||
<copyright>(C) 2017 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.7.0</version>
|
||||
<description>PLG_EDITORS-XTD_FIELDS_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\Fields</namespace>
|
||||
<files>
|
||||
<folder plugin="fields">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_fields.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_fields.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/fields/services/provider.php
Normal file
46
plugins/editors-xtd/fields/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.fields
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\Fields\Extension\Fields;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Fields(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'fields')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
117
plugins/editors-xtd/fields/src/Extension/Fields.php
Normal file
117
plugins/editors-xtd/fields/src/Extension/Fields.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.fields
|
||||
*
|
||||
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\Fields\Extension;
|
||||
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor Fields button
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
final class Fields extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$subject = $event->getButtonsRegistry();
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId());
|
||||
|
||||
if ($button) {
|
||||
$subject->add($button);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button
|
||||
*
|
||||
* @param string $name The name of the button to add
|
||||
*
|
||||
* @return Button|void The button options as Button object
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
// Check if com_fields is enabled
|
||||
if (!ComponentHelper::isEnabled('com_fields')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->loadLanguage();
|
||||
|
||||
// Guess the field context based on view.
|
||||
$jinput = $this->getApplication()->getInput();
|
||||
$context = $jinput->get('option') . '.' . $jinput->get('view');
|
||||
|
||||
// Special context for com_categories
|
||||
if ($context === 'com_categories.category') {
|
||||
$context = $jinput->get('extension', 'com_content') . '.categories';
|
||||
}
|
||||
|
||||
$link = 'index.php?option=com_fields&view=fields&layout=modal&tmpl=component&context='
|
||||
. $context . '&editor=' . $name . '&' . Session::getFormToken() . '=1';
|
||||
|
||||
$button = new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'modal',
|
||||
'link' => $link,
|
||||
'text' => Text::_('PLG_EDITORS-XTD_FIELDS_BUTTON_FIELD'),
|
||||
'icon' => 'puzzle',
|
||||
'iconSVG' => '<svg viewBox="0 0 576 512" width="24" height="24"><path d="M519.442 288.651c-41.519 0-59.5 31.593-82.058 31.593C377.'
|
||||
. '409 320.244 432 144 432 144s-196.288 80-196.288-3.297c0-35.827 36.288-46.25 36.288-85.985C272 19.216 243.885 0 210.'
|
||||
. '539 0c-34.654 0-66.366 18.891-66.366 56.346 0 41.364 31.711 59.277 31.711 81.75C175.885 207.719 0 166.758 0 166.758'
|
||||
. 'v333.237s178.635 41.047 178.635-28.662c0-22.473-40-40.107-40-81.471 0-37.456 29.25-56.346 63.577-56.346 33.673 0 61'
|
||||
. '.788 19.216 61.788 54.717 0 39.735-36.288 50.158-36.288 85.985 0 60.803 129.675 25.73 181.23 25.73 0 0-34.725-120.1'
|
||||
. '01 25.827-120.101 35.962 0 46.423 36.152 86.308 36.152C556.712 416 576 387.99 576 354.443c0-34.199-18.962-65.792-56'
|
||||
. '.558-65.792z"></path></svg>',
|
||||
// This is whole Plugin name, it is needed for keeping backward compatibility
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
]
|
||||
);
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
21
plugins/editors-xtd/image/image.xml
Normal file
21
plugins/editors-xtd/image/image.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_image</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2004-08</creationDate>
|
||||
<copyright>(C) 2005 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.0.0</version>
|
||||
<description>PLG_IMAGE_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\Image</namespace>
|
||||
<files>
|
||||
<folder plugin="image">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_image.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_image.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/image/services/provider.php
Normal file
46
plugins/editors-xtd/image/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.image
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\Image\Extension\Image;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Image(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'image')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
214
plugins/editors-xtd/image/src/Extension/Image.php
Normal file
214
plugins/editors-xtd/image/src/Extension/Image.php
Normal file
@ -0,0 +1,214 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.image
|
||||
*
|
||||
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\Image\Extension;
|
||||
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor Image button
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
final class Image extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId(), $event->getAsset(), $event->getAuthor());
|
||||
|
||||
if ($button) {
|
||||
$event->getButtonsRegistry()->add($button);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button.
|
||||
*
|
||||
* @param string $name The name of the button to display.
|
||||
* @param string $asset The name of the asset being edited.
|
||||
* @param integer $author The id of the author owning the asset being edited.
|
||||
*
|
||||
* @return Button|false
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public function onDisplay($name, $asset, $author)
|
||||
{
|
||||
$doc = $this->getApplication()->getDocument();
|
||||
$user = $this->getApplication()->getIdentity();
|
||||
$extension = $this->getApplication()->getInput()->get('option');
|
||||
|
||||
// For categories we check the extension (ex: component.section)
|
||||
if ($extension === 'com_categories') {
|
||||
$parts = explode('.', $this->getApplication()->getInput()->get('extension', 'com_content'));
|
||||
$extension = $parts[0];
|
||||
}
|
||||
|
||||
$asset = $asset !== '' ? $asset : $extension;
|
||||
|
||||
if (
|
||||
$user->authorise('core.edit', $asset)
|
||||
|| $user->authorise('core.create', $asset)
|
||||
|| (\count($user->getAuthorisedCategories($asset, 'core.create')) > 0)
|
||||
|| ($user->authorise('core.edit.own', $asset) && $author === $user->id)
|
||||
|| (\count($user->getAuthorisedCategories($extension, 'core.edit')) > 0)
|
||||
|| (\count($user->getAuthorisedCategories($extension, 'core.edit.own')) > 0 && $author === $user->id)
|
||||
) {
|
||||
$this->loadLanguage();
|
||||
|
||||
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $doc->getWebAssetManager();
|
||||
|
||||
// Register the button assets
|
||||
if (!$wa->assetExists('script', 'editor-button.image')) {
|
||||
$wa->registerStyle('editor-button.image', '', [], [], ['webcomponent.media-select']);
|
||||
$wa->registerScript(
|
||||
'editor-button.image',
|
||||
'plg_editors-xtd_image/button-image.js',
|
||||
[],
|
||||
['type' => 'module'],
|
||||
['webcomponent.media-select', 'editors', 'joomla.dialog']
|
||||
);
|
||||
}
|
||||
|
||||
$doc->addScriptOptions('media-picker-api', ['apiBaseUrl' => Uri::base(true) . '/index.php?option=com_media&format=json']);
|
||||
|
||||
if (!$doc->getScriptOptions('media-picker')) {
|
||||
$imagesExt = array_map(
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
ComponentHelper::getParams('com_media')->get(
|
||||
'image_extensions',
|
||||
'bmp,gif,jpg,jpeg,png,webp'
|
||||
)
|
||||
)
|
||||
);
|
||||
$audiosExt = array_map(
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
ComponentHelper::getParams('com_media')->get(
|
||||
'audio_extensions',
|
||||
'mp3,m4a,mp4a,ogg'
|
||||
)
|
||||
)
|
||||
);
|
||||
$videosExt = array_map(
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
ComponentHelper::getParams('com_media')->get(
|
||||
'video_extensions',
|
||||
'mp4,mp4v,mpeg,mov,webm'
|
||||
)
|
||||
)
|
||||
);
|
||||
$documentsExt = array_map(
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
ComponentHelper::getParams('com_media')->get(
|
||||
'doc_extensions',
|
||||
'doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$doc->addScriptOptions('media-picker', [
|
||||
'images' => $imagesExt,
|
||||
'audios' => $audiosExt,
|
||||
'videos' => $videosExt,
|
||||
'documents' => $documentsExt,
|
||||
]);
|
||||
}
|
||||
|
||||
Text::script('JCLOSE');
|
||||
Text::script('PLG_IMAGE_BUTTON_INSERT');
|
||||
Text::script('JFIELD_MEDIA_LAZY_LABEL');
|
||||
Text::script('JFIELD_MEDIA_ALT_LABEL');
|
||||
Text::script('JFIELD_MEDIA_ALT_CHECK_LABEL');
|
||||
Text::script('JFIELD_MEDIA_ALT_CHECK_DESC_LABEL');
|
||||
Text::script('JFIELD_MEDIA_CLASS_LABEL');
|
||||
Text::script('JFIELD_MEDIA_FIGURE_CLASS_LABEL');
|
||||
Text::script('JFIELD_MEDIA_FIGURE_CAPTION_LABEL');
|
||||
Text::script('JFIELD_MEDIA_LAZY_LABEL');
|
||||
Text::script('JFIELD_MEDIA_SUMMARY_LABEL');
|
||||
Text::script('JFIELD_MEDIA_EMBED_CHECK_DESC_LABEL');
|
||||
Text::script('JFIELD_MEDIA_DOWNLOAD_CHECK_DESC_LABEL');
|
||||
Text::script('JFIELD_MEDIA_DOWNLOAD_CHECK_LABEL');
|
||||
Text::script('JFIELD_MEDIA_EMBED_CHECK_LABEL');
|
||||
Text::script('JFIELD_MEDIA_WIDTH_LABEL');
|
||||
Text::script('JFIELD_MEDIA_TITLE_LABEL');
|
||||
Text::script('JFIELD_MEDIA_HEIGHT_LABEL');
|
||||
Text::script('JFIELD_MEDIA_UNSUPPORTED');
|
||||
Text::script('JFIELD_MEDIA_DOWNLOAD_FILE');
|
||||
|
||||
$link = 'index.php?option=com_media&view=media&tmpl=component&e_name=' . $name . '&asset=' . $asset . '&mediatypes=0,1,2,3' . '&author=' . $author;
|
||||
|
||||
return new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'modal-media',
|
||||
'text' => Text::_('PLG_IMAGE_BUTTON_IMAGE'),
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
'icon' => 'pictures',
|
||||
'link' => $link,
|
||||
'iconSVG' => '<svg width="24" height="24" viewBox="0 0 512 512"><path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48'
|
||||
. ' 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6'
|
||||
. ' 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40'
|
||||
. 'zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4'
|
||||
. '.686-16.971 0L96 304v48z"></path></svg>',
|
||||
],
|
||||
[
|
||||
'popupType' => 'iframe',
|
||||
'textHeader' => Text::_('PLG_IMAGE_BUTTON_IMAGE'),
|
||||
'iconHeader' => 'icon-pictures',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
1
plugins/editors-xtd/insert_attachments_token/index.html
Normal file
1
plugins/editors-xtd/insert_attachments_token/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/**
|
||||
* Add Attachments Button plugin
|
||||
*
|
||||
* @package Attachments
|
||||
* @subpackage Insert_Attachments_Token_Button_Plugin
|
||||
*
|
||||
* @copyright Copyright (C) 2007-2018 Jonathan M. Cameron, All Rights Reserved
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
* @link http://joomlacode.org/gf/project/attachments/frs/
|
||||
* @author Jonathan M. Cameron
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined( '_JEXEC' ) or die('Restricted access');
|
||||
|
||||
jimport('joomla.plugin.plugin');
|
||||
|
||||
/**
|
||||
* Button that allows you to insert an {attachments} token into the text from the editor
|
||||
*
|
||||
* @package Attachments
|
||||
*/
|
||||
class plgButtonInsert_attachments_token extends JPlugin
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param &object &$subject The object to observe
|
||||
* @param array $config An array that holds the plugin configuration
|
||||
* @since 1.5
|
||||
*/
|
||||
public function __construct(&$subject, $config)
|
||||
{
|
||||
parent::__construct($subject, $config);
|
||||
$this->loadLanguage();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert attachments token button
|
||||
*
|
||||
* @param string $name The name of the editor form
|
||||
* @param int $asset The asset ID for the entity being edited
|
||||
* @param int $authro The ID of the author of the entity
|
||||
*
|
||||
* @return a button
|
||||
*/
|
||||
public function onDisplay($name, $asset, $author)
|
||||
{
|
||||
// Get the component parameters
|
||||
jimport('joomla.application.component.helper');
|
||||
$params = JComponentHelper::getParams('com_attachments');
|
||||
|
||||
// This button should only be displayed in 'custom placement' mode.
|
||||
// Check to make sure that is the case
|
||||
$placement = $params->get('attachments_placement', 'end');
|
||||
if ( $placement != 'custom' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Avoid displaying the button for anything except for registered parents
|
||||
$parent_type = JRequest::getCmd('option');
|
||||
|
||||
// Handle sections and categories specially (since they are really com_content)
|
||||
if ($parent_type == 'com_categories') {
|
||||
$parent_type = 'com_content';
|
||||
}
|
||||
|
||||
// Get the article/parent handler
|
||||
JPluginHelper::importPlugin('attachments');
|
||||
$apm = getAttachmentsPluginManager();
|
||||
if ( !$apm->attachmentsPluginInstalled($parent_type) ) {
|
||||
// Exit if there is no Attachments plugin to handle this parent_type
|
||||
return new JObject();
|
||||
}
|
||||
|
||||
// Get ready for language things
|
||||
$lang = JFactory::getLanguage();
|
||||
if ( !$lang->load('plg_editors-xtd_insert_attachments_token', dirname(__FILE__)) ) {
|
||||
// If the desired translation is not available, at least load the English
|
||||
$lang->load('plg_editors-xtd_insert_attachments_token', JPATH_ADMINISTRATOR, 'en-GB');
|
||||
}
|
||||
|
||||
// Set up the Javascript to insert the tag
|
||||
$getContent = $this->_subject->getContent($name);
|
||||
$present = JText::_('ATTACH_ATTACHMENTS_TOKEN_ALREADY_PRESENT', true) ;
|
||||
$js = "
|
||||
function insertAttachmentsToken(editor) {
|
||||
var content = $getContent
|
||||
if (content.match(/\{\s*attachments/i)) {
|
||||
alert('$present');
|
||||
return false;
|
||||
} else {
|
||||
jInsertEditorText('<span class=\"hide_attachments_token\">{attachments}</span>', editor);
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$doc = JFactory::getDocument();
|
||||
$uri = JFactory::getURI();
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
|
||||
// Add the regular css file
|
||||
JHtml::stylesheet('com_attachments/attachments_list.css', Array(), true);
|
||||
JHtml::stylesheet('com_attachments/insert_attachments_token_button.css', Array(), true);
|
||||
|
||||
// Handle RTL styling (if necessary)
|
||||
if ( $lang->isRTL() ) {
|
||||
JHtml::stylesheet('com_attachments/attachments_list_rtl.css', Array(), true);
|
||||
JHtml::stylesheet('com_attachments/insert_attachments_token_button_rtl.css', Array(), true);
|
||||
}
|
||||
|
||||
$button = new JObject();
|
||||
$button->set('modal', false);
|
||||
$button->set('class', 'btn');
|
||||
$button->set('onclick', 'insertAttachmentsToken(\''.$name.'\');return false;');
|
||||
$button->set('text', JText::_('ATTACH_ATTACHMENTS_TOKEN'));
|
||||
$button->set('title', JText::_('ATTACH_ATTACHMENTS_TOKEN_DESCRIPTION'));
|
||||
|
||||
if ( $app->isAdmin() ) {
|
||||
$button_name = 'insert_attachments_token';
|
||||
if (version_compare(JVERSION, '3.3', 'ge')) {
|
||||
$button_name = 'paperclip';
|
||||
}
|
||||
$button->set('name', $button_name);
|
||||
}
|
||||
else {
|
||||
$button_name = 'insert_attachments_token_frontend';
|
||||
if (version_compare(JVERSION, '3.3', 'ge')) {
|
||||
$button_name = 'paperclip';
|
||||
}
|
||||
$button->set('name', $button_name);
|
||||
}
|
||||
|
||||
// TODO: The button writer needs to take into account the javascript directive
|
||||
// $button->set('link', 'javascript:void(0)');
|
||||
$button->set('link', '#');
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" group="editors-xtd" version="2.5" method="upgrade">
|
||||
<name>plg_editors-xtd_insert_attachments_token_btn</name>
|
||||
<version>3.2.6</version>
|
||||
<creationDate>March 26, 2018</creationDate>
|
||||
<author>Jonathan M. Cameron</author>
|
||||
<copyright>(C) 2007-2018 Jonathan M. Cameron. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
|
||||
<authorEmail>jmcameron@jmcameron.net</authorEmail>
|
||||
<authorUrl>http://joomlacode.org/gf/project/attachments/</authorUrl>
|
||||
<description>ATTACH_INSERT_ATTACHMENTS_TOKEN_BUTTON_PLUGIN_DESCRIPTION</description>
|
||||
|
||||
<files>
|
||||
<filename plugin="insert_attachments_token">insert_attachments_token.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
|
||||
</extension>
|
||||
@ -0,0 +1,18 @@
|
||||
; en-GB.plg_editors-xtd_add_attachment.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2018 Jonathan M. Cameron, All rights reserved.
|
||||
; License http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; English translation
|
||||
|
||||
; NOTE TO TRANSLATORS:
|
||||
; Do not translate the '{attachments}' part of any of the right-hand
|
||||
; strings below! It must appear exactly as '{attachments}' in the
|
||||
; article/parent text in order for the substitutions to work correctly in
|
||||
; 'custom placement' mode.!
|
||||
|
||||
ATTACH_ATTACHMENTS_TOKEN="Insert {attachments} token"
|
||||
ATTACH_ATTACHMENTS_TOKEN_ALREADY_PRESENT="The {attachments} token is already present. It can only appear in one location in the text!"
|
||||
ATTACH_ATTACHMENTS_TOKEN_DESCRIPTION="Place the cursor in the location where you want the attachments list to display (in the front end) and then click on this button. This inserts the {attachments} token that the 'Custom Placement' option uses. Some HTML is also added to hide the token when attachments lists are not shown."
|
||||
ATTACH_INSERT_ATTACHMENTS_TOKEN_BUTTON_PLUGIN_DESCRIPTION="The insert attachments token plugin adds a button that allows you to insert an {attachments} custom placement token while editing articles or categories."
|
||||
@ -0,0 +1,16 @@
|
||||
; en-GB.plg_editors-xtd_add_attachment.sys.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2018 Jonathan M. Cameron, All rights reserved.
|
||||
; License http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; English translation
|
||||
|
||||
; NOTE TO TRANSLATORS:
|
||||
; Do not translate the '{attachments}' part of any of the right-hand
|
||||
; strings below! It must appear exactly as '{attachments}' in the
|
||||
; article/parent text in order for the substitutions to work correctly in
|
||||
; 'custom placement' mode.!
|
||||
|
||||
ATTACH_INSERT_ATTACHMENTS_TOKEN_BUTTON_PLUGIN_DESCRIPTION="The insert attachments token plugin adds a button that allows you to insert an {attachments} custom placement token while editing articles or categories."
|
||||
PLG_EDITORS-XTD_INSERT_ATTACHMENTS_TOKEN_BTN="Editor Button - Insert Attachments Token"
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,18 @@
|
||||
; it-IT.plg_editors-xtd_add_attachment.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2013 Jonathan M. Cameron, All rights reserved.
|
||||
; License GNU GPL 3: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; Italian translation by: Piero Mattirolo (2.0, 3.0), Lemminkainen (version 1.3.4)
|
||||
|
||||
; NOTE TO TRANSLATORS:
|
||||
; Do not translate the '{attachments}' part of any of the right-hand
|
||||
; strings below! It must appear exactly as '{attachments}' in the
|
||||
; article/parent text in order for the substitutions to work correctly in
|
||||
; 'custom placement' mode.!
|
||||
|
||||
ATTACH_ATTACHMENTS_TOKEN="Inserisce segnaposto {attachments}"
|
||||
ATTACH_ATTACHMENTS_TOKEN_ALREADY_PRESENT="Il segnaposto {attachments} è già presente. Può soltanto apparire in una sola posizione nel testo!"
|
||||
ATTACH_ATTACHMENTS_TOKEN_DESCRIPTION="Inserire il cursore nella posizione dove si desidere mostrare la lista allegati (nel front end) e premere il bottone. Questo inserisce il segnaposto {attachments} utilizzato dall'opzione 'Posizione personalizzata'. Viene inserito del codice HTML che nasconde il segnaposto quando la lista degli allegati non viene mostrata."
|
||||
ATTACH_INSERT_ATTACHMENTS_TOKEN_BUTTON_PLUGIN_DESCRIPTION="Il plugin aggiunge un bottone che permette di inserire un segnaposto personalizzato {attachments} in fase di modifica di articoli o categorie."
|
||||
@ -0,0 +1,16 @@
|
||||
; it-IT.plg_editors-xtd_add_attachment.sys.ini
|
||||
; Attachments for Joomla! extension
|
||||
; Copyright (C) 2007-2013 Jonathan M. Cameron, All rights reserved.
|
||||
; License GNU GPL 3: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
; Italian translation by: Piero Mattirolo (2.0, 3.0), Lemminkainen (version 1.3.4)
|
||||
|
||||
; NOTE TO TRANSLATORS:
|
||||
; Do not translate the '{attachments}' part of any of the right-hand
|
||||
; strings below! It must appear exactly as '{attachments}' in the
|
||||
; article/parent text in order for the substitutions to work correctly in
|
||||
; 'custom placement' mode.!
|
||||
|
||||
ATTACH_INSERT_ATTACHMENTS_TOKEN_BUTTON_PLUGIN_DESCRIPTION="Questo plugin aggiunge un bottone che permette di inserire un segnaposto personalizzato per l'inserimento di {attachments} mentre si modificano articoli o categorie."
|
||||
PLG_EDITORS-XTD_INSERT_ATTACHMENTS_TOKEN_BTN="Bottone Editor - Inserisce segnaposto allegati"
|
||||
21
plugins/editors-xtd/menu/menu.xml
Normal file
21
plugins/editors-xtd/menu/menu.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_menu</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2016-08</creationDate>
|
||||
<copyright>(C) 2016 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.7.0</version>
|
||||
<description>PLG_EDITORS-XTD_MENU_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\Menu</namespace>
|
||||
<files>
|
||||
<folder plugin="menu">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_menu.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_menu.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/menu/services/provider.php
Normal file
46
plugins/editors-xtd/menu/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.article
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\Menu\Extension\Menu;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Menu(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'menu')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
110
plugins/editors-xtd/menu/src/Extension/Menu.php
Normal file
110
plugins/editors-xtd/menu/src/Extension/Menu.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.menu
|
||||
*
|
||||
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\Menu\Extension;
|
||||
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor menu button
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
final class Menu extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$subject = $event->getButtonsRegistry();
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId());
|
||||
|
||||
if ($button) {
|
||||
$subject->add($button);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button
|
||||
*
|
||||
* @param string $name The name of the button to add
|
||||
*
|
||||
* @return Button|void The button options as Button object
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @deprecated 5.0 Use onEditorButtonsSetup event
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
$user = $this->getApplication()->getIdentity();
|
||||
|
||||
if (
|
||||
$user->authorise('core.create', 'com_menus')
|
||||
|| $user->authorise('core.edit', 'com_menus')
|
||||
) {
|
||||
$this->loadLanguage();
|
||||
|
||||
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&'
|
||||
. Session::getFormToken() . '=1&editor=' . $name;
|
||||
|
||||
$button = new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'modal',
|
||||
'link' => $link,
|
||||
'text' => Text::_('PLG_EDITORS-XTD_MENU_BUTTON_MENU'),
|
||||
'icon' => 'list',
|
||||
'iconSVG' => '<svg viewBox="0 0 512 512" width="24" height="24"><path d="M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 1'
|
||||
. '6 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 '
|
||||
. '0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H1'
|
||||
. '76a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16'
|
||||
. 'v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16'
|
||||
. 'h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"></path></svg>',
|
||||
// This is whole Plugin name, it is needed for keeping backward compatibility
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
]
|
||||
);
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
plugins/editors-xtd/module/module.xml
Normal file
21
plugins/editors-xtd/module/module.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_module</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2015-10</creationDate>
|
||||
<copyright>(C) 2015 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.5.0</version>
|
||||
<description>PLG_MODULE_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\Module</namespace>
|
||||
<files>
|
||||
<folder plugin="module">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_module.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_module.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/module/services/provider.php
Normal file
46
plugins/editors-xtd/module/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.article
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\Module\Extension\Module;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new Module(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'module')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
109
plugins/editors-xtd/module/src/Extension/Module.php
Normal file
109
plugins/editors-xtd/module/src/Extension/Module.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.module
|
||||
*
|
||||
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\Module\Extension;
|
||||
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor Module button
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
final class Module extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$subject = $event->getButtonsRegistry();
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId());
|
||||
|
||||
if ($button) {
|
||||
$subject->add($button);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button
|
||||
*
|
||||
* @param string $name The name of the button to add
|
||||
*
|
||||
* @return Button|void The button options as Button object
|
||||
*
|
||||
* @since 3.5
|
||||
*
|
||||
* @deprecated 5.0 Use onEditorButtonsSetup event
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
$user = $this->getApplication()->getIdentity();
|
||||
|
||||
if (
|
||||
$user->authorise('core.create', 'com_modules')
|
||||
|| $user->authorise('core.edit', 'com_modules')
|
||||
|| $user->authorise('core.edit.own', 'com_modules')
|
||||
) {
|
||||
$this->loadLanguage();
|
||||
|
||||
$link = 'index.php?option=com_modules&view=modules&layout=modal&tmpl=component&'
|
||||
. Session::getFormToken() . '=1&editor=' . $name;
|
||||
|
||||
$button = new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'modal',
|
||||
'link' => $link,
|
||||
'text' => Text::_('PLG_MODULE_BUTTON_MODULE'),
|
||||
'icon' => 'cube',
|
||||
'iconSVG' => '<svg viewBox="0 0 512 512" width="24" height="24"><path d="M239.1 6.3l-208 78c-18.7 7-31.1 '
|
||||
. '25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 '
|
||||
. '26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 '
|
||||
. '78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"></path></svg>',
|
||||
// This is whole Plugin name, it is needed for keeping backward compatibility
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
]
|
||||
);
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
plugins/editors-xtd/pagebreak/pagebreak.xml
Normal file
21
plugins/editors-xtd/pagebreak/pagebreak.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_pagebreak</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2004-08</creationDate>
|
||||
<copyright>(C) 2005 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.0.0</version>
|
||||
<description>PLG_EDITORSXTD_PAGEBREAK_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\PageBreak</namespace>
|
||||
<files>
|
||||
<folder plugin="pagebreak">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_pagebreak.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_pagebreak.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/pagebreak/services/provider.php
Normal file
46
plugins/editors-xtd/pagebreak/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.pagebreak
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\PageBreak\Extension\PageBreak;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new PageBreak(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'pagebreak')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
129
plugins/editors-xtd/pagebreak/src/Extension/PageBreak.php
Normal file
129
plugins/editors-xtd/pagebreak/src/Extension/PageBreak.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.pagebreak
|
||||
*
|
||||
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\PageBreak\Extension;
|
||||
|
||||
use Joomla\CMS\Application\CMSWebApplicationInterface;
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor Pagebreak button
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
final class PageBreak extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Load the language file on instantiation.
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.1
|
||||
*/
|
||||
protected $autoloadLanguage = true;
|
||||
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.2.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$subject = $event->getButtonsRegistry();
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId());
|
||||
|
||||
if ($button) {
|
||||
$subject->add($button);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the button
|
||||
*
|
||||
* @param string $name The name of the button to add
|
||||
*
|
||||
* @return Button|void The button options as Button object
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @deprecated 5.0 Use onEditorButtonsSetup event
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
$app = $this->getApplication();
|
||||
|
||||
if (!$app instanceof CMSWebApplicationInterface) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user = $app->getIdentity();
|
||||
|
||||
// Can create in any category (component permission) or at least in one category
|
||||
$canCreateRecords = $user->authorise('core.create', 'com_content')
|
||||
|| \count($user->getAuthorisedCategories('com_content', 'core.create')) > 0;
|
||||
|
||||
// Instead of checking edit on all records, we can use **same** check as the form editing view
|
||||
$values = (array) $app->getUserState('com_content.edit.article.id');
|
||||
$isEditingRecords = \count($values);
|
||||
|
||||
// This ACL check is probably a double-check (form view already performed checks)
|
||||
$hasAccess = $canCreateRecords || $isEditingRecords;
|
||||
if (!$hasAccess) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->loadLanguage();
|
||||
$app->getDocument()->addScriptOptions('xtd-pagebreak', ['editor' => $name]);
|
||||
$link = 'index.php?option=com_content&view=article&layout=pagebreak&tmpl=component&e_name=' . $name;
|
||||
|
||||
$button = new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'modal',
|
||||
'link' => $link,
|
||||
'text' => Text::_('PLG_EDITORSXTD_PAGEBREAK_BUTTON_PAGEBREAK'),
|
||||
'icon' => 'copy',
|
||||
'iconSVG' => '<svg viewBox="0 0 32 32" width="24" height="24"><path d="M26 8h-6v-2l-6-6h-14v24h12v8h20v-18l-6-6zM26 10.828l3.172 3'
|
||||
. '.172h-3.172v-3.172zM14 2.828l3.172 3.172h-3.172v-3.172zM2 2h10v6h6v14h-16v-20zM30 30h-16v-6h6v-14h4v6h6v14z"></pa'
|
||||
. 'th></svg>',
|
||||
// This is whole Plugin name, it is needed for keeping backward compatibility
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
]
|
||||
);
|
||||
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
21
plugins/editors-xtd/readmore/readmore.xml
Normal file
21
plugins/editors-xtd/readmore/readmore.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="editors-xtd" method="upgrade">
|
||||
<name>plg_editors-xtd_readmore</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2006-03</creationDate>
|
||||
<copyright>(C) 2006 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.0.0</version>
|
||||
<description>PLG_READMORE_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\EditorsXtd\ReadMore</namespace>
|
||||
<files>
|
||||
<folder plugin="readmore">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_readmore.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_editors-xtd_readmore.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
46
plugins/editors-xtd/readmore/services/provider.php
Normal file
46
plugins/editors-xtd/readmore/services/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.article
|
||||
*
|
||||
* @copyright (C) 2023 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\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\EditorsXtd\ReadMore\Extension\ReadMore;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new ReadMore(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('editors-xtd', 'readmore')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
105
plugins/editors-xtd/readmore/src/Extension/ReadMore.php
Normal file
105
plugins/editors-xtd/readmore/src/Extension/ReadMore.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Editors-xtd.readmore
|
||||
*
|
||||
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\EditorsXtd\ReadMore\Extension;
|
||||
|
||||
use Joomla\CMS\Editor\Button\Button;
|
||||
use Joomla\CMS\Event\Editor\EditorButtonsSetupEvent;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Editor Readmore button
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
final class ReadMore extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of events this subscriber will listen to.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return ['onEditorButtonsSetup' => 'onEditorButtonsSetup'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditorButtonsSetupEvent $event
|
||||
* @return void
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
public function onEditorButtonsSetup(EditorButtonsSetupEvent $event): void
|
||||
{
|
||||
$subject = $event->getButtonsRegistry();
|
||||
$disabled = $event->getDisabledButtons();
|
||||
|
||||
if (\in_array($this->_name, $disabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button = $this->onDisplay($event->getEditorId());
|
||||
$subject->add($button);
|
||||
}
|
||||
|
||||
/**
|
||||
* Readmore button
|
||||
*
|
||||
* @param string $name The name of the button to add
|
||||
*
|
||||
* @return Button The button options as Button object
|
||||
*
|
||||
* @since 1.5
|
||||
*
|
||||
* @deprecated 5.0 Use onEditorButtonsSetup event
|
||||
*/
|
||||
public function onDisplay($name)
|
||||
{
|
||||
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->getApplication()->getDocument()->getWebAssetManager();
|
||||
|
||||
// Register the asset "editor-button.<button name>", will be loaded by the button layout
|
||||
if (!$wa->assetExists('script', 'editor-button.' . $this->_name)) {
|
||||
$wa->registerScript(
|
||||
'editor-button.' . $this->_name,
|
||||
'com_content/admin-article-readmore.min.js',
|
||||
[],
|
||||
['type' => 'module'],
|
||||
['editors', 'joomla.dialog']
|
||||
);
|
||||
}
|
||||
|
||||
$this->loadLanguage();
|
||||
|
||||
Text::script('PLG_READMORE_ALREADY_EXISTS');
|
||||
|
||||
$button = new Button(
|
||||
$this->_name,
|
||||
[
|
||||
'action' => 'insert-readmore',
|
||||
'text' => Text::_('PLG_READMORE_BUTTON_READMORE'),
|
||||
'icon' => 'arrow-down',
|
||||
'iconSVG' => '<svg viewBox="0 0 32 32" width="24" height="24"><path d="M32 12l-6-6-10 10-10-10-6 6 16 16z"></path></svg>',
|
||||
// This is whole Plugin name, it is needed for keeping backward compatibility
|
||||
'name' => $this->_type . '_' . $this->_name,
|
||||
]
|
||||
);
|
||||
return $button;
|
||||
}
|
||||
}
|
||||
145
plugins/editors-xtd/retabulizer/retabulizer.php
Normal file
145
plugins/editors-xtd/retabulizer/retabulizer.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport( 'joomla.plugin.plugin' );
|
||||
|
||||
if(!defined('DS')){define('DS',DIRECTORY_SEPARATOR);}
|
||||
|
||||
|
||||
class plgButtonRetabulizer extends JPlugin
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct(& $subject, $config)
|
||||
{
|
||||
parent::__construct($subject, $config);
|
||||
$this->loadLanguage();
|
||||
}
|
||||
|
||||
public function onDisplay($name, $asset = null, $author = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
$doc = JFactory::getDocument();
|
||||
$template = $app->getTemplate();
|
||||
|
||||
if(version_compare(JVERSION,'1.6.0','ge')) {
|
||||
$tabulizer_plugin = JPluginHelper::getPlugin('editors-xtd', 'tabulizer');
|
||||
$tabulizerPluginParams = new JRegistry();
|
||||
$tabulizerPluginParams->loadString($tabulizer_plugin->params);
|
||||
$tabulizer_directive_add_comments = 0;
|
||||
} else {
|
||||
$tabulizer_plugin = &JPluginHelper::getPlugin('editors-xtd', 'tabulizer');
|
||||
$tabulizerPluginParams = new JRegistry($tabulizer_plugin->params);
|
||||
$tabulizer_directive_add_comments = 0;
|
||||
}
|
||||
|
||||
$popup_url = JURI::base() . 'index.php?option=com_tabulizer&task=dialog&tmpl=component&use_comments='.$tabulizer_directive_add_comments;
|
||||
|
||||
$tinymce_warning_msg = JText::_('PLG_RETABULIZER_INVALID_EDITOR');
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_tabulizer'.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'common'.DIRECTORY_SEPARATOR.'helper.php');
|
||||
$no_use_permissions = (TabulizerPermissions::isAllowed('ruleset-use'))?0:1;
|
||||
$no_use_permissions_warning_msg = TabulizerString::makeHTMLSafe(JText::_('PLG_RETABULIZER_RULESET_USE_PERMISSION_INVALID'));
|
||||
|
||||
$setOriginalContent = $this->_subject->setContent($name, 'original_content' );
|
||||
$setNewContent = $this->_subject->setContent($name, 'new_content' );
|
||||
|
||||
// remove surrounding quotes, if present
|
||||
$quotes = array('"',"'");
|
||||
foreach ($quotes as $quote) {
|
||||
$setOriginalContent = str_replace("{$quote}original_content{$quote}","original_content",$setOriginalContent);
|
||||
$setNewContent = str_replace("{$quote}new_content{$quote}","new_content",$setNewContent);
|
||||
}
|
||||
|
||||
$js = "
|
||||
|
||||
function retabulizerGetCaretPosition (editor)
|
||||
{
|
||||
var LOCATION_TOKEN = '{TABULIZER-CARET-POSITION-MARK-F6ZX7E39DE6G}';
|
||||
var original_content = ".$this->_subject->getContent($name)."
|
||||
jInsertEditorText( LOCATION_TOKEN, editor );
|
||||
var content = ".$this->_subject->getContent($name)."
|
||||
var caret_position = content.indexOf(LOCATION_TOKEN);
|
||||
{$setOriginalContent}
|
||||
|
||||
return caret_position;
|
||||
}
|
||||
|
||||
function retabulizerGetEditorContent ()
|
||||
{
|
||||
var content = ".$this->_subject->getContent($name)."
|
||||
return content;
|
||||
}
|
||||
|
||||
function retabulizerOpenDialog( editor )
|
||||
{
|
||||
if ($no_use_permissions) {
|
||||
alert('{$no_use_permissions_warning_msg}');
|
||||
return;
|
||||
}
|
||||
var caret_position = retabulizerGetCaretPosition (editor);
|
||||
var durl = '{$popup_url}&clb_name=' + editor + '&caret_position=' + caret_position;
|
||||
var wnd = window.open( durl, '_blank', 'status=no,resizable=yes,width=720,height=680,left=50,top=50' );
|
||||
wnd.focus();
|
||||
return wnd;
|
||||
}
|
||||
|
||||
function retabulizerClickCallback( editor, result, replace_from, replace_to )
|
||||
{
|
||||
if (result) {
|
||||
var r1 = parseInt(replace_from);
|
||||
var r2 = parseInt(replace_to);
|
||||
|
||||
var content = ".$this->_subject->getContent($name)."
|
||||
var new_content = content.substr(0,r1) + result + content.substr(r2+1);
|
||||
$setNewContent
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
|
||||
if(version_compare(JVERSION,'1.6.0','ge')) {
|
||||
// Joomla! 1.6 code here
|
||||
$plugin_dir = 'plugins/editors-xtd/tabulizer/tabulizer';
|
||||
} else {
|
||||
// Joomla! 1.5 code here
|
||||
$plugin_dir = 'plugins/editors-xtd/tabulizer';
|
||||
}
|
||||
|
||||
$css = " .button2-left .Retabulizer { background: url(../{$plugin_dir}/images/retabulizer_button.png) 100% 0 no-repeat; } \n";
|
||||
$css .= " .icon-Retabulizer { background: url(../{$plugin_dir}/images/retabulizer_button_j3.png) 100% 0 no-repeat; } \n";
|
||||
|
||||
$doc->addStyleDeclaration($css);
|
||||
|
||||
$button = new JObject();
|
||||
$button->set('modal', false);
|
||||
$button->set('onclick', 'retabulizerOpenDialog(\''.$name.'\'); return false;');
|
||||
$button->set('text', JText::_('PLG_RETABULIZER_BUTTON_LABEL'));
|
||||
$button->set('name', 'Retabulizer');
|
||||
$button->set('link', '#');
|
||||
if(version_compare(JVERSION,'3.1.0','ge')) {
|
||||
$button->set('class','btn');
|
||||
}
|
||||
|
||||
return $button;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
20
plugins/editors-xtd/retabulizer/retabulizer.xml
Normal file
20
plugins/editors-xtd/retabulizer/retabulizer.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" version="1.5" group="editors-xtd" method="upgrade">
|
||||
<name>Button - ReTabulizer</name>
|
||||
<creationDate>2019-01-17</creationDate>
|
||||
<copyright>Copyright (C) 2011. All rights reserved.</copyright>
|
||||
<license>GNU General Public License</license>
|
||||
<author>Dimitrios Mourloukos</author>
|
||||
<authorEmail>info@alterora.gr</authorEmail>
|
||||
<authorUrl>www.tabulizer.gr</authorUrl>
|
||||
<version>6.2.6</version>
|
||||
|
||||
<description>PLG_RETABULIZER_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename plugin="retabulizer">retabulizer.php</filename>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_editors-xtd_retabulizer.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_editors-xtd_retabulizer.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
101
plugins/editors-xtd/tabulizer/tabulizer.php
Normal file
101
plugins/editors-xtd/tabulizer/tabulizer.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport( 'joomla.plugin.plugin' );
|
||||
|
||||
if(!defined('DS')){define('DS',DIRECTORY_SEPARATOR);}
|
||||
|
||||
|
||||
class plgButtonTabulizer extends JPlugin
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct(& $subject, $config)
|
||||
{
|
||||
parent::__construct($subject, $config);
|
||||
$this->loadLanguage();
|
||||
}
|
||||
|
||||
public function onDisplay($name, $asset = null, $author = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
$doc = JFactory::getDocument();
|
||||
$template = $app->getTemplate();
|
||||
|
||||
$tabulizer_directive_add_comments = 0;
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_tabulizer'.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'common'.DIRECTORY_SEPARATOR.'helper.php');
|
||||
$no_use_permissions = (TabulizerPermissions::isAllowed('ruleset-use'))?0:1;
|
||||
$no_use_permissions_warning_msg = TabulizerString::makeHTMLSafe(JText::_('PLG_TABULIZER_RULESET_USE_PERMISSION_INVALID'));
|
||||
|
||||
$popup_url = JURI::base() . 'index.php?option=com_tabulizer&task=dialog&tmpl=component&use_comments='.$tabulizer_directive_add_comments;
|
||||
|
||||
$tinymce_warning_msg = JText::_('PLG_TABULIZER_INVALID_EDITOR');
|
||||
|
||||
$js = "
|
||||
function tabulizerClickCallback( editor, result )
|
||||
{
|
||||
if( result ) {
|
||||
jInsertEditorText( result, editor );
|
||||
}
|
||||
}
|
||||
|
||||
function tabulizerOpenDialog( editor )
|
||||
{
|
||||
if ($no_use_permissions) {
|
||||
alert('{$no_use_permissions_warning_msg}');
|
||||
return;
|
||||
}
|
||||
var durl = '{$popup_url}&clb_name=' + editor;
|
||||
var wnd = window.open( durl, '_blank', 'status=no,resizable=yes,scrollbars=1,width=720,height=710,left=50,top=20' );
|
||||
wnd.focus();
|
||||
return wnd;
|
||||
}
|
||||
";
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
|
||||
if(version_compare(JVERSION,'1.6.0','ge')) {
|
||||
// Joomla! 1.6 code here
|
||||
$plugin_dir = 'plugins/editors-xtd/tabulizer/tabulizer';
|
||||
} else {
|
||||
// Joomla! 1.5 code here
|
||||
$plugin_dir = 'plugins/editors-xtd/tabulizer';
|
||||
}
|
||||
|
||||
$css = " .button2-left .Tabulizer { background: url(../{$plugin_dir}/images/tabulizer_button.png) 100% 0 no-repeat; } \n";
|
||||
$css .= " .icon-Tabulizer { background: url(../{$plugin_dir}/images/tabulizer_button_j3.png) 100% 0 no-repeat; } \n";
|
||||
|
||||
$doc->addStyleDeclaration($css);
|
||||
|
||||
$button = new JObject();
|
||||
$button->set('modal', false);
|
||||
$button->set('onclick', 'tabulizerOpenDialog(\''.$name.'\'); return false;');
|
||||
$button->set('text', JText::_('PLG_TABULIZER_BUTTON_LABEL'));
|
||||
$button->set('name', 'Tabulizer');
|
||||
$button->set('link', '#');
|
||||
if(version_compare(JVERSION,'3.1.0','ge')) {
|
||||
$button->set('class','btn');
|
||||
}
|
||||
|
||||
return $button;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
35
plugins/editors-xtd/tabulizer/tabulizer.xml
Normal file
35
plugins/editors-xtd/tabulizer/tabulizer.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" version="1.5" group="editors-xtd" method="upgrade">
|
||||
<name>Button - Tabulizer</name>
|
||||
<creationDate>2019-01-17</creationDate>
|
||||
<copyright>Copyright (C) 2011. All rights reserved.</copyright>
|
||||
<license>GNU General Public License</license>
|
||||
<author>Dimitrios Mourloukos</author>
|
||||
<authorEmail>info@alterora.gr</authorEmail>
|
||||
<authorUrl>www.tabulizer.gr</authorUrl>
|
||||
<version>6.2.6</version>
|
||||
|
||||
<description>PLG_TABULIZER_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename plugin="tabulizer">tabulizer.php</filename>
|
||||
<folder>tabulizer</folder>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_editors-xtd_tabulizer.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_editors-xtd_tabulizer.sys.ini</language>
|
||||
</languages>
|
||||
|
||||
<params>
|
||||
<param name="tabulizer-ruleset-use" type="usergroup" default="25" label="PLG_TABULIZER_RULESET_USE_PERMISSION_LABEL" description="PLG_TABULIZER_RULESET_USE_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-ruleset-view" type="usergroup" default="25" label="PLG_TABULIZER_RULESET_VIEW_PERMISSION_LABEL" description="PLG_TABULIZER_RULESET_VIEW_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-ruleset-edit" type="usergroup" default="25" label="PLG_TABULIZER_RULESET_EDIT_PERMISSION_LABEL" description="PLG_TABULIZER_RULESET_EDIT_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-ruleset-import" type="usergroup" default="25" label="PLG_TABULIZER_RULESET_IMPORT_PERMISSION_LABEL" description="PLG_TABULIZER_RULESET_IMPORT_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-ruleset-export" type="usergroup" default="25" label="PLG_TABULIZER_RULESET_EXPORT_PERMISSION_LABEL" description="PLG_TABULIZER_RULESET_EXPORT_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-datasource-view" type="usergroup" default="25" label="PLG_TABULIZER_DATASOURCE_VIEW_PERMISSION_LABEL" description="PLG_TABULIZER_DATASOURCE_VIEW_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-datasource-edit" type="usergroup" default="25" label="PLG_TABULIZER_DATASOURCE_EDIT_PERMISSION_LABEL" description="PLG_TABULIZER_DATASOURCE_EDIT_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-datasource-import" type="usergroup" default="25" label="PLG_TABULIZER_DATASOURCE_IMPORT_PERMISSION_LABEL" description="PLG_TABULIZER_DATASOURCE_IMPORT_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-datasource-export" type="usergroup" default="25" label="PLG_TABULIZER_DATASOURCE_EXPORT_PERMISSION_LABEL" description="PLG_TABULIZER_DATASOURCE_EXPORT_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
<param name="tabulizer-data-import" type="usergroup" default="25" label="PLG_TABULIZER_DATA_IMPORT_PERMISSION_LABEL" description="PLG_TABULIZER_DATA_IMPORT_PERMISSION_DESCRIPTION" multiple="yes" />
|
||||
</params>
|
||||
|
||||
</extension>
|
||||
1572
plugins/editors-xtd/tabulizer/tabulizer/assets/class.php
Normal file
1572
plugins/editors-xtd/tabulizer/tabulizer/assets/class.php
Normal file
File diff suppressed because it is too large
Load Diff
89
plugins/editors-xtd/tabulizer/tabulizer/assets/helper.php
Normal file
89
plugins/editors-xtd/tabulizer/tabulizer/assets/helper.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
class TabulizerMath {
|
||||
function parseInt($ptString) {
|
||||
if (strlen($ptString) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$regex = '/^[-+]?[0-9]+$/';
|
||||
if (preg_match($regex,$ptString,$matches)) {
|
||||
return intval($ptString);
|
||||
} else return false;
|
||||
}
|
||||
|
||||
function parseFloat($ptString) {
|
||||
$pString = trim($ptString);
|
||||
if (strlen($ptString) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (substr_count($pString, ",") > 1)
|
||||
$pString = str_replace(",", "", $pString);
|
||||
|
||||
if (substr_count($pString, ".") > 1)
|
||||
$pString = str_replace(".", "", $pString);
|
||||
|
||||
$pregResult = array();
|
||||
|
||||
$commaset = strpos($pString,',');
|
||||
if ($commaset === false) {$commaset = -1;}
|
||||
|
||||
$pointset = strpos($pString,'.');
|
||||
if ($pointset === false) {$pointset = -1;}
|
||||
|
||||
$pregResultA = array();
|
||||
$pregResultB = array();
|
||||
|
||||
if ($pointset < $commaset) {
|
||||
preg_match('#^(([-]?[0-9]+(\.[0-9])?)+(,[0-9]+)?)$#', $pString, $pregResultA);
|
||||
}
|
||||
preg_match('#^(([-]?[0-9]+(,[0-9])?)+(\.[0-9]+)?)$#', $pString, $pregResultB);
|
||||
if ((isset($pregResultA[0]) && (!isset($pregResultB[0])
|
||||
|| strstr($preResultA[0],$pregResultB[0]) == 0
|
||||
|| !$pointset))) {
|
||||
$numberString = $pregResultA[0];
|
||||
$numberString = str_replace('.','',$numberString);
|
||||
$numberString = str_replace(',','.',$numberString);
|
||||
}
|
||||
elseif (isset($pregResultB[0]) && (!isset($pregResultA[0])
|
||||
|| strstr($pregResultB[0],$preResultA[0]) == 0
|
||||
|| !$commaset)) {
|
||||
$numberString = $pregResultB[0];
|
||||
$numberString = str_replace(',','',$numberString);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
$result = (float)$numberString;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getNumericValue($str) {
|
||||
//$value = str_replace(array('<27>','$','€'), array(' ',' ',' '), $value);
|
||||
|
||||
$value = self::parseInt($str);
|
||||
if ($value !== false) return $value;
|
||||
|
||||
$value = self::parseFloat($str);
|
||||
if ($value !== false) return $value;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 974 B |
Binary file not shown.
|
After Width: | Height: | Size: 777 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 739 B |
242
plugins/editors-xtd/tabulizer/tabulizer/defines.php
Normal file
242
plugins/editors-xtd/tabulizer/tabulizer/defines.php
Normal file
@ -0,0 +1,242 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// ENCODING
|
||||
if (!function_exists('mb_internal_encoding')) {
|
||||
$mbstring_error_msg = 'MBString library is missing! Tabulizer requires the MBString PHP extension in order to run properly. Please ask your system administrator to install it for you. Alternatively, if you are using the standard latin alphabet and you do not need multibyte character support you can use the Tabulizer\'s MBString proxy implementation. You can enable this feature by setting to YES the related parameter of the "Button - Tabulizer" editors-xtd plugin.';
|
||||
$mbstring_proxy_enabled = 1;
|
||||
if ($mbstring_proxy_enabled) {
|
||||
if (!defined('MBSTRING_PROXY')) {
|
||||
// MBString is not installed/enabled by default
|
||||
function mb_internal_encoding($encoding = "UTF-8") {
|
||||
// do nothing
|
||||
}
|
||||
function mb_regex_encoding($encoding = "UTF-8") {
|
||||
// do nothing
|
||||
}
|
||||
function mb_strtoupper ($str, $encoding = "UTF-8") {
|
||||
return strtoupper($str);
|
||||
}
|
||||
function mb_strpos ($haystack , $needle, $offset = 0, $encoding = "UTF-8") {
|
||||
return strpos ($haystack, $needle, $offset);
|
||||
}
|
||||
function mb_stripos ($haystack , $needle, $offset = 0, $encoding = "UTF-8") {
|
||||
return stripos ($haystack, $needle, $offset);
|
||||
}
|
||||
function mb_strlen($str, $encoding = "UTF-8") {
|
||||
return strlen($str);
|
||||
}
|
||||
function mb_substr($str, $start, $length = NULL, $encoding = "UTF-8") {
|
||||
if (empty($length)) return substr($str, $start);
|
||||
else return substr($str, $start, $length);
|
||||
}
|
||||
function mb_ereg($pattern, $string, &$regs = NULL) {
|
||||
if (!empty($regs)) {
|
||||
return ereg($pattern,$string,$regs);
|
||||
} else {
|
||||
return ereg($pattern,$string);
|
||||
}
|
||||
}
|
||||
function mb_eregi($pattern, $string, &$regs = NULL) {
|
||||
if (!empty($regs)) {
|
||||
return eregi($pattern,$string,$regs);
|
||||
} else {
|
||||
return eregi($pattern,$string);
|
||||
}
|
||||
}
|
||||
function mb_ereg_replace($pattern, $replacement, $string) {
|
||||
return ereg_replace($pattern, $replacement, $string);
|
||||
}
|
||||
function mb_eregi_replace($pattern, $replacement, $string) {
|
||||
return eregi_replace($pattern, $replacement, $string);
|
||||
}
|
||||
function mb_convert_encoding ($str,$to_encoding = NULL,$from_encoding=NULL) {
|
||||
global $mbstring_error_msg;
|
||||
exit($mbstring_error_msg);
|
||||
}
|
||||
define('MBSTRING_PROXY',1);
|
||||
}
|
||||
} else {
|
||||
exit($mbstring_error_msg);
|
||||
}
|
||||
} else {
|
||||
mb_internal_encoding("UTF-8");
|
||||
mb_regex_encoding("UTF-8");
|
||||
}
|
||||
|
||||
// DIRECTORIES
|
||||
if (!defined('DS')) define( 'DS', DIRECTORY_SEPARATOR );
|
||||
|
||||
define('TABULIZER_APP_VERSION','4.0.0');
|
||||
|
||||
define('RULES_DIR','templates/tabulizer/');
|
||||
define('RULES_XML_DIR', RULES_DIR .'rules/');
|
||||
define('RULES_CSS_DIR', RULES_DIR .'css/');
|
||||
define('RULES_CALC_DIR', RULES_DIR .'calc/');
|
||||
define('RULES_IMAGE_DIR', RULES_DIR .'images/');
|
||||
define('RULES_UPLOAD_DIR','tmp/');
|
||||
define('SHEET_UPLOAD_DIR','tmp/');
|
||||
|
||||
if (!defined('XML_FILE_EXT')) define('XML_FILE_EXT','.xml');
|
||||
|
||||
// STYLE INCLUDE PREFIX
|
||||
define('TABULIZER_INCLUDE_STYLE_PREFIX','{tabulizer:style[%s]}');
|
||||
define('TABULIZER_INCLUDE_STYLE_REGEX','/{tabulizer:style\[(.+)\]}/i');
|
||||
|
||||
// COLUMNS SEPARATORS
|
||||
define('SEPARATOR_COMMA','cm');
|
||||
define('SEPARATOR_SEMICOLON','sc');
|
||||
define('SEPARATOR_SPACE','sp');
|
||||
define('SEPARATOR_TAB','tb');
|
||||
define('SEPARATOR_ASTERISK','as');
|
||||
define('SEPARATOR_CARET','cr');
|
||||
|
||||
// COLUMN ENCLOSURES
|
||||
define('ENCLOSURE_DOUBLE_QUOTES','dq');
|
||||
define('ENCLOSURE_SINGLE_QUOTES','sq');
|
||||
define('ENCLOSURE_NONE','none');
|
||||
|
||||
// ROWS SEPARATOS
|
||||
define('SEPARATOR_NEWLLINE','[NEWLINEROW]');
|
||||
|
||||
// DATA TYPES
|
||||
define('DATA_TYPE_SEPARATOR','^');
|
||||
define('DATA_TYPE_UNDEFINED',0);
|
||||
define('DATA_TYPE_TEXT',100);
|
||||
define('DATA_TYPE_NUMERIC',300);
|
||||
define('DATA_TYPE_CURRENCY',400);
|
||||
define('DATA_TYPE_DATE',500);
|
||||
|
||||
// FORMAT
|
||||
define('FORMAT_TEXT_UPPERCASE',110); // HELLO WORLD
|
||||
define('FORMAT_TEXT_LOWERCASE',112); // hello world
|
||||
define('FORMAT_TEXT_UCFIRST',113); // Hello world
|
||||
define('FORMAT_TEXT_UCWORDS',114); // Hello World
|
||||
|
||||
define('FORMAT_DATE_DDMMYY_1',510); // 21-10-09
|
||||
define('FORMAT_DATE_DDMMYY_2',511); // 21/10/09
|
||||
define('FORMAT_DATE_MMDDYY_1',520); // 10-21-09
|
||||
define('FORMAT_DATE_MMDDYY_2',521); // 10/21/09
|
||||
define('FORMAT_DATE_DDMMYYYY_1',530); // 21-10-2009
|
||||
define('FORMAT_DATE_DDMMYYYY_2',531); // 21/10/2009
|
||||
define('FORMAT_DATE_DDMMYYYY_3',531); // 21/Oct/2009
|
||||
define('FORMAT_DATE_MMDDYYYY_1',540); // 10-21-2009
|
||||
define('FORMAT_DATE_MMDDYYYY_2',541); // 10/21/2009
|
||||
define('FORMAT_DATE_MMDDYYYY_3',542); // Jan 1, 2009
|
||||
define('FORMAT_DATE_dDDMMYYYY_1',550); // Monday, 21-Oct-2009
|
||||
define('FORMAT_DATE_dDDMMYYYY_2',551); // Monday, 21/Oct/2009
|
||||
define('FORMAT_DATE_dMMDDYYYY_1',560); // Monday, Oct 1, 2009
|
||||
define('FORMAT_DATE_dMMDDYYYY_2',561); // Monday, 21-Oct-2009
|
||||
define('FORMAT_DATE_dDDm_1',570); // Monday, 21 October
|
||||
define('FORMAT_DATE_dmDD_1',575); // Monday, October 21
|
||||
|
||||
define('FORMAT_NUMERIC_SEPARATOR','*');
|
||||
define('FORMAT_NUMERIC_DEC_POINT_COMMA',1);
|
||||
define('FORMAT_NUMERIC_DEC_POINT_PERIOD',2);
|
||||
|
||||
define('FORMAT_CURRENCY_SEPARATOR','*');
|
||||
define('FORMAT_CURRENCY_SYMBOL_ORDER_NONE',0);
|
||||
define('FORMAT_CURRENCY_SYMBOL_ORDER_BEFORE',1);
|
||||
define('FORMAT_CURRENCY_SYMBOL_ORDER_AFTER',2);
|
||||
|
||||
// REPLACEMENT
|
||||
define('REPLACEMENT_SEPARATOR','^RWS^');
|
||||
|
||||
// CALCULATION
|
||||
define('CALCULATION_NONE',0);
|
||||
define('CALCULATION_ADD_ABOVE',110);
|
||||
define('CALCULATION_ADD_BELOW',120);
|
||||
define('CALCULATION_ADD_LEFT',130);
|
||||
define('CALCULATION_ADD_RIGHT',140);
|
||||
define('CALCULATION_MUL_ABOVE',210);
|
||||
define('CALCULATION_MUL_BELOW',220);
|
||||
define('CALCULATION_MUL_LEFT',230);
|
||||
define('CALCULATION_MUL_RIGHT',240);
|
||||
define('CALCULATION_AVG_ABOVE',310);
|
||||
define('CALCULATION_AVG_BELOW',320);
|
||||
define('CALCULATION_AVG_LEFT',330);
|
||||
define('CALCULATION_AVG_RIGHT',340);
|
||||
define('CALCULATION_MED_ABOVE',410);
|
||||
define('CALCULATION_MED_BELOW',420);
|
||||
define('CALCULATION_MED_LEFT',430);
|
||||
define('CALCULATION_MED_RIGHT',440);
|
||||
define('CALCULATION_MIN_ABOVE',510);
|
||||
define('CALCULATION_MIN_BELOW',520);
|
||||
define('CALCULATION_MIN_LEFT',530);
|
||||
define('CALCULATION_MIN_RIGHT',540);
|
||||
define('CALCULATION_MAX_ABOVE',610);
|
||||
define('CALCULATION_MAX_BELOW',620);
|
||||
define('CALCULATION_MAX_LEFT',630);
|
||||
define('CALCULATION_MAX_RIGHT',640);
|
||||
|
||||
define('CALCULATION_SEP','$');
|
||||
|
||||
// RANGE SEPARATORS
|
||||
define('RANGE_FILTER_SEP','#');
|
||||
define('RANGE_EXCLUDE_SEP','^');
|
||||
|
||||
// FILE SIZES AND OTHER LIMITS
|
||||
define('MAX_UPLOAD_SHEET_FILE_SIZE',2097152); // in bytes
|
||||
|
||||
// ERROR CODES
|
||||
define('ERROR_CODE_PREFIX','ERROR');
|
||||
define('ERROR_CODE_NO_ROWS','<7>');
|
||||
define('ERROR_CODE_NUM_OF_COLUMN_DISCREPANCY','<13>');
|
||||
|
||||
define('DEBUG_FILENAME','tmp/debug.txt');
|
||||
|
||||
// FUNCTIONS
|
||||
function getNumericPoint($point) {
|
||||
switch ($point) {
|
||||
case FORMAT_NUMERIC_DEC_POINT_COMMA: return ',';
|
||||
case FORMAT_NUMERIC_DEC_POINT_PERIOD: return '.';
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
function increaseProcessingLimits($memory_size = 64, $execution_time = 120) {
|
||||
$size = intval(str_replace('M','',ini_get('memory_limit')));
|
||||
while ($size < $memory_size) {
|
||||
$success = ini_set('memory_limit',$memory_size . 'M'); // in MB
|
||||
if (!$success) $memory_size = $memory_size / 2;
|
||||
else break;
|
||||
}
|
||||
$time = intval(ini_get('max_execution_time'));
|
||||
if ($time <= $execution_time) {
|
||||
ini_set('max_execution_time', $execution_time); // in seconds
|
||||
}
|
||||
}
|
||||
|
||||
function memoryUsage($output = 'display') {
|
||||
$peak_usage = (memory_get_peak_usage(true) / 1024 / 1024);
|
||||
$msg = "Peak memory usage: {$peak_usage} MB";
|
||||
debugMsg($msg, $output);
|
||||
}
|
||||
|
||||
function debugMsg($msg, $output = 'display', $filename = null) {
|
||||
if (($output == 'display')||($output == 'both')) {
|
||||
echo "{$msg}<br>\n";
|
||||
}
|
||||
if (($output == 'file')||($output == 'both')) {
|
||||
if (empty($filename)) $filename = JPATH_SITE .DIRECTORY_SEPARATOR. DEBUG_FILENAME;
|
||||
$timestamp = date('Y-m-d H:i:s');
|
||||
file_put_contents($filename, "{$timestamp} {$msg}\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
4
plugins/editors-xtd/tabulizer/tabulizer/helper.js
Normal file
4
plugins/editors-xtd/tabulizer/tabulizer/helper.js
Normal file
@ -0,0 +1,4 @@
|
||||
/* helper.js */
|
||||
|
||||
|
||||
|
||||
4
plugins/editors-xtd/tabulizer/tabulizer/index.html
Normal file
4
plugins/editors-xtd/tabulizer/tabulizer/index.html
Normal file
@ -0,0 +1,4 @@
|
||||
<html>
|
||||
<body bgcolor="#FFFFFF">
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,29 @@
|
||||
TABULIZER_TXTBUTTON=Tabulize!
|
||||
|
||||
TABULIZER INSTRUCTIONS=Please follow the steps bellow:<ol><li>Type or paste the table data in plain text format in the <em>%s</em> box</li><li>Select the proper <em>column separator</em> and the appropriate <em>ruleset</em> (or leave the default choices)</li><li>Click on the <strong>%s</strong> button to produce the HTML formatted table</li><li>Click on the <strong>%s</strong> button to insert the produced HTML code into the editor content</li></ol>
|
||||
|
||||
TABULIZER TITLE=Tabulizer
|
||||
COLUMN SEPARATOR=Column Seperator
|
||||
COMMA SEPARATOR=Comma (,)
|
||||
SEMICOLON SEPARATOR=Semicolon (;)
|
||||
ASTERISK SEPARATOR=Asterisk (*)
|
||||
CARET SEPARATOR=Caret (^)
|
||||
SPACE SEPARATOR=Space
|
||||
TAB SEPARATOR=Tab
|
||||
|
||||
RULESET NAME=Ruleset
|
||||
HEADER PRESENT=First row is header
|
||||
TABLE SUFFIX=Table suffix
|
||||
TABLE TEXT=Input Text
|
||||
TABLE HTML=Output HTML Code
|
||||
NONE=None
|
||||
|
||||
CONVERT TABLE=Convert
|
||||
INSERT TABLE=Insert
|
||||
CANCEL CONVERSION=Close
|
||||
|
||||
NO CONVERSION UTILITY=Unable to access conversion form. Make sure the Tabulizer plugin is installed correctly.
|
||||
CONVERSION ERRORS FOUND=Please correct the following errors before you try to convert the input text again:
|
||||
NO INPUT TEXT=No input text to convert!
|
||||
COLUMNS COUNT DISCREPANCY=The number of columns must be the same on each row. Please make sure the column seperator in not used in the field value of any column.
|
||||
INVALID SEPARATOR=invalid separator code!
|
||||
99
plugins/editors-xtd/tabulizerds/tabulizerds.php
Normal file
99
plugins/editors-xtd/tabulizerds/tabulizerds.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport( 'joomla.plugin.plugin' );
|
||||
|
||||
if(!defined('DS')){define('DS',DIRECTORY_SEPARATOR);}
|
||||
|
||||
|
||||
class plgButtonTabulizerds extends JPlugin
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct(& $subject, $config)
|
||||
{
|
||||
parent::__construct($subject, $config);
|
||||
$this->loadLanguage();
|
||||
}
|
||||
|
||||
public function onDisplay($name)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
$doc = JFactory::getDocument();
|
||||
$template = $app->getTemplate();
|
||||
|
||||
require_once(JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_tabulizer'.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'common'.DIRECTORY_SEPARATOR.'helper.php');
|
||||
$no_use_permissions = (TabulizerPermissions::isAllowed('ruleset-use'))?0:1;
|
||||
$no_use_permissions_warning_msg = TabulizerString::makeHTMLSafe(JText::_('PLG_TABULIZER_RULESET_USE_PERMISSION_INVALID'));
|
||||
|
||||
$popup_url = JURI::base() . 'index.php?option=com_tabulizer&task=dsselect&tmpl=component';
|
||||
|
||||
$tinymce_warning_msg = JText::_('PLG_TABULIZER_INVALID_EDITOR');
|
||||
|
||||
$js = "
|
||||
function tabulizerdsClickCallback( editor, result )
|
||||
{
|
||||
if( result ) {
|
||||
jInsertEditorText( result, editor );
|
||||
}
|
||||
}
|
||||
|
||||
function tabulizerdsOpenDialog( editor )
|
||||
{
|
||||
if ($no_use_permissions) {
|
||||
alert('{$no_use_permissions_warning_msg}');
|
||||
return;
|
||||
}
|
||||
var durl = '{$popup_url}&clb_name=' + editor;
|
||||
var wnd = window.open( durl, '_blank', 'status=no,resizable=yes,width=520,height=180,left=50,top=50' );
|
||||
wnd.focus();
|
||||
return wnd;
|
||||
}
|
||||
";
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
|
||||
if(version_compare(JVERSION,'1.6.0','ge')) {
|
||||
// Joomla! 1.6 code here
|
||||
$plugin_dir = 'plugins/editors-xtd/tabulizer/tabulizer';
|
||||
} else {
|
||||
// Joomla! 1.5 code here
|
||||
$plugin_dir = 'plugins/editors-xtd/tabulizer';
|
||||
}
|
||||
|
||||
$css = " .button2-left .Tabulizerds { background: url(../{$plugin_dir}/images/tabulizerds_button.png) 100% 0 no-repeat; } \n";
|
||||
$css .= " .icon-Tabulizerds { background: url(../{$plugin_dir}/images/tabulizerds_button_j3.png) 100% 0 no-repeat; } \n";
|
||||
|
||||
$doc->addStyleDeclaration($css);
|
||||
|
||||
$button = new JObject();
|
||||
$button->set('modal', false);
|
||||
$button->set('onclick', 'tabulizerdsOpenDialog(\''.$name.'\'); return false;');
|
||||
$button->set('text', JText::_('PLG_TABULIZERDS_BUTTON_LABEL'));
|
||||
$button->set('name', 'Tabulizerds');
|
||||
$button->set('link', '#');
|
||||
if(version_compare(JVERSION,'3.1.0','ge')) {
|
||||
$button->set('class','btn');
|
||||
}
|
||||
|
||||
return $button;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
20
plugins/editors-xtd/tabulizerds/tabulizerds.xml
Normal file
20
plugins/editors-xtd/tabulizerds/tabulizerds.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" version="1.5" group="editors-xtd" method="upgrade">
|
||||
<name>Button - Tabulizer Data Source</name>
|
||||
<creationDate>2019-01-17</creationDate>
|
||||
<copyright>Copyright (C) 2011. All rights reserved.</copyright>
|
||||
<license>GNU General Public License</license>
|
||||
<author>Dimitrios Mourloukos</author>
|
||||
<authorEmail>info@alterora.gr</authorEmail>
|
||||
<authorUrl>www.tabulizer.gr</authorUrl>
|
||||
<version>6.2.6</version>
|
||||
|
||||
<description>PLG_TABULIZERDS_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename plugin="tabulizerds">tabulizerds.php</filename>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_editors-xtd_tabulizerds.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_editors-xtd_tabulizerds.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
Reference in New Issue
Block a user