This commit is contained in:
2024-12-31 11:07:09 +01:00
parent df7915205d
commit e089172b15
1916 changed files with 165422 additions and 271 deletions

View File

@ -0,0 +1,57 @@
<?php
/**
* @author Tassos Marinos <info@tassos.gr>
* @link http://www.tassos.gr
* @copyright Copyright © 2020 Tassos Marinos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
// No direct access to this file
defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\SubformField;
class JFormFieldFAQ extends SubformField
{
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value.
*
* @return boolean True on success.
*
* @since 3.6
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
if (!parent::setup($element, $value, $group))
{
return false;
}
$xml = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<form>
<field
name="value"
type="subform"
hiddenLabel="true"
multiple="true"
layout="joomla.form.field.subform.repeatable-table"
formsource="/plugins/fields/acffaq/fields/value.xml"
default='{"faq":{}}'
/>
</form>
XML;
$this->formsource = $xml;
return true;
}
public function getInput()
{
return '<div class="tf-subform-hide-label">' . parent::getInput() . '</div>';
}
}

View File

@ -0,0 +1,34 @@
<?php
/**
* @author Tassos Marinos <info@tassos.gr>
* @link http://www.tassos.gr
* @copyright Copyright © 2020 Tassos Marinos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
// No direct access to this file
defined('_JEXEC') or die;
require_once JPATH_PLUGINS . '/system/nrframework/fields/nrtoggle.php';
use NRFramework\Extension;
use Joomla\CMS\Language\Text;
class JFormFieldFAQSchemaToggle extends JFormFieldNRToggle
{
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*/
public function getInput()
{
// If GSD Pro is not installed and activated abort
if (!Extension::isInstalled('gsd', 'plugin') || !Extension::isPro('plg_system_gsd'))
{
return '<div class="alert alert-warning">' . Text::_('ACF_FAQ_SCHEMA_GSD_MISSING') . '</div>';
}
return parent::getInput();
}
}

View File

@ -0,0 +1,100 @@
<?php
/**
* @author Tassos Marinos <info@tassos.gr>
* @link http://www.tassos.gr
* @copyright Copyright © 2020 Tassos Marinos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
// No direct access to this file
defined('_JEXEC') or die;
$presets = [
1 => [
'separator' => [
'type' => 'nrtoggle',
'value' => true
],
'show_toggle_icon' => [
'type' => 'nrtoggle',
'value' => true
],
'icon' => [
'type' => 'radio',
'value' => 'arrow'
],
'icon_position' => [
'type' => 'radio',
'value' => 'right'
],
],
2 => [
'separator' => [
'type' => 'nrtoggle',
'value' => true
],
'show_toggle_icon' => [
'type' => 'nrtoggle',
'value' => true
],
'icon' => [
'type' => 'radio',
'value' => 'plus_minus'
],
'icon_position' => [
'type' => 'radio',
'value' => 'left'
],
],
3 => [
'initial_state' => [
'type' => 'list',
'value' => 'all-open'
],
'keep_one_question_open' => [
'type' => 'nrtoggle',
'value' => false
],
'separator' => [
'type' => 'nrtoggle',
'value' => true
],
'show_toggle_icon' => [
'type' => 'nrtoggle',
'value' => false
]
],
4 => [
'separator' => [
'type' => 'nrtoggle',
'value' => false
],
'background_color' => [
'type' => 'text',
'value' => '#fff'
],
'item_padding' => [
'type' => 'number',
'responsive' => true,
'dimensions' => true,
'value' => 20
],
'item_gap' => [
'type' => 'number',
'responsive' => true,
'value' => 14
],
'show_toggle_icon' => [
'type' => 'nrtoggle',
'value' => true
],
'icon' => [
'type' => 'radio',
'value' => 'arrow'
],
'icon_position' => [
'type' => 'radio',
'value' => 'right'
],
]
];

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset>
<field name="question" type="tfeditor"
label="ACF_FAQ_QUESTION"
hint="ACF_FAQ_QUESTION_HINT"
class="span12 full-width w-100"
rows="10"
filter="raw"
/>
<field name="answer" type="tfeditor"
label="ACF_FAQ_ANSWER"
hint="ACF_FAQ_ANSWER_HINT"
class="span12 full-width w-100"
rows="10"
filter="raw"
/>
</fieldset>
</form>