acf
This commit is contained in:
92
plugins/fields/acfcountdown/acfcountdown.php
Normal file
92
plugins/fields/acfcountdown/acfcountdown.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Advanced Custom Fields
|
||||
* @version 2.8.8 Pro
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Form;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
JLoader::register('ACF_Field', JPATH_PLUGINS . '/system/acf/helper/plugin.php');
|
||||
|
||||
if (!class_exists('ACF_Field'))
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage('Advanced Custom Fields System Plugin is missing', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
class PlgFieldsACFCountdown extends ACF_Field
|
||||
{
|
||||
/**
|
||||
* Override the field type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $overrideType = 'Countdown';
|
||||
|
||||
/**
|
||||
* The form event. Load additional parameters when available into the field form.
|
||||
* Only when the type of the form is of interest.
|
||||
*
|
||||
* @param Form $form The form
|
||||
* @param stdClass $data The data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function onContentPrepareForm(Form $form, $data)
|
||||
{
|
||||
$data = (object) $data;
|
||||
|
||||
// Make sure we are manipulating the right field.
|
||||
if (isset($data->type) && $data->type != $this->_name)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the configuration for the presets.
|
||||
*
|
||||
* These are handed over to Javascript and
|
||||
* whenever we click on a preset, these values
|
||||
* are set to each setting on the backend.
|
||||
*/
|
||||
if (Factory::getApplication()->isClient('administrator'))
|
||||
{
|
||||
Text::script('ACF_FIELD_PREVIEWER');
|
||||
Text::script('ACF_FIELD_PREVIEWER_INFO_ICON_TITLE');
|
||||
Text::script('NR_AND_LC');
|
||||
Text::script('NR_DAYS');
|
||||
Text::script('NR_HOURS');
|
||||
Text::script('NR_MINUTES');
|
||||
Text::script('NR_SECONDS');
|
||||
|
||||
// Include presets
|
||||
include 'fields/helper.php';
|
||||
|
||||
$script = 'window.ACFCountdownPresetsData = ' . json_encode($presets) . ';';
|
||||
Factory::getDocument()->addScriptDeclaration($script);
|
||||
HTMLHelper::script('plg_system_nrframework/tffieldsvaluesapplier.js', ['relative' => true, 'version' => 'auto']);
|
||||
HTMLHelper::script('plg_fields_acfcountdown/countdown.js', ['relative' => true, 'version' => 'auto']);
|
||||
|
||||
$script = 'window.ACFFieldsPreviewerData = ' . json_encode([
|
||||
'fullscreenActions' => true,
|
||||
'responsiveControls' => true
|
||||
]) . ';';
|
||||
Factory::getDocument()->addScriptDeclaration($script);
|
||||
HTMLHelper::script('plg_fields_acfcountdown/previewer.js', ['relative' => true, 'version' => 'auto']);
|
||||
}
|
||||
|
||||
|
||||
return parent::onContentPrepareForm($form, $data);
|
||||
}
|
||||
}
|
||||
26
plugins/fields/acfcountdown/acfcountdown.xml
Normal file
26
plugins/fields/acfcountdown/acfcountdown.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<extension type="plugin" version="3.7.0" group="fields" method="upgrade">
|
||||
<name>ACF_COUNTDOWN</name>
|
||||
<description>ACF_COUNTDOWN_DESC</description>
|
||||
<author>Tassos Marinos</author>
|
||||
<creationDate>December 2022</creationDate>
|
||||
<copyright>Copyright (C) 2021 Tassos Marinos. All rights reserved.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>info@tassos.gr</authorEmail>
|
||||
<authorUrl>www.tassos.gr</authorUrl>
|
||||
<version>1.0</version>
|
||||
<scriptfile>script.install.php</scriptfile>
|
||||
<files>
|
||||
<filename plugin="acfcountdown">acfcountdown.php</filename>
|
||||
<filename>script.install.helper.php</filename>
|
||||
<filename>version.php</filename>
|
||||
<folder>fields</folder>
|
||||
<folder>language</folder>
|
||||
<folder>params</folder>
|
||||
<folder>tmpl</folder>
|
||||
</files>
|
||||
<media folder="media" destination="plg_fields_acfcountdown">
|
||||
<folder>js</folder>
|
||||
<folder>img</folder>
|
||||
</media>
|
||||
</extension>
|
||||
120
plugins/fields/acfcountdown/fields/countdown.php
Normal file
120
plugins/fields/acfcountdown/fields/countdown.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?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\FormField;
|
||||
use Joomla\CMS\Form\Form;
|
||||
|
||||
class JFormFieldCountdown extends FormField
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
// Value must be an array
|
||||
if (is_string($this->value) && $value = json_decode($this->value, true))
|
||||
{
|
||||
$this->value = json_decode($this->value, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
$countdown_type = (string) $this->element['countdown_type'];
|
||||
|
||||
$static_fields = '
|
||||
<field name="value" type="calendar"
|
||||
hiddenLabel="true"
|
||||
format="%Y-%m-%d %H:%M:%S"
|
||||
filter="none"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
required="' . $this->required . '"
|
||||
/>';
|
||||
|
||||
$evergreen_fields = '
|
||||
<field name="acf_countdown_inline_start" hiddenLabel="true" type="nr_inline" />
|
||||
<field name="dynamic_days" type="nrnumber"
|
||||
class="input-small"
|
||||
hiddenLabel="true"
|
||||
addon="ACF_COUNTDOWN_DAYS"
|
||||
default="0"
|
||||
min="0"
|
||||
max="365"
|
||||
required="' . $this->required . '"
|
||||
/>
|
||||
<field name="dynamic_hours" type="nrnumber"
|
||||
class="input-small"
|
||||
hiddenLabel="true"
|
||||
addon="ACF_COUNTDOWN_HOURS"
|
||||
default="0"
|
||||
min="0"
|
||||
max="999"
|
||||
required="' . $this->required . '"
|
||||
/>
|
||||
<field name="dynamic_minutes" type="nrnumber"
|
||||
class="input-small"
|
||||
hiddenLabel="true"
|
||||
addon="ACF_COUNTDOWN_MINUTES"
|
||||
default="0"
|
||||
min="0"
|
||||
max="999"
|
||||
required="' . $this->required . '"
|
||||
/>
|
||||
<field name="dynamic_seconds" type="nrnumber"
|
||||
class="input-small"
|
||||
hiddenLabel="true"
|
||||
addon="ACF_COUNTDOWN_SECONDS"
|
||||
default="0"
|
||||
min="0"
|
||||
max="999"
|
||||
required="' . $this->required . '"
|
||||
/>
|
||||
<field name="acf_countdown_inline_end" end="1" type="nr_inline" />
|
||||
';
|
||||
|
||||
$form_source = new SimpleXMLElement('
|
||||
<form>
|
||||
<fieldset name="acfcountdown">
|
||||
' . ($countdown_type === 'static' ? $static_fields : $evergreen_fields) . '
|
||||
</fieldset>
|
||||
</form>
|
||||
');
|
||||
|
||||
$control = $this->name;
|
||||
$formname = 'acfcountdown.' . str_replace(['jform[', '[', ']'], ['', '.', ''], $control);
|
||||
|
||||
$form = Form::getInstance($formname, $form_source->asXML(), ['control' => $control]);
|
||||
$form->bind($this->value);
|
||||
|
||||
return '<div class="acf-countdown-item-edit-wrapper">' . $form->renderFieldset('acfcountdown') . '</div>';
|
||||
}
|
||||
}
|
||||
516
plugins/fields/acfcountdown/fields/helper.php
Normal file
516
plugins/fields/acfcountdown/fields/helper.php
Normal file
@ -0,0 +1,516 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$presets = [
|
||||
1 => [
|
||||
'separator' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => true
|
||||
],
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 30, 'tablet' => 25, 'mobile' => '']
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 15, 'tablet' => 13, 'mobile' => '']
|
||||
],
|
||||
'gap' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 10, 'tablet' => 0, 'mobile' => '']
|
||||
],
|
||||
'minutes_label' => [
|
||||
'type' => 'text',
|
||||
'value' => Text::_('ACF_COUNTDOWN_MINS')
|
||||
],
|
||||
'seconds_label' => [
|
||||
'type' => 'text',
|
||||
'value' => Text::_('ACF_COUNTDOWN_SECS')
|
||||
],
|
||||
'digits_wrapper_custom_width' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => true
|
||||
],
|
||||
'digits_wrapper_min_width' => [
|
||||
'type' => 'number',
|
||||
'value' => 50
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'digit_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'unit_label_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'label_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 400
|
||||
],
|
||||
'unit_label_margin_top' => [
|
||||
'type' => 'number',
|
||||
'value' => 9
|
||||
]
|
||||
],
|
||||
2 => [
|
||||
'item_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => 74
|
||||
],
|
||||
'[border][style]' => [
|
||||
'type' => 'list',
|
||||
'value' => 'solid'
|
||||
],
|
||||
'[border][width]' => [
|
||||
'type' => 'number',
|
||||
'value' => 2
|
||||
],
|
||||
'[border][color]' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'item_border_radius' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'border_radius' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 9]
|
||||
],
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 30, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'digit_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 12, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'label_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'unit_label_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
]
|
||||
],
|
||||
3 => [
|
||||
'days_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('NR_DAYS'))
|
||||
],
|
||||
'hours_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('NR_HOURS'))
|
||||
],
|
||||
'minutes_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('ACF_COUNTDOWN_MINS'))
|
||||
],
|
||||
'seconds_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('ACF_COUNTDOWN_SECS'))
|
||||
],
|
||||
'item_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => 84
|
||||
],
|
||||
'[border][style]' => [
|
||||
'type' => 'list',
|
||||
'value' => 'solid'
|
||||
],
|
||||
'[border][width]' => [
|
||||
'type' => 'number',
|
||||
'value' => 2
|
||||
],
|
||||
'[border][color]' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'item_border_radius' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'border_radius' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 100]
|
||||
],
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 30, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'digit_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 12, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'label_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'unit_label_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
]
|
||||
],
|
||||
4 => [
|
||||
'item_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => 74
|
||||
],
|
||||
'item_background_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'item_border_radius' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'border_radius' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 9]
|
||||
],
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 30, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'digit_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#fff'
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 12, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'label_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'unit_label_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#d2d5ee'
|
||||
]
|
||||
],
|
||||
5 => [
|
||||
'days' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => false
|
||||
],
|
||||
'separator' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => true
|
||||
],
|
||||
'gap' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 5]
|
||||
],
|
||||
'digits_gap' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 3]
|
||||
],
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 30, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'digit_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#fff'
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 15, 'tablet' => 13, 'mobile' => '']
|
||||
],
|
||||
'label_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 400
|
||||
],
|
||||
'unit_label_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'unit_label_margin_top' => [
|
||||
'type' => 'number',
|
||||
'value' => 8
|
||||
],
|
||||
'digits_custom_width' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => true
|
||||
],
|
||||
'digits_min_width' => [
|
||||
'type' => 'number',
|
||||
'value' => 39
|
||||
],
|
||||
'digits_padding' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => ['top' => 9, 'right' => 5, 'bottom' => 9, 'left' => 5]]
|
||||
],
|
||||
'digit_background_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'digits_border_radius' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'border_radius' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 9]
|
||||
]
|
||||
],
|
||||
6 => [
|
||||
'minutes_label' => [
|
||||
'type' => 'text',
|
||||
'value' => Text::_('ACF_COUNTDOWN_MINS')
|
||||
],
|
||||
'seconds_label' => [
|
||||
'type' => 'text',
|
||||
'value' => Text::_('ACF_COUNTDOWN_SECS')
|
||||
],
|
||||
'digits_wrapper_custom_width' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => true
|
||||
],
|
||||
'digits_wrapper_min_width' => [
|
||||
'type' => 'number',
|
||||
'value' => 59
|
||||
],
|
||||
'digits_wrapper_padding' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 9]
|
||||
],
|
||||
'digits_wrapper_background_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'digit_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#fff'
|
||||
],
|
||||
'digits_wrapper_border_radius' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'border_radius' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 5]
|
||||
],
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 30, 'tablet' => 25, 'mobile' => '']
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 15, 'tablet' => 13, 'mobile' => '']
|
||||
],
|
||||
'label_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 400
|
||||
],
|
||||
'unit_label_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'unit_label_margin_top' => [
|
||||
'type' => 'number',
|
||||
'value' => 8
|
||||
]
|
||||
],
|
||||
7 => [
|
||||
'days_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('NR_DAYS'))
|
||||
],
|
||||
'hours_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('NR_HOURS'))
|
||||
],
|
||||
'minutes_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('ACF_COUNTDOWN_MINS'))
|
||||
],
|
||||
'seconds_label' => [
|
||||
'type' => 'text',
|
||||
'value' => strtoupper(Text::_('ACF_COUNTDOWN_SECS'))
|
||||
],
|
||||
'separator' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => true
|
||||
],
|
||||
'item_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => 90
|
||||
],
|
||||
'item_border_radius' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'border_radius' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 7]
|
||||
],
|
||||
'item_background_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#f6f6f6'
|
||||
],
|
||||
'gap' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 5]
|
||||
],
|
||||
'digits_gap' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 3]
|
||||
],
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 30, 'tablet' => 25, 'mobile' => '']
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
],
|
||||
'digit_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#fff'
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 12, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'label_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 600
|
||||
],
|
||||
'unit_label_text_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'unit_label_margin_top' => [
|
||||
'type' => 'number',
|
||||
'value' => 9
|
||||
],
|
||||
'digits_custom_width' => [
|
||||
'type' => 'nrtoggle',
|
||||
'value' => true
|
||||
],
|
||||
'digits_min_width' => [
|
||||
'type' => 'number',
|
||||
'value' => 30
|
||||
],
|
||||
'digits_padding' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 5]
|
||||
],
|
||||
'digit_background_color' => [
|
||||
'type' => 'text',
|
||||
'value' => '#41495b'
|
||||
],
|
||||
'digits_border_radius' => [
|
||||
'responsive' => true,
|
||||
'dimensions' => true,
|
||||
'border_radius' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 7]
|
||||
]
|
||||
],
|
||||
8 => [
|
||||
'digits_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 16, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'label_font_size' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ['desktop' => 16, 'tablet' => '', 'mobile' => '']
|
||||
],
|
||||
'gap' => [
|
||||
'responsive' => true,
|
||||
'type' => 'number',
|
||||
'value' => ''
|
||||
],
|
||||
'days_label' => [
|
||||
'type' => 'text',
|
||||
'value' => ' ' . strtolower(Text::_('NR_DAYS'))
|
||||
],
|
||||
'hours_label' => [
|
||||
'type' => 'text',
|
||||
'value' => ' ' . strtolower(Text::_('NR_HOURS'))
|
||||
],
|
||||
'minutes_label' => [
|
||||
'type' => 'text',
|
||||
'value' => ' ' . strtolower(Text::_('NR_MINUTES'))
|
||||
],
|
||||
'seconds_label' => [
|
||||
'type' => 'text',
|
||||
'value' => ' ' . strtolower(Text::_('NR_SECONDS'))
|
||||
],
|
||||
'digits_font_weight' => [
|
||||
'type' => 'list',
|
||||
'value' => 500
|
||||
]
|
||||
]
|
||||
];
|
||||
@ -0,0 +1,108 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2020 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFCOUNTDOWN_LABEL="ACF - Countdown"
|
||||
ACF_COUNTDOWN="Fields - ACF Countdown"
|
||||
ACF_COUNTDOWN_VALUE_DESC="Set the countdown date, or dynamic days/hours/minutes/seconds."
|
||||
ACF_COUNTDOWN_DESC="Use a countdown timer to create anticipation and scarcity around upcoming events, creating the feeling of scarcity, anticipation, and drive more sales."
|
||||
ACF_COUNTDOWN_SHOW_MESSAGE="Show message"
|
||||
ACF_COUNTDOWN_SHOW_MESSAGE_DESC="Set the message that will appear once the timer ends."
|
||||
ACF_COUNTDOWN_FINISH_TEXT_DESC="Set the message that will appear once the countdown ends."
|
||||
ACF_COUNTDOWN_FINISH_TEXT_HINT="Countdown finished."
|
||||
ACF_COUNTDOWN_CUSTOM_FORMAT="Custom Format"
|
||||
ACF_COUNTDOWN_CUSTOM_FORMAT_DESC="Using the <strong>Custom Format</strong> option, you can write your own HTML to produce a countdown that fits your needs.<br>Available Tags:<br><br>• {days}<br>• {hours}<br>• {minutes}<br>• {seconds}<br><br>Example: {minutes}m:{seconds}s will produce a countdown with output: 35m:28s"
|
||||
ACF_COUNTDOWN_CUSTOM_FORMAT_HINT="{days} days, {hours} hours, {minutes} minutes and {seconds} seconds"
|
||||
ACF_COUNTDOWN_COUNTDOWN_TIMER="Timer"
|
||||
ACF_COUNTDOWN_ACTION="On Countdown Expire"
|
||||
ACF_COUNTDOWN_ACTION_DESC="Select the countdown end action.<br><br><strong>No action:</strong> The countdown will remain once finished.<br><strong>Hide timer:</strong> The countdown will disappear once it ends.<br><strong>Show message:</strong> Show a message once the countdown ends.<br><strong>Redirect to URL:</strong> Redirect to a URL once the timer ends."
|
||||
ACF_COUNTDOWN_ACTION_NO_ACTION="No action"
|
||||
ACF_COUNTDOWN_ACTION_HIDE_TIMER="Hide timer"
|
||||
ACF_COUNTDOWN_ACTION_REDIRECT="Redirect to URL"
|
||||
ACF_COUNTDOWN_REDIRECT_URL="Redirect URL"
|
||||
ACF_COUNTDOWN_REDIRECT_URL_DESC="Set the URL to redirect the user once the countdown ends."
|
||||
ACF_COUNTDOWN_REDIRECT_URL_HINT="https://"
|
||||
ACF_COUNTDOWN_PRE_MADE_TEMPLATE="Pre-made Template"
|
||||
ACF_COUNTDOWN_TEMPLATE="Template"
|
||||
ACF_COUNTDOWN_TEMPLATE_DESC="Select the countdown template to use. Once you select a template, the settings below will be updated based on the selected template."
|
||||
ACF_COUNTDOWN_UNIT_DISPLAY="Unit Display"
|
||||
ACF_COUNTDOWN_DAYS_LABEL="Show Days"
|
||||
ACF_COUNTDOWN_DAYS="Days"
|
||||
ACF_COUNTDOWN_DAYS_DESC="Set whether to display the days."
|
||||
ACF_COUNTDOWN_DAYS_LABEL="Days Label"
|
||||
ACF_COUNTDOWN_DAYS_LABEL_DESC="Set the days label."
|
||||
ACF_COUNTDOWN_HOURS_LABEL="Show Hours"
|
||||
ACF_COUNTDOWN_HOURS="Hours"
|
||||
ACF_COUNTDOWN_HOURS_DESC="Set whether to display the hours."
|
||||
ACF_COUNTDOWN_HOURS_LABEL="Hours Label"
|
||||
ACF_COUNTDOWN_HOURS_LABEL_DESC="Set the hours label."
|
||||
ACF_COUNTDOWN_MINUTES_LABEL="Show Minutes"
|
||||
ACF_COUNTDOWN_MINUTES="Minutes"
|
||||
ACF_COUNTDOWN_MINUTES_DESC="Set whether to display the minutes."
|
||||
ACF_COUNTDOWN_MINUTES_LABEL="Minutes Label"
|
||||
ACF_COUNTDOWN_MINUTES_LABEL_DESC="Set the minutes label."
|
||||
ACF_COUNTDOWN_SECONDS_LABEL="Show Seconds"
|
||||
ACF_COUNTDOWN_SECONDS="Seconds"
|
||||
ACF_COUNTDOWN_SECONDS_DESC="Set whether to display the seconds."
|
||||
ACF_COUNTDOWN_SECONDS_LABEL="Seconds Label"
|
||||
ACF_COUNTDOWN_SECONDS_LABEL_DESC="Set the seconds label."
|
||||
ACF_COUNTDOWN_TYPE="Type"
|
||||
ACF_COUNTDOWN_TYPE_DESC="Select the Contdown type.<br><br><strong>Fixed:</strong> Counts down to a specific date and time. Universal deadline for all visitors.<br><strong>Evergreen:</strong> Set-and-forget solution. The countdown starts when your visitor sees the offer. The countdown will also restart upon ending."
|
||||
ACF_COUNTDOWN_TYPE_FIXED="Fixed Date"
|
||||
ACF_COUNTDOWN_TYPE_EVERGREEN="Evergreen"
|
||||
ACF_COUNTDOWN_TIMEZONE="Date Timezone"
|
||||
ACF_COUNTDOWN_TIMEZONE_DESC="Select which timezone will be used."
|
||||
ACF_COUNTDOWN_TIMEZONE_SERVER="Use Joomla Timezone"
|
||||
ACF_COUNTDOWN_TIMEZONE_CLIENT="Use Visitor's Timezone"
|
||||
ACF_COUNTDOWN_THEME_SETTINGS="Theme Settings"
|
||||
ACF_COUNTDOWN_ITEM_BORDER_COLOR="Item Border Color"
|
||||
ACF_COUNTDOWN_ITEM_BORDER_COLOR_DESC="Set the border color around each countdown item."
|
||||
ACF_COUNTDOWN_ENABLE_SEPARATOR="Enable Separator"
|
||||
ACF_COUNTDOWN_ENABLE_SEPARATOR_DESC="Set to display a colon \":\" separator."
|
||||
ACF_COUNTDOWN_DOUBLE_ZEROES_FORMAT="Enable 00 Number Format"
|
||||
ACF_COUNTDOWN_DOUBLE_ZEROES_FORMAT_DESC="Set whether to display the numbers in 0 or 00 format."
|
||||
ACF_COUNTDOWN_UNIT_ITEM="Unit Item"
|
||||
ACF_COUNTDOWN_ITEM_SIZE="Size"
|
||||
ACF_COUNTDOWN_ITEM_SIZE_DESC="Sets the item's width and height in pixels. Leave empty for auto width."
|
||||
ACF_COUNTDOWN_TEMPLATE_SELECTOR_DESC="Select whether to use a pre-made template or a custom template"
|
||||
ACF_COUNTDOWN_TEMPLATE_SELECTOR="Template selector"
|
||||
ACF_COUNTDOWN_GAP="Gap"
|
||||
ACF_COUNTDOWN_GAP_DESC="Set the space between unit items."
|
||||
ACF_COUNTDOWN_BACKGROUND_COLOR="Background Color"
|
||||
ACF_COUNTDOWN_ITEM_BACKGROUND_COLOR_DESC="Set the item background color."
|
||||
ACF_COUNTDOWN_UNIT_ITEM_BORDER_CONTROL_DESC="Set the border for the unit item (style, color and width)."
|
||||
ACF_COUNTDOWN_UNIT_DIGITS_CONTAINER="Unit Digits Container"
|
||||
ACF_COUNTDOWN_UNIT_DIGIT="Unit Digit"
|
||||
ACF_COUNTDOWN_UNIT_LABEL="Unit Label"
|
||||
ACF_COUNTDOWN_ITEM_BORDER_RADIUS_DESC="Set the item border radius."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_PADDING_DESC="Set the digits container padding."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_CUSTOM_WIDTH="Digits Container Custom Width"
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_CUSTOM_WIDTH_DESC="Set the digits container minimum width.<br><br><strong>Enable</strong> to set a custom width.<br><strong>Disable</strong> for auto width."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_BACKGROUND_COLOR_DESC="Set the digits container background color."
|
||||
ACF_COUNTDOWN_DIGITS_FONT_SIZE_DESC="Set the font size of the digits."
|
||||
ACF_COUNTDOWN_DIGITS_FONT_WEIGHT="Font Weight"
|
||||
ACF_COUNTDOWN_DIGITS_FONT_WEIGHT_DESC="Set the font weight of the digits."
|
||||
ACF_COUNTDOWN_DIGITS_CUSTOM_WIDTH="Digits Custom Width"
|
||||
ACF_COUNTDOWN_DIGITS_CUSTOM_WIDTH_DESC="Set the digits minimum width.<br><br><strong>Enable</strong> to set a custom width.<br><strong>Disable</strong> for auto width."
|
||||
ACF_COUNTDOWN_DIGITS_PADDING_DESC="Set the padding for each digit."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_BORDER_RADIUS_DESC="Set the border radius for the digits container."
|
||||
ACF_COUNTDOWN_DIGITS_BORDER_RADIUS_DESC="Set the border radius for each digit."
|
||||
ACF_COUNTDOWN_DIGITS_GAP_DESC="Set the gap between the digits."
|
||||
ACF_COUNTDOWN_DIGIT_BACKGROUND_COLOR_DESC="Set the background color of each digit."
|
||||
ACF_COUNTDOWN_TEXT_COLOR="Text Color"
|
||||
ACF_COUNTDOWN_DIGIT_TEXT_COLOR_DESC="Set the text color of each digit."
|
||||
ACF_COUNTDOWN_LABEL_FONT_SIZE_DESC="Set the font size of the labels."
|
||||
ACF_COUNTDOWN_LABEL_FONT_WEIGHT="Label Weight"
|
||||
ACF_COUNTDOWN_LABEL_FONT_WEIGHT_DESC="Set the font weight of the labels."
|
||||
ACF_COUNTDOWN_UNIT_LABEL_COLOR_DESC="Set the text color of the labels appearing below each countdown digit."
|
||||
ACF_COUNTDOWN_UNIT_LABEL_MARGIN_TOP="Space between label and digits"
|
||||
ACF_COUNTDOWN_UNIT_LABEL_MARGIN_TOP_DESC="Set the spacing between the label and the countdown digits."
|
||||
ACF_COUNTDOWN_MINS="Mins"
|
||||
ACF_COUNTDOWN_SECS="Secs"
|
||||
ACF_COUNTDOWN_SHOW_ADVANCED_SETTINGS="Show Advanced Settings"
|
||||
ACF_COUNTDOWN_SHOW_ADVANCED_SETTINGS_DESC="Enable to show advanced settings."
|
||||
ACF_COUNTDOWN_ITEM_PADDING="Item Padding"
|
||||
ACF_COUNTDOWN_ITEM_PADDING_DESC="Set the item's padding."
|
||||
@ -0,0 +1,9 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2020 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
ACF_COUNTDOWN="Fields - ACF Countdown"
|
||||
ACF_COUNTDOWN_DESC="Use a countdown timer to create anticipation and scarcity around upcoming events, creating the feeling of scarcity, anticipation, and drive more sales."
|
||||
@ -0,0 +1,108 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2020 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFCOUNTDOWN_LABEL="ACF - Cuenta Atras"
|
||||
ACF_COUNTDOWN="Campos - ACF Cuenta Atras"
|
||||
ACF_COUNTDOWN_VALUE_DESC="Establezca la fecha de la cuenta regresiva o en dinámico los días/horas/minutos/segundos."
|
||||
ACF_COUNTDOWN_DESC="Use un temporizador de cuenta regresiva para crear anticipación y escasez en torno a los próximos eventos, creando la sensación de escasez, anticipación e impulsando más ventas."
|
||||
ACF_COUNTDOWN_SHOW_MESSAGE="Mostrar mensaje"
|
||||
ACF_COUNTDOWN_SHOW_MESSAGE_DESC="Configure el mensaje que aparecerá una vez que finalice el temporizador."
|
||||
ACF_COUNTDOWN_FINISH_TEXT_DESC="Configure el mensaje que aparecerá una vez finalice la cuenta atrás."
|
||||
ACF_COUNTDOWN_FINISH_TEXT_HINT="Cuenta regresiva finalizada."
|
||||
ACF_COUNTDOWN_CUSTOM_FORMAT="Formato Personalizado"
|
||||
ACF_COUNTDOWN_CUSTOM_FORMAT_DESC="Usando la opción de <strong>Formato Personalizado</strong>, puede escribir su propio HTML para producir una cuenta regresiva que se ajuste a sus necesidades.<br>Etiquetas Disponibles:<br><br>• {days}<br>• {hours}<br>• {minutes}<br>• {seconds}<br><br>Ejemplo: {minutes}m:{seconds}s producirá una cuenta regresiva con salida: 35m:28s"
|
||||
ACF_COUNTDOWN_CUSTOM_FORMAT_HINT="{days} días, {hours} horas, {minutes} minutos y {seconds} segundos"
|
||||
ACF_COUNTDOWN_COUNTDOWN_TIMER="Temporizador"
|
||||
ACF_COUNTDOWN_ACTION="Expirar una Cuenta Atras"
|
||||
ACF_COUNTDOWN_ACTION_DESC="Seleccione la acción final de la cuenta atras.<br><br><strong>Sin acción:</strong> La cuenta atrás permanecerá una vez finalizada.<br><strong>Ocultar temporizador:</strong> La cuenta atras desaparecerá una vez que finalice.<br><strong>Mostrar mensaje:</strong> Muestra un mensaje una vez que finaliza la cuenta atras.<br><strong>Redirigir a una URL:</strong> Redirige a una URL una vez que finaliza el temporizador."
|
||||
ACF_COUNTDOWN_ACTION_NO_ACTION="Sin acción"
|
||||
ACF_COUNTDOWN_ACTION_HIDE_TIMER="Ocultar temporizador"
|
||||
ACF_COUNTDOWN_ACTION_REDIRECT="Redirigir a URL"
|
||||
ACF_COUNTDOWN_REDIRECT_URL="Redireccionar URL"
|
||||
ACF_COUNTDOWN_REDIRECT_URL_DESC="Configure la URL para redirigir al usuario una vez que finalice la cuenta atras."
|
||||
ACF_COUNTDOWN_REDIRECT_URL_HINT="https://"
|
||||
ACF_COUNTDOWN_PRE_MADE_TEMPLATE="Plantilla Prefabricada"
|
||||
ACF_COUNTDOWN_TEMPLATE="Plantilla"
|
||||
ACF_COUNTDOWN_TEMPLATE_DESC="Seleccione la plantilla de cuenta atrasa que desea usar. Una vez que seleccione una plantilla, la configuración a continuación se actualizará en función de la plantilla seleccionada."
|
||||
ACF_COUNTDOWN_UNIT_DISPLAY="Pantalla de unidad"
|
||||
ACF_COUNTDOWN_DAYS_LABEL="Mostrar Días"
|
||||
ACF_COUNTDOWN_DAYS="Días"
|
||||
ACF_COUNTDOWN_DAYS_DESC="Establezca si mostrar los días."
|
||||
ACF_COUNTDOWN_DAYS_LABEL="Mostrar Días"
|
||||
ACF_COUNTDOWN_DAYS_LABEL_DESC="Establecer la etiqueta de días."
|
||||
ACF_COUNTDOWN_HOURS_LABEL="Mostrar Horas"
|
||||
ACF_COUNTDOWN_HOURS="Horas"
|
||||
ACF_COUNTDOWN_HOURS_DESC="Establezca si mostrar las horas."
|
||||
ACF_COUNTDOWN_HOURS_LABEL="Mostrar Horas"
|
||||
ACF_COUNTDOWN_HOURS_LABEL_DESC="Establecer la etiqueta de horas."
|
||||
ACF_COUNTDOWN_MINUTES_LABEL="Mostrar Minutos"
|
||||
ACF_COUNTDOWN_MINUTES="Minutos"
|
||||
ACF_COUNTDOWN_MINUTES_DESC="Establezca si mostrar minutos."
|
||||
ACF_COUNTDOWN_MINUTES_LABEL="Mostrar Minutos"
|
||||
ACF_COUNTDOWN_MINUTES_LABEL_DESC="Establecer la etiqueta de minutos."
|
||||
ACF_COUNTDOWN_SECONDS_LABEL="Mostrar Segundos"
|
||||
ACF_COUNTDOWN_SECONDS="Segundos"
|
||||
ACF_COUNTDOWN_SECONDS_DESC="Establezca si mostrar segundos"
|
||||
ACF_COUNTDOWN_SECONDS_LABEL="Mostrar Segundos"
|
||||
ACF_COUNTDOWN_SECONDS_LABEL_DESC="Establecer la etiqueta de segundos."
|
||||
ACF_COUNTDOWN_TYPE="Tipo"
|
||||
ACF_COUNTDOWN_TYPE_DESC="Seleccione el tipo de Cuenta Atras.<br><br><strong>Fijo:</strong> Cuenta atrás hasta una fecha y hora específicas. Plazo universal para todos los visitantes.<br><strong>Perenne:</strong> Solución de configurar y olvidar. La cuenta regresiva comienza cuando su visitante ve la oferta. La cuenta regresiva también se reiniciará al finalizar."
|
||||
ACF_COUNTDOWN_TYPE_FIXED="Fecha Fijada"
|
||||
ACF_COUNTDOWN_TYPE_EVERGREEN="Perenne"
|
||||
ACF_COUNTDOWN_TIMEZONE="Zona Horaria"
|
||||
ACF_COUNTDOWN_TIMEZONE_DESC="Seleccione qué zona horaria se utilizará."
|
||||
ACF_COUNTDOWN_TIMEZONE_SERVER="Usar la zona horaria de Joomla"
|
||||
ACF_COUNTDOWN_TIMEZONE_CLIENT="Usar la zona horaria del visitante"
|
||||
ACF_COUNTDOWN_THEME_SETTINGS="Ajustes del Tema"
|
||||
ACF_COUNTDOWN_ITEM_BORDER_COLOR="Color del borde del artículo"
|
||||
ACF_COUNTDOWN_ITEM_BORDER_COLOR_DESC="Establezca el color del borde alrededor de cada elemento de la cuenta atras."
|
||||
ACF_COUNTDOWN_ENABLE_SEPARATOR="Activar Separador"
|
||||
ACF_COUNTDOWN_ENABLE_SEPARATOR_DESC="Configure para mostrar un separador de dos puntos \\\":\\\"."
|
||||
ACF_COUNTDOWN_DOUBLE_ZEROES_FORMAT="Habilitar Formato de Número 00"
|
||||
ACF_COUNTDOWN_DOUBLE_ZEROES_FORMAT_DESC="Establezca si mostrar los números en formato 0 o 00."
|
||||
ACF_COUNTDOWN_UNIT_ITEM="Unidad del Elemento"
|
||||
ACF_COUNTDOWN_ITEM_SIZE="Tamaño"
|
||||
ACF_COUNTDOWN_ITEM_SIZE_DESC="Establece el ancho y la altura del elemento en píxeles. Deje vacío para ancho automático."
|
||||
ACF_COUNTDOWN_TEMPLATE_SELECTOR_DESC="Seleccione si desea utilizar una plantilla prefabricada o una plantilla personalizada"
|
||||
ACF_COUNTDOWN_TEMPLATE_SELECTOR="Selector de Plantilla"
|
||||
ACF_COUNTDOWN_GAP="Espaciado"
|
||||
ACF_COUNTDOWN_GAP_DESC="Establezca el espacio entre los elementos de la unidad."
|
||||
ACF_COUNTDOWN_BACKGROUND_COLOR="Color de Fondo"
|
||||
ACF_COUNTDOWN_ITEM_BACKGROUND_COLOR_DESC="Establezca el color de fondo del elemento"
|
||||
ACF_COUNTDOWN_UNIT_ITEM_BORDER_CONTROL_DESC="Establezca el borde para el elemento de la unidad (estilo, color y ancho)."
|
||||
ACF_COUNTDOWN_UNIT_DIGITS_CONTAINER="Contenedor de Unidad de Dígitos"
|
||||
ACF_COUNTDOWN_UNIT_DIGIT="Unidad de Digitos"
|
||||
ACF_COUNTDOWN_UNIT_LABEL="Unidad de Etiqueta"
|
||||
ACF_COUNTDOWN_ITEM_BORDER_RADIUS_DESC="Establezca el radio del borde del elemento."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_PADDING_DESC="Establezca el relleno del contenedor de dígitos."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_CUSTOM_WIDTH="Ancho personalizado del contenedor de dígitos"
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_CUSTOM_WIDTH_DESC="Establezca el ancho mínimo del contenedor de dígitos.<br><br><strong>Activado</strong>para establecer un ancho personalizado.<br><strong>Desactivado</strong> Para tamaño automático."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_BACKGROUND_COLOR_DESC="Establezca el color de fondo del contenedor de dígitos."
|
||||
ACF_COUNTDOWN_DIGITS_FONT_SIZE_DESC="Establezca el tamaño de la fuente de los dígitos."
|
||||
ACF_COUNTDOWN_DIGITS_FONT_WEIGHT="Peso de fuente"
|
||||
ACF_COUNTDOWN_DIGITS_FONT_WEIGHT_DESC="Establezca el peso de la fuente de los dígitos."
|
||||
ACF_COUNTDOWN_DIGITS_CUSTOM_WIDTH="Ancho Personalizado de Dígitos"
|
||||
ACF_COUNTDOWN_DIGITS_CUSTOM_WIDTH_DESC="Configure el ancho mínimo de los dígitos.<br><br><strong>Activado</strong> para establecer un ancho personalizado.<br><strong>Desactivado</strong> para tamaño automático."
|
||||
ACF_COUNTDOWN_DIGITS_PADDING_DESC="Establecer el relleno para cada dígito."
|
||||
ACF_COUNTDOWN_DIGITS_CONTAINER_BORDER_RADIUS_DESC="Establezca el radio del borde para el contenedor de dígitos."
|
||||
ACF_COUNTDOWN_DIGITS_BORDER_RADIUS_DESC="Establezca el radio del borde para cada dígito."
|
||||
ACF_COUNTDOWN_DIGITS_GAP_DESC="Establezca el espacio entre los dígitos."
|
||||
ACF_COUNTDOWN_DIGIT_BACKGROUND_COLOR_DESC="Establezca el color de fondo de cada dígito."
|
||||
ACF_COUNTDOWN_TEXT_COLOR="Color del Texto"
|
||||
ACF_COUNTDOWN_DIGIT_TEXT_COLOR_DESC="Establece el color del texto de cada dígito."
|
||||
ACF_COUNTDOWN_LABEL_FONT_SIZE_DESC="Establezca el tamaño de fuente de las etiquetas."
|
||||
ACF_COUNTDOWN_LABEL_FONT_WEIGHT="Peso de la Etiqueta"
|
||||
ACF_COUNTDOWN_LABEL_FONT_WEIGHT_DESC="Establezca el peso de la fuente de las etiquetas."
|
||||
ACF_COUNTDOWN_UNIT_LABEL_COLOR_DESC="Establezca el color del texto de las etiquetas que aparecen debajo de cada dígito de la cuenta regresiva."
|
||||
ACF_COUNTDOWN_UNIT_LABEL_MARGIN_TOP="Espacio entre la etiqueta y los dígitos"
|
||||
ACF_COUNTDOWN_UNIT_LABEL_MARGIN_TOP_DESC="Configure el espacio entre la etiqueta y los dígitos de la cuenta atras."
|
||||
ACF_COUNTDOWN_MINS="Minutos"
|
||||
ACF_COUNTDOWN_SECS="Segundos"
|
||||
ACF_COUNTDOWN_SHOW_ADVANCED_SETTINGS="Mostrar Ajustes Avanzados"
|
||||
ACF_COUNTDOWN_SHOW_ADVANCED_SETTINGS_DESC="Habilite para mostrar la configuración avanzada."
|
||||
ACF_COUNTDOWN_ITEM_PADDING="Relleno de Artículos"
|
||||
ACF_COUNTDOWN_ITEM_PADDING_DESC="Establezca el relleno del elemento."
|
||||
@ -0,0 +1,9 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2020 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
ACF_COUNTDOWN="Campos - ACF Cuenta Atras"
|
||||
ACF_COUNTDOWN_DESC="Use un temporizador de cuenta regresiva para crear anticipación y escasez en torno a los próximos eventos, creando la sensación de escasez, anticipación e impulsando más ventas."
|
||||
417
plugins/fields/acfcountdown/params/acfcountdown.xml
Normal file
417
plugins/fields/acfcountdown/params/acfcountdown.xml
Normal file
@ -0,0 +1,417 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form>
|
||||
<fields name="fieldparams">
|
||||
<fieldset name="fieldparams">
|
||||
<field name="advanced_settings" type="nrtoggle"
|
||||
label="ACF_COUNTDOWN_SHOW_ADVANCED_SETTINGS"
|
||||
description="ACF_COUNTDOWN_SHOW_ADVANCED_SETTINGS_DESC"
|
||||
/>
|
||||
<!-- Timer -->
|
||||
<field name="a" type="spacer" class="acf" label="ACF_COUNTDOWN_COUNTDOWN_TIMER" />
|
||||
<field name="countdown_type" type="radio"
|
||||
label="ACF_COUNTDOWN_TYPE"
|
||||
description="ACF_COUNTDOWN_TYPE_DESC"
|
||||
default="static"
|
||||
class="btn-group btn-group-yesno"
|
||||
required="true">
|
||||
<option value="static">ACF_COUNTDOWN_TYPE_FIXED</option>
|
||||
<option value="evergreen">ACF_COUNTDOWN_TYPE_EVERGREEN</option>
|
||||
</field>
|
||||
<field name="timezone" type="list"
|
||||
label="ACF_COUNTDOWN_TIMEZONE"
|
||||
description="ACF_COUNTDOWN_TIMEZONE_DESC"
|
||||
default="server"
|
||||
showon="countdown_type:static"
|
||||
required="true">
|
||||
<option value="server">ACF_COUNTDOWN_TIMEZONE_SERVER</option>
|
||||
<option value="client">ACF_COUNTDOWN_TIMEZONE_CLIENT</option>
|
||||
</field>
|
||||
<field name="action" type="list"
|
||||
label="ACF_COUNTDOWN_ACTION"
|
||||
description="ACF_COUNTDOWN_ACTION_DESC"
|
||||
class="tfHasChosen"
|
||||
showon="countdown_type:static"
|
||||
default="keep">
|
||||
<option value="keep">ACF_COUNTDOWN_ACTION_NO_ACTION</option>
|
||||
<option value="hide">ACF_COUNTDOWN_ACTION_HIDE_TIMER</option>
|
||||
<option value="message">ACF_COUNTDOWN_SHOW_MESSAGE</option>
|
||||
<option value="redirect">ACF_COUNTDOWN_ACTION_REDIRECT</option>
|
||||
</field>
|
||||
<field name="finish_text" type="textarea"
|
||||
label="ACF_COUNTDOWN_SHOW_MESSAGE"
|
||||
description="ACF_COUNTDOWN_SHOW_MESSAGE_DESC"
|
||||
hint="ACF_COUNTDOWN_FINISH_TEXT_HINT"
|
||||
rows="5"
|
||||
filter="raw"
|
||||
class="input-xxlarge"
|
||||
showon="action:message[AND]countdown_type:static"
|
||||
/>
|
||||
<field name="redirect_url" type="text"
|
||||
label="ACF_COUNTDOWN_REDIRECT_URL"
|
||||
description="ACF_COUNTDOWN_REDIRECT_URL_DESC"
|
||||
hint="ACF_COUNTDOWN_REDIRECT_URL_HINT"
|
||||
showon="action:redirect[AND]countdown_type:static"
|
||||
/>
|
||||
<!-- Template Selector -->
|
||||
<field name="b" type="spacer" class="acf" label="ACF_COUNTDOWN_TEMPLATE_SELECTOR" />
|
||||
<field name="preset_source" type="radio"
|
||||
label="ACF_COUNTDOWN_TYPE"
|
||||
description="ACF_COUNTDOWN_TEMPLATE_SELECTOR_DESC"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="preset">
|
||||
<option value="preset">ACF_COUNTDOWN_TEMPLATE</option>
|
||||
<option value="custom">NR_CUSTOM</option>
|
||||
</field>
|
||||
<field name="preset" type="NRImagesSelector"
|
||||
images="/media/plg_fields_acfcountdown/img"
|
||||
class="acf-countdown-preset-selector"
|
||||
width="800px"
|
||||
height="110px"
|
||||
columns="2"
|
||||
required="true"
|
||||
default="2"
|
||||
label="ACF_COUNTDOWN_TEMPLATE"
|
||||
key_type="filename"
|
||||
description="ACF_COUNTDOWN_TEMPLATE_DESC"
|
||||
showon="preset_source:preset"
|
||||
/>
|
||||
<field name="format" type="textarea"
|
||||
label="ACF_COUNTDOWN_CUSTOM_FORMAT"
|
||||
description="ACF_COUNTDOWN_CUSTOM_FORMAT_DESC"
|
||||
default="{days} days, {hours} hours, {minutes} minutes and {seconds} seconds"
|
||||
rows="5"
|
||||
filter="raw"
|
||||
hint="ACF_COUNTDOWN_CUSTOM_FORMAT_HINT"
|
||||
showon="preset_source:custom"
|
||||
class="input-xxlarge"
|
||||
/>
|
||||
<!-- Unit Display -->
|
||||
<field name="c" type="spacer" class="acf" label="ACF_COUNTDOWN_UNIT_DISPLAY" />
|
||||
<!-- Days -->
|
||||
<field name="days" type="nrtoggle"
|
||||
label="ACF_COUNTDOWN_DAYS"
|
||||
description="ACF_COUNTDOWN_DAYS_DESC"
|
||||
checked="true"
|
||||
showon="preset_source:preset"
|
||||
/>
|
||||
<field name="days_label" type="text"
|
||||
label="ACF_COUNTDOWN_DAYS_LABEL"
|
||||
description="ACF_COUNTDOWN_DAYS_LABEL_DESC"
|
||||
default="Days"
|
||||
hint="ACF_COUNTDOWN_DAYS"
|
||||
showon="preset_source:preset[AND]days:1"
|
||||
/>
|
||||
<!-- Hours -->
|
||||
<field name="hours" type="nrtoggle"
|
||||
label="ACF_COUNTDOWN_HOURS"
|
||||
description="ACF_COUNTDOWN_HOURS_DESC"
|
||||
checked="true"
|
||||
showon="preset_source:preset"
|
||||
/>
|
||||
<field name="hours_label" type="text"
|
||||
label="ACF_COUNTDOWN_HOURS_LABEL"
|
||||
description="ACF_COUNTDOWN_HOURS_LABEL_DESC"
|
||||
default="Hours"
|
||||
hint="ACF_COUNTDOWN_HOURS"
|
||||
showon="preset_source:preset[AND]hours:1"
|
||||
/>
|
||||
<!-- Minutes -->
|
||||
<field name="minutes" type="nrtoggle"
|
||||
label="ACF_COUNTDOWN_MINUTES"
|
||||
description="ACF_COUNTDOWN_MINUTES_DESC"
|
||||
checked="true"
|
||||
showon="preset_source:preset"
|
||||
/>
|
||||
<field name="minutes_label" type="text"
|
||||
label="ACF_COUNTDOWN_MINUTES_LABEL"
|
||||
description="ACF_COUNTDOWN_MINUTES_LABEL_DESC"
|
||||
default="Mins"
|
||||
hint="ACF_COUNTDOWN_MINUTES"
|
||||
showon="preset_source:preset[AND]minutes:1"
|
||||
/>
|
||||
<!-- Seconds -->
|
||||
<field name="seconds" type="nrtoggle"
|
||||
label="ACF_COUNTDOWN_SECONDS"
|
||||
description="ACF_COUNTDOWN_SECONDS_DESC"
|
||||
checked="true"
|
||||
showon="preset_source:preset"
|
||||
/>
|
||||
<field name="seconds_label" type="text"
|
||||
label="ACF_COUNTDOWN_SECONDS_LABEL"
|
||||
description="ACF_COUNTDOWN_SECONDS_LABEL_DESC"
|
||||
default="Secs"
|
||||
hint="ACF_COUNTDOWN_SECONDS"
|
||||
showon="preset_source:preset[AND]seconds:1"
|
||||
/>
|
||||
<field name="separator" type="nrtoggle"
|
||||
checked="true"
|
||||
label="ACF_COUNTDOWN_ENABLE_SEPARATOR"
|
||||
description="ACF_COUNTDOWN_ENABLE_SEPARATOR_DESC"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]preset!:1"
|
||||
/>
|
||||
<field name="double_zeroes_format" type="nrtoggle"
|
||||
checked="true"
|
||||
label="ACF_COUNTDOWN_DOUBLE_ZEROES_FORMAT"
|
||||
description="ACF_COUNTDOWN_DOUBLE_ZEROES_FORMAT_DESC"
|
||||
showon="advanced_settings:1"
|
||||
/>
|
||||
<!-- Unit Item -->
|
||||
<field name="d" type="spacer" class="acf" label="ACF_COUNTDOWN_UNIT_ITEM" showon="preset_source:preset[AND]preset!:1" />
|
||||
<field name="item_size_responsive" type="NRResponsiveControl"
|
||||
label="ACF_COUNTDOWN_ITEM_SIZE"
|
||||
description="ACF_COUNTDOWN_ITEM_SIZE_DESC"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]preset!:1">
|
||||
<subform>
|
||||
<field name="item_size" type="number"
|
||||
class="input-small"
|
||||
min="0"
|
||||
hint="90"
|
||||
max="999" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="item_gap" type="NRResponsiveControl"
|
||||
label="ACF_COUNTDOWN_GAP"
|
||||
description="ACF_COUNTDOWN_GAP_DESC"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]preset!:1"
|
||||
default='{"desktop": {"gap": 10}}'
|
||||
>
|
||||
<subform>
|
||||
<field name="gap" type="number"
|
||||
class="input-small"
|
||||
hint="20"
|
||||
min="0"
|
||||
max="999" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="item_padding_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]preset!:1"
|
||||
label="ACF_COUNTDOWN_ITEM_PADDING"
|
||||
description="ACF_COUNTDOWN_ITEM_PADDING_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="item_padding"
|
||||
type="TFDimensionControl" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="item_background_color" type="color"
|
||||
label="ACF_COUNTDOWN_BACKGROUND_COLOR"
|
||||
description="ACF_COUNTDOWN_ITEM_BACKGROUND_COLOR_DESC"
|
||||
keywords="transparent,none"
|
||||
format="rgba"
|
||||
position="bottom"
|
||||
showon="preset_source:preset[AND]preset!:1"
|
||||
/>
|
||||
<field name="border" type="TFBorderControl"
|
||||
label="NR_BORDER"
|
||||
description="ACF_COUNTDOWN_UNIT_ITEM_BORDER_CONTROL_DESC"
|
||||
inline="true"
|
||||
hide_labels="true"
|
||||
control_group_class="nr-hide-control-group-label"
|
||||
default_width="1"
|
||||
default_color="#333"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]preset!:1"
|
||||
/>
|
||||
<field name="item_border_radius_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]preset!:1"
|
||||
label="NR_BORDER_RADIUS"
|
||||
description="ACF_COUNTDOWN_ITEM_BORDER_RADIUS_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="item_border_radius"
|
||||
type="TFBorderRadiusControl" />
|
||||
</subform>
|
||||
</field>
|
||||
<!-- Unit Digits Container -->
|
||||
<field name="e" type="spacer" class="acf" label="ACF_COUNTDOWN_UNIT_DIGITS_CONTAINER" showon="preset_source:preset" />
|
||||
<field name="digits_wrapper_padding_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="NR_PADDING"
|
||||
description="ACF_COUNTDOWN_DIGITS_CONTAINER_PADDING_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="digits_wrapper_padding"
|
||||
type="TFDimensionControl" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="digits_wrapper_border_radius_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="NR_BORDER_RADIUS"
|
||||
description="ACF_COUNTDOWN_DIGITS_CONTAINER_BORDER_RADIUS_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="digits_wrapper_border_radius"
|
||||
type="TFBorderRadiusControl" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="digits_wrapper_background_color" type="color"
|
||||
showon="preset_source:preset"
|
||||
label="ACF_COUNTDOWN_BACKGROUND_COLOR"
|
||||
description="ACF_COUNTDOWN_DIGITS_CONTAINER_BACKGROUND_COLOR_DESC"
|
||||
keywords="transparent,none"
|
||||
format="rgba"
|
||||
position="bottom"
|
||||
/>
|
||||
<field name="digits_container_custom_width_row_start"
|
||||
label="ACF_COUNTDOWN_DIGITS_CONTAINER_CUSTOM_WIDTH"
|
||||
description="ACF_COUNTDOWN_DIGITS_CONTAINER_CUSTOM_WIDTH_DESC"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
type="nr_inline" />
|
||||
<field name="digits_wrapper_custom_width" type="NRToggle"
|
||||
checked="true"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
hiddenLabel="true"
|
||||
/>
|
||||
<field name="digits_wrapper_min_width" type="nrnumber"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]digits_wrapper_custom_width:1"
|
||||
default="50"
|
||||
hint="50"
|
||||
hiddenLabel="true"
|
||||
class="input-small"
|
||||
addon="px"
|
||||
/>
|
||||
<field name="digits_container_custom_width_row_end" type="nr_inline" end="1" showon="advanced_settings:1[AND]preset_source:preset" />
|
||||
<!-- Unit Digit -->
|
||||
<field name="f" type="spacer" class="acf" label="ACF_COUNTDOWN_UNIT_DIGIT" showon="preset_source:preset" />
|
||||
<field name="digits_font_size_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="NR_FONT_SIZE"
|
||||
default='{"desktop": {"digits_font_size": 30}}'
|
||||
description="ACF_COUNTDOWN_DIGITS_FONT_SIZE_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="digits_font_size"
|
||||
type="nrnumber"
|
||||
hint="30"
|
||||
class="input-small"
|
||||
addon="px" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="digits_font_weight" type="list"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="ACF_COUNTDOWN_DIGITS_FONT_WEIGHT"
|
||||
description="ACF_COUNTDOWN_DIGITS_FONT_WEIGHT_DESC"
|
||||
class="tfHasChosen"
|
||||
default="500">
|
||||
<option value="300">300</option>
|
||||
<option value="400">400</option>
|
||||
<option value="500">500</option>
|
||||
<option value="600">600</option>
|
||||
<option value="700">700</option>
|
||||
</field>
|
||||
<field name="digits_padding_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="NR_PADDING"
|
||||
description="ACF_COUNTDOWN_DIGITS_PADDING_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="digits_padding"
|
||||
type="TFDimensionControl" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="digits_border_radius_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="NR_BORDER_RADIUS"
|
||||
description="ACF_COUNTDOWN_DIGITS_BORDER_RADIUS_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="digits_border_radius"
|
||||
type="TFBorderRadiusControl" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="digits_gap_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="ACF_COUNTDOWN_GAP"
|
||||
description="ACF_COUNTDOWN_DIGITS_GAP_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="digits_gap"
|
||||
hint="0"
|
||||
type="nrnumber"
|
||||
class="input-small"
|
||||
addon="px" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="digit_background_color" type="color"
|
||||
showon="preset_source:preset"
|
||||
label="ACF_COUNTDOWN_BACKGROUND_COLOR"
|
||||
description="ACF_COUNTDOWN_DIGIT_BACKGROUND_COLOR_DESC"
|
||||
keywords="transparent,none"
|
||||
format="rgba"
|
||||
position="bottom"
|
||||
/>
|
||||
<field name="digit_text_color" type="color"
|
||||
showon="preset_source:preset"
|
||||
label="ACF_COUNTDOWN_TEXT_COLOR"
|
||||
description="ACF_COUNTDOWN_DIGIT_TEXT_COLOR_DESC"
|
||||
keywords="transparent,none"
|
||||
default="#41495b"
|
||||
format="rgba"
|
||||
position="bottom"
|
||||
/>
|
||||
<field name="digits_custom_width_row_start"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="ACF_COUNTDOWN_DIGITS_CUSTOM_WIDTH"
|
||||
description="ACF_COUNTDOWN_DIGITS_CUSTOM_WIDTH_DESC"
|
||||
type="nr_inline" />
|
||||
<field name="digits_custom_width" type="NRToggle"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
hiddenLabel="true"
|
||||
/>
|
||||
<field name="digits_min_width" type="nrnumber"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]digits_custom_width:1"
|
||||
hiddenLabel="true"
|
||||
hint="20"
|
||||
class="input-small"
|
||||
addon="px"
|
||||
/>
|
||||
<field name="digits_custom_width_row_end" type="nr_inline" end="1" showon="advanced_settings:1[AND]preset_source:preset" />
|
||||
<!-- Unit Label -->
|
||||
<field name="g" type="spacer" class="acf" label="ACF_COUNTDOWN_UNIT_LABEL" showon="preset_source:preset" />
|
||||
<field name="label_font_size_control" type="NRResponsiveControl"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="NR_FONT_SIZE"
|
||||
default='{"desktop": {"label_font_size": 15}}'
|
||||
description="ACF_COUNTDOWN_LABEL_FONT_SIZE_DESC">
|
||||
<subform>
|
||||
<field
|
||||
name="label_font_size"
|
||||
type="nrnumber"
|
||||
hint="15"
|
||||
class="input-small"
|
||||
addon="px" />
|
||||
</subform>
|
||||
</field>
|
||||
<field name="label_font_weight" type="list"
|
||||
showon="advanced_settings:1[AND]preset_source:preset"
|
||||
label="ACF_COUNTDOWN_LABEL_FONT_WEIGHT"
|
||||
description="ACF_COUNTDOWN_LABEL_FONT_WEIGHT_DESC"
|
||||
class="tfHasChosen"
|
||||
default="400">
|
||||
<option value="300">300</option>
|
||||
<option value="400">400</option>
|
||||
<option value="500">500</option>
|
||||
<option value="600">600</option>
|
||||
<option value="700">700</option>
|
||||
</field>
|
||||
<field name="unit_label_margin_top" type="nrnumber"
|
||||
showon="advanced_settings:1[AND]preset_source:preset[AND]preset!:1"
|
||||
label="ACF_COUNTDOWN_UNIT_LABEL_MARGIN_TOP"
|
||||
description="ACF_COUNTDOWN_UNIT_LABEL_MARGIN_TOP_DESC"
|
||||
class="input-small"
|
||||
addon="px"
|
||||
hint="9"
|
||||
default="9"
|
||||
/>
|
||||
<field name="unit_label_text_color" type="color"
|
||||
showon="preset_source:preset"
|
||||
label="ACF_COUNTDOWN_TEXT_COLOR"
|
||||
description="ACF_COUNTDOWN_UNIT_LABEL_COLOR_DESC"
|
||||
keywords="transparent,none"
|
||||
default="#41495b"
|
||||
format="rgba"
|
||||
position="bottom"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</form>
|
||||
|
||||
691
plugins/fields/acfcountdown/script.install.helper.php
Normal file
691
plugins/fields/acfcountdown/script.install.helper.php
Normal file
@ -0,0 +1,691 @@
|
||||
<?php
|
||||
/**
|
||||
* Installer Script Helper
|
||||
*
|
||||
* @author Tassos Marinos <info@tassos.gr>
|
||||
* @link http://www.tassos.gr
|
||||
* @copyright Copyright © 2016 Tassos Marinos All Rights Reserved
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Installer\Installer;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\Filesystem\File;
|
||||
use Joomla\Filesystem\Folder;
|
||||
|
||||
class PlgFieldsAcfcountdownInstallerScriptHelper
|
||||
{
|
||||
public $name = '';
|
||||
public $alias = '';
|
||||
public $extname = '';
|
||||
public $extension_type = '';
|
||||
public $plugin_folder = 'system';
|
||||
public $module_position = 'status';
|
||||
public $client_id = 1;
|
||||
public $install_type = 'install';
|
||||
public $show_message = true;
|
||||
public $autopublish = true;
|
||||
public $db = null;
|
||||
public $app = null;
|
||||
public $installedVersion;
|
||||
|
||||
public function __construct(&$params)
|
||||
{
|
||||
$this->extname = $this->extname ?: $this->alias;
|
||||
$this->db = Factory::getDbo();
|
||||
$this->app = Factory::getApplication();
|
||||
$this->installedVersion = $this->getVersion($this->getInstalledXMLFile());
|
||||
}
|
||||
|
||||
/**
|
||||
* Preflight event
|
||||
*
|
||||
* @param string
|
||||
* @param JAdapterInstance
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function preflight($route, $adapter)
|
||||
{
|
||||
if (!in_array($route, array('install', 'update')))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Factory::getLanguage()->load('plg_system_novaraininstaller', JPATH_PLUGINS . '/system/novaraininstaller');
|
||||
|
||||
if ($this->show_message && $this->isInstalled())
|
||||
{
|
||||
$this->install_type = 'update';
|
||||
}
|
||||
|
||||
if ($this->onBeforeInstall() === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Preflight event
|
||||
*
|
||||
* @param string
|
||||
* @param JAdapterInstance
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function postflight($route, $adapter)
|
||||
{
|
||||
Factory::getLanguage()->load($this->getPrefix() . '_' . $this->extname, $this->getMainFolder());
|
||||
|
||||
if (!in_array($route, array('install', 'update')))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->onAfterInstall() === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($route == 'install' && $this->autopublish)
|
||||
{
|
||||
$this->publishExtension();
|
||||
}
|
||||
|
||||
if ($this->show_message)
|
||||
{
|
||||
$this->addInstalledMessage();
|
||||
}
|
||||
|
||||
Factory::getCache()->clean('com_plugins');
|
||||
Factory::getCache()->clean('_system');
|
||||
}
|
||||
|
||||
public function isInstalled()
|
||||
{
|
||||
if (!is_file($this->getInstalledXMLFile()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$query = $this->db->getQuery(true)
|
||||
->select('extension_id')
|
||||
->from('#__extensions')
|
||||
->where($this->db->quoteName('type') . ' = ' . $this->db->quote($this->extension_type))
|
||||
->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->getElementName()));
|
||||
$this->db->setQuery($query, 0, 1);
|
||||
$result = $this->db->loadResult();
|
||||
|
||||
return empty($result) ? false : true;
|
||||
}
|
||||
|
||||
public function getMainFolder()
|
||||
{
|
||||
switch ($this->extension_type)
|
||||
{
|
||||
case 'plugin' :
|
||||
return JPATH_SITE . '/plugins/' . $this->plugin_folder . '/' . $this->extname;
|
||||
|
||||
case 'component' :
|
||||
return JPATH_ADMINISTRATOR . '/components/com_' . $this->extname;
|
||||
|
||||
case 'module' :
|
||||
return JPATH_ADMINISTRATOR . '/modules/mod_' . $this->extname;
|
||||
|
||||
case 'library' :
|
||||
return JPATH_SITE . '/libraries/' . $this->extname;
|
||||
}
|
||||
}
|
||||
|
||||
public function getInstalledXMLFile()
|
||||
{
|
||||
return $this->getXMLFile($this->getMainFolder());
|
||||
}
|
||||
|
||||
public function getCurrentXMLFile()
|
||||
{
|
||||
return $this->getXMLFile(__DIR__);
|
||||
}
|
||||
|
||||
public function getXMLFile($folder)
|
||||
{
|
||||
switch ($this->extension_type)
|
||||
{
|
||||
case 'module' :
|
||||
return $folder . '/mod_' . $this->extname . '.xml';
|
||||
default :
|
||||
return $folder . '/' . $this->extname . '.xml';
|
||||
}
|
||||
}
|
||||
|
||||
public function foldersExist($folders = array())
|
||||
{
|
||||
foreach ($folders as $folder)
|
||||
{
|
||||
if (is_dir($folder))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function publishExtension()
|
||||
{
|
||||
switch ($this->extension_type)
|
||||
{
|
||||
case 'plugin' :
|
||||
$this->publishPlugin();
|
||||
|
||||
case 'module' :
|
||||
$this->publishModule();
|
||||
}
|
||||
}
|
||||
|
||||
public function publishPlugin()
|
||||
{
|
||||
$query = $this->db->getQuery(true)
|
||||
->update('#__extensions')
|
||||
->set($this->db->quoteName('enabled') . ' = 1')
|
||||
->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin'))
|
||||
->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->extname))
|
||||
->where($this->db->quoteName('folder') . ' = ' . $this->db->quote($this->plugin_folder));
|
||||
$this->db->setQuery($query);
|
||||
$this->db->execute();
|
||||
}
|
||||
|
||||
public function publishModule()
|
||||
{
|
||||
// Get module id
|
||||
$query = $this->db->getQuery(true)
|
||||
->select('id')
|
||||
->from('#__modules')
|
||||
->where($this->db->quoteName('module') . ' = ' . $this->db->quote('mod_' . $this->extname))
|
||||
->where($this->db->quoteName('client_id') . ' = ' . (int) $this->client_id);
|
||||
$this->db->setQuery($query, 0, 1);
|
||||
$id = $this->db->loadResult();
|
||||
|
||||
if (!$id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// check if module is already in the modules_menu table (meaning is is already saved)
|
||||
$query->clear()
|
||||
->select('moduleid')
|
||||
->from('#__modules_menu')
|
||||
->where($this->db->quoteName('moduleid') . ' = ' . (int) $id);
|
||||
$this->db->setQuery($query, 0, 1);
|
||||
$exists = $this->db->loadResult();
|
||||
|
||||
if ($exists)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get highest ordering number in position
|
||||
$query->clear()
|
||||
->select('ordering')
|
||||
->from('#__modules')
|
||||
->where($this->db->quoteName('position') . ' = ' . $this->db->quote($this->module_position))
|
||||
->where($this->db->quoteName('client_id') . ' = ' . (int) $this->client_id)
|
||||
->order('ordering DESC');
|
||||
$this->db->setQuery($query, 0, 1);
|
||||
$ordering = $this->db->loadResult();
|
||||
$ordering++;
|
||||
|
||||
// publish module and set ordering number
|
||||
$query->clear()
|
||||
->update('#__modules')
|
||||
->set($this->db->quoteName('published') . ' = 1')
|
||||
->set($this->db->quoteName('ordering') . ' = ' . (int) $ordering)
|
||||
->set($this->db->quoteName('position') . ' = ' . $this->db->quote($this->module_position))
|
||||
->where($this->db->quoteName('id') . ' = ' . (int) $id);
|
||||
$this->db->setQuery($query);
|
||||
$this->db->execute();
|
||||
|
||||
// add module to the modules_menu table
|
||||
$query->clear()
|
||||
->insert('#__modules_menu')
|
||||
->columns(array($this->db->quoteName('moduleid'), $this->db->quoteName('menuid')))
|
||||
->values((int) $id . ', 0');
|
||||
$this->db->setQuery($query);
|
||||
$this->db->execute();
|
||||
}
|
||||
|
||||
public function addInstalledMessage()
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
Text::sprintf(
|
||||
Text::_($this->install_type == 'update' ? 'NRI_THE_EXTENSION_HAS_BEEN_UPDATED_SUCCESSFULLY' : 'NRI_THE_EXTENSION_HAS_BEEN_INSTALLED_SUCCESSFULLY'),
|
||||
'<strong>' . Text::_($this->name) . '</strong>',
|
||||
'<strong>' . $this->getVersion() . '</strong>',
|
||||
$this->getFullType()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function getPrefix()
|
||||
{
|
||||
switch ($this->extension_type)
|
||||
{
|
||||
case 'plugin';
|
||||
return Text::_('plg_' . strtolower($this->plugin_folder));
|
||||
|
||||
case 'component':
|
||||
return Text::_('com');
|
||||
|
||||
case 'module':
|
||||
return Text::_('mod');
|
||||
|
||||
case 'library':
|
||||
return Text::_('lib');
|
||||
|
||||
default:
|
||||
return $this->extension_type;
|
||||
}
|
||||
}
|
||||
|
||||
public function getElementName($type = null, $extname = null)
|
||||
{
|
||||
$type = is_null($type) ? $this->extension_type : $type;
|
||||
$extname = is_null($extname) ? $this->extname : $extname;
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
case 'component' :
|
||||
return 'com_' . $extname;
|
||||
|
||||
case 'module' :
|
||||
return 'mod_' . $extname;
|
||||
|
||||
case 'plugin' :
|
||||
default:
|
||||
return $extname;
|
||||
}
|
||||
}
|
||||
|
||||
public function getFullType()
|
||||
{
|
||||
return Text::_('NRI_' . strtoupper($this->getPrefix()));
|
||||
}
|
||||
|
||||
public function isPro()
|
||||
{
|
||||
$versionFile = __DIR__ . "/version.php";
|
||||
|
||||
// If version file does not exist we assume a PRO version
|
||||
if (!is_file($versionFile))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Load version file
|
||||
require_once $versionFile;
|
||||
return (bool) $NR_PRO;
|
||||
}
|
||||
|
||||
public function getVersion($file = '')
|
||||
{
|
||||
$file = $file ?: $this->getCurrentXMLFile();
|
||||
|
||||
if (!is_file($file))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$xml = Installer::parseXMLInstallFile($file);
|
||||
|
||||
if (!$xml || !isset($xml['version']))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
return $xml['version'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks wether the extension can be installed or not
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function canInstall()
|
||||
{
|
||||
// The extension is not installed yet. Accept Install.
|
||||
if (!$installed_version = $this->getVersion($this->getInstalledXMLFile()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Path to extension's version file
|
||||
$versionFile = $this->getMainFolder() . "/version.php";
|
||||
$NR_PRO = true;
|
||||
|
||||
// If version file does not exist we assume we have a PRO version installed
|
||||
if (file_exists($versionFile))
|
||||
{
|
||||
require_once($versionFile);
|
||||
}
|
||||
|
||||
// The free version is installed. Accept install.
|
||||
if (!(bool)$NR_PRO)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Current package is a PRO version. Accept install.
|
||||
if ($this->isPro())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// User is trying to update from PRO version to FREE. Do not accept install.
|
||||
Factory::getLanguage()->load($this->getPrefix() . '_' . $this->extname, __DIR__);
|
||||
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
Text::_('NRI_ERROR_PRO_TO_FREE'), 'error'
|
||||
);
|
||||
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
html_entity_decode(
|
||||
Text::sprintf(
|
||||
'NRI_ERROR_UNINSTALL_FIRST',
|
||||
'<a href="http://www.tassos.gr/joomla-extensions/' . $this->getUrlAlias() . '" target="_blank">',
|
||||
'</a>',
|
||||
Text::_($this->name)
|
||||
)
|
||||
), 'error'
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL alias of the extension.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getUrlAlias()
|
||||
{
|
||||
$alias = $this->alias;
|
||||
|
||||
switch ($alias)
|
||||
{
|
||||
case 'smilepack':
|
||||
$alias = 'smile-pack';
|
||||
break;
|
||||
case 'convertforms':
|
||||
$alias = 'convert-forms';
|
||||
break;
|
||||
case 'rstbox':
|
||||
$alias = 'engagebox';
|
||||
break;
|
||||
case 'gsd':
|
||||
$alias = 'google-structured-data';
|
||||
break;
|
||||
}
|
||||
|
||||
// ACF
|
||||
if ($this->plugin_folder === 'fields' && ($alias === 'acf' || $this->startsWith($alias, 'acf')))
|
||||
{
|
||||
$alias = 'advanced-custom-fields';
|
||||
}
|
||||
|
||||
return $alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether string starts with substring.
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $query
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function startsWith($string, $query)
|
||||
{
|
||||
return substr($string, 0, strlen($query)) === $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if current version is newer than the installed one
|
||||
* Used for Novarain Framework
|
||||
*
|
||||
* @return boolean [description]
|
||||
*/
|
||||
public function isNewer()
|
||||
{
|
||||
if (!$installed_version = $this->getVersion($this->getInstalledXMLFile()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
$package_version = $this->getVersion();
|
||||
|
||||
return version_compare($installed_version, $package_version, '<=');
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method triggered before installation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function onBeforeInstall()
|
||||
{
|
||||
if (!$this->canInstall())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method triggered after installation
|
||||
*/
|
||||
public function onAfterInstall()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete files
|
||||
*
|
||||
* @param array $folders
|
||||
*/
|
||||
public function deleteFiles($files = array())
|
||||
{
|
||||
foreach ($files as $key => $file)
|
||||
{
|
||||
if (!is_file($file))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
File::delete($file);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes folders
|
||||
*
|
||||
* @param array $folders
|
||||
*/
|
||||
public function deleteFolders($folders = array())
|
||||
{
|
||||
foreach ($folders as $folder)
|
||||
{
|
||||
if (!is_dir($folder))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Folder::delete($folder);
|
||||
}
|
||||
}
|
||||
|
||||
public function dropIndex($table, $index)
|
||||
{
|
||||
$db = $this->db;
|
||||
|
||||
// Check if index exists first
|
||||
$query = 'SHOW INDEX FROM ' . $db->quoteName('#__' . $table) . ' WHERE KEY_NAME = ' . $db->quote($index);
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
|
||||
if (!$db->loadResult())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove index
|
||||
$query = 'ALTER TABLE ' . $db->quoteName('#__' . $table) . ' DROP INDEX ' . $db->quoteName($index);
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
|
||||
public function dropUnwantedTables($tables) {
|
||||
|
||||
if (!$tables) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($tables as $table) {
|
||||
$query = "DROP TABLE IF EXISTS #__".$this->db->escape($table);
|
||||
$this->db->setQuery($query);
|
||||
$this->db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
public function dropUnwantedColumns($table, $columns) {
|
||||
|
||||
if (!$columns || !$table) {
|
||||
return;
|
||||
}
|
||||
|
||||
$db = $this->db;
|
||||
|
||||
// Check if columns exists in database
|
||||
function qt($n) {
|
||||
return(Factory::getDBO()->quote($n));
|
||||
}
|
||||
|
||||
$query = 'SHOW COLUMNS FROM #__'.$table.' WHERE Field IN ('.implode(",", array_map("qt", $columns)).')';
|
||||
$db->setQuery($query);
|
||||
$rows = $db->loadColumn(0);
|
||||
|
||||
// Abort if we don't have any rows
|
||||
if (!$rows) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Let's remove the columns
|
||||
$q = "";
|
||||
foreach ($rows as $key => $column) {
|
||||
$comma = (($key+1) < count($rows)) ? "," : "";
|
||||
$q .= "drop ".$this->db->escape($column).$comma;
|
||||
}
|
||||
|
||||
$query = "alter table #__".$table." $q";
|
||||
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
|
||||
public function fetch($table, $columns = "*", $where = null, $singlerow = false) {
|
||||
if (!$table) {
|
||||
return;
|
||||
}
|
||||
|
||||
$db = $this->db;
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$query
|
||||
->select($columns)
|
||||
->from("#__$table");
|
||||
|
||||
if (isset($where)) {
|
||||
$query->where("$where");
|
||||
}
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
return ($singlerow) ? $db->loadObject() : $db->loadObjectList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the Novarain Framework
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function loadFramework()
|
||||
{
|
||||
if (is_file(JPATH_PLUGINS . '/system/nrframework/autoload.php'))
|
||||
{
|
||||
include_once JPATH_PLUGINS . '/system/nrframework/autoload.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-orders plugin after passed array of plugins
|
||||
*
|
||||
* @param string $plugin Plugin element name
|
||||
* @param array $lowerPluginOrder Array of plugin element names
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function pluginOrderAfter($lowerPluginOrder)
|
||||
{
|
||||
|
||||
if (!is_array($lowerPluginOrder) || !count($lowerPluginOrder))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$db = $this->db;
|
||||
|
||||
// Get plugins max order
|
||||
$query = $db->getQuery(true);
|
||||
$query
|
||||
->select($db->quoteName('b.ordering'))
|
||||
->from($db->quoteName('#__extensions', 'b'))
|
||||
->where($db->quoteName('b.element') . ' IN ("'.implode("\",\"",$lowerPluginOrder).'")')
|
||||
->order('b.ordering desc');
|
||||
|
||||
$db->setQuery($query);
|
||||
$maxOrder = $db->loadResult();
|
||||
|
||||
if (is_null($maxOrder))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get plugin details
|
||||
$query
|
||||
->clear()
|
||||
->select(array($db->quoteName('extension_id'), $db->quoteName('ordering')))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote($this->alias));
|
||||
|
||||
$db->setQuery($query);
|
||||
$pluginInfo = $db->loadObject();
|
||||
|
||||
if (!isset($pluginInfo->ordering) || $pluginInfo->ordering > $maxOrder)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the new plugin order
|
||||
$object = new stdClass();
|
||||
$object->extension_id = $pluginInfo->extension_id;
|
||||
$object->ordering = ($maxOrder + 1);
|
||||
|
||||
try {
|
||||
$db->updateObject('#__extensions', $object, 'extension_id');
|
||||
} catch (Exception $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
23
plugins/fields/acfcountdown/script.install.php
Normal file
23
plugins/fields/acfcountdown/script.install.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Advanced Custom Fields
|
||||
* @version 2.8.8 Pro
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
require_once __DIR__ . '/script.install.helper.php';
|
||||
|
||||
class PlgFieldsACFCountdownInstallerScript extends PlgFieldsACFCountdownInstallerScriptHelper
|
||||
{
|
||||
public $alias = 'acfcountdown';
|
||||
public $extension_type = 'plugin';
|
||||
public $plugin_folder = "fields";
|
||||
public $show_message = false;
|
||||
}
|
||||
110
plugins/fields/acfcountdown/tmpl/acfcountdown.php
Normal file
110
plugins/fields/acfcountdown/tmpl/acfcountdown.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Advanced Custom Fields
|
||||
* @version 2.8.8 Pro
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
if (!$value = $field->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_string($value) && !$value = json_decode($value, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$countdown_action = $fieldParams->get('action', 'keep');
|
||||
$countdown_type = $fieldParams->get('countdown_type', 'static');
|
||||
|
||||
// Evergreen provides extra actions, allow to override the action on item editing page
|
||||
if ($countdown_type === 'evergreen')
|
||||
{
|
||||
$countdown_action = 'restart';
|
||||
}
|
||||
|
||||
$preset_source = $fieldParams->get('preset_source', 'preset');
|
||||
$preset = $fieldParams->get('preset', '1');
|
||||
|
||||
// Determine theme
|
||||
$theme = $preset_source === 'custom' ? 'custom' : ($preset === '8' ? 'oneline' : 'default');
|
||||
|
||||
$payload = [
|
||||
// Field values
|
||||
'countdown_type' => $countdown_type,
|
||||
'value' => isset($value['value']) ? $value['value'] : null,
|
||||
'timezone' => $fieldParams->get('timezone', 'server'),
|
||||
'dynamic_days' => isset($value['dynamic_days']) ? $value['dynamic_days'] : null,
|
||||
'dynamic_hours' => isset($value['dynamic_hours']) ? $value['dynamic_hours'] : null,
|
||||
'dynamic_minutes' => isset($value['dynamic_minutes']) ? $value['dynamic_minutes'] : null,
|
||||
'dynamic_seconds' => isset($value['dynamic_seconds']) ? $value['dynamic_seconds'] : null,
|
||||
|
||||
// Countdown End Action
|
||||
'finish_text' => $fieldParams->get('finish_text', ''),
|
||||
'redirect_url' => $fieldParams->get('redirect_url', ''),
|
||||
'countdown_action' => $countdown_action,
|
||||
|
||||
// Preset
|
||||
'theme' => $theme,
|
||||
'format' => $fieldParams->get('format', ''),
|
||||
|
||||
// Unit Display
|
||||
'days' => $fieldParams->get('days') === '1',
|
||||
'days_label' => $fieldParams->get('days_label'),
|
||||
'hours' => $fieldParams->get('hours') === '1',
|
||||
'hours_label' => $fieldParams->get('hours_label'),
|
||||
'minutes' => $fieldParams->get('minutes') === '1',
|
||||
'minutes_label' => $fieldParams->get('minutes_label'),
|
||||
'seconds' => $fieldParams->get('seconds') === '1',
|
||||
'seconds_label' => $fieldParams->get('seconds_label'),
|
||||
'separator' => $fieldParams->get('separator') === '1',
|
||||
'double_zeroes_format' => $fieldParams->get('double_zeroes_format') === '1',
|
||||
|
||||
// Unit Item
|
||||
'item_size' => $fieldParams->get('item_size_responsive.item_size'),
|
||||
'item_padding' => $fieldParams->get('item_padding_control.item_padding'),
|
||||
'gap' => $fieldParams->get('item_gap.gap'),
|
||||
'item_border_style' => $fieldParams->get('border.style'),
|
||||
'item_border_width' => $fieldParams->get('border.width'),
|
||||
'item_border_color' => $fieldParams->get('border.color'),
|
||||
'item_background_color' => $fieldParams->get('item_background_color'),
|
||||
'item_border_radius' => $fieldParams->get('item_border_radius_control.item_border_radius'),
|
||||
|
||||
// Unit Digits Container
|
||||
'digits_wrapper_min_width' => $fieldParams->get('digits_wrapper_custom_width') === '1' ? $fieldParams->get('digits_wrapper_min_width') : null,
|
||||
'digits_wrapper_padding' => $fieldParams->get('digits_wrapper_padding_control.digits_wrapper_padding'),
|
||||
'digits_wrapper_border_radius' => $fieldParams->get('digits_wrapper_border_radius_control.digits_wrapper_border_radius'),
|
||||
'digits_wrapper_background_color' => $fieldParams->get('digits_wrapper_background_color'),
|
||||
|
||||
// Unit Digit
|
||||
'digits_font_size' => $fieldParams->get('digits_font_size_control.digits_font_size'),
|
||||
'digits_font_weight' => $fieldParams->get('digits_font_weight'),
|
||||
'digit_min_width' => $fieldParams->get('digits_custom_width') === '1' ? $fieldParams->get('digits_min_width') : null,
|
||||
'digits_padding' => $fieldParams->get('digits_padding_control.digits_padding'),
|
||||
'digit_border_radius' => $fieldParams->get('digits_border_radius_control.digits_border_radius'),
|
||||
'digits_gap' => $fieldParams->get('digits_gap_control.digits_gap'),
|
||||
'digit_background_color' => $fieldParams->get('digit_background_color'),
|
||||
'digit_text_color' => $fieldParams->get('digit_text_color'),
|
||||
|
||||
// Unit Label
|
||||
'label_font_size' => $fieldParams->get('label_font_size_control.label_font_size'),
|
||||
'label_font_weight' => $fieldParams->get('label_font_weight'),
|
||||
'unit_label_margin_top' => $fieldParams->get('unit_label_margin_top'),
|
||||
'unit_label_text_color' => $fieldParams->get('unit_label_text_color'),
|
||||
];
|
||||
|
||||
// Set custom layout
|
||||
if ($field->params->get('acf_layout_override'))
|
||||
{
|
||||
$payload['layout'] = $field->params->get('acf_layout_override');
|
||||
}
|
||||
|
||||
echo \NRFramework\Widgets\Helper::render('Countdown', $payload);
|
||||
16
plugins/fields/acfcountdown/version.php
Normal file
16
plugins/fields/acfcountdown/version.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Advanced Custom Fields
|
||||
* @version 2.8.8 Pro
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted Access');
|
||||
$NR_PRO = "1";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user