Added the option to customize the import of data per view.

This commit is contained in:
2016-05-04 05:53:33 +01:00
parent 951e0c1f5d
commit 6b70aa45e6
374 changed files with 4370 additions and 2718 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4
@build 2nd May, 2016
@version 2.1.5
@build 4th May, 2016
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php
@ -96,46 +96,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->php_allowedit))
if (!empty($item->php_before_delete))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_getitems))
{
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_after_delete))
{
// base64 Decode php_after_delete.
$item->php_after_delete = base64_decode($item->php_after_delete);
}
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_getitem))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
$item->php_getlistquery = base64_decode($item->php_getlistquery);
// base64 Decode php_before_delete.
$item->php_before_delete = base64_decode($item->php_before_delete);
}
if (!empty($item->php_postsavehook))
@ -144,34 +108,76 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
$item->php_getlistquery = base64_decode($item->php_getlistquery);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
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_document))
{
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->sql))
if (!empty($item->php_getitem))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->php_ajaxmethod))
if (!empty($item->html_import_view))
{
// base64 Decode php_ajaxmethod.
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
// base64 Decode html_import_view.
$item->html_import_view = base64_decode($item->html_import_view);
}
if (!empty($item->php_getitems))
{
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_save))
{
// base64 Decode php_save.
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->php_allowedit))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_after_delete))
{
// base64 Decode php_after_delete.
$item->php_after_delete = base64_decode($item->php_after_delete);
}
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))
@ -208,6 +214,18 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
// base64 Decode javascript_views_footer.
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
}
if (!empty($item->php_ajaxmethod))
{
// base64 Decode php_ajaxmethod.
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
}
if (!empty($item->php_import_setdata))
{
// base64 Decode php_import_setdata.
$item->php_import_setdata = base64_decode($item->php_import_setdata);
}
if (!empty($item->id))
@ -226,7 +244,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVxafields()
public function getVxdfields()
{
// Get the user object.
$user = JFactory::getUser();
@ -295,13 +313,13 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
foreach ($items as $nr => &$item)
{
// convert datatype
$item->datatype = $this->selectionTranslationVxafields($item->datatype, 'datatype');
$item->datatype = $this->selectionTranslationVxdfields($item->datatype, 'datatype');
// convert indexes
$item->indexes = $this->selectionTranslationVxafields($item->indexes, 'indexes');
$item->indexes = $this->selectionTranslationVxdfields($item->indexes, 'indexes');
// convert null_switch
$item->null_switch = $this->selectionTranslationVxafields($item->null_switch, 'null_switch');
$item->null_switch = $this->selectionTranslationVxdfields($item->null_switch, 'null_switch');
// convert store
$item->store = $this->selectionTranslationVxafields($item->store, 'store');
$item->store = $this->selectionTranslationVxdfields($item->store, 'store');
}
}
@ -336,7 +354,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return translatable string
*/
public function selectionTranslationVxafields($value,$name)
public function selectionTranslationVxdfields($value,$name)
{
// Array of datatype language strings
if ($name == 'datatype')
@ -1099,46 +1117,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
// Set the php_before_delete string to base64 string.
if (isset($data['php_before_delete']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_after_delete string to base64 string.
if (isset($data['php_after_delete']))
{
$data['php_after_delete'] = base64_encode($data['php_after_delete']);
}
// 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_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// Set the php_postsavehook string to base64 string.
@ -1147,34 +1129,76 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
}
// 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_delete string to base64 string.
if (isset($data['php_before_delete']))
{
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// Set the php_document string to base64 string.
if (isset($data['php_document']))
{
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['sql'] = base64_encode($data['sql']);
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the php_ajaxmethod string to base64 string.
if (isset($data['php_ajaxmethod']))
// Set the html_import_view string to base64 string.
if (isset($data['html_import_view']))
{
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
$data['html_import_view'] = base64_encode($data['html_import_view']);
}
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_save string to base64 string.
if (isset($data['php_save']))
{
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// 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.
if (isset($data['php_after_delete']))
{
$data['php_after_delete'] = base64_encode($data['php_after_delete']);
}
// 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.
@ -1211,6 +1235,18 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if (isset($data['javascript_views_footer']))
{
$data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']);
}
// Set the php_ajaxmethod string to base64 string.
if (isset($data['php_ajaxmethod']))
{
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
}
// 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 Params Items to data