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

@ -94,20 +94,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
'php_document'
)
),
'mysql' => array(
'left' => array(
'mysql_table_engine',
'mysql_table_charset',
'mysql_table_collate',
'mysql_table_row_format',
'add_sql',
'source',
'addtables'
),
'fullwidth' => array(
'sql'
)
),
'custom_import' => array(
'fullwidth' => array(
'note_beginner_import',
@ -122,6 +108,20 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
'php_import_ext'
)
),
'mysql' => array(
'left' => array(
'mysql_table_engine',
'mysql_table_charset',
'mysql_table_collate',
'mysql_table_row_format',
'add_sql',
'source',
'addtables'
),
'fullwidth' => array(
'sql'
)
),
'settings' => array(
'fullwidth' => array(
'note_on_permissions',
@ -293,76 +293,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->php_import_headers))
if (!empty($item->php_before_cancel))
{
// base64 Decode php_import_headers.
$item->php_import_headers = base64_decode($item->php_import_headers);
}
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_save))
{
// base64 Decode php_import_save.
$item->php_import_save = base64_decode($item->php_import_save);
}
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->css_view))
{
// base64 Decode css_view.
$item->css_view = base64_decode($item->css_view);
}
if (!empty($item->php_getform))
{
// base64 Decode php_getform.
$item->php_getform = base64_decode($item->php_getform);
}
if (!empty($item->php_before_save))
{
// base64 Decode php_before_save.
$item->php_before_save = base64_decode($item->php_before_save);
}
if (!empty($item->css_views))
{
// base64 Decode css_views.
$item->css_views = base64_decode($item->css_views);
}
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_file))
{
// base64 Decode javascript_view_file.
$item->javascript_view_file = base64_decode($item->javascript_view_file);
// base64 Decode php_before_cancel.
$item->php_before_cancel = base64_decode($item->php_before_cancel);
}
if (!empty($item->php_allowadd))
@ -371,64 +305,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_allowadd = base64_decode($item->php_allowadd);
}
if (!empty($item->php_allowedit))
if (!empty($item->php_save))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
// base64 Decode php_save.
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->javascript_view_footer))
if (!empty($item->php_getform))
{
// base64 Decode javascript_view_footer.
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
// base64 Decode php_getform.
$item->php_getform = base64_decode($item->php_getform);
}
if (!empty($item->php_before_cancel))
if (!empty($item->php_import_display))
{
// base64 Decode php_before_cancel.
$item->php_before_cancel = base64_decode($item->php_before_cancel);
}
if (!empty($item->php_after_cancel))
{
// base64 Decode php_after_cancel.
$item->php_after_cancel = base64_decode($item->php_after_cancel);
}
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_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
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_before_publish))
{
// base64 Decode php_before_publish.
$item->php_before_publish = base64_decode($item->php_before_publish);
}
if (!empty($item->php_after_publish))
{
// base64 Decode php_after_publish.
$item->php_after_publish = base64_decode($item->php_after_publish);
// base64 Decode php_import_display.
$item->php_import_display = base64_decode($item->php_import_display);
}
if (!empty($item->php_before_delete))
@ -437,10 +329,76 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_before_delete = base64_decode($item->php_before_delete);
}
if (!empty($item->php_controller))
if (!empty($item->php_batchcopy))
{
// base64 Decode php_controller.
$item->php_controller = base64_decode($item->php_controller);
// 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_document))
{
// base64 Decode php_document.
$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_import_setdata))
{
// base64 Decode php_import_setdata.
$item->php_import_setdata = base64_decode($item->php_import_setdata);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
$item->php_getlistquery = base64_decode($item->php_getlistquery);
}
if (!empty($item->php_before_save))
{
// base64 Decode php_before_save.
$item->php_before_save = base64_decode($item->php_before_save);
}
if (!empty($item->php_postsavehook))
{
// base64 Decode php_postsavehook.
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->php_allowedit))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_after_cancel))
{
// base64 Decode php_after_cancel.
$item->php_after_cancel = base64_decode($item->php_after_cancel);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
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_after_delete))
@ -449,18 +407,66 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_after_delete = base64_decode($item->php_after_delete);
}
if (!empty($item->php_import))
{
// base64 Decode php_import.
$item->php_import = base64_decode($item->php_import);
}
if (!empty($item->php_import_ext))
{
// base64 Decode php_import_ext.
$item->php_import_ext = base64_decode($item->php_import_ext);
}
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_model))
{
// base64 Decode php_model.
$item->php_model = base64_decode($item->php_model);
}
if (!empty($item->php_document))
{
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->php_controller_list))
{
// base64 Decode php_controller_list.
@ -479,34 +485,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
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_getitem))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->php_import))
if (!empty($item->html_import_view))
{
// base64 Decode php_import.
$item->php_import = base64_decode($item->php_import);
// base64 Decode html_import_view.
$item->html_import_view = base64_decode($item->html_import_view);
}
if (!empty($item->php_import_setdata))
if (!empty($item->php_import_headers))
{
// base64 Decode php_import_setdata.
$item->php_import_setdata = base64_decode($item->php_import_setdata);
// base64 Decode php_import_headers.
$item->php_import_headers = base64_decode($item->php_import_headers);
}
if (!empty($item->php_getitems))
@ -515,18 +509,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_import_ext))
if (!empty($item->php_import_save))
{
// base64 Decode php_import_ext.
$item->php_import_ext = base64_decode($item->php_import_ext);
// base64 Decode php_import_save.
$item->php_import_save = base64_decode($item->php_import_save);
}
if (!empty($item->addtables))
if (!empty($item->php_getitems_after_all))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
// base64 Decode php_getitems_after_all.
$item->php_getitems_after_all = base64_decode($item->php_getitems_after_all);
}
if (!empty($item->addpermissions))
@ -569,6 +561,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->custom_button = $custom_button->toArray();
}
if (!empty($item->addtables))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
@ -687,14 +687,14 @@ class ComponentbuilderModelAdmin_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']))
{
@ -796,6 +796,13 @@ class ComponentbuilderModelAdmin_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;
}
@ -1481,19 +1488,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['system_name'] = $data['name_single'];
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid']))
{
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}
// Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables']))
{
$addtables = new JRegistry;
$addtables->loadArray($data['addtables']);
$data['addtables'] = (string) $addtables;
}
elseif (!isset($data['addtables']))
{
// Set the empty addtables to data
$data['addtables'] = '';
}
// Set the addpermissions items to data.
if (isset($data['addpermissions']) && is_array($data['addpermissions']))
@ -1560,6 +1560,19 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['custom_button'] = '';
}
// Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables']))
{
$addtables = new JRegistry;
$addtables->loadArray($data['addtables']);
$data['addtables'] = (string) $addtables;
}
elseif (!isset($data['addtables']))
{
// Set the empty addtables to data
$data['addtables'] = '';
}
// Set the ajax_input items to data.
if (isset($data['ajax_input']) && is_array($data['ajax_input']))
{
@ -1573,76 +1586,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['ajax_input'] = '';
}
// Set the php_import_headers string to base64 string.
if (isset($data['php_import_headers']))
// Set the php_before_cancel string to base64 string.
if (isset($data['php_before_cancel']))
{
$data['php_import_headers'] = base64_encode($data['php_import_headers']);
}
// 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_save string to base64 string.
if (isset($data['php_import_save']))
{
$data['php_import_save'] = base64_encode($data['php_import_save']);
}
// 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 css_view string to base64 string.
if (isset($data['css_view']))
{
$data['css_view'] = base64_encode($data['css_view']);
}
// Set the php_getform string to base64 string.
if (isset($data['php_getform']))
{
$data['php_getform'] = base64_encode($data['php_getform']);
}
// Set the php_before_save string to base64 string.
if (isset($data['php_before_save']))
{
$data['php_before_save'] = base64_encode($data['php_before_save']);
}
// Set the css_views string to base64 string.
if (isset($data['css_views']))
{
$data['css_views'] = base64_encode($data['css_views']);
}
// 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_file string to base64 string.
if (isset($data['javascript_view_file']))
{
$data['javascript_view_file'] = base64_encode($data['javascript_view_file']);
$data['php_before_cancel'] = base64_encode($data['php_before_cancel']);
}
// Set the php_allowadd string to base64 string.
@ -1651,64 +1598,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_allowadd'] = base64_encode($data['php_allowadd']);
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
// Set the php_save string to base64 string.
if (isset($data['php_save']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the javascript_view_footer string to base64 string.
if (isset($data['javascript_view_footer']))
// Set the php_getform string to base64 string.
if (isset($data['php_getform']))
{
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
$data['php_getform'] = base64_encode($data['php_getform']);
}
// Set the php_before_cancel string to base64 string.
if (isset($data['php_before_cancel']))
// Set the php_import_display string to base64 string.
if (isset($data['php_import_display']))
{
$data['php_before_cancel'] = base64_encode($data['php_before_cancel']);
}
// Set the php_after_cancel string to base64 string.
if (isset($data['php_after_cancel']))
{
$data['php_after_cancel'] = base64_encode($data['php_after_cancel']);
}
// 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_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_batchcopy'] = base64_encode($data['php_batchcopy']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// 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_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_after_publish string to base64 string.
if (isset($data['php_after_publish']))
{
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
$data['php_import_display'] = base64_encode($data['php_import_display']);
}
// Set the php_before_delete string to base64 string.
@ -1717,10 +1622,76 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// Set the php_controller string to base64 string.
if (isset($data['php_controller']))
// Set the php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_controller'] = base64_encode($data['php_controller']);
$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_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']))
{
$data['sql'] = base64_encode($data['sql']);
}
// 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 php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
}
// Set the php_before_save string to base64 string.
if (isset($data['php_before_save']))
{
$data['php_before_save'] = base64_encode($data['php_before_save']);
}
// Set the php_postsavehook string to base64 string.
if (isset($data['php_postsavehook']))
{
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// Set the php_after_cancel string to base64 string.
if (isset($data['php_after_cancel']))
{
$data['php_after_cancel'] = base64_encode($data['php_after_cancel']);
}
// 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_publish string to base64 string.
if (isset($data['php_after_publish']))
{
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
}
// Set the php_after_delete string to base64 string.
@ -1729,18 +1700,66 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_after_delete'] = base64_encode($data['php_after_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_import_ext string to base64 string.
if (isset($data['php_import_ext']))
{
$data['php_import_ext'] = base64_encode($data['php_import_ext']);
}
// 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_model string to base64 string.
if (isset($data['php_model']))
{
$data['php_model'] = base64_encode($data['php_model']);
}
// Set the php_document string to base64 string.
if (isset($data['php_document']))
{
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the php_controller_list string to base64 string.
if (isset($data['php_controller_list']))
{
@ -1759,34 +1778,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// 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_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the php_import string to base64 string.
if (isset($data['php_import']))
// Set the html_import_view string to base64 string.
if (isset($data['html_import_view']))
{
$data['php_import'] = base64_encode($data['php_import']);
$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']))
// Set the php_import_headers string to base64 string.
if (isset($data['php_import_headers']))
{
$data['php_import_setdata'] = base64_encode($data['php_import_setdata']);
$data['php_import_headers'] = base64_encode($data['php_import_headers']);
}
// Set the php_getitems string to base64 string.
@ -1795,10 +1802,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_import_ext string to base64 string.
if (isset($data['php_import_ext']))
// Set the php_import_save string to base64 string.
if (isset($data['php_import_save']))
{
$data['php_import_ext'] = base64_encode($data['php_import_ext']);
$data['php_import_save'] = base64_encode($data['php_import_save']);
}
// 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 Params Items to data