52
0

Release of v1.1.0

This commit is contained in:
Robot 2024-03-02 22:10:30 +02:00
parent 971882d6ae
commit 1dd14b835b
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
5 changed files with 17 additions and 47 deletions

View File

@ -21,30 +21,15 @@ use VDM\Joomla\Utilities\StringHelper;
JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
/** /**
* Extension - Componentbuilder Field Ordering Compiler plugin. * Extension - Componentbuilder Field Ordering Compiler plugin.
* *
* @package ComponentbuilderFieldOrderingCompiler * @package ComponentbuilderFieldOrderingCompiler
* @since 1.0.2 * @since 1.1.0
*/ */
class PlgExtensionComponentbuilderFieldOrderingCompiler extends CMSPlugin class PlgExtensionComponentbuilderFieldOrderingCompiler extends CMSPlugin
{ {
/**
* Global switch to see if component have need of field ordering.
*
* @var boolean
* @since 1.0.0
*/
protected $loadFieldordering = false;
/**
* The Views active with default ordering options
*
* @var array
* @since 1.0.0
*/
protected $activeViews = array();
/** /**
* Event Triggered in the compiler [on Before Model View Data] * Event Triggered in the compiler [on Before Model View Data]
* *
@ -52,7 +37,7 @@ class PlgExtensionComponentbuilderFieldOrderingCompiler extends CMSPlugin
* *
* @since 1.0 * @since 1.0
*/ */
public function jcb_ce_onBeforeModelViewData(&$context, &$view, &$placeholders) public function jcb_ce_onBeforeModelViewData(&$view)
{ {
// add the privacy // add the privacy
$view->params = (isset($view->params) && JsonHelper::check($view->params)) ? json_decode($view->params, true) : $view->params; $view->params = (isset($view->params) && JsonHelper::check($view->params)) ? json_decode($view->params, true) : $view->params;
@ -61,31 +46,11 @@ class PlgExtensionComponentbuilderFieldOrderingCompiler extends CMSPlugin
if ($view->params['fieldordering']['add_admin_ordering'] == 1 if ($view->params['fieldordering']['add_admin_ordering'] == 1
|| $view->params['fieldordering']['add_linked_ordering'] == 1) || $view->params['fieldordering']['add_linked_ordering'] == 1)
{ {
// activate the load of the privacy plugin
$this->loadFieldordering = true;
// setup the view key name // setup the view key name
$name_list = StringHelper::safe($view->name_list); $name_list = StringHelper::safe($view->name_list);
// load the admin view details // load the admin view details
$this->activeViews[$name_list] = $view->params['fieldordering']; CFactory::_('Compiler.Builder.Views.Default.Ordering')->set($name_list, $view->params['fieldordering']);
} }
} }
} }
/**
* Event Triggered in the compiler [on After Get]
*
* @return void
*
* @since 1.0
*/
public function jcb_ce_onAfterGet(&$context, $compiler)
{
// check if this component needs a privacy plugin loaded
if ($this->loadFieldordering)
{
// move the data to the compiler
$compiler->viewsDefaultOrdering =& $this->activeViews;
}
}
} }

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="4" group="extension" method="upgrade"> <extension type="plugin" version="3.10" group="extension" method="upgrade">
<name>PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER</name> <name>PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER</name>
<creationDate>24th October, 2023</creationDate> <creationDate>2nd March, 2024</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail> <authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl> <authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright> <copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license> <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.0.2</version> <version>1.1.0</version>
<description>PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_XML_DESCRIPTION</description> <description>PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_XML_DESCRIPTION</description>
<!-- Scripts to run on installation --> <!-- Scripts to run on installation -->

View File

@ -1,3 +1,3 @@
PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER="Extension - Componentbuilder Field Ordering Compiler" PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER="Extension - Componentbuilder Field Ordering Compiler"
PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_DESCRIPTION="This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering." PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_DESCRIPTION="This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering."
PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Field Ordering Compiler (v.1.0.2)</h1> <div style='clear: both;'></div><p>This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st May, 2020</small></p>" PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Field Ordering Compiler (v.1.1.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st May, 2020</small></p>"

View File

@ -1,3 +1,3 @@
PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER="Extension - Componentbuilder Field Ordering Compiler" PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER="Extension - Componentbuilder Field Ordering Compiler"
PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_DESCRIPTION="This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering." PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_DESCRIPTION="This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering."
PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Field Ordering Compiler (v.1.0.2)</h1> <div style='clear: both;'></div><p>This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st May, 2020</small></p>" PLG_EXTENSION_COMPONENTBUILDERFIELDORDERINGCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Field Ordering Compiler (v.1.1.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set the ordring for your component views during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to set your admin views where you would like to use Field Ordering.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st May, 2020</small></p>"

View File

@ -12,6 +12,11 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
/** /**
* Extension - Componentbuilder Field Ordering Compiler script file. * Extension - Componentbuilder Field Ordering Compiler script file.
* *
@ -31,7 +36,7 @@ class plgExtensionComponentbuilderFieldOrderingCompilerInstallerScript
public function preflight($route, $adapter) public function preflight($route, $adapter)
{ {
// get application // get application
$app = JFactory::getApplication(); $app = Factory::getApplication();
// the default for both install and update // the default for both install and update
$jversion = new JVersion(); $jversion = new JVersion();