Added field fix in models to help with the change from repeatable fields to subform fields. Added ajax to load admin fields and conditions into the admin view.

This commit is contained in:
2017-10-14 05:37:18 +02:00
parent f7b168d762
commit 2b7914f05d
361 changed files with 1081 additions and 466 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 58 of this MVC
@build 9th October, 2017
@version @update number 63 of this MVC
@build 14th October, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_view.php
@ -183,6 +183,45 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{
// base64 Decode php_jview.
$item->php_jview = base64_decode($item->php_jview);
}
// update the fields
$objectUpdate = new stdClass();
$objectUpdate->id = (int) $item->id;
// check what type of custom_button array we have here (should be subform... but just incase)
// This could happen due to huge data sets
if (isset($item->custom_button) && isset($item->custom_button['name']))
{
$bucket = array();
foreach($item->custom_button as $option => $values)
{
foreach($values as $nr => $value)
{
$bucket['custom_button'.$nr][$option] = $value;
}
}
$item->custom_button = $bucket;
$objectUpdate->custom_button = json_encode($bucket);
}
// check what type of ajax_input array we have here (should be subform... but just incase)
// This could happen due to huge data sets
if (isset($item->ajax_input) && isset($item->ajax_input['value_name']))
{
$bucket = array();
foreach($item->ajax_input as $option => $values)
{
foreach($values as $nr => $value)
{
$bucket['ajax_input'.$nr][$option] = $value;
}
}
$item->ajax_input = $bucket;
$objectUpdate->ajax_input = json_encode($bucket);
}
// be sure to update the table if we found repeatable fields that are still not converted
if (count((array) $objectUpdate) > 1)
{
$this->_db->updateObject('#__componentbuilder_site_view', $objectUpdate, 'id');
}
if (!empty($item->id))