Added GUID to selected views, and started updating JCB accordingly.

This commit is contained in:
2020-01-03 03:41:55 +02:00
parent a317ba855f
commit 46e52db097
122 changed files with 7142 additions and 6262 deletions

View File

@@ -83,6 +83,11 @@ class ComponentbuilderModelSite_view extends JModelAdmin
'css'
)
),
'linked_components' => array(
'fullwidth' => array(
'note_linked_to_notice'
)
),
'custom_buttons' => array(
'left' => array(
'add_custom_button'
@@ -96,11 +101,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
'php_controller',
'php_model'
)
),
'linked_components' => array(
'fullwidth' => array(
'note_linked_to_notice'
)
)
);
@@ -215,40 +215,10 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->php_document))
if (!empty($item->js_document))
{
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->php_view))
{
// base64 Decode php_view.
$item->php_view = base64_decode($item->php_view);
}
if (!empty($item->default))
{
// base64 Decode default.
$item->default = base64_decode($item->default);
}
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_jview))
{
// base64 Decode php_jview.
$item->php_jview = base64_decode($item->php_jview);
}
if (!empty($item->php_model))
{
// base64 Decode php_model.
$item->php_model = base64_decode($item->php_model);
// base64 Decode js_document.
$item->js_document = base64_decode($item->js_document);
}
if (!empty($item->javascript_file))
@@ -257,10 +227,10 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->javascript_file = base64_decode($item->javascript_file);
}
if (!empty($item->js_document))
if (!empty($item->default))
{
// base64 Decode js_document.
$item->js_document = base64_decode($item->js_document);
// base64 Decode default.
$item->default = base64_decode($item->default);
}
if (!empty($item->css_document))
@@ -281,12 +251,42 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
}
if (!empty($item->php_document))
{
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->php_view))
{
// base64 Decode php_view.
$item->php_view = base64_decode($item->php_view);
}
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_jview))
{
// base64 Decode php_jview.
$item->php_jview = base64_decode($item->php_jview);
}
if (!empty($item->php_controller))
{
// base64 Decode php_controller.
$item->php_controller = base64_decode($item->php_controller);
}
if (!empty($item->php_model))
{
// base64 Decode php_model.
$item->php_model = base64_decode($item->php_model);
}
if (!empty($item->custom_get))
{
// Convert the custom_get field to an array.
@@ -295,14 +295,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->custom_get = $custom_get->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->libraries))
{
// Convert the libraries field to an array.
@@ -311,6 +303,14 @@ class ComponentbuilderModelSite_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_button))
{
// Convert the custom_button field to an array.
@@ -416,14 +416,14 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{
// set load data option
$options['load_data'] = $loadData;
// // check if xpath was set in options
// check if xpath was set in options
$xpath = false;
if (isset($options['xpath']))
{
$xpath = $options['xpath'];
unset($options['xpath']);
}
// // check if clear form was set in options
// check if clear form was set in options
$clear = false;
if (isset($options['clear']))
{
@@ -523,6 +523,13 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
// Only load the GUID if new item
if (0 == $id)
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
return $form;
}
@@ -1134,7 +1141,14 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{
// always make safe string
$data['context'] = ComponentbuilderHelper::safeString($data['context']);
}
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid']))
{
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}
// Set the custom_get items to data.
if (isset($data['custom_get']) && is_array($data['custom_get']))
@@ -1149,19 +1163,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$data['custom_get'] = '';
}
// 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 libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries']))
{
@@ -1175,6 +1176,19 @@ class ComponentbuilderModelSite_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_button items to data.
if (isset($data['custom_button']) && is_array($data['custom_button']))
{
@@ -1188,40 +1202,10 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$data['custom_button'] = '';
}
// Set the php_document string to base64 string.
if (isset($data['php_document']))
// Set the js_document string to base64 string.
if (isset($data['js_document']))
{
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the php_view string to base64 string.
if (isset($data['php_view']))
{
$data['php_view'] = base64_encode($data['php_view']);
}
// Set the default string to base64 string.
if (isset($data['default']))
{
$data['default'] = base64_encode($data['default']);
}
// 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_jview string to base64 string.
if (isset($data['php_jview']))
{
$data['php_jview'] = base64_encode($data['php_jview']);
}
// Set the php_model string to base64 string.
if (isset($data['php_model']))
{
$data['php_model'] = base64_encode($data['php_model']);
$data['js_document'] = base64_encode($data['js_document']);
}
// Set the javascript_file string to base64 string.
@@ -1230,10 +1214,10 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$data['javascript_file'] = base64_encode($data['javascript_file']);
}
// Set the js_document string to base64 string.
if (isset($data['js_document']))
// Set the default string to base64 string.
if (isset($data['default']))
{
$data['js_document'] = base64_encode($data['js_document']);
$data['default'] = base64_encode($data['default']);
}
// Set the css_document string to base64 string.
@@ -1254,10 +1238,40 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
}
// Set the php_document string to base64 string.
if (isset($data['php_document']))
{
$data['php_document'] = base64_encode($data['php_document']);
}
// 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_display string to base64 string.
if (isset($data['php_jview_display']))
{
$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']);
}
// Set the php_controller string to base64 string.
if (isset($data['php_controller']))
{
$data['php_controller'] = base64_encode($data['php_controller']);
}
// Set the php_model string to base64 string.
if (isset($data['php_model']))
{
$data['php_model'] = base64_encode($data['php_model']);
}
// Set the Params Items to data