acf
This commit is contained in:
49
plugins/fields/acfiframe/acfiframe.php
Normal file
49
plugins/fields/acfiframe/acfiframe.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?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;
|
||||
|
||||
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 PlgFieldsACFIframe extends ACF_Field
|
||||
{
|
||||
protected $validate = 'url';
|
||||
|
||||
/**
|
||||
* Override the field type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $overrideType = 'url';
|
||||
|
||||
/**
|
||||
* Field's Hint Description
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $hint = 'http://';
|
||||
|
||||
/**
|
||||
* Field's Class
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $class = 'input-xxlarge w-100';
|
||||
}
|
||||
21
plugins/fields/acfiframe/acfiframe.xml
Normal file
21
plugins/fields/acfiframe/acfiframe.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<extension type="plugin" version="3.7.0" group="fields" method="upgrade">
|
||||
<name>ACF_IFRAME</name>
|
||||
<description>ACF_IFRAME_DESC</description>
|
||||
<author>Tassos Marinos</author>
|
||||
<creationDate>May 2017</creationDate>
|
||||
<copyright>Copyright (C) 2019 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="acfiframe">acfiframe.php</filename>
|
||||
<filename>script.install.helper.php</filename>
|
||||
<filename>version.php</filename>
|
||||
<folder>params</folder>
|
||||
<folder>tmpl</folder>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
</extension>
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
; ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Camps - ACF IFrame"
|
||||
; ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Escriu l'URL de l'IFrame. També pots incrustar un vídeo des de Youtube o Vimeo. Exemple: http://www.tassos.gr o https://www.youtube.com/embed/IpCdMGfducg."
|
||||
ACF_IFRAME_IFRAMESCROLLING="Barres de desplaçament"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Escull si mostrar barres de desplaçament dins l'IFrame"
|
||||
ACF_IFRAME_ASYNC="Carregar asíncronament"
|
||||
ACF_IFRAME_ASYNC_DESC="Si està activat, l'iframe es carregarà de manera asíncrona un cop s'hagi carregat totalment la pàgina."
|
||||
ACF_IFRAME_IFRAMEPARAMS="ibuts HTML"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Afegeix atributs HTML extra a l'element IFrame."
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
; ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Felter - ACF IFrame"
|
||||
; ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Angiv IFrame'ens URL adresse. Du indlejrer også en video fra YouTube eller Vimeo.<br><br>Eksempelt: http://www.tassos.gr eller https://www.youtube.com/embed/IpCdMGfducg."
|
||||
ACF_IFRAME_IFRAMESCROLLING="Rullebjælker"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Vælg om IFrame'ens rullebjælker skal vises eller ej"
|
||||
ACF_IFRAME_ASYNC="Indlæs async"
|
||||
ACF_IFRAME_ASYNC_DESC="Hvis aktiveret, så vil iframe'en indlæses asynkront efter at siden er blevet fuldt indlæst."
|
||||
ACF_IFRAME_IFRAMEPARAMS="HTML attributter"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Tilføj ekstra HTML attributter til IFrame elementet."
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
; ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Felder - ACF IFrame"
|
||||
; ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Geben Sie die URL-Adresse des IFrames ein. Sie haben auch ein Video von YouTube oder Vimeo eingebettet. <br> <br> Beispiel: http://www.tassos.gr oder https://www.youtube.com/embed/IpCdMGfducg . "
|
||||
ACF_IFRAME_IFRAMESCROLLING="Bildlaufleisten"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Wählen Sie aus, ob die Bildlaufleisten von IFrame angezeigt werden sollen oder nicht."
|
||||
ACF_IFRAME_ASYNC="Async laden"
|
||||
ACF_IFRAME_ASYNC_DESC="Wenn aktiviert, wird der Iframe asynchron geladen, nachdem die Seite vollständig geladen wurde."
|
||||
ACF_IFRAME_IFRAMEPARAMS="HTML-Attribute"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Füge dem IFrame-Element zusätzliche HTML-Attribute hinzu."
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Fields - ACF IFrame"
|
||||
ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Enter the IFrame's URL address. You embed a video from YouTube or Vimeo too.<br><br>Example: http://www.tassos.gr or https://www.youtube.com/embed/IpCdMGfducg."
|
||||
ACF_IFRAME_IFRAMESCROLLING="Scrollbars"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Choose whether to show IFrame's scrollbars or not"
|
||||
ACF_IFRAME_ASYNC="Load Async"
|
||||
ACF_IFRAME_ASYNC_DESC="If enabled, the iframe will be loaded asynchronously after the page has fully loaded."
|
||||
ACF_IFRAME_IFRAMEPARAMS="HTML Attributes"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Add extra HTML attributes to the IFrame element."
|
||||
@ -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) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
ACF_IFRAME="Fields - ACF Iframe"
|
||||
ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
ACF_IFRAME_VALUE_DESC="Ingrese la URL del IFrame"
|
||||
ACF_IFRAME="Campos - ACF IFrame"
|
||||
ACF_IFRAME_DESC="Ingrese una URL en el back-end para mostrarla dentro de un iFrame en el front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Introduzca la dirección URL del IFrame. Incrustara también un video de YouTube o Vimeo.<br><br>Ejemplo: http://www.tassos.gr or https://www.youtube.com/embed/IpCdMGfducg."
|
||||
ACF_IFRAME_IFRAMESCROLLING="Barras de desplazamiento"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Elija si desea mostrar las barras de desplazamiento de IFrame o no"
|
||||
ACF_IFRAME_ASYNC="Carga Asíncrona"
|
||||
ACF_IFRAME_ASYNC_DESC="Si está habilitado, el iframe se cargará de forma asíncrona después de que la página se haya cargado por completo."
|
||||
ACF_IFRAME_IFRAMEPARAMS="Atributos HTML"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Agregue atributos HTML adicionales al elemento IFrame."
|
||||
@ -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) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
ACF_IFRAME="Campos - ACF IFrame"
|
||||
ACF_IFRAME_DESC="Ingrese una URL en el back-end para mostrarla dentro de un iFrame en el front-end."
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
; ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Champs - IFrame ACF"
|
||||
; ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Entrez l'adresse URL d'une IFrame. Vous pouvez aussi intégrer une vidéo depuis YouTube ou Vimeo. <br><br>Exemple : http://www.tassos.gr ou https://www.youtube.com/embed/IpCdMGfducg"
|
||||
ACF_IFRAME_IFRAMESCROLLING="Barres de défilement"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Choisissez d'afficher les barres de défilement de l'IFrame ou non"
|
||||
ACF_IFRAME_ASYNC="Charger Asynchrone"
|
||||
ACF_IFRAME_ASYNC_DESC="Si activé, l'IFrame sera chargée de façon asynchrone après le chargement total de la page"
|
||||
ACF_IFRAME_IFRAMEPARAMS="Attributs HTML"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Ajouter des attributs HTML supplémentaires à l'élément IFrame"
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
; ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Campi - IFrame ACF"
|
||||
; ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Immettere l'indirizzo URL dell'IFrame. Incorpora anche un video da YouTube o Vimeo.<br><br>Esempio: http://www.tassos.gr or https://www.youtube.com/embed/IpCdMGfducg."
|
||||
ACF_IFRAME_IFRAMESCROLLING="Barre di scorrimento"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Scegli se mostrare o meno le barre di scorrimento con un IFrame"
|
||||
ACF_IFRAME_ASYNC="Carica in maniera asincrona"
|
||||
ACF_IFRAME_ASYNC_DESC="Se abilitato, l'Iframe verrà caricato in modo asincrono dopo che la pagina è stata caricata completamente."
|
||||
ACF_IFRAME_IFRAMEPARAMS="Attributi HTML"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Aggiungi attributi HTML extra all'elemento IFrame."
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
; ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Velden - ACF IFrame"
|
||||
; ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Voer het URL-adres van het IFrame in. Je kunt ook een video van YouTube of Vimeo insluiten.<br><br>Bijvoorbeeld: http://www.tassos.gr of https://www.youtube.com/embed/IpCdMGfducg."
|
||||
ACF_IFRAME_IFRAMESCROLLING="Schuifbalken"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Kies of je IFrame-schuifbalken wilt weergeven."
|
||||
ACF_IFRAME_ASYNC="Laad Asynchroon"
|
||||
ACF_IFRAME_ASYNC_DESC="Indien ingeschakeld, wordt het iframe asynchroon geladen nadat de pagina volledig is geladen."
|
||||
ACF_IFRAME_IFRAMEPARAMS="HTML-kenmerken"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Voeg extra HTML-kenmerken toe aan het IFrame-element toe."
|
||||
@ -0,0 +1,18 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2016 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
ACF_IFRAME="Поля - ACF IFrame"
|
||||
ACF_IFRAME_DESC="Асинхронно отображать содержимое любого URL-адреса в пределах кадра."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Введите URL-адрес IFrame. Вы также встраиваете видео с YouTube или Vimeo. <br> <br> Пример: http://www.tassos.gr или https://www.youtube.com/embed/IpCdMGfducg «"
|
||||
ACF_IFRAME_IFRAMESCROLLING="Scrollbars"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Выберите, показывать ли полосы прокрутки IFrame или нет"
|
||||
ACF_IFRAME_ASYNC="Загрузить асинхронно"
|
||||
ACF_IFRAME_ASYNC_DESC="Если включено, iframe будет загружаться асинхронно после полной загрузки страницы."
|
||||
ACF_IFRAME_IFRAMEPARAMS="Атрибуты HTML"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Добавить дополнительные атрибуты HTML к элементу IFrame."
|
||||
@ -0,0 +1,19 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2019 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
; ACF_IFRAME_VALUE_DESC="Enter the URL of the IFrame"
|
||||
ACF_IFRAME="Fält - ACF IFrame"
|
||||
; ACF_IFRAME_DESC="Enter a URL in the back-end to display it within an iFrame in the front-end."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Ange IFrames URL. Du kan bädda in en video från YouTube eller Vimeo också. Exempel: http://www.tassos.gr eller https://www.youtube.com/embed/IpCdMGfducg."
|
||||
ACF_IFRAME_IFRAMESCROLLING="Rullningslister"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Välj om IFrames rullningslister ska visas eller inte"
|
||||
ACF_IFRAME_ASYNC="Ladda Async"
|
||||
ACF_IFRAME_ASYNC_DESC="Om aktiverad, laddas iframe asynkront efter att sidan har laddats helt."
|
||||
ACF_IFRAME_IFRAMEPARAMS="HTML Attribut"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Lägg till extra HTML-attribut till IFrame-elementet."
|
||||
@ -0,0 +1,18 @@
|
||||
; @package Advanced Custom Fields
|
||||
; @version 2.8.8 Pro
|
||||
;
|
||||
; @author Tassos Marinos - http://www.tassos.gr/joomla-extensions
|
||||
; @copyright Copyright (c) 2016 Tassos Marinos. All rights reserved.
|
||||
; @license http://www.tassos.gr
|
||||
|
||||
PLG_FIELDS_ACFIFRAME_LABEL="ACF - IFrame"
|
||||
ACF_IFRAME="Поля - ACF IFrame"
|
||||
ACF_IFRAME_DESC="Відобразити вміст з будь-якої URL-адреси в кадрі асихронно."
|
||||
ACF_IFRAME_IFRAMEURL="URL"
|
||||
ACF_IFRAME_IFRAMEURL_DESC="Введіть URL-адресу IFrame. Ви також вставили відео з YouTube або Vimeo. <br> Приклад: http://www.tassos.gr або https://www.youtube.com/embed/IpCdMGfducg . "
|
||||
ACF_IFRAME_IFRAMESCROLLING="Панелі прокрутки"
|
||||
ACF_IFRAME_IFRAMESCROLLING_DESC="Виберіть, чи потрібно показувати смуги прокрутки IFrame чи ні"
|
||||
ACF_IFRAME_ASYNC="Завантажити асинхронізацію"
|
||||
ACF_IFRAME_ASYNC_DESC="Якщо увімкнено, кадр iframe буде завантажений асинхронно після повного завантаження сторінки."
|
||||
ACF_IFRAME_IFRAMEPARAMS="Атрибути HTML"
|
||||
ACF_IFRAME_IFRAMEPARAMS_DESC="Додати додаткові атрибути HTML до елемента IFrame."
|
||||
28
plugins/fields/acfiframe/params/acfiframe.xml
Normal file
28
plugins/fields/acfiframe/params/acfiframe.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form>
|
||||
<fields name="fieldparams">
|
||||
<fieldset name="fieldparams">
|
||||
<field name="iframeheight" type="text"
|
||||
label="NR_HEIGHT"
|
||||
description="NR_HEIGHT_DESC"
|
||||
default="500px"
|
||||
/>
|
||||
<field name="iframescrolling" type="list"
|
||||
label="ACF_IFRAME_IFRAMESCROLLING"
|
||||
description="ACF_IFRAME_IFRAMESCROLLING_DESC"
|
||||
default="auto">
|
||||
<option value="no">JNO</option>
|
||||
<option value="yes">JYES</option>
|
||||
<option value="auto">Auto</option>
|
||||
</field>
|
||||
<field name="iframeasync" type="nrtoggle"
|
||||
label="ACF_IFRAME_ASYNC"
|
||||
description="ACF_IFRAME_ASYNC_DESC"
|
||||
/>
|
||||
<field name="iframeparams" type="text"
|
||||
label="ACF_IFRAME_IFRAMEPARAMS"
|
||||
description="ACF_IFRAME_IFRAMEPARAMS_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</form>
|
||||
691
plugins/fields/acfiframe/script.install.helper.php
Normal file
691
plugins/fields/acfiframe/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 PlgFieldsAcfiframeInstallerScriptHelper
|
||||
{
|
||||
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/acfiframe/script.install.php
Normal file
23
plugins/fields/acfiframe/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 © 2019 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 PlgFieldsACFIframeInstallerScript extends PlgFieldsACFIframeInstallerScriptHelper
|
||||
{
|
||||
public $alias = 'acfiframe';
|
||||
public $extension_type = 'plugin';
|
||||
public $plugin_folder = 'fields';
|
||||
public $show_message = false;
|
||||
}
|
||||
67
plugins/fields/acfiframe/tmpl/acfiframe.php
Normal file
67
plugins/fields/acfiframe/tmpl/acfiframe.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Advanced Custom Fields
|
||||
* @version 2.8.8 Pro
|
||||
*
|
||||
* @author Tassos Marinos <info@tassos.gr>
|
||||
* @link http://www.tassos.gr
|
||||
* @copyright Copyright © 2019 Tassos Marinos All Rights Reserved
|
||||
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
if (!$iframe = $field->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$buffer = '';
|
||||
|
||||
// Setup Variables
|
||||
$id = 'acf_iframe_' . $item->id . '_' . $field->id;
|
||||
$height = $fieldParams->get('iframeheight', '500px');
|
||||
$scrolling = $fieldParams->get('iframescrolling', 'auto');
|
||||
$params = $fieldParams->get('iframeparams', 'auto');
|
||||
$async = (bool) $fieldParams->get('iframeasync', false);
|
||||
|
||||
// Output
|
||||
$content = '
|
||||
<iframe
|
||||
src="' . $iframe . '"
|
||||
width="100%"
|
||||
height="' . $height . '"
|
||||
scrolling="' . $scrolling . '"
|
||||
' . $params . '
|
||||
frameborder="0"
|
||||
allowtransparency="true"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
';
|
||||
|
||||
$buffer .= '<div class="acf_iframe_wrapper" id="' . $id . '">';
|
||||
|
||||
//if not async
|
||||
if (!$async) {
|
||||
$buffer .= $content;
|
||||
}
|
||||
|
||||
$buffer .= '</div>';
|
||||
|
||||
echo $buffer;
|
||||
|
||||
// if async
|
||||
// We can't use addScriptDeclaration() here due to a bug which is fires twices the same event.
|
||||
// https://github.com/joomla/joomla-cms/issues/21004
|
||||
if ($async) {
|
||||
echo '<script>
|
||||
jQuery(function($) {
|
||||
var container = $("#' . $id . '.acf_iframe_wrapper");
|
||||
var content = ' . json_encode($content) .';
|
||||
|
||||
$(window).on("load", function() {
|
||||
container.html(content);
|
||||
})
|
||||
});</script>';
|
||||
}
|
||||
16
plugins/fields/acfiframe/version.php
Normal file
16
plugins/fields/acfiframe/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 © 2019 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