first commit
This commit is contained in:
18
plugins/editors-xtd/tabsaccordions/forms/items.xml
Normal file
18
plugins/editors-xtd/tabsaccordions/forms/items.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form addfieldprefix="RegularLabs\Library\Form\Field">
|
||||
<fieldset>
|
||||
<field name="title" type="Text" label="JGLOBAL_TITLE" required="1"/>
|
||||
<field name="settings" type="IconToggle" default="0" icon1="cog" icon2="arrow-up"/>
|
||||
<field name="@showon__settings__a" type="ShowOn" value="settings:1"/>
|
||||
<field name="open" type="Radio" default="0" class="btn-group rl-btn-group btn-group-md btn-group-yesno" label="RLTA_OPENED_BY_DEFAULT" description="RLTA_OPENED_BY_DEFAULT_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field name="@block_content_a" type="Block" class="form-vertical" no_default_class="1"/>
|
||||
<field name="content" type="Editor" label="RL_CONTENT"/>
|
||||
<field name="@block_content_b" type="Block" end="1"/>
|
||||
<field name="@access" type="OnlyPro" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC"/>
|
||||
<field name="@usergroup" type="OnlyPro" label="RL_USER_GROUPS" description="RL_USER_GROUPS_DESC"/>
|
||||
<field name="@showon__settings__b" type="ShowOn"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
66
plugins/editors-xtd/tabsaccordions/forms/popup.xml
Normal file
66
plugins/editors-xtd/tabsaccordions/forms/popup.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config addfieldprefix="RegularLabs\Library\Form\Field">
|
||||
<fieldset name="items" addfieldprefix="RegularLabs\Library\Form\Field">
|
||||
<field name="type" type="Radio" default="tabs" class="btn-group rl-btn-group btn-group-md" label="RL_TYPE">
|
||||
<option value="tabs" class="btn btn-outline-info">RLTA_TABS</option>
|
||||
<option value="accordions" class="btn btn-outline-info">RLTA_ACCORDIONS</option>
|
||||
</field>
|
||||
<field name="items" type="Subform" formsource="plugins/editors-xtd/tabsaccordions/forms/items.xml" multiple="true" buttons="add,remove" class="rl-subform rl-hide-main-buttons" min="1"/>
|
||||
</fieldset>
|
||||
<fieldset name="styling">
|
||||
<field name="theme" type="List" default="" class="w-auto" label="RL_THEME">
|
||||
<option value="">JDEFAULT</option>
|
||||
<option value="neutral">RLTA_THEME_NEUTRAL</option>
|
||||
<option value="custom">RL_CUSTOM</option>
|
||||
<option disabled="disabled" value="-">---</option>
|
||||
<option disabled="disabled" value="-">RL_ONLY_AVAILABLE_IN_PRO_LIST_OPTION</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_ACCENT_LINES</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_COLORFUL</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_DARK</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_LIGHT</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_LINES</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_LINES_COLORFUL</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_MINIMAL</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_PILLS</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_PILLS_COLORFUL</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_PILLS_DARK</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_PILLS_LIGHT</option>
|
||||
<option disabled="disabled" value="-">RLTA_THEME_PILLS_MINIMAL</option>
|
||||
</field>
|
||||
<field name="@note__dynamic_heights" type="OnlyPro" label="RLTA_DYNAMIC_HEIGHTS" description="RLTA_DYNAMIC_HEIGHTS_DESC"/>
|
||||
<field name="class" type="Text" default="" label="RL_CLASSNAME" description="RLTA_CLASSNAME_DESC"/>
|
||||
<field name="@showon__tab_handles__a" type="ShowOn" value="type:tabs"/>
|
||||
<field name="@block__tab_handles__a" type="Block" start="1" label="RLTA_TAB_HANDLES"/>
|
||||
<field name="dynamic_heights" type="Radio" class="btn-group rl-btn-group btn-group-md btn-group-yesno" default="" label="RLTA_DYNAMIC_HEIGHTS" description="%s<br><br><em>%s</em>,RLTA_DYNAMIC_HEIGHTS_DESC,RLTA_NOT_ALL_THEMES">
|
||||
<option value="">JDEFAULT</option>
|
||||
<option value="false">JNO</option>
|
||||
<option value="true">JYES</option>
|
||||
</field>
|
||||
<field name="@note__positioning" type="Radio" class="btn-group rl-btn-group btn-group-md" default="top" label="RLTA_POSITIONING" description="RLTA_POSITIONING_DESC">
|
||||
<option value="top" class="btn btn-outline-info">%s %s,<span class="icon-arrow-up-4"></span>,RLTA_POSITIONING_TOP</option>
|
||||
<option value="" disabled="disabled">%s %s,<span class="icon-arrow-down-4"></span>,RLTA_POSITIONING_BOTTOM</option>
|
||||
<option value="" disabled="disabled">%s %s,<span class="icon-arrow-left-4"></span>,RLTA_POSITIONING_LEFT</option>
|
||||
<option value="" disabled="disabled">%s %s,<span class="icon-arrow-right-4"></span>,RLTA_POSITIONING_RIGHT</option>
|
||||
</field>
|
||||
<field name="@note__positioning_2" label="---" type="OnlyPro"/>
|
||||
<field name="alignment" type="Radio" class="btn-group rl-btn-group btn-group-md" default="" label="RLTA_ALIGNMENT" description="RLTA_ALIGNMENT_DESC" showon="positioning:[OR]positioning:top[OR]positioning:bottom">
|
||||
<option value="">JDEFAULT</option>
|
||||
<option value="left" class="btn btn-outline-info">%s %s,<span class="icon-paragraph-left"></span>,RLTA_POSITIONING_LEFT</option>
|
||||
<option value="center" class="btn btn-outline-info">%s %s,<span class="icon-paragraph-center"></span>,RLTA_POSITIONING_CENTER</option>
|
||||
<option value="right" class="btn btn-outline-info">%s %s,<span class="icon-paragraph-right"></span>,RLTA_POSITIONING_RIGHT</option>
|
||||
<option value="justify" class="btn btn-outline-info">%s %s,<span class="icon-paragraph-justify"></span>,RLTA_POSITIONING_JUSTIFY</option>
|
||||
</field>
|
||||
<field name="@block__tab_handles__b" type="Block" end="1"/>
|
||||
<field name="@showon__tab_handles__b" type="ShowOn"/>
|
||||
</fieldset>
|
||||
<fieldset name="slideshow">
|
||||
<field name="@note__slideshow" type="OnlyPro" label="RLTA_SLIDESHOW" description="SLIDESHOW_DESC"/>
|
||||
</fieldset>
|
||||
<fieldset name="settings">
|
||||
<field name="nested" type="Radio" default="" class="btn-group rl-btn-group btn-group-md btn-group-yesno" label="RLTA_NESTED_SET" description="RLTA_NESTED_SET_DESC">
|
||||
<option value="">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field name="nested_id" type="Text" default="nested" class="btn-group rl-btn-group btn-group-md btn-group-yesno" label="RLTA_NESTED_SET_ID" description="RLTA_NESTED_SET_ID_DESC" showon="nested:1"/>
|
||||
</fieldset>
|
||||
</config>
|
||||
@@ -0,0 +1,18 @@
|
||||
;; @package Tabs & Accordions
|
||||
;; @version 2.0.0
|
||||
;;
|
||||
;; @author Peter van Westen <info@regularlabs.com>
|
||||
;; @link https://regularlabs.com
|
||||
;; @copyright Copyright © 2023 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_TABSACCORDIONS="Button - Regular Labs - Tabs & Accordions"
|
||||
PLG_EDITORS-XTD_TABSACCORDIONS_DESC="Tabs & Accordions - make content tabs and accordions in Joomla!"
|
||||
TABSACCORDIONS="Tabs & Accordions"
|
||||
|
||||
TABSACCORDIONS_DESC="With Tabs & Accordions you can make content tabs and accordions anywhere in Joomla!"
|
||||
|
||||
RLTA_SETTINGS="Please see the [[%1:start link%]]Tabs & Accordions system plugin[[%2:end link%]] for settings."
|
||||
RLTA_THE_SYSTEM_PLUGIN="the Tabs & Accordions system plugin"
|
||||
@@ -0,0 +1,13 @@
|
||||
;; @package Tabs & Accordions
|
||||
;; @version 2.0.0
|
||||
;;
|
||||
;; @author Peter van Westen <info@regularlabs.com>
|
||||
;; @link https://regularlabs.com
|
||||
;; @copyright Copyright © 2023 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_TABSACCORDIONS="Button - Regular Labs - Tabs & Accordions"
|
||||
PLG_EDITORS-XTD_TABSACCORDIONS_DESC="Tabs & Accordions - make content tabs and accordions in Joomla!"
|
||||
TABSACCORDIONS="Tabs & Accordions"
|
||||
34
plugins/editors-xtd/tabsaccordions/src/Popup.php
Normal file
34
plugins/editors-xtd/tabsaccordions/src/Popup.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Tabs & Accordions
|
||||
* @version 2.0.0
|
||||
*
|
||||
* @author Peter van Westen <info@regularlabs.com>
|
||||
* @link https://regularlabs.com
|
||||
* @copyright Copyright © 2023 Regular Labs All Rights Reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
|
||||
namespace RegularLabs\Plugin\EditorButton\TabsAccordions;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use RegularLabs\Library\Document as RL_Document;
|
||||
use RegularLabs\Library\EditorButtonPopup as RL_EditorButtonPopup;
|
||||
|
||||
class Popup extends RL_EditorButtonPopup
|
||||
{
|
||||
protected $extension = 'tabsaccordions';
|
||||
protected $require_core_auth = false;
|
||||
|
||||
protected function loadScripts()
|
||||
{
|
||||
RL_Document::script('regularlabs.regular');
|
||||
RL_Document::script('regularlabs.admin-form');
|
||||
RL_Document::script('regularlabs.admin-form-descriptions');
|
||||
RL_Document::script('tabsaccordions.popup');
|
||||
|
||||
$script = "document.addEventListener('DOMContentLoaded', function(){RegularLabs.TabsAccordionsPopup.init()});";
|
||||
RL_Document::scriptDeclaration($script, 'TabsAccordions Button', true, 'after');
|
||||
}
|
||||
}
|
||||
70
plugins/editors-xtd/tabsaccordions/tabsaccordions.php
Normal file
70
plugins/editors-xtd/tabsaccordions/tabsaccordions.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Tabs & Accordions
|
||||
* @version 2.0.0
|
||||
*
|
||||
* @author Peter van Westen <info@regularlabs.com>
|
||||
* @link https://regularlabs.com
|
||||
* @copyright Copyright © 2023 Regular Labs All Rights Reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Language\Text as JText;
|
||||
use Joomla\CMS\Uri\Uri as JUri;
|
||||
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('tabsaccordions', 'plugin', 'editors-xtd');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (true)
|
||||
{
|
||||
class PlgButtonTabsAccordions 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="M 15 7 L 15 9 L 21 9 L 21 7 C 21 5.9 20.1 5 19 5 L 17 5 C 15.9 5 15 5.9 15 7 ZM 9 7 L 9 9 L 15 9 L 15 7 C 15 5.9 14.1 5 13 5 L 11 5 C 9.9 5 9 5.9 9 7 ZM 3 7 L 3 17 C 3 18.105 3.895 19 5 19 L 19 19 C 20.105 19 21 18.105 21 17 L 21 9 L 9 9 L 9 7 C 9 5.9 8.1 5 7 5 L 5 5 C 3.895 5 3 5.895 3 7 Z" />'
|
||||
. '</svg>';
|
||||
|
||||
protected function getPopupOptions()
|
||||
{
|
||||
$options = parent::getPopupOptions();
|
||||
|
||||
$options['confirmCallback'] = 'RegularLabs.TabsAccordionsButton.insertText(\'' . $this->editor_name . '\');';
|
||||
$options['confirmText'] = JText::_('RL_INSERT');
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
protected function loadScripts()
|
||||
{
|
||||
$params = $this->getParams();
|
||||
|
||||
RL_Document::scriptOptions([
|
||||
'tag_tabs_open' => $params->tag_tabs_open,
|
||||
'tag_tabs_close' => $params->tag_tabs_close,
|
||||
'tag_accordions_open' => $params->tag_accordions_open,
|
||||
'tag_accordions_close' => $params->tag_accordions_close,
|
||||
'tag_characters' => explode('.', $params->tag_characters),
|
||||
'root' => JUri::root(true),
|
||||
], 'tabsaccordions_button');
|
||||
|
||||
RL_Document::script('tabsaccordions.button');
|
||||
}
|
||||
}
|
||||
}
|
||||
33
plugins/editors-xtd/tabsaccordions/tabsaccordions.xml
Normal file
33
plugins/editors-xtd/tabsaccordions/tabsaccordions.xml
Normal file
@@ -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_TABSACCORDIONS</name>
|
||||
<description>PLG_EDITORS-XTD_TABSACCORDIONS_DESC</description>
|
||||
<version>2.0.0</version>
|
||||
<creationDate>September 2023</creationDate>
|
||||
<author>Regular Labs (Peter van Westen)</author>
|
||||
<authorEmail>info@regularlabs.com</authorEmail>
|
||||
<authorUrl>https://regularlabs.com</authorUrl>
|
||||
<copyright>Copyright © 2023 Regular Labs - All Rights Reserved</copyright>
|
||||
<license>GNU General Public License version 2 or later</license>
|
||||
<namespace path="src">RegularLabs\Plugin\EditorButton\TabsAccordions</namespace>
|
||||
<scriptfile>script.install.php</scriptfile>
|
||||
<files>
|
||||
<file plugin="tabsaccordions">tabsaccordions.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="TABSACCORDIONS"/>
|
||||
<field name="@version" type="Version" extension="TABSACCORDIONS"/>
|
||||
<field name="@dependency" type="Dependency" label="RLTA_THE_SYSTEM_PLUGIN" file="/plugins/system/tabsaccordions/tabsaccordions.xml"/>
|
||||
<field name="@header" type="Header" label="TABSACCORDIONS" description="TABSACCORDIONS_DESC" url="https://regularlabs.com/tabsaccordions"/>
|
||||
<field name="@note__settings" type="Note" class="rl-alert alert alert-info rl-alert-light" text="RLTA_SETTINGS,<a href="index.php?option=com_plugins&filter[folder]=system&filter[search]=tabsaccordions" target="_blank">,</a>"/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
61
plugins/editors-xtd/tabsaccordions/tmpl/popup.php
Normal file
61
plugins/editors-xtd/tabsaccordions/tmpl/popup.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Tabs & Accordions
|
||||
* @version 2.0.0
|
||||
*
|
||||
* @author Peter van Westen <info@regularlabs.com>
|
||||
* @link https://regularlabs.com
|
||||
* @copyright Copyright © 2023 Regular Labs All Rights Reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Editor\Editor as JEditor;
|
||||
use Joomla\CMS\Factory as JFactory;
|
||||
use Joomla\CMS\Form\Form as JForm;
|
||||
use Joomla\CMS\HTML\HTMLHelper as JHtml;
|
||||
use Joomla\CMS\Language\Text as JText;
|
||||
use Joomla\CMS\Plugin\PluginHelper as JPluginHelper;
|
||||
|
||||
$xmlfile = dirname(__FILE__, 2) . '/forms/popup.xml';
|
||||
|
||||
$form = new JForm('tabsaccordions');
|
||||
$form->loadFile($xmlfile, 1, '//config');
|
||||
|
||||
$editor_plugin = JPluginHelper::getPlugin('editors', 'codemirror');
|
||||
|
||||
if (empty($editor_plugin))
|
||||
{
|
||||
JFactory::getApplication()->enqueueMessage(JText::sprintf('RL_ERROR_CODEMIRROR_DISABLED', JText::_('TABSACCORDIONS'), '<a href="index.php?option=com_plugins&filter[folder]=editors&filter[search]=codemirror" target="_blank">', '</a>'), 'error');
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
$user = JFactory::getApplication()->getIdentity() ?: JFactory::getUser();
|
||||
$editor = JEditor::getInstance('codemirror');
|
||||
?>
|
||||
|
||||
<div class="container-fluid container-main">
|
||||
<form action="index.php" id="tabsAccordionsForm" method="post" style="width:99%">
|
||||
<?php echo JHtml::_('uitab.startTabSet', 'main', ['active' => 'items']); ?>
|
||||
|
||||
<?php
|
||||
$tabs = [
|
||||
'items' => 'RLTA_TABS',
|
||||
'styling' => 'RL_STYLING',
|
||||
'slideshow' => 'RLTA_SLIDESHOW',
|
||||
'settings' => 'RL_OTHER_SETTINGS',
|
||||
];
|
||||
|
||||
foreach ($tabs as $id => $title)
|
||||
{
|
||||
echo JHtml::_('uitab.addTab', 'main', $id, JText::_($title));
|
||||
echo $form->renderFieldset($id);
|
||||
echo JHtml::_('uitab.endTab');
|
||||
}
|
||||
?>
|
||||
|
||||
<?php echo JHtml::_('uitab.endTabSet'); ?>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user