Decoupled fields and conditions from admin view as explained in gh-136. Added new admin_fields and admin_fields_conditions tables and moved the data from admin_view to these new tables.
This commit is contained in:
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 126 of this MVC
|
||||
@build 11th October, 2017
|
||||
@version @update number 136 of this MVC
|
||||
@build 12th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_view.php
|
||||
@ -64,6 +64,11 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
public function getTable($type = 'admin_view', $prefix = 'ComponentbuilderTable', $config = array())
|
||||
{
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
public function getVDM()
|
||||
{
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -119,22 +124,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$item->addlinked_views = $addlinked_views->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->addfields))
|
||||
{
|
||||
// Convert the addfields field to an array.
|
||||
$addfields = new Registry;
|
||||
$addfields->loadString($item->addfields);
|
||||
$item->addfields = $addfields->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->addconditions))
|
||||
{
|
||||
// Convert the addconditions field to an array.
|
||||
$addconditions = new Registry;
|
||||
$addconditions->loadString($item->addconditions);
|
||||
$item->addconditions = $addconditions->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->custom_button))
|
||||
{
|
||||
// Convert the custom_button field to an array.
|
||||
@ -261,10 +250,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$item->php_import_display = base64_decode($item->php_import_display);
|
||||
}
|
||||
|
||||
if (!empty($item->php_getitem))
|
||||
if (!empty($item->css_view))
|
||||
{
|
||||
// base64 Decode php_getitem.
|
||||
$item->php_getitem = base64_decode($item->php_getitem);
|
||||
// base64 Decode css_view.
|
||||
$item->css_view = base64_decode($item->css_view);
|
||||
}
|
||||
|
||||
if (!empty($item->php_import_save))
|
||||
@ -273,12 +262,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$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.
|
||||
@ -351,11 +334,38 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$item->php_import_setdata = base64_decode($item->php_import_setdata);
|
||||
}
|
||||
|
||||
if (!empty($item->php_getitem))
|
||||
{
|
||||
// base64 Decode php_getitem.
|
||||
$item->php_getitem = base64_decode($item->php_getitem);
|
||||
}
|
||||
|
||||
if (!empty($item->php_import_ext))
|
||||
{
|
||||
// base64 Decode php_import_ext.
|
||||
$item->php_import_ext = base64_decode($item->php_import_ext);
|
||||
}
|
||||
|
||||
|
||||
if (empty($item->id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $item->id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('admin_view__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
|
||||
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
@ -1192,32 +1202,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$data['addlinked_views'] = '';
|
||||
}
|
||||
|
||||
// Set the addfields items to data.
|
||||
if (isset($data['addfields']) && is_array($data['addfields']))
|
||||
{
|
||||
$addfields = new JRegistry;
|
||||
$addfields->loadArray($data['addfields']);
|
||||
$data['addfields'] = (string) $addfields;
|
||||
}
|
||||
elseif (!isset($data['addfields']))
|
||||
{
|
||||
// Set the empty addfields to data
|
||||
$data['addfields'] = '';
|
||||
}
|
||||
|
||||
// Set the addconditions items to data.
|
||||
if (isset($data['addconditions']) && is_array($data['addconditions']))
|
||||
{
|
||||
$addconditions = new JRegistry;
|
||||
$addconditions->loadArray($data['addconditions']);
|
||||
$data['addconditions'] = (string) $addconditions;
|
||||
}
|
||||
elseif (!isset($data['addconditions']))
|
||||
{
|
||||
// Set the empty addconditions to data
|
||||
$data['addconditions'] = '';
|
||||
}
|
||||
|
||||
// Set the custom_button items to data.
|
||||
if (isset($data['custom_button']) && is_array($data['custom_button']))
|
||||
{
|
||||
@ -1359,10 +1343,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$data['php_import_display'] = base64_encode($data['php_import_display']);
|
||||
}
|
||||
|
||||
// Set the php_getitem string to base64 string.
|
||||
if (isset($data['php_getitem']))
|
||||
// Set the css_view string to base64 string.
|
||||
if (isset($data['css_view']))
|
||||
{
|
||||
$data['php_getitem'] = base64_encode($data['php_getitem']);
|
||||
$data['css_view'] = base64_encode($data['css_view']);
|
||||
}
|
||||
|
||||
// Set the php_import_save string to base64 string.
|
||||
@ -1371,12 +1355,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$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']))
|
||||
{
|
||||
@ -1449,6 +1427,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$data['php_import_setdata'] = base64_encode($data['php_import_setdata']);
|
||||
}
|
||||
|
||||
// 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_ext string to base64 string.
|
||||
if (isset($data['php_import_ext']))
|
||||
{
|
||||
|
Reference in New Issue
Block a user