Update some comments. Fixed some conditional implementation of the show hide fields area in the admin views.

This commit is contained in:
Llewellyn van der Merwe 2018-09-09 22:04:38 +02:00
parent 1d5a99878a
commit 5b1813db7c
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
11 changed files with 187 additions and 138 deletions

View File

@ -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*: 1st September, 2018
+ *Last Build*: 8th September, 2018
+ *Version*: 2.9.0
+ *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*: **192959**
+ *Line count*: **192999**
+ *Field count*: **1081**
+ *File count*: **1273**
+ *Folder count*: **201**

View File

@ -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*: 1st September, 2018
+ *Last Build*: 8th September, 2018
+ *Version*: 2.9.0
+ *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*: **192959**
+ *Line count*: **192999**
+ *Field count*: **1081**
+ *File count*: **1273**
+ *Folder count*: **201**

View File

@ -5,8 +5,8 @@
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version ###VERSION###
@ -14,10 +14,10 @@
@created ###CREATIONDATE###
@package ###Component_name###
@subpackage ###FILENAME###
@author ###AUTHOR### <###AUTHORWEBSITE###>###CONTRIBUTORS###
@author ###AUTHOR### <###AUTHORWEBSITE###>###CONTRIBUTORS###
@copyright ###COPYRIGHT###
@license ###LICENSE###
###SHORT_DESCRIPTION###
@license ###LICENSE###
###SHORT_DESCRIPTION###
/-----------------------------------------------------------------------------------------------------------------------------*/

View File

@ -9195,19 +9195,18 @@ class Interpretation extends Fields
$ifValue = array();
$targetControls = array();
$functions = array();
foreach ($viewArray['settings']->conditions as $condition)
{
if (isset($condition['match_name']) && ComponentbuilderHelper::checkString($condition['match_name']))
{
$uniqueVar = $this->uniquekey(7);
$matchName = $condition['match_name'] . '_' . $uniqueVar;
$targetBehavior = ($condition['target_behavior'] == 1) ? 'show' : 'hide';
$targetDefault = ($condition['target_behavior'] == 1) ? 'hide' : 'show';
$targetBehavior = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 3) ? 'show' : 'hide';
$targetDefault = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 3) ? 'hide' : 'show';
// make sure only one relation is set
$firstTime = true;
// set the realtation if any
if ($condition['target_relation'] && $firstTime)
if ($condition['target_relation'])
{
// chain to other items of the same target
$relations = $this->getTargetRelationScript($viewArray['settings']->conditions, $condition, $viewName);
@ -9216,6 +9215,7 @@ class Interpretation extends Fields
// set behavior and default array
$behaviors[$matchName] = $targetBehavior;
$defaults[$matchName] = $targetDefault;
$toggleSwitch[$matchName] = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 2) ? true : false;
// set the type buket
$typeBuket[$matchName] = $condition['match_type'];
// set function array
@ -9230,7 +9230,6 @@ class Interpretation extends Fields
// set the target controls
$targetControls[$matchName] = $this->setTargetControlsScript($condition['target_field'], $targetBehavior, $targetDefault, $uniqueVar, $viewName);
$firstTime = false;
foreach ($relations as $relation)
{
if (ComponentbuilderHelper::checkString($relation['match_name']))
@ -9254,6 +9253,7 @@ class Interpretation extends Fields
// set behavior and default array
$behaviors[$matchName] = $targetBehavior;
$defaults[$matchName] = $targetDefault;
$toggleSwitch[$matchName] = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 2) ? true : false;
// set the type buket
$typeBuket[$matchName] = $condition['match_type'];
// set function array
@ -9279,7 +9279,7 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($functions))
{
// now build the initial script
$initial .= "// Initial Script" . PHP_EOL . "jQuery(document).ready(function()";
$initial .= "//" . $this->setLine(__LINE__) . " Initial Script" . PHP_EOL . "jQuery(document).ready(function()";
$initial .= PHP_EOL . "{";
foreach ($functions as $function => $matchKeys)
{
@ -9310,7 +9310,7 @@ class Interpretation extends Fields
$name = $name . '_id';
}
$listener .= PHP_EOL . "// #jform_" . $name . " listeners for " . $l_matchKey . " function";
$listener .= PHP_EOL . "//" . $this->setLine(__LINE__) . " #jform_" . $name . " listeners for " . $l_matchKey . " function";
$listener .= PHP_EOL . "jQuery('#jform_" . $name . "').on('keyup',function()";
$listener .= PHP_EOL . "{";
$listener .= $funcCall['code'];
@ -9346,7 +9346,7 @@ class Interpretation extends Fields
{
$addArray = true;
}
$func .= PHP_EOL . "// the " . $f_function . " function";
$func .= PHP_EOL . "//" . $this->setLine(__LINE__) . " the " . $f_function . " function";
$func .= PHP_EOL . "function " . $f_function . "(";
$fucounter = 0;
foreach ($f_matchKeys as $fu_matchKey)
@ -9378,7 +9378,7 @@ class Interpretation extends Fields
$func .= PHP_EOL . $this->_t(1) . "var " . $name . " = " . $a_matchKey . ".some(" . $a_matchKey . "_SomeFunc);" . PHP_EOL;
// setup the map function
$map .= PHP_EOL . "// the " . $f_function . " Some function";
$map .= PHP_EOL . "//" . $this->setLine(__LINE__) . " the " . $f_function . " Some function";
$map .= PHP_EOL . "function " . $a_matchKey . "_SomeFunc(" . $a_matchKey . ")";
$map .= PHP_EOL . "{";
$map .= PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set the function logic";
@ -9434,6 +9434,11 @@ class Interpretation extends Fields
}
$ifcounter++;
}
else
{
var_dump($functions);
var_dump($ifValue);exit;
}
}
$func .= ")" . PHP_EOL . $this->_t(1) . "{";
}
@ -9452,13 +9457,16 @@ class Interpretation extends Fields
$head .= $action['requiredVar'];
}
}
$func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . $this->_t(1) . "else" . PHP_EOL . $this->_t(1) . "{";
foreach ($controls as $target => $action)
if ($toggleSwitch[$f_matchKeys[0]])
{
$func .= $action['default'];
if (ComponentbuilderHelper::checkString($action['hide']))
$func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . $this->_t(1) . "else" . PHP_EOL . $this->_t(1) . "{";
foreach ($controls as $target => $action)
{
$func .= $action[$targetDefault];
$func .= $action['default'];
if (ComponentbuilderHelper::checkString($action['hide']))
{
$func .= $action[$targetDefault];
}
}
}
$func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . "}" . PHP_EOL . $map;
@ -9612,7 +9620,7 @@ class Interpretation extends Fields
// convert to name array
foreach ($condition['target_field'] as $targetField)
{
if (ComponentbuilderHelper::checkArray($targetField))
if (ComponentbuilderHelper::checkArray($targetField) && isset($targetField['name']))
{
$currentTargets[] = $targetField['name'];
}
@ -9622,7 +9630,8 @@ class Interpretation extends Fields
{
// reset found
$found = false;
if ($relation['match_field'] != $condition['match_field'])
// chain only none matching fields
if ($relation['match_field'] !== $condition['match_field'] && $relation['target_relation']) // Made this change to see if it improves the expected result (TODO)
{
if (ComponentbuilderHelper::checkArray($relation['target_field']))
{

View File

@ -2400,14 +2400,14 @@ abstract class ComponentbuilderHelper
/**
* Get the file path or url
* Get the file path or url
*
* @param string $type The (url/path) type to return
* @param string $target The Params Target name (if set)
* @param string $default The default path if not set in Params (fallback path)
* @param bool $createIfNotSet The switch to create the folder if not found
* @param string $type The (url/path) type to return
* @param string $target The Params Target name (if set)
* @param string $default The default path if not set in Params (fallback path)
* @param bool $createIfNotSet The switch to create the folder if not found
*
* @return string On success the path or url is returned based on the type requested
* @return string On success the path or url is returned based on the type requested
*
*/
public static function getFolderPath($type = 'path', $target = 'folderpath', $default = '', $createIfNotSet = true)
@ -2448,7 +2448,7 @@ abstract class ComponentbuilderHelper
/**
* get the content of a file
*
* @param string $path The path to the file
* @param string $path The path to the file
* @param string/bool $none The return value if no content was found
*
* @return string On success
@ -2597,34 +2597,37 @@ abstract class ComponentbuilderHelper
}
/**
* the locker
* the locker
*
* @var array
* @var array
**/
protected static $locker = array();
/**
* the dynamic replacement salt
* the dynamic replacement salt
*
* @var array
* @var array
**/
protected static $globalSalt = array();
/**
* the timer
* the timer
*
* @var object
* @var object
**/
protected static $keytimer;
/**
* To Lock string
* To Lock string
*
* @param string $string The string/array to lock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url encoding
*
* @return string Encrypted String
*
* @param string $string The string/array to lock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url encoding
**/
public static function lock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true)
{
@ -2638,13 +2641,13 @@ abstract class ComponentbuilderHelper
{
$timer = $salt;
}
// set the default key
$key = self::salt($timer, $dynamic);
// try getting the system key
if (method_exists(get_called_class(), "getCryptKey"))
{
$key = self::getCryptKey('basic', self::salt($timer, $dynamic));
}
else
{
$key = self::salt($timer, $dynamic);
// try getting the medium key first the fall back to basic, and then default
$key = self::getCryptKey('medium', self::getCryptKey('basic', $key));
}
}
// check if we have a salt timer
@ -2663,7 +2666,7 @@ abstract class ComponentbuilderHelper
$string = serialize($string);
}
// prep for url
if ($urlencode)
if ($urlencode && method_exists(get_called_class(), "base64_urlencode"))
{
return self::base64_urlencode(self::$locker[$key]->encryptString($string));
}
@ -2671,13 +2674,16 @@ abstract class ComponentbuilderHelper
}
/**
* To un-Lock string
* To un-Lock string
*
* @param string $string The string to unlock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url decoding
*
* @return string Decrypted String
*
* @param string $string The string to unlock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url decoding
**/
public static function unlock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true)
{
@ -2691,14 +2697,13 @@ abstract class ComponentbuilderHelper
{
$timer = $salt;
}
// get secure key
// set the default key
$key = self::salt($timer, $dynamic);
// try getting the system key
if (method_exists(get_called_class(), "getCryptKey"))
{
$key = self::getCryptKey('basic', self::salt($timer, $dynamic));
}
else
{
$key = self::salt($timer, $dynamic);
// try getting the medium key first the fall back to basic, and then default
$key = self::getCryptKey('medium', self::getCryptKey('basic', $key));
}
}
// check if we have a salt timer
@ -2712,7 +2717,7 @@ abstract class ComponentbuilderHelper
self::$locker[$key] = new FOFEncryptAes($key, 128);
}
// make sure we have real base64
if ($urlencode)
if ($urlencode && method_exists(get_called_class(), "base64_urldecode"))
{
$string = self::base64_urldecode($string);
}
@ -2730,10 +2735,13 @@ abstract class ComponentbuilderHelper
}
/**
* The Salt
* The Salt
*
* @param int $type The type of length the salt should be valid
* @param int $dynamic The dynamic replacement array of salt build string
*
* @return string
*
* @param int $type The type of length the salt should be valid
* @param int $dynamic The dynamic replacement array of salt build string
**/
public static function salt($type = 1, $dynamic = null)
{
@ -2778,9 +2786,9 @@ abstract class ComponentbuilderHelper
}
/**
* The function to insure the salt is valid within the given period (third try)
* The function to insure the salt is valid within the given period (third try)
*
* @param int $main The main number
* @param int $main The main number
*/
protected static function periodFix($main)
{
@ -2788,8 +2796,12 @@ abstract class ComponentbuilderHelper
}
/**
* Check if a string is serialized
* @param string $string
* Check if a string is serialized
*
* @param string $string
*
* @return Boolean
*
*/
public static function is_serial($string)
{
@ -2797,7 +2809,7 @@ abstract class ComponentbuilderHelper
}
/**
* Get dynamic replacement salt
* Get dynamic replacement salt
*/
public static function getDynamicSalt($dynamic = null)
{
@ -2814,7 +2826,7 @@ abstract class ComponentbuilderHelper
}
/**
* The random or dynamic secret salt
* The random or dynamic secret salt
*/
public static function getSecretSalt($string = null, $size = 9)
{
@ -2837,7 +2849,7 @@ abstract class ComponentbuilderHelper
}
/**
* Get global replacement salt
* Get global replacement salt
*/
public static function getGlobalSalt()
{
@ -2877,7 +2889,7 @@ abstract class ComponentbuilderHelper
}
/**
* Close public protocol
* Close public protocol
*/
public static function closePublicProtocol($id, $public)
{
@ -2904,7 +2916,7 @@ abstract class ComponentbuilderHelper
}
/**
* Open public protocol
* Open public protocol
*/
public static function openPublicProtocol($SECRET, $ID, $PUBLIC)
{

View File

@ -249,7 +249,8 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CREATED_DATE_LABEL="Created Date"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT="Editing the Admin Fields Conditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ERROR_UNIQUE_ALIAS="Another Admin Fields Conditions has the same alias."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EXACT_LENGTH_ONLY_FOUR_TEXT_FIELD="Exact Length (only 4 text_field)"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE="Hide"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE_ONLY="Hide Only"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE_TOGGLE="Hide Toggle"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ID="Id"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ISOLATE="Isolate"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES="Is Not (only 4 list/radio/checkboxes)"
@ -278,7 +279,8 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PERMISSION="Permissions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields Conditions to customise the alias."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SHOW="Show"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SHOW_ONLY="Show Only"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SHOW_TOGGLE="Show Toggle"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_STATUS="Status"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_BEHAVIOR_DESCRIPTION="Select the target field/s behavior."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_BEHAVIOR_LABEL="Target Behavior"
@ -4378,7 +4380,8 @@ COM_COMPONENTBUILDER_HELP_MANAGER="Help"
COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERCOPYRIGHTHFOURPSP="<h4 class="nav-header">Copyright</h4><p>%s</p>"
COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERLICENSEHFOURPSP="<h4 class="nav-header">License</h4><p>%s</p>"
COM_COMPONENTBUILDER_HI="Hi"
COM_COMPONENTBUILDER_HIDE="Hide"
COM_COMPONENTBUILDER_HIDE_ONLY="Hide Only"
COM_COMPONENTBUILDER_HIDE_TOGGLE="Hide Toggle"
COM_COMPONENTBUILDER_HOW_TO_GET_A_S_FREE_KEYSA_FROM_VDM="How to get <a %s >free keys</a> from VDM."
COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP="<h2>Curl Not Found!</h2><p>Please setup curl on your system, or <b>componentbuilder</b> will not function correctly!</p>"
COM_COMPONENTBUILDER_HTWODATA_IS_CORRUPTHTWOTHIS_COULD_BE_DUE_TO_BKEY_ERRORB_OR_BROKEN_PACKAGE="<h2>Data is corrupt!</h2>This could be due to <b>key error</b>, or broken package!"
@ -5860,8 +5863,9 @@ COM_COMPONENTBUILDER_SHOULD_THIS_FIELD_BE_ESCAPED_IN_THE_LIST_VIEW="Should this
COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT="Should we be showing more elaborate information during import."
COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED="Should we force the update of all local data, even if it is newer then the data being imported."
COM_COMPONENTBUILDER_SHOULD_WE_MERGE_THE_COMPONENTS_WITH_SIMILAR_LOCAL_COMPONENTS_MERGING_THE_COMPONENTS_USE_TO_BE_THE_DEFAULT_BEHAVIOUR_BUT_NOW_YOU_CAN_IMPORT_THE_COMPONENTS_AND_FORCE_IT_NOT_TO_MERGE_THE_FOLLOWING_AREAS_VALIDATION_RULE_FIELDTYPE_SNIPPET_LANGUAGE_LANGUAGE_TRANSLATION_BMUST_AND_WILL_STILLB_MERGE_EVEN_OF_YOUR_SELECTION_IS_BNOB_BECAUSE_OF_THE_SINGULAR_NATURE_OF_THOSE_AREAS="Should we merge the component/s with similar local component/s. Merging the component/s use to be the default behaviour, but now you can import the component/s and force it not to merge. The following areas (validation_rule, fieldtype, snippet, language, language_translation) <b>must and will still</b> merge even of your selection is <b>No</b>, because of the singular nature of those areas."
COM_COMPONENTBUILDER_SHOW="Show"
COM_COMPONENTBUILDER_SHOW_IN_LIST_VIEW="Show in list view"
COM_COMPONENTBUILDER_SHOW_ONLY="Show Only"
COM_COMPONENTBUILDER_SHOW_TOGGLE="Show Toggle"
COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB="Since the owner details are displayed during <b>import process</b> before adding the key, this way if the user/dev <b>does not</b> have the key they can see <b>where to get it</b>."
COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it."
COM_COMPONENTBUILDER_SITE_VIEW="Site View"

View File

@ -1049,9 +1049,17 @@ class ComponentbuilderModelAjax extends JModelList
{
if (1 == $value)
{
return JText::_('COM_COMPONENTBUILDER_SHOW');
return JText::_('COM_COMPONENTBUILDER_SHOW_TOGGLE');
}
return JText::_('COM_COMPONENTBUILDER_HIDE');
elseif (3 == $value)
{
return JText::_('COM_COMPONENTBUILDER_SHOW_ONLY');
}
elseif (4 == $value)
{
return JText::_('COM_COMPONENTBUILDER_HIDE_ONLY');
}
return JText::_('COM_COMPONENTBUILDER_HIDE_TOGGLE');
}
protected function setTargetRelation($header, $value)

View File

@ -131,9 +131,13 @@
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SHOW</option>
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SHOW_TOGGLE</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE</option>
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE_TOGGLE</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SHOW_ONLY</option>
<option value="4">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE_ONLY</option>
</field>
<!-- Target_relation Field. Type: List. (joomla) -->
<field

View File

@ -1696,7 +1696,7 @@ INSERT INTO `#__componentbuilder_help_document` (`id`, `admin_view`, `alias`, `a
--
INSERT INTO `#__componentbuilder_admin_fields` (`id`, `addfields`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
(111, '{\"0\":{\"field\":\"84\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"tab\":\"1\",\"alignment\":\"3\",\"order_edit\":\"1\",\"permission\":\"0\"},\"1\":{\"field\":\"199\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"1\",\"permission\":\"0\"},\"2\":{\"field\":\"23\",\"order_list\":\"0\",\"alias\":\"1\",\"search\":\"1\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"2\",\"permission\":\"0\"},\"3\":{\"field\":\"203\",\"order_list\":\"0\",\"tab\":\"1\",\"alignment\":\"5\",\"order_edit\":\"1\",\"permission\":\"0\"},\"4\":{\"field\":\"682\",\"order_list\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"tab\":\"2\",\"alignment\":\"1\",\"order_edit\":\"1\",\"permission\":\"0\"},\"5\":{\"field\":\"100\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"1\",\"permission\":\"0\"},\"6\":{\"field\":\"196\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"2\",\"permission\":\"0\"},\"7\":{\"field\":\"1011\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"3\",\"permission\":\"0\"},\"8\":{\"field\":\"158\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"4\",\"permission\":\"0\"},\"9\":{\"field\":\"280\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"5\",\"permission\":\"0\"}}', 109, 1, '2017-10-12 19:52:03', '2018-03-10 23:04:11', 4, '', '');
(111, '{\"0\":{\"field\":\"84\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"tab\":\"1\",\"alignment\":\"3\",\"order_edit\":\"1\"},\"1\":{\"field\":\"199\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"1\"},\"2\":{\"field\":\"23\",\"list\":\"\",\"order_list\":\"0\",\"alias\":\"1\",\"search\":\"1\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"2\"},\"3\":{\"field\":\"203\",\"list\":\"\",\"order_list\":\"0\",\"tab\":\"1\",\"alignment\":\"5\",\"order_edit\":\"1\"},\"4\":{\"field\":\"682\",\"list\":\"\",\"order_list\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"tab\":\"2\",\"alignment\":\"1\",\"order_edit\":\"1\"},\"5\":{\"field\":\"100\",\"list\":\"\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"1\"},\"6\":{\"field\":\"196\",\"list\":\"\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"2\"},\"7\":{\"field\":\"1011\",\"list\":\"\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"3\"},\"8\":{\"field\":\"158\",\"list\":\"\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"4\"},\"9\":{\"field\":\"280\",\"list\":\"\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"5\"}}', 109, 1, '2017-10-12 19:52:03', '2018-09-03 17:02:46', 6, '', '');
--
-- Dumping data for table `#__componentbuilder_admin_fields_conditions`

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>1st September, 2018</creationDate>
<creationDate>8th September, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>

View File

@ -2400,14 +2400,14 @@ abstract class ComponentbuilderHelper
/**
* Get the file path or url
* Get the file path or url
*
* @param string $type The (url/path) type to return
* @param string $target The Params Target name (if set)
* @param string $default The default path if not set in Params (fallback path)
* @param bool $createIfNotSet The switch to create the folder if not found
* @param string $type The (url/path) type to return
* @param string $target The Params Target name (if set)
* @param string $default The default path if not set in Params (fallback path)
* @param bool $createIfNotSet The switch to create the folder if not found
*
* @return string On success the path or url is returned based on the type requested
* @return string On success the path or url is returned based on the type requested
*
*/
public static function getFolderPath($type = 'path', $target = 'folderpath', $default = '', $createIfNotSet = true)
@ -2448,7 +2448,7 @@ abstract class ComponentbuilderHelper
/**
* get the content of a file
*
* @param string $path The path to the file
* @param string $path The path to the file
* @param string/bool $none The return value if no content was found
*
* @return string On success
@ -2597,34 +2597,37 @@ abstract class ComponentbuilderHelper
}
/**
* the locker
* the locker
*
* @var array
* @var array
**/
protected static $locker = array();
/**
* the dynamic replacement salt
* the dynamic replacement salt
*
* @var array
* @var array
**/
protected static $globalSalt = array();
/**
* the timer
* the timer
*
* @var object
* @var object
**/
protected static $keytimer;
/**
* To Lock string
* To Lock string
*
* @param string $string The string/array to lock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url encoding
*
* @return string Encrypted String
*
* @param string $string The string/array to lock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url encoding
**/
public static function lock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true)
{
@ -2638,13 +2641,13 @@ abstract class ComponentbuilderHelper
{
$timer = $salt;
}
// set the default key
$key = self::salt($timer, $dynamic);
// try getting the system key
if (method_exists(get_called_class(), "getCryptKey"))
{
$key = self::getCryptKey('basic', self::salt($timer, $dynamic));
}
else
{
$key = self::salt($timer, $dynamic);
// try getting the medium key first the fall back to basic, and then default
$key = self::getCryptKey('medium', self::getCryptKey('basic', $key));
}
}
// check if we have a salt timer
@ -2663,7 +2666,7 @@ abstract class ComponentbuilderHelper
$string = serialize($string);
}
// prep for url
if ($urlencode)
if ($urlencode && method_exists(get_called_class(), "base64_urlencode"))
{
return self::base64_urlencode(self::$locker[$key]->encryptString($string));
}
@ -2671,13 +2674,16 @@ abstract class ComponentbuilderHelper
}
/**
* To un-Lock string
* To un-Lock string
*
* @param string $string The string to unlock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url decoding
*
* @return string Decrypted String
*
* @param string $string The string to unlock
* @param string $key The custom key to use
* @param int $salt The switch to add salt and type of salt
* @param int $dynamic The dynamic replacement array of salt build string
* @param int $urlencode The switch to control url decoding
**/
public static function unlock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true)
{
@ -2691,14 +2697,13 @@ abstract class ComponentbuilderHelper
{
$timer = $salt;
}
// get secure key
// set the default key
$key = self::salt($timer, $dynamic);
// try getting the system key
if (method_exists(get_called_class(), "getCryptKey"))
{
$key = self::getCryptKey('basic', self::salt($timer, $dynamic));
}
else
{
$key = self::salt($timer, $dynamic);
// try getting the medium key first the fall back to basic, and then default
$key = self::getCryptKey('medium', self::getCryptKey('basic', $key));
}
}
// check if we have a salt timer
@ -2712,7 +2717,7 @@ abstract class ComponentbuilderHelper
self::$locker[$key] = new FOFEncryptAes($key, 128);
}
// make sure we have real base64
if ($urlencode)
if ($urlencode && method_exists(get_called_class(), "base64_urldecode"))
{
$string = self::base64_urldecode($string);
}
@ -2730,10 +2735,13 @@ abstract class ComponentbuilderHelper
}
/**
* The Salt
* The Salt
*
* @param int $type The type of length the salt should be valid
* @param int $dynamic The dynamic replacement array of salt build string
*
* @return string
*
* @param int $type The type of length the salt should be valid
* @param int $dynamic The dynamic replacement array of salt build string
**/
public static function salt($type = 1, $dynamic = null)
{
@ -2778,9 +2786,9 @@ abstract class ComponentbuilderHelper
}
/**
* The function to insure the salt is valid within the given period (third try)
* The function to insure the salt is valid within the given period (third try)
*
* @param int $main The main number
* @param int $main The main number
*/
protected static function periodFix($main)
{
@ -2788,8 +2796,12 @@ abstract class ComponentbuilderHelper
}
/**
* Check if a string is serialized
* @param string $string
* Check if a string is serialized
*
* @param string $string
*
* @return Boolean
*
*/
public static function is_serial($string)
{
@ -2797,7 +2809,7 @@ abstract class ComponentbuilderHelper
}
/**
* Get dynamic replacement salt
* Get dynamic replacement salt
*/
public static function getDynamicSalt($dynamic = null)
{
@ -2814,7 +2826,7 @@ abstract class ComponentbuilderHelper
}
/**
* The random or dynamic secret salt
* The random or dynamic secret salt
*/
public static function getSecretSalt($string = null, $size = 9)
{
@ -2837,7 +2849,7 @@ abstract class ComponentbuilderHelper
}
/**
* Get global replacement salt
* Get global replacement salt
*/
public static function getGlobalSalt()
{
@ -2877,7 +2889,7 @@ abstract class ComponentbuilderHelper
}
/**
* Close public protocol
* Close public protocol
*/
public static function closePublicProtocol($id, $public)
{
@ -2904,7 +2916,7 @@ abstract class ComponentbuilderHelper
}
/**
* Open public protocol
* Open public protocol
*/
public static function openPublicProtocol($SECRET, $ID, $PUBLIC)
{