acf
This commit is contained in:
129
plugins/system/acf/layouts/dashboard.php
Normal file
129
plugins/system/acf/layouts/dashboard.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?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;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
|
||||
if (!@include_once(JPATH_PLUGINS . '/system/nrframework/autoload.php'))
|
||||
{
|
||||
throw new RuntimeException('Novarain Framework is not installed', 500);
|
||||
}
|
||||
|
||||
if (defined('nrJ4'))
|
||||
{
|
||||
HTMLHelper::stylesheet('plg_system_nrframework/joomla4.css', ['relative' => true, 'version' => 'auto']);
|
||||
} else
|
||||
{
|
||||
HTMLHelper::_('behavior.modal');
|
||||
}
|
||||
|
||||
Factory::getDocument()->addStyleDeclaration('
|
||||
.stars:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.icon-star {
|
||||
color: #fcac0a;
|
||||
width: ' . (defined('nrJ4') ? '14' : '7') . 'px;
|
||||
}
|
||||
');
|
||||
|
||||
/**
|
||||
* Get list of all available fields
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getFieldsCollection()
|
||||
{
|
||||
// Load XML file
|
||||
$xmlfile = __DIR__ . '/fieldscollection.xml';
|
||||
|
||||
if (!is_file($xmlfile))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$xmlItems = simplexml_load_file($xmlfile))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$fields = array();
|
||||
|
||||
foreach ($xmlItems as $key => $item)
|
||||
{
|
||||
$item = (array) $item;
|
||||
$item = new Registry($item["@attributes"]);
|
||||
|
||||
$extensionName = 'acf' . $item->get("name");
|
||||
$extensionID = NRFramework\Functions::getExtensionID($extensionName, 'fields');
|
||||
$backEndURL = "index.php?option=com_plugins&task=plugin.edit&extension_id=" . $extensionID;
|
||||
|
||||
$url = $item->get("proonly", null) ? NRFramework\Functions::getUTMURL($item->get("url", "https://www.tassos.gr/joomla-extensions/advanced-custom-fields")) : Uri::base() . $backEndURL;
|
||||
|
||||
$path = JPATH_PLUGINS . '/fields/acf' . $item->get("name");
|
||||
NRFramework\Functions::loadLanguage('plg_fields_acf' . $item->get("name"), $path);
|
||||
|
||||
$obj = array(
|
||||
"label" => isset($item['label']) ? $item['label'] : str_replace('ACF - ', '', Text::_('PLG_FIELDS_ACF' . strtoupper($item->get("name")) . '_LABEL')),
|
||||
"description" => isset($item['description']) ? $item['description'] : Text::_('ACF_' . strtoupper($item->get("name")) . '_DESC'),
|
||||
"backendurl" => Uri::base() . $backEndURL,
|
||||
"extensionid" => $extensionID,
|
||||
"proonly" => $item->get("proonly", null),
|
||||
"comingsoon" => $item->get("comingsoon", false),
|
||||
'docurl' => 'https://www.tassos.gr/joomla-extensions/advanced-custom-fields/docs/' . $item->get('doc')
|
||||
);
|
||||
|
||||
$fields[] = $obj;
|
||||
}
|
||||
|
||||
asort($fields);
|
||||
|
||||
$layout = new FileLayout('fieldscollection', __DIR__);
|
||||
return $layout->render($fields);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="nr">
|
||||
<div class="nr-well well">
|
||||
<h4><?php echo Text::_("NR_INFORMATION") ?></h4>
|
||||
<p>
|
||||
<a target="_blank" href="https://www.tassos.gr/joomla-extensions/advanced-custom-fields">
|
||||
<?php echo Text::_("ACF") ?>
|
||||
<?php echo NRFramework\Functions::getExtensionVersion("plg_system_acf", true) ?>
|
||||
</a>
|
||||
</p>
|
||||
<p><?php echo Text::_("NR_LIKE_THIS_EXTENSION") ?> <a target="_blank" href="https://extensions.joomla.org/extensions/extension/authoring-a-content/content-construction/advanced-custom-fields/"><?php echo Text::_("NR_LEAVE_A_REVIEW") ?></a>
|
||||
<a class="stars" target="_blank" href="https://extensions.joomla.org/extensions/extension/authoring-a-content/content-construction/advanced-custom-fields/">
|
||||
<span class="icon-star"></span>
|
||||
<span class="icon-star"></span>
|
||||
<span class="icon-star"></span>
|
||||
<span class="icon-star"></span>
|
||||
<span class="icon-star"></span>
|
||||
</a>
|
||||
</p>
|
||||
<?php echo Text::_("NR_NEED_SUPPORT") ?>
|
||||
<a target="_blank" href="http://www.tassos.gr/contact?extension=Advanced Custom Fields"><?php echo Text::_("NR_DROP_EMAIL") ?></a>
|
||||
</div>
|
||||
|
||||
<!-- Fields Collection -->
|
||||
<?php echo getFieldsCollection(); ?>
|
||||
|
||||
<hr>
|
||||
<p><?php echo Text::sprintf('NR_COPYRIGHT', '© ' . Date("Y")) ?></p>
|
||||
</div>
|
||||
93
plugins/system/acf/layouts/fieldscollection.php
Normal file
93
plugins/system/acf/layouts/fieldscollection.php
Normal file
@ -0,0 +1,93 @@
|
||||
<?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('JPATH_PLATFORM') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
if (!defined('nrJ4'))
|
||||
{
|
||||
HTMLHelper::_('behavior.modal');
|
||||
}
|
||||
|
||||
$modalRel = 'rel="{handler: \'iframe\', size: {x: 1000, y: 630}}"';
|
||||
$product_url = 'https://www.tassos.gr/joomla-extensions/advanced-custom-fields';
|
||||
|
||||
?>
|
||||
|
||||
<div class="acft">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo Text::_('ACF_FIELDS_COLLECTION') ?></th>
|
||||
<th width="140px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php foreach ($displayData as $key => $field) { ?>
|
||||
<tr>
|
||||
<td class="acft-text">
|
||||
<h4><?php echo $field['label'] ?></h4>
|
||||
<?php echo $field['description'] ?>
|
||||
</td>
|
||||
<td class="acft-btn">
|
||||
<div class="acft-btn">
|
||||
<?php if ($field['comingsoon']) { ?>
|
||||
<a class="btn" href="<?php echo $product_url ?>/roadmap" target="_blank">
|
||||
On the roadmap
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
<?php if ($field["extensionid"]) { ?>
|
||||
<a class="btn <?php echo !defined('nrJ4') ? 'modal' : '' ?> btn-outline-secondary btn-sm" <?php echo $modalRel; ?> href="<?php echo $field['backendurl'] ?>">
|
||||
<span class="icon-options"></span>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<a class="btn btn-outline-secondary btn-sm" href="<?php echo $field['docurl'] ?>" target="_blank">
|
||||
<span class="icon-help"></span>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td>
|
||||
<div><strong><?php echo Text::_("ACF_MISSING_FIELD") ?></strong></div>
|
||||
<?php echo Text::_("ACF_MISSING_FIELD_DESC") ?>
|
||||
</td>
|
||||
<td class="acft-btn">
|
||||
<a class="btn btn-primary" target="_blank" href="https://www.tassos.gr/contact?extension=Advanced Custom Fields">
|
||||
<?php echo Text::_("NR_DROP_EMAIL")?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.acft-btn {
|
||||
text-align: right !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.acft td, .acft th {
|
||||
padding:13px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.acft h4 {
|
||||
margin:0 0 5px 0;
|
||||
padding:0;
|
||||
color:#3071a9;
|
||||
}
|
||||
</style>
|
||||
130
plugins/system/acf/layouts/fieldscollection.xml
Normal file
130
plugins/system/acf/layouts/fieldscollection.xml
Normal file
@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fields>
|
||||
<field name="email"
|
||||
label="Email"
|
||||
description="Safely display email addresses in the front-end that are unreadbable to spambots."
|
||||
doc="the-email-field"
|
||||
/>
|
||||
<field name="gravatar"
|
||||
doc="the-gravatar-field"
|
||||
/>
|
||||
<field name="country"
|
||||
doc="the-country-field"
|
||||
/>
|
||||
<field name="currency"
|
||||
doc="the-currency-field"
|
||||
/>
|
||||
<field name="url"
|
||||
doc="the-url-field"
|
||||
/>
|
||||
<field name="convertforms"
|
||||
doc="the-convert-forms-field"
|
||||
/>
|
||||
<field name="soundcloud"
|
||||
doc="the-soundcloud-field"
|
||||
/>
|
||||
<field name="telephone"
|
||||
doc="the-telephone-field"
|
||||
/>
|
||||
<field name="iframe"
|
||||
doc="the-iframe-field"
|
||||
/>
|
||||
<field name="progressbar"
|
||||
doc="the-progress-bar-field"
|
||||
/>
|
||||
<field name="truefalse"
|
||||
doc="the-true-false-field"
|
||||
/>
|
||||
<field name="timepicker"
|
||||
doc="the-timepicker-field"
|
||||
/>
|
||||
<field name="downloadbutton"
|
||||
doc="the-download-button-field"
|
||||
/>
|
||||
<field name="html5audio"
|
||||
doc="the-html5-audio-field"
|
||||
/>
|
||||
<field name="qrcode"
|
||||
doc="the-qr-code-field"
|
||||
/>
|
||||
<field name="whatsappctc"
|
||||
doc="the-whatsapp-click-to-chat-field"
|
||||
/>
|
||||
<field name="facebook"
|
||||
doc="the-facebook-field"
|
||||
/>
|
||||
<field name="twitter"
|
||||
doc="the-twitter-field"
|
||||
/>
|
||||
<field name="map"
|
||||
doc="the-map-field"
|
||||
/>
|
||||
<field name="video"
|
||||
doc="the-video-field"
|
||||
/>
|
||||
<!--
|
||||
Note: Always set a fixed value in the Label and Description properties of
|
||||
the Pro only fields as the Free version doesn't include them at all,
|
||||
ending up with untranslated language strings
|
||||
-->
|
||||
<field name="address"
|
||||
label="Address Autocomplete"
|
||||
description="Display a map with location details such as address, country, city, postal code, state, etc..."
|
||||
proonly="true"
|
||||
doc="acf-address-field-get-instant-address-details"
|
||||
/>
|
||||
<field name="gallery"
|
||||
label="Gallery"
|
||||
description="Create image galleries to share group of pictures on your site."
|
||||
proonly="true"
|
||||
doc="the-gallery-field"
|
||||
/>
|
||||
<field name="upload"
|
||||
label="File Upload"
|
||||
description="Upload any file using a drag & drop file uploader in the back-end and display the uploaded file as a link or image in the front-end."
|
||||
proonly="true"
|
||||
doc="how-to-add-a-file-upload-field-in-joomla-forms"
|
||||
/>
|
||||
<field name="module"
|
||||
label="Module Loader"
|
||||
description="Select any existing Joomla! Module in the back-end and render it in the front-end."
|
||||
proonly="true"
|
||||
doc="the-module-field"
|
||||
/>
|
||||
<field name="php"
|
||||
label="PHP"
|
||||
description="Execute PHP in a Joomla! Custom Field and display a dynamic value in the front-end."
|
||||
proonly="true"
|
||||
doc="how-to-run-php-code-in-a-joomla-custom-field"
|
||||
/>
|
||||
<field name="paypal"
|
||||
label="PayPal"
|
||||
description="Accept donations, allow your shoppers to buy products or subscribe to your services with the PayPal button."
|
||||
proonly="true"
|
||||
doc="joomla-paypal-custom-field"
|
||||
/>
|
||||
<field name="chainedfields"
|
||||
label="Chained Fields"
|
||||
description="Create select fields that dynamically change based on the previous selection."
|
||||
proonly="true"
|
||||
doc="create-chained-selects"
|
||||
/>
|
||||
<field name="countdown"
|
||||
label="Countdown"
|
||||
description="Use a countdown timer to create anticipation and scarcity around upcoming events, creating the feeling of scarcity, anticipation, and drive more sales."
|
||||
proonly="true"
|
||||
doc="how-to-add-a-countdown-timer-field"
|
||||
/>
|
||||
<field name="articles"
|
||||
label="Articles"
|
||||
description="Select and connect articles to each other."
|
||||
proonly="true"
|
||||
doc="articles"
|
||||
/>
|
||||
<field name="faq"
|
||||
label="FAQ"
|
||||
description="Add a Frequently Asked Questions section to your site."
|
||||
proonly="true"
|
||||
doc="create-faq-section-joomla"
|
||||
/>
|
||||
</fields>
|
||||
Reference in New Issue
Block a user