forked from joomla/Component-Builder
Added the option to random order the dynamic get result set. gh-348
This commit is contained in:
parent
1447e06dd7
commit
fdd1cf7390
@ -125,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 28th September, 2018
|
+ *Last Build*: 29th September, 2018
|
||||||
+ *Version*: 2.9.6
|
+ *Version*: 2.9.6
|
||||||
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
|
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
|
||||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
+ *Line count*: **195702**
|
+ *Line count*: **195705**
|
||||||
+ *Field count*: **1087**
|
+ *Field count*: **1087**
|
||||||
+ *File count*: **1278**
|
+ *File count*: **1278**
|
||||||
+ *Folder count*: **201**
|
+ *Folder count*: **201**
|
||||||
|
@ -125,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 28th September, 2018
|
+ *Last Build*: 29th September, 2018
|
||||||
+ *Version*: 2.9.6
|
+ *Version*: 2.9.6
|
||||||
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
|
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
|
||||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
+ *Line count*: **195702**
|
+ *Line count*: **195705**
|
||||||
+ *Field count*: **1087**
|
+ *Field count*: **1087**
|
||||||
+ *File count*: **1278**
|
+ *File count*: **1278**
|
||||||
+ *Folder count*: **201**
|
+ *Folder count*: **201**
|
||||||
|
@ -2075,9 +2075,17 @@ class Interpretation extends Fields
|
|||||||
foreach ($order as $or)
|
foreach ($order as $or)
|
||||||
{
|
{
|
||||||
list($as, $field) = array_map('trim', explode('.', $or['table_key']));
|
list($as, $field) = array_map('trim', explode('.', $or['table_key']));
|
||||||
|
// check if random
|
||||||
// set the string
|
if ('RAND' === $or['direction'])
|
||||||
$string = "\$query->order('" . $or['table_key'] . " " . $or['direction'] . "');";
|
{
|
||||||
|
// set the string
|
||||||
|
$string = "\$query->order('RAND()');";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// set the string
|
||||||
|
$string = "\$query->order('" . $or['table_key'] . " " . $or['direction'] . "');";
|
||||||
|
}
|
||||||
// sort where
|
// sort where
|
||||||
if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) && ComponentbuilderHelper::checkString($this->siteMainGet[$this->target][$code][$as])))
|
if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) && ComponentbuilderHelper::checkString($this->siteMainGet[$this->target][$code][$as])))
|
||||||
{
|
{
|
||||||
|
@ -4045,6 +4045,7 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_PUBLISHING="Publishing"
|
|||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_Q="q"
|
COM_COMPONENTBUILDER_DYNAMIC_GET_Q="q"
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_QQ="qq"
|
COM_COMPONENTBUILDER_DYNAMIC_GET_QQ="qq"
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_R="r"
|
COM_COMPONENTBUILDER_DYNAMIC_GET_R="r"
|
||||||
|
COM_COMPONENTBUILDER_DYNAMIC_GET_RANDOM="Random"
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE="Repeatable Value"
|
COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE="Repeatable Value"
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_ROW_TYPE_DESCRIPTION="Single row or Multiple rows"
|
COM_COMPONENTBUILDER_DYNAMIC_GET_ROW_TYPE_DESCRIPTION="Single row or Multiple rows"
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_ROW_TYPE_LABEL="Return Row Type"
|
COM_COMPONENTBUILDER_DYNAMIC_GET_ROW_TYPE_LABEL="Return Row Type"
|
||||||
|
@ -2233,7 +2233,7 @@ class ComponentbuilderModelAjax extends JModelList
|
|||||||
/**
|
/**
|
||||||
* Get the keys of the values to search custom code in
|
* Get the keys of the values to search custom code in
|
||||||
*
|
*
|
||||||
* @param string $targe The table targeted
|
* @param string $target The table targeted
|
||||||
* @param string $type The type of get
|
* @param string $type The type of get
|
||||||
*
|
*
|
||||||
* @return array The query options
|
* @return array The query options
|
||||||
|
@ -243,7 +243,7 @@ function setCustomCodePlaceholder() {
|
|||||||
jQuery('#jcb-placeholder').html('<code>[not ready]</code>');
|
jQuery('#jcb-placeholder').html('<code>[not ready]</code>');
|
||||||
jQuery('#jcb-placeholder-arg').html('<code>[not ready]</code>');
|
jQuery('#jcb-placeholder-arg').html('<code>[not ready]</code>');
|
||||||
} else if (functioName.length > 2) {
|
} else if (functioName.length > 2) {
|
||||||
jQuery('#jcb-placeholder').html('<code><code>[CUSTO'+'MCODE='+functioName+']</code>');
|
jQuery('#jcb-placeholder').html('<code>[CUSTO'+'MCODE='+functioName+']</code>');
|
||||||
jQuery('#jcb-placeholder-arg').html('<code>[CUSTO'+'MCODE='+functioName+'+value1,value2]</code>');
|
jQuery('#jcb-placeholder-arg').html('<code>[CUSTO'+'MCODE='+functioName+'+value1,value2]</code>');
|
||||||
} else {
|
} else {
|
||||||
jQuery('#jcb-placeholder').html('<code>[save to see]</code>');
|
jQuery('#jcb-placeholder').html('<code>[save to see]</code>');
|
||||||
|
@ -954,6 +954,8 @@
|
|||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_ASCENDING</option>
|
COM_COMPONENTBUILDER_DYNAMIC_GET_ASCENDING</option>
|
||||||
<option value="DESC">
|
<option value="DESC">
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GET_DESCENDING</option>
|
COM_COMPONENTBUILDER_DYNAMIC_GET_DESCENDING</option>
|
||||||
|
<option value="RAND">
|
||||||
|
COM_COMPONENTBUILDER_DYNAMIC_GET_RANDOM</option>
|
||||||
</field>
|
</field>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
@ -1680,7 +1680,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
|||||||
/**
|
/**
|
||||||
* Get the keys of the values to search custom code in
|
* Get the keys of the values to search custom code in
|
||||||
*
|
*
|
||||||
* @param string $targe The table targeted
|
* @param string $target The table targeted
|
||||||
* @param string $type The type of get
|
* @param string $type The type of get
|
||||||
*
|
*
|
||||||
* @return array The query options
|
* @return array The query options
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.2" method="upgrade">
|
<extension type="component" version="3.2" method="upgrade">
|
||||||
<name>COM_COMPONENTBUILDER</name>
|
<name>COM_COMPONENTBUILDER</name>
|
||||||
<creationDate>28th September, 2018</creationDate>
|
<creationDate>29th September, 2018</creationDate>
|
||||||
<author>Llewellyn van der Merwe</author>
|
<author>Llewellyn van der Merwe</author>
|
||||||
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
|
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
|
||||||
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
|
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
|
||||||
|
Loading…
Reference in New Issue
Block a user