Added (Linked To) back in related areas, so we can see where what is linked. Added ajax fields to the custom admin view. Added some backward compatibility to stylesheets and scripts being added, resolved gh-217. Fixed gh-212 no access lang string. Added the site CSS area to Joomla Component view resolved gh-216.

This commit is contained in:
2018-01-15 17:54:05 +02:00
parent 423df415fa
commit 98510ae504
144 changed files with 6453 additions and 5362 deletions

View File

@@ -64,6 +64,11 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
public function getTable($type = 'custom_admin_view', $prefix = 'ComponentbuilderTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getVDM()
{
return $this->vastDevMod;
}
/**
@@ -103,6 +108,14 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->libraries = $libraries->toArray();
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
$ajax_input = new Registry;
$ajax_input->loadString($item->ajax_input);
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->custom_get))
{
// Convert the custom_get field to an array.
@@ -119,10 +132,28 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->custom_button = $custom_button->toArray();
}
if (!empty($item->php_controller))
if (!empty($item->php_document))
{
// base64 Decode php_controller.
$item->php_controller = base64_decode($item->php_controller);
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->php_jview_display))
{
// base64 Decode php_jview_display.
$item->php_jview_display = base64_decode($item->php_jview_display);
}
if (!empty($item->php_view))
{
// base64 Decode php_view.
$item->php_view = base64_decode($item->php_view);
}
if (!empty($item->php_jview))
{
// base64 Decode php_jview.
$item->php_jview = base64_decode($item->php_jview);
}
if (!empty($item->default))
@@ -131,12 +162,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->default = base64_decode($item->default);
}
if (!empty($item->php_model))
{
// base64 Decode php_model.
$item->php_model = base64_decode($item->php_model);
}
if (!empty($item->js_document))
{
// base64 Decode js_document.
@@ -161,30 +186,45 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->css = base64_decode($item->css);
}
if (!empty($item->php_document))
if (!empty($item->php_ajaxmethod))
{
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
// base64 Decode php_ajaxmethod.
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
}
if (!empty($item->php_view))
if (!empty($item->php_controller))
{
// base64 Decode php_view.
$item->php_view = base64_decode($item->php_view);
// base64 Decode php_controller.
$item->php_controller = base64_decode($item->php_controller);
}
if (!empty($item->php_jview_display))
if (!empty($item->php_model))
{
// base64 Decode php_jview_display.
$item->php_jview_display = base64_decode($item->php_jview_display);
}
if (!empty($item->php_jview))
{
// base64 Decode php_jview.
$item->php_jview = base64_decode($item->php_jview);
// base64 Decode php_model.
$item->php_model = base64_decode($item->php_model);
}
if (empty($item->id))
{
$id = 0;
}
else
{
$id = $item->id;
}
// set the id and view name to session
if ($vdm = ComponentbuilderHelper::get('custom_admin_view__'.$id))
{
$this->vastDevMod = $vdm;
}
else
{
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'custom_admin_view__'.$id);
ComponentbuilderHelper::set('custom_admin_view__'.$id, $this->vastDevMod);
}
// 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']))
@@ -945,6 +985,19 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$data['libraries'] = '';
}
// Set the ajax_input items to data.
if (isset($data['ajax_input']) && is_array($data['ajax_input']))
{
$ajax_input = new JRegistry;
$ajax_input->loadArray($data['ajax_input']);
$data['ajax_input'] = (string) $ajax_input;
}
elseif (!isset($data['ajax_input']))
{
// Set the empty ajax_input to data
$data['ajax_input'] = '';
}
// Set the custom_get items to data.
if (isset($data['custom_get']) && is_array($data['custom_get']))
{
@@ -971,10 +1024,28 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$data['custom_button'] = '';
}
// Set the php_controller string to base64 string.
if (isset($data['php_controller']))
// Set the php_document string to base64 string.
if (isset($data['php_document']))
{
$data['php_controller'] = base64_encode($data['php_controller']);
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the php_jview_display string to base64 string.
if (isset($data['php_jview_display']))
{
$data['php_jview_display'] = base64_encode($data['php_jview_display']);
}
// Set the php_view string to base64 string.
if (isset($data['php_view']))
{
$data['php_view'] = base64_encode($data['php_view']);
}
// Set the php_jview string to base64 string.
if (isset($data['php_jview']))
{
$data['php_jview'] = base64_encode($data['php_jview']);
}
// Set the default string to base64 string.
@@ -983,12 +1054,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$data['default'] = base64_encode($data['default']);
}
// Set the php_model string to base64 string.
if (isset($data['php_model']))
{
$data['php_model'] = base64_encode($data['php_model']);
}
// Set the js_document string to base64 string.
if (isset($data['js_document']))
{
@@ -1013,28 +1078,22 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$data['css'] = base64_encode($data['css']);
}
// Set the php_document string to base64 string.
if (isset($data['php_document']))
// Set the php_ajaxmethod string to base64 string.
if (isset($data['php_ajaxmethod']))
{
$data['php_document'] = base64_encode($data['php_document']);
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
}
// Set the php_view string to base64 string.
if (isset($data['php_view']))
// Set the php_controller string to base64 string.
if (isset($data['php_controller']))
{
$data['php_view'] = base64_encode($data['php_view']);
$data['php_controller'] = base64_encode($data['php_controller']);
}
// Set the php_jview_display string to base64 string.
if (isset($data['php_jview_display']))
// Set the php_model string to base64 string.
if (isset($data['php_model']))
{
$data['php_jview_display'] = base64_encode($data['php_jview_display']);
}
// Set the php_jview string to base64 string.
if (isset($data['php_jview']))
{
$data['php_jview'] = base64_encode($data['php_jview']);
$data['php_model'] = base64_encode($data['php_model']);
}
// Set the Params Items to data