Further gh-53 implementation of the export and import of complete components as JCB packages. Fixes gh-56

This commit is contained in:
2017-03-27 14:38:51 +02:00
parent 63b1bac955
commit 8b522f44d9
243 changed files with 4548 additions and 2296 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 104 of this MVC
@build 6th March, 2017
@version @update number 108 of this MVC
@build 24th March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php
@ -95,124 +95,34 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->html_import_view))
{
// base64 Decode html_import_view.
$item->html_import_view = base64_decode($item->html_import_view);
}
if (!empty($item->php_import_setdata))
{
// base64 Decode php_import_setdata.
$item->php_import_setdata = base64_decode($item->php_import_setdata);
}
if (!empty($item->css_view))
{
// base64 Decode css_view.
$item->css_view = base64_decode($item->css_view);
}
if (!empty($item->php_getitem))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->php_getitems))
{
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->css_views))
{
// base64 Decode css_views.
$item->css_views = base64_decode($item->css_views);
}
if (!empty($item->php_getitems_after_all))
{
// base64 Decode php_getitems_after_all.
$item->php_getitems_after_all = base64_decode($item->php_getitems_after_all);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
$item->php_getlistquery = base64_decode($item->php_getlistquery);
}
if (!empty($item->javascript_view_file))
{
// base64 Decode javascript_view_file.
$item->javascript_view_file = base64_decode($item->javascript_view_file);
}
if (!empty($item->php_save))
{
// base64 Decode php_save.
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->php_postsavehook))
{
// base64 Decode php_postsavehook.
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->javascript_view_footer))
{
// base64 Decode javascript_view_footer.
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
}
if (!empty($item->php_allowedit))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
if (!empty($item->javascript_views_file))
{
// base64 Decode javascript_views_file.
$item->javascript_views_file = base64_decode($item->javascript_views_file);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_before_publish))
{
// base64 Decode php_before_publish.
$item->php_before_publish = base64_decode($item->php_before_publish);
}
if (!empty($item->javascript_views_footer))
{
// base64 Decode javascript_views_footer.
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
}
if (!empty($item->php_after_publish))
{
// base64 Decode php_after_publish.
$item->php_after_publish = base64_decode($item->php_after_publish);
}
if (!empty($item->php_before_delete))
if (!empty($item->php_allowedit))
{
// base64 Decode php_before_delete.
$item->php_before_delete = base64_decode($item->php_before_delete);
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_save))
{
// base64 Decode php_save.
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_after_delete))
@ -221,10 +131,46 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_after_delete = base64_decode($item->php_after_delete);
}
if (!empty($item->php_controller))
if (!empty($item->php_getitems))
{
// base64 Decode php_controller.
$item->php_controller = base64_decode($item->php_controller);
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
$item->php_getlistquery = base64_decode($item->php_getlistquery);
}
if (!empty($item->php_postsavehook))
{
// base64 Decode php_postsavehook.
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
if (!empty($item->php_before_publish))
{
// base64 Decode php_before_publish.
$item->php_before_publish = base64_decode($item->php_before_publish);
}
if (!empty($item->php_before_delete))
{
// base64 Decode php_before_delete.
$item->php_before_delete = base64_decode($item->php_before_delete);
}
if (!empty($item->php_import))
{
// base64 Decode php_import.
$item->php_import = base64_decode($item->php_import);
}
if (!empty($item->php_document))
@ -233,6 +179,72 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->php_getitem))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->php_import_display))
{
// base64 Decode php_import_display.
$item->php_import_display = base64_decode($item->php_import_display);
}
if (!empty($item->php_import_save))
{
// base64 Decode php_import_save.
$item->php_import_save = base64_decode($item->php_import_save);
}
if (!empty($item->css_view))
{
// base64 Decode css_view.
$item->css_view = base64_decode($item->css_view);
}
if (!empty($item->css_views))
{
// base64 Decode css_views.
$item->css_views = base64_decode($item->css_views);
}
if (!empty($item->javascript_view_file))
{
// base64 Decode javascript_view_file.
$item->javascript_view_file = base64_decode($item->javascript_view_file);
}
if (!empty($item->javascript_view_footer))
{
// base64 Decode javascript_view_footer.
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
}
if (!empty($item->javascript_views_file))
{
// base64 Decode javascript_views_file.
$item->javascript_views_file = base64_decode($item->javascript_views_file);
}
if (!empty($item->javascript_views_footer))
{
// base64 Decode javascript_views_footer.
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
}
if (!empty($item->php_controller))
{
// base64 Decode php_controller.
$item->php_controller = base64_decode($item->php_controller);
}
if (!empty($item->php_controller_list))
{
// base64 Decode php_controller_list.
@ -245,22 +257,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_model = base64_decode($item->php_model);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->php_model_list))
{
// base64 Decode php_model_list.
$item->php_model_list = base64_decode($item->php_model_list);
}
if (!empty($item->php_import_display))
if (!empty($item->html_import_view))
{
// base64 Decode php_import_display.
$item->php_import_display = base64_decode($item->php_import_display);
// base64 Decode html_import_view.
$item->html_import_view = base64_decode($item->html_import_view);
}
if (!empty($item->php_ajaxmethod))
@ -269,16 +275,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
}
if (!empty($item->php_import))
if (!empty($item->php_import_setdata))
{
// base64 Decode php_import.
$item->php_import = base64_decode($item->php_import);
// base64 Decode php_import_setdata.
$item->php_import_setdata = base64_decode($item->php_import_setdata);
}
if (!empty($item->php_import_save))
if (!empty($item->php_import_ext))
{
// base64 Decode php_import_save.
$item->php_import_save = base64_decode($item->php_import_save);
// base64 Decode php_import_ext.
$item->php_import_ext = base64_decode($item->php_import_ext);
}
if (!empty($item->id))
@ -298,7 +304,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVxvfields()
public function getVxwfields()
{
// Get the user object.
$user = JFactory::getUser();
@ -367,13 +373,13 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
foreach ($items as $nr => &$item)
{
// convert datatype
$item->datatype = $this->selectionTranslationVxvfields($item->datatype, 'datatype');
$item->datatype = $this->selectionTranslationVxwfields($item->datatype, 'datatype');
// convert indexes
$item->indexes = $this->selectionTranslationVxvfields($item->indexes, 'indexes');
$item->indexes = $this->selectionTranslationVxwfields($item->indexes, 'indexes');
// convert null_switch
$item->null_switch = $this->selectionTranslationVxvfields($item->null_switch, 'null_switch');
$item->null_switch = $this->selectionTranslationVxwfields($item->null_switch, 'null_switch');
// convert store
$item->store = $this->selectionTranslationVxvfields($item->store, 'store');
$item->store = $this->selectionTranslationVxwfields($item->store, 'store');
}
}
@ -413,7 +419,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return translatable string
*/
public function selectionTranslationVxvfields($value,$name)
public function selectionTranslationVxwfields($value,$name)
{
// Array of datatype language strings
if ($name === 'datatype')
@ -491,7 +497,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVxwlinked_components()
public function getVxxlinked_components()
{
// Get the user object.
$user = JFactory::getUser();
@ -1272,124 +1278,34 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// Set the html_import_view string to base64 string.
if (isset($data['html_import_view']))
{
$data['html_import_view'] = base64_encode($data['html_import_view']);
}
// Set the php_import_setdata string to base64 string.
if (isset($data['php_import_setdata']))
{
$data['php_import_setdata'] = base64_encode($data['php_import_setdata']);
}
// Set the css_view string to base64 string.
if (isset($data['css_view']))
{
$data['css_view'] = base64_encode($data['css_view']);
}
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the css_views string to base64 string.
if (isset($data['css_views']))
{
$data['css_views'] = base64_encode($data['css_views']);
}
// Set the php_getitems_after_all string to base64 string.
if (isset($data['php_getitems_after_all']))
{
$data['php_getitems_after_all'] = base64_encode($data['php_getitems_after_all']);
}
// Set the php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
}
// Set the javascript_view_file string to base64 string.
if (isset($data['javascript_view_file']))
{
$data['javascript_view_file'] = base64_encode($data['javascript_view_file']);
}
// Set the php_save string to base64 string.
if (isset($data['php_save']))
{
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the php_postsavehook string to base64 string.
if (isset($data['php_postsavehook']))
{
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the javascript_view_footer string to base64 string.
if (isset($data['javascript_view_footer']))
{
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// Set the php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_batchcopy'] = base64_encode($data['php_batchcopy']);
}
// Set the javascript_views_file string to base64 string.
if (isset($data['javascript_views_file']))
{
$data['javascript_views_file'] = base64_encode($data['javascript_views_file']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_before_publish string to base64 string.
if (isset($data['php_before_publish']))
{
$data['php_before_publish'] = base64_encode($data['php_before_publish']);
}
// Set the javascript_views_footer string to base64 string.
if (isset($data['javascript_views_footer']))
{
$data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']);
}
// Set the php_after_publish string to base64 string.
if (isset($data['php_after_publish']))
{
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
}
// Set the php_before_delete string to base64 string.
if (isset($data['php_before_delete']))
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
{
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// Set the php_save string to base64 string.
if (isset($data['php_save']))
{
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_after_delete string to base64 string.
@ -1398,10 +1314,46 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_after_delete'] = base64_encode($data['php_after_delete']);
}
// Set the php_controller string to base64 string.
if (isset($data['php_controller']))
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_controller'] = base64_encode($data['php_controller']);
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
}
// Set the php_postsavehook string to base64 string.
if (isset($data['php_postsavehook']))
{
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_batchcopy'] = base64_encode($data['php_batchcopy']);
}
// Set the php_before_publish string to base64 string.
if (isset($data['php_before_publish']))
{
$data['php_before_publish'] = base64_encode($data['php_before_publish']);
}
// Set the php_before_delete string to base64 string.
if (isset($data['php_before_delete']))
{
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// Set the php_import string to base64 string.
if (isset($data['php_import']))
{
$data['php_import'] = base64_encode($data['php_import']);
}
// Set the php_document string to base64 string.
@ -1410,6 +1362,72 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the php_import_display string to base64 string.
if (isset($data['php_import_display']))
{
$data['php_import_display'] = base64_encode($data['php_import_display']);
}
// Set the php_import_save string to base64 string.
if (isset($data['php_import_save']))
{
$data['php_import_save'] = base64_encode($data['php_import_save']);
}
// Set the css_view string to base64 string.
if (isset($data['css_view']))
{
$data['css_view'] = base64_encode($data['css_view']);
}
// Set the css_views string to base64 string.
if (isset($data['css_views']))
{
$data['css_views'] = base64_encode($data['css_views']);
}
// Set the javascript_view_file string to base64 string.
if (isset($data['javascript_view_file']))
{
$data['javascript_view_file'] = base64_encode($data['javascript_view_file']);
}
// Set the javascript_view_footer string to base64 string.
if (isset($data['javascript_view_footer']))
{
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
}
// Set the javascript_views_file string to base64 string.
if (isset($data['javascript_views_file']))
{
$data['javascript_views_file'] = base64_encode($data['javascript_views_file']);
}
// Set the javascript_views_footer string to base64 string.
if (isset($data['javascript_views_footer']))
{
$data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']);
}
// Set the php_controller string to base64 string.
if (isset($data['php_controller']))
{
$data['php_controller'] = base64_encode($data['php_controller']);
}
// Set the php_controller_list string to base64 string.
if (isset($data['php_controller_list']))
{
@ -1422,22 +1440,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_model'] = base64_encode($data['php_model']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the php_model_list string to base64 string.
if (isset($data['php_model_list']))
{
$data['php_model_list'] = base64_encode($data['php_model_list']);
}
// Set the php_import_display string to base64 string.
if (isset($data['php_import_display']))
// Set the html_import_view string to base64 string.
if (isset($data['html_import_view']))
{
$data['php_import_display'] = base64_encode($data['php_import_display']);
$data['html_import_view'] = base64_encode($data['html_import_view']);
}
// Set the php_ajaxmethod string to base64 string.
@ -1446,16 +1458,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
}
// Set the php_import string to base64 string.
if (isset($data['php_import']))
// Set the php_import_setdata string to base64 string.
if (isset($data['php_import_setdata']))
{
$data['php_import'] = base64_encode($data['php_import']);
$data['php_import_setdata'] = base64_encode($data['php_import_setdata']);
}
// Set the php_import_save string to base64 string.
if (isset($data['php_import_save']))
// Set the php_import_ext string to base64 string.
if (isset($data['php_import_ext']))
{
$data['php_import_save'] = base64_encode($data['php_import_save']);
$data['php_import_ext'] = base64_encode($data['php_import_ext']);
}
// Sort fields by "Tab" ASC, "Order in Edit" ASC