Fixed the subform to allow encryption of values without data lose.

This commit is contained in:
Llewellyn van der Merwe 2018-04-30 14:06:05 +02:00
parent cec566176d
commit 8b4efd640f
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
20 changed files with 340 additions and 280 deletions

View File

@ -126,11 +126,11 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th April, 2018
+ *Last Build*: 30th April, 2018
+ *Version*: 2.7.6
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **193274**
+ *Line count*: **193305**
+ *Field count*: **1027**
+ *File count*: **1201**
+ *Folder count*: **193**

View File

@ -126,11 +126,11 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th April, 2018
+ *Last Build*: 30th April, 2018
+ *Version*: 2.7.6
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **193274**
+ *Line count*: **193305**
+ *Field count*: **1027**
+ *File count*: **1201**
+ *Folder count*: **193**

View File

@ -2013,7 +2013,18 @@ class Fields extends Structure
// set the decoding methods
if (in_array($set, $decode))
{
$this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']] = array('decode' => $set, 'type' => $type);
if (isset($this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']]) &&
isset($this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']]['decode']))
{
if (!in_array($set, $this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']]['decode']))
{
$this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']]['decode'][] = $set;
}
}
else
{
$this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']] = array('decode' => array($set), 'type' => $type);
}
}
// set the uikit checker
if ((2 == $this->uikit || 1 == $this->uikit) && in_array($type, $textareas))
@ -2556,6 +2567,7 @@ class Fields extends Structure
// setup checkboxes and other json items for this view
if ($dbSwitch && (($typeName === 'subform' || $typeName === 'checkboxes' || $multiple || $field['settings']->store != 0) && $typeName != 'tag'))
{
$subformJsonSwitch = true;
switch ($field['settings']->store)
{
case 1:
@ -2593,6 +2605,8 @@ class Fields extends Structure
$this->jsonItemBuilder[$view_name_single][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData($view_name_single, $name, 'json', $typeName);
// no londer add the json again (already added)
$subformJsonSwitch = false;
break;
}
// just a heads-up for usergroups set to multiple
@ -2614,10 +2628,19 @@ class Fields extends Structure
}
}
// if subform the values must revert to array
// subform house keeping
if ('subform' === $typeName)
{
// the values must revert to array
$this->jsonItemBuilderArray[$view_name_single][] = $name;
// should the json builder still be added
if ($subformJsonSwitch)
{
// and insure the if is converted to json
$this->jsonItemBuilder[$view_name_single][] = $name;
// Site settings of each field if needed
$this->buildSiteFieldData($view_name_single, $name, 'json', $typeName);
}
}
}
// build the data for the export & import methods $typeName === 'repeatable' ||

View File

@ -1686,37 +1686,43 @@ class Interpretation extends Fields
$fieldDecode = '';
foreach ($checker as $field => $array)
{
if (strpos($get['selection']['select'], $field) !== false)
if (strpos($get['selection']['select'], $field) !== false && ComponentbuilderHelper::checkArray($array['decode']))
{
if ('json' === $array['decode'])
// insure it is unique
$array['decode'] = (array) array_unique(array_reverse((array) $array['decode']));
// now loop the array
foreach ($array['decode'] as $decode)
{
$if = PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . "\t" . $tab . "\t{";
// json_decode
$decoder = $string . "->" . $field . " = json_decode(" . $string . "->" . $field . ", true);";
}
elseif ('base64' === $array['decode'])
{
$if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ")))" . PHP_EOL . "\t" . $tab . "\t{";
// base64_decode
$decoder = $string . "->" . $field . " = base64_decode(" . $string . "->" . $field . ");";
}
elseif (strpos($array['decode'], '_encryption') !== false)
{
foreach ($this->cryptionTypes as $cryptionType)
if ('json' === $decode)
{
if ($cryptionType . '_encryption' === $array['decode'])
$if = PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . "\t" . $tab . "\t{";
// json_decode
$decoder = $string . "->" . $field . " = json_decode(" . $string . "->" . $field . ", true);";
}
elseif ('base64' === $decode)
{
$if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ")))" . PHP_EOL . "\t" . $tab . "\t{";
// base64_decode
$decoder = $string . "->" . $field . " = base64_decode(" . $string . "->" . $field . ");";
}
elseif (strpos($decode, '_encryption') !== false)
{
foreach ($this->cryptionTypes as $cryptionType)
{
$if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && \$" . $cryptionType . "key && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . "\t" . $tab . "\t{";
// set decryption
$decoder = $string . "->" . $field . " = rtrim(\$" . $cryptionType . "->decryptString(" . $string . "->" . $field . "), " . '"\0"' . ");";
$this->siteDecrypt[$cryptionType][$code] = true;
if ($cryptionType . '_encryption' === $decode)
{
$if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && \$" . $cryptionType . "key && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . "\t" . $tab . "\t{";
// set decryption
$decoder = $string . "->" . $field . " = rtrim(\$" . $cryptionType . "->decryptString(" . $string . "->" . $field . "), " . '"\0"' . ");";
$this->siteDecrypt[$cryptionType][$code] = true;
}
}
}
}
// build decoder string
$fieldDecode .= $if . PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Decode " . $field;
$fieldDecode .= PHP_EOL . "\t" . $tab . "\t\t" . $decoder . PHP_EOL . "\t" . $tab . "\t}";
// build decoder string
$fieldDecode .= $if . PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Decode " . $field;
$fieldDecode .= PHP_EOL . "\t" . $tab . "\t\t" . $decoder . PHP_EOL . "\t" . $tab . "\t}";
}
}
}
return $fieldDecode;
@ -4246,6 +4252,39 @@ class Interpretation extends Fields
public function setMethodGetItem(&$view)
{
$script = '';
// get the component name
$Component = $this->fileContentStatic['###Component###'];
// go from base64 to string
if (isset($this->base64Builder[$view]) && ComponentbuilderHelper::checkArray($this->base64Builder[$view]))
{
foreach ($this->base64Builder[$view] as $baseString)
{
$script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . "))"; // TODO && base64_encode(base64_decode(\$item->".$baseString.", true)) === \$item->".$baseString.")";
$script .= PHP_EOL . "\t\t\t{";
$script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " base64 Decode " . $baseString . ".";
$script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = base64_decode(\$item->" . $baseString . ");";
$script .= PHP_EOL . "\t\t\t}";
}
}
// decryption
foreach ($this->cryptionTypes as $cryptionType)
{
if (isset($this->{$cryptionType . 'EncryptionBuilder'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'EncryptionBuilder'}[$view]))
{
$script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption.";
$script .= PHP_EOL . "\t\t\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');";
$script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the encryption object.";
$script .= PHP_EOL . "\t\t\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);";
foreach ($this->{$cryptionType . 'EncryptionBuilder'}[$view] as $baseString)
{
$script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . ") && \$" . $cryptionType . "key && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))";
$script .= PHP_EOL . "\t\t\t{";
$script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $cryptionType . " decrypt data " . $baseString . ".";
$script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = rtrim(\$" . $cryptionType . "->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");";
$script .= PHP_EOL . "\t\t\t}";
}
}
}
// go from json to array
if (isset($this->jsonItemBuilder[$view]) && ComponentbuilderHelper::checkArray($this->jsonItemBuilder[$view]))
{
@ -4281,39 +4320,6 @@ class Interpretation extends Fields
$script .= PHP_EOL . "\t\t\t}";
}
}
// go from base64 to string
if (isset($this->base64Builder[$view]) && ComponentbuilderHelper::checkArray($this->base64Builder[$view]))
{
foreach ($this->base64Builder[$view] as $baseString)
{
$script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . "))"; // TODO && base64_encode(base64_decode(\$item->".$baseString.", true)) === \$item->".$baseString.")";
$script .= PHP_EOL . "\t\t\t{";
$script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " base64 Decode " . $baseString . ".";
$script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = base64_decode(\$item->" . $baseString . ");";
$script .= PHP_EOL . "\t\t\t}";
}
}
// get the component name
$Component = $this->fileContentStatic['###Component###'];
// decryption
foreach ($this->cryptionTypes as $cryptionType)
{
if (isset($this->{$cryptionType . 'EncryptionBuilder'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'EncryptionBuilder'}[$view]))
{
$script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption.";
$script .= PHP_EOL . "\t\t\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');";
$script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the encryption object.";
$script .= PHP_EOL . "\t\t\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);";
foreach ($this->{$cryptionType . 'EncryptionBuilder'}[$view] as $baseString)
{
$script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . ") && \$" . $cryptionType . "key && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))";
$script .= PHP_EOL . "\t\t\t{";
$script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $cryptionType . " decrypt data " . $baseString . ".";
$script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = rtrim(\$" . $cryptionType . "->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");";
$script .= PHP_EOL . "\t\t\t}";
}
}
}
// add custom php to getitem method
$script .= $this->getCustomScriptBuilder('php_getitem', $view, PHP_EOL . PHP_EOL);

View File

@ -2650,6 +2650,23 @@ abstract class ComponentbuilderHelper
*/
protected static $curlErrorLoaded = false;
/**
* check if a worker has more work
*
* @param string $function The function to target to perform the task
*
* @return bool
*
*/
public static function hasWork(&$function)
{
if (isset(self::$worker[$function]) && self::checkArray(self::$worker[$function]))
{
return count( (array) self::$worker[$function]);
}
return false;
}
/**
* Set a worker url
*

View File

@ -100,62 +100,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->addpermissions))
{
// Convert the addpermissions field to an array.
$addpermissions = new Registry;
$addpermissions->loadString($item->addpermissions);
$item->addpermissions = $addpermissions->toArray();
}
if (!empty($item->addtabs))
{
// Convert the addtabs field to an array.
$addtabs = new Registry;
$addtabs->loadString($item->addtabs);
$item->addtabs = $addtabs->toArray();
}
if (!empty($item->addlinked_views))
{
// Convert the addlinked_views field to an array.
$addlinked_views = new Registry;
$addlinked_views->loadString($item->addlinked_views);
$item->addlinked_views = $addlinked_views->toArray();
}
if (!empty($item->addtables))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
}
if (!empty($item->alias_builder))
{
// Convert the alias_builder field to an array.
$alias_builder = new Registry;
$alias_builder->loadString($item->alias_builder);
$item->alias_builder = $alias_builder->toArray();
}
if (!empty($item->custom_button))
{
// Convert the custom_button field to an array.
$custom_button = new Registry;
$custom_button->loadString($item->custom_button);
$item->custom_button = $custom_button->toArray();
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
$ajax_input = new Registry;
$ajax_input->loadString($item->ajax_input);
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->html_import_view))
{
// base64 Decode html_import_view.
@ -360,6 +304,62 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_ext = base64_decode($item->php_import_ext);
}
if (!empty($item->addpermissions))
{
// Convert the addpermissions field to an array.
$addpermissions = new Registry;
$addpermissions->loadString($item->addpermissions);
$item->addpermissions = $addpermissions->toArray();
}
if (!empty($item->addtabs))
{
// Convert the addtabs field to an array.
$addtabs = new Registry;
$addtabs->loadString($item->addtabs);
$item->addtabs = $addtabs->toArray();
}
if (!empty($item->addlinked_views))
{
// Convert the addlinked_views field to an array.
$addlinked_views = new Registry;
$addlinked_views->loadString($item->addlinked_views);
$item->addlinked_views = $addlinked_views->toArray();
}
if (!empty($item->addtables))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
}
if (!empty($item->alias_builder))
{
// Convert the alias_builder field to an array.
$alias_builder = new Registry;
$alias_builder->loadString($item->alias_builder);
$item->alias_builder = $alias_builder->toArray();
}
if (!empty($item->custom_button))
{
// Convert the custom_button field to an array.
$custom_button = new Registry;
$custom_button->loadString($item->custom_button);
$item->custom_button = $custom_button->toArray();
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
$ajax_input = new Registry;
$ajax_input->loadString($item->ajax_input);
$item->ajax_input = $ajax_input->toArray();
}
if (empty($item->id))
{

View File

@ -95,6 +95,12 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->php_dashboard_methods))
{
// base64 Decode php_dashboard_methods.
$item->php_dashboard_methods = base64_decode($item->php_dashboard_methods);
}
if (!empty($item->dashboard_tab))
{
// Convert the dashboard_tab field to an array.
@ -103,12 +109,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$item->dashboard_tab = $dashboard_tab->toArray();
}
if (!empty($item->php_dashboard_methods))
{
// base64 Decode php_dashboard_methods.
$item->php_dashboard_methods = base64_decode($item->php_dashboard_methods);
}
// update the fields
$objectUpdate = new stdClass();
$objectUpdate->id = (int) $item->id;

View File

@ -100,38 +100,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
$ajax_input = new Registry;
$ajax_input->loadString($item->ajax_input);
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (!empty($item->custom_get))
{
// Convert the custom_get field to an array.
$custom_get = new Registry;
$custom_get->loadString($item->custom_get);
$item->custom_get = $custom_get->toArray();
}
if (!empty($item->custom_button))
{
// Convert the custom_button field to an array.
$custom_button = new Registry;
$custom_button->loadString($item->custom_button);
$item->custom_button = $custom_button->toArray();
}
if (!empty($item->php_jview_display))
{
// base64 Decode php_jview_display.
@ -204,6 +172,38 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->php_model = base64_decode($item->php_model);
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
$ajax_input = new Registry;
$ajax_input->loadString($item->ajax_input);
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (!empty($item->custom_get))
{
// Convert the custom_get field to an array.
$custom_get = new Registry;
$custom_get->loadString($item->custom_get);
$item->custom_get = $custom_get->toArray();
}
if (!empty($item->custom_button))
{
// Convert the custom_button field to an array.
$custom_button = new Registry;
$custom_button->loadString($item->custom_button);
$item->custom_button = $custom_button->toArray();
}
if (empty($item->id))
{

View File

@ -100,54 +100,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->filter))
{
// Convert the filter field to an array.
$filter = new Registry;
$filter->loadString($item->filter);
$item->filter = $filter->toArray();
}
if (!empty($item->where))
{
// Convert the where field to an array.
$where = new Registry;
$where->loadString($item->where);
$item->where = $where->toArray();
}
if (!empty($item->order))
{
// Convert the order field to an array.
$order = new Registry;
$order->loadString($item->order);
$item->order = $order->toArray();
}
if (!empty($item->global))
{
// Convert the global field to an array.
$global = new Registry;
$global->loadString($item->global);
$item->global = $global->toArray();
}
if (!empty($item->join_view_table))
{
// Convert the join_view_table field to an array.
$join_view_table = new Registry;
$join_view_table->loadString($item->join_view_table);
$item->join_view_table = $join_view_table->toArray();
}
if (!empty($item->join_db_table))
{
// Convert the join_db_table field to an array.
$join_db_table = new Registry;
$join_db_table->loadString($item->join_db_table);
$item->join_db_table = $join_db_table->toArray();
}
if (!empty($item->php_custom_get))
{
// base64 Decode php_custom_get.
@ -196,6 +148,54 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$item->php_calculation = base64_decode($item->php_calculation);
}
if (!empty($item->filter))
{
// Convert the filter field to an array.
$filter = new Registry;
$filter->loadString($item->filter);
$item->filter = $filter->toArray();
}
if (!empty($item->where))
{
// Convert the where field to an array.
$where = new Registry;
$where->loadString($item->where);
$item->where = $where->toArray();
}
if (!empty($item->order))
{
// Convert the order field to an array.
$order = new Registry;
$order->loadString($item->order);
$item->order = $order->toArray();
}
if (!empty($item->global))
{
// Convert the global field to an array.
$global = new Registry;
$global->loadString($item->global);
$item->global = $global->toArray();
}
if (!empty($item->join_view_table))
{
// Convert the join_view_table field to an array.
$join_view_table = new Registry;
$join_view_table->loadString($item->join_view_table);
$item->join_view_table = $join_view_table->toArray();
}
if (!empty($item->join_db_table))
{
// Convert the join_db_table field to an array.
$join_db_table = new Registry;
$join_db_table->loadString($item->join_db_table);
$item->join_db_table = $join_db_table->toArray();
}
if (empty($item->id))
{

View File

@ -100,12 +100,6 @@ class ComponentbuilderModelField extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->xml))
{
// JSON Decode xml.
$item->xml = json_decode($item->xml);
}
if (!empty($item->css_views))
{
// base64 Decode css_views.
@ -130,6 +124,12 @@ class ComponentbuilderModelField extends JModelAdmin
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
}
if (!empty($item->xml))
{
// JSON Decode xml.
$item->xml = json_decode($item->xml);
}
if (empty($item->id))
{

View File

@ -1141,8 +1141,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
max="20"
min="1">
max="20">
<form hidden="true" name="list_custom_button_modal" repeat="true">
<!-- Icomoon Field. Type: List. (joomla) -->
<field

View File

@ -612,8 +612,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
max="20"
min="1">
max="20">
<form hidden="true" name="list_custom_button_modal" repeat="true">
<!-- Icomoon Field. Type: List. (joomla) -->
<field

View File

@ -631,8 +631,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
max="20"
min="1">
max="20">
<form hidden="true" name="list_custom_button_modal" repeat="true">
<!-- Icomoon Field. Type: List. (joomla) -->
<field

View File

@ -100,14 +100,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->addcontributors))
{
// Convert the addcontributors field to an array.
$addcontributors = new Registry;
$addcontributors->loadString($item->addcontributors);
$item->addcontributors = $addcontributors->toArray();
}
if (!empty($item->php_postflight_update))
{
// base64 Decode php_postflight_update.
@ -221,6 +213,14 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$item->export_key = rtrim($basic->decryptString($item->export_key), "\0");
}
if (!empty($item->addcontributors))
{
// Convert the addcontributors field to an array.
$addcontributors = new Registry;
$addcontributors->loadString($item->addcontributors);
$item->addcontributors = $addcontributors->toArray();
}
if (empty($item->id))
{

View File

@ -100,14 +100,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (!empty($item->php_view))
{
// base64 Decode php_view.
@ -120,6 +112,14 @@ class ComponentbuilderModelLayout extends JModelAdmin
$item->layout = base64_decode($item->layout);
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (empty($item->id))
{

View File

@ -100,6 +100,12 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->php_setdocument))
{
// base64 Decode php_setdocument.
$item->php_setdocument = base64_decode($item->php_setdocument);
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
@ -116,12 +122,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$item->addconditions = $addconditions->toArray();
}
if (!empty($item->php_setdocument))
{
// base64 Decode php_setdocument.
$item->php_setdocument = base64_decode($item->php_setdocument);
}
if (empty($item->id))
{

View File

@ -100,38 +100,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
$ajax_input = new Registry;
$ajax_input->loadString($item->ajax_input);
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (!empty($item->custom_get))
{
// Convert the custom_get field to an array.
$custom_get = new Registry;
$custom_get->loadString($item->custom_get);
$item->custom_get = $custom_get->toArray();
}
if (!empty($item->custom_button))
{
// Convert the custom_button field to an array.
$custom_button = new Registry;
$custom_button->loadString($item->custom_button);
$item->custom_button = $custom_button->toArray();
}
if (!empty($item->php_document))
{
// base64 Decode php_document.
@ -204,6 +172,38 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->php_model = base64_decode($item->php_model);
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
$ajax_input = new Registry;
$ajax_input->loadString($item->ajax_input);
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (!empty($item->custom_get))
{
// Convert the custom_get field to an array.
$custom_get = new Registry;
$custom_get->loadString($item->custom_get);
$item->custom_get = $custom_get->toArray();
}
if (!empty($item->custom_button))
{
// Convert the custom_button field to an array.
$custom_button = new Registry;
$custom_button->loadString($item->custom_button);
$item->custom_button = $custom_button->toArray();
}
if (empty($item->id))
{

View File

@ -100,14 +100,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (!empty($item->php_view))
{
// base64 Decode php_view.
@ -120,6 +112,14 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$item->template = base64_decode($item->template);
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (empty($item->id))
{

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>27th April, 2018</creationDate>
<creationDate>30th April, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://joomlacomponentbuilder.com</authorUrl>

View File

@ -2650,6 +2650,23 @@ abstract class ComponentbuilderHelper
*/
protected static $curlErrorLoaded = false;
/**
* check if a worker has more work
*
* @param string $function The function to target to perform the task
*
* @return bool
*
*/
public static function hasWork(&$function)
{
if (isset(self::$worker[$function]) && self::checkArray(self::$worker[$function]))
{
return count( (array) self::$worker[$function]);
}
return false;
}
/**
* Set a worker url
*