Adapted the compiler to use the new tables and subforms for the joomla component. Improved the compiler to make more use of the array_map function

This commit is contained in:
2017-10-29 13:03:06 +02:00
parent 2bab5e2721
commit 6003b45b7a
476 changed files with 1324 additions and 2745 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 243 of this MVC
@build 27th October, 2017
@version @update number 244 of this MVC
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 243 of this MVC
@build 27th October, 2017
@version @update number 244 of this MVC
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ajax.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_admin_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 23rd October, 2017
@package Component Builder
@subpackage component_config.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 23rd October, 2017
@package Component Builder
@subpackage component_custom_admin_menus.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_custom_admin_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 26th October, 2017
@package Component Builder
@subpackage component_dashboard.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 26th October, 2017
@package Component Builder
@subpackage component_files_folders.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_mysql_tweaks.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 26th October, 2017
@version @update number 4 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_site_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 26th October, 2017
@version @update number 8 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_updates.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage components_admin_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 23rd October, 2017
@package Component Builder
@subpackage components_config.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 23rd October, 2017
@package Component Builder
@subpackage components_custom_admin_menus.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage components_custom_admin_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 26th October, 2017
@package Component Builder
@subpackage components_dashboard.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 26th October, 2017
@package Component Builder
@subpackage components_files_folders.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage components_mysql_tweaks.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 26th October, 2017
@version @update number 4 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage components_site_views.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 26th October, 2017
@version @update number 8 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage components_updates.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminsviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage articles.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage component.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentadminmenus.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentadminviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage components.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customadminviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfilelist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customgets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dbtables.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicget.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicgets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ftps.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage joomlacomponents.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage lang.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage maingets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage matchfield.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage snippets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage targetfields.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage viewtabs.php

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 243 of this MVC
@build 27th October, 2017
@version @update number 244 of this MVC
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_admin_views.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 23rd October, 2017
@package Component Builder
@subpackage component_config.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 23rd October, 2017
@package Component Builder
@subpackage component_custom_admin_menus.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_custom_admin_views.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 4 of this MVC
@build 26th October, 2017
@version @update number 5 of this MVC
@build 29th October, 2017
@created 26th October, 2017
@package Component Builder
@subpackage component_dashboard.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 26th October, 2017
@package Component Builder
@subpackage component_files_folders.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 5 of this MVC
@build 26th October, 2017
@version @update number 6 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_mysql_tweaks.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
@build 26th October, 2017
@version @update number 4 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_site_views.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 26th October, 2017
@version @update number 8 of this MVC
@build 29th October, 2017
@created 22nd October, 2017
@package Component Builder
@subpackage component_updates.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 505 of this MVC
@build 27th October, 2017
@version @update number 508 of this MVC
@build 29th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_component.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.9
@build 28th October, 2017
@build 29th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import_joomla_components.php
@ -1005,7 +1005,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
// convert Repetable Fields
if (ComponentbuilderHelper::checkArray($addlinked_views) && isset($addlinked_views['adminview']))
{
$addlinked_views = $this->convertRepeatable($addlinked_views, 'addlinked_views');
$addlinked_views = ComponentbuilderHelper::convertRepeatable($addlinked_views, 'addlinked_views');
}
// update the view IDs
if (ComponentbuilderHelper::checkArray($addlinked_views))
@ -1051,68 +1051,6 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
}
}
/*
* Convert repeatable field to subform
*
* @param array $item The array to convert
* @param string $name The main field name
* @param array $updater The updater (dynamic) option
*
* @return array
*/
protected function convertRepeatable($item, $name)
{
// continue only if we have an array
if (ComponentbuilderHelper::checkArray($item))
{
$bucket = array();
foreach ($item as $key => $values)
{
foreach ($values as $nr => $value)
{
if (!isset($bucket[$name . $nr]) || !ComponentbuilderHelper::checkArray($bucket[$name . $nr]))
{
$bucket[$name . $nr] = array();
}
$bucket[$name . $nr][$key] = $value;
}
}
return $bucket;
}
return $item;
}
/*
* Convert repeatable field to subform
*
* @param object $item The item to update
* @param json $updater The fields to check and update
*
* @return void
*/
protected function convertRepeatableFields($object, $updater)
{
// update the repeatable fields
foreach ($updater as $up => $sleutel)
{
if (isset($object->{$up}) && ComponentbuilderHelper::checkJson($object->{$up}))
{
$updateArray = json_decode($object->{$up}, true);
// check if this is old values for repeatable fields
if (ComponentbuilderHelper::checkArray($updateArray) && isset($updateArray[$sleutel]))
{
// load it back
$object->{$up} = json_encode($this->convertRepeatable($updateArray, $up));
}
}
elseif (isset($object->{$up}))
{
unset($object->{$up});
}
}
return $object;
}
/**
* Update Many Subform IDs
*
@ -1376,7 +1314,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
'properties' => 'name'
);
// update the repeatable fields
$item = $this->convertRepeatableFields($item, $updaterR);
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
break;
case 'field':
// update the fieldtype
@ -1417,7 +1355,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
'filter' => 'filter_type'
);
// update the repeatable fields
$item = $this->convertRepeatableFields($item, $updaterR);
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
// subform fields to target
$updaterT = array(
// subformfield => field => type_value
@ -1450,7 +1388,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
'custom_button' => 'name'
);
// update the repeatable fields
$item = $this->convertRepeatableFields($item, $updaterR);
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
break;
case 'admin_view':
// we must clear the demo content (since it was not moved as far as we know) TODO
@ -1509,7 +1447,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
'addpermissions' => 'action'
);
// update the repeatable fields
$item = $this->convertRepeatableFields($item, $updaterR);
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
break;
case 'joomla_component':
// update the addconfig
@ -1764,7 +1702,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
}
// update the repeatable fields
$item = $this->convertRepeatableFields($item, $updaterR);
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
// update the subform ids
$this->updateSubformsIDs($item, $type, $updaterT);
@ -1887,7 +1825,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
// check if this is old values for repeatable fields
if (isset($properties['name']))
{
$properties = $this->convertRepeatable($properties, 'properties');
$properties = ComponentbuilderHelper::convertRepeatable($properties, 'properties');
}
// now check to find type
foreach ($properties as $property)

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 505 of this MVC
@build 27th October, 2017
@version @update number 508 of this MVC
@build 29th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_component.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 505 of this MVC
@build 27th October, 2017
@version @update number 508 of this MVC
@build 29th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_components.php