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

@ -229,14 +229,14 @@ class ComponentbuilderModelClass_method 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']))
{
@ -338,6 +338,13 @@ class ComponentbuilderModelClass_method 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;
}
@ -960,7 +967,14 @@ class ComponentbuilderModelClass_method extends JModelAdmin
}
// make sure the name is safe to be used as a function name
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid']))
{
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}
// Set the code string to base64 string.
if (isset($data['code']))