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)
|
||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 28th September, 2018
|
||||
+ *Last Build*: 29th September, 2018
|
||||
+ *Version*: 2.9.6
|
||||
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **195702**
|
||||
+ *Line count*: **195705**
|
||||
+ *Field count*: **1087**
|
||||
+ *File count*: **1278**
|
||||
+ *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)
|
||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 28th September, 2018
|
||||
+ *Last Build*: 29th September, 2018
|
||||
+ *Version*: 2.9.6
|
||||
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **195702**
|
||||
+ *Line count*: **195705**
|
||||
+ *Field count*: **1087**
|
||||
+ *File count*: **1278**
|
||||
+ *Folder count*: **201**
|
||||
|
@ -2075,9 +2075,17 @@ class Interpretation extends Fields
|
||||
foreach ($order as $or)
|
||||
{
|
||||
list($as, $field) = array_map('trim', explode('.', $or['table_key']));
|
||||
|
||||
// set the string
|
||||
$string = "\$query->order('" . $or['table_key'] . " " . $or['direction'] . "');";
|
||||
// check if random
|
||||
if ('RAND' === $or['direction'])
|
||||
{
|
||||
// set the string
|
||||
$string = "\$query->order('RAND()');";
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the string
|
||||
$string = "\$query->order('" . $or['table_key'] . " " . $or['direction'] . "');";
|
||||
}
|
||||
// sort where
|
||||
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_QQ="qq"
|
||||
COM_COMPONENTBUILDER_DYNAMIC_GET_R="r"
|
||||
COM_COMPONENTBUILDER_DYNAMIC_GET_RANDOM="Random"
|
||||
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_LABEL="Return Row Type"
|
||||
|
@ -2233,7 +2233,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return array The query options
|
||||
|
@ -243,7 +243,7 @@ function setCustomCodePlaceholder() {
|
||||
jQuery('#jcb-placeholder').html('<code>[not ready]</code>');
|
||||
jQuery('#jcb-placeholder-arg').html('<code>[not ready]</code>');
|
||||
} 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>');
|
||||
} else {
|
||||
jQuery('#jcb-placeholder').html('<code>[save to see]</code>');
|
||||
|
@ -954,6 +954,8 @@
|
||||
COM_COMPONENTBUILDER_DYNAMIC_GET_ASCENDING</option>
|
||||
<option value="DESC">
|
||||
COM_COMPONENTBUILDER_DYNAMIC_GET_DESCENDING</option>
|
||||
<option value="RAND">
|
||||
COM_COMPONENTBUILDER_DYNAMIC_GET_RANDOM</option>
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -1680,7 +1680,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return array The query options
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.2" method="upgrade">
|
||||
<name>COM_COMPONENTBUILDER</name>
|
||||
<creationDate>28th September, 2018</creationDate>
|
||||
<creationDate>29th September, 2018</creationDate>
|
||||
<author>Llewellyn van der Merwe</author>
|
||||
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
|
||||
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
|
||||
|
Loading…
Reference in New Issue
Block a user