Release of v3.2.1-beta1

Add fallback option to ensure that all JCB tables and fields exist. Move the powers autoloader to its own file.
This commit is contained in:
2024-04-22 00:59:42 +02:00
parent 3a48b5596c
commit 5e980f5f95
98 changed files with 11195 additions and 6926 deletions

View File

@ -2814,7 +2814,7 @@ class ComponentbuilderModelAjax extends ListModel
// #__componentbuilder_joomla_component (a)
'joomla_component' => array(
'search' => array('id', 'system_name', 'php_preflight_install', 'php_postflight_install',
'php_preflight_update', 'php_postflight_update', 'php_method_uninstall',
'php_preflight_update', 'php_postflight_update', 'php_method_uninstall', 'php_method_install',
'php_helper_admin', 'php_admin_event', 'php_helper_both', 'php_helper_site',
'php_site_event', 'javascript', 'readme', 'sql', 'sql_uninstall'),
'views' => 'joomla_components',

View File

@ -257,7 +257,7 @@ class ComponentbuilderModelFieldtype extends AdminModel
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVycfields()
public function getVxtfields()
{
// Get the user object.
$user = Factory::getUser();
@ -399,13 +399,13 @@ class ComponentbuilderModelFieldtype extends AdminModel
foreach ($items as $nr => &$item)
{
// convert datatype
$item->datatype = $this->selectionTranslationVycfields($item->datatype, 'datatype');
$item->datatype = $this->selectionTranslationVxtfields($item->datatype, 'datatype');
// convert indexes
$item->indexes = $this->selectionTranslationVycfields($item->indexes, 'indexes');
$item->indexes = $this->selectionTranslationVxtfields($item->indexes, 'indexes');
// convert null_switch
$item->null_switch = $this->selectionTranslationVycfields($item->null_switch, 'null_switch');
$item->null_switch = $this->selectionTranslationVxtfields($item->null_switch, 'null_switch');
// convert store
$item->store = $this->selectionTranslationVycfields($item->store, 'store');
$item->store = $this->selectionTranslationVxtfields($item->store, 'store');
}
}
@ -419,7 +419,7 @@ class ComponentbuilderModelFieldtype extends AdminModel
*
* @return string The translatable string.
*/
public function selectionTranslationVycfields($value,$name)
public function selectionTranslationVxtfields($value,$name)
{
// Array of datatype language strings
if ($name === 'datatype')

View File

@ -886,7 +886,7 @@
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_SQL_HINT"
required="true"
showon="add_sql:1"
/>
<!-- Note_category_menu_switch Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_category_menu_switch" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CATEGORY_MENU_SWITCH_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CATEGORY_MENU_SWITCH_DESCRIPTION" heading="h4" class="alert alert-info note_category_menu_switch" />

File diff suppressed because it is too large Load Diff

View File

@ -198,7 +198,8 @@
name="addreadme"
label="COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDREADME_LABEL"
class="btn-group btn-group-yesno"
default="0">
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_JOOMLA_MODULE_YES</option>
@ -357,6 +358,7 @@
class="list_class"
multiple="false"
default="0"
showon="add_sales_server:1"
button="true"
/>
<!-- Custom_get Field. Type: Customgets. (custom) -->
@ -383,6 +385,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_preflight_update:1"
/>
<!-- Note_mod_file_options Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_mod_file_options" label="COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_MOD_FILE_OPTIONS_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_MOD_FILE_OPTIONS_DESCRIPTION" heading="h4" class="alert alert-info note_mod_file_options" />
@ -401,6 +404,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_preflight_uninstall:1"
/>
<!-- Mod_code Field. Type: Editor. (joomla) -->
<field
@ -434,6 +438,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_postflight_install:1"
/>
<!-- Add_class_helper Field. Type: List. (joomla) -->
<field
@ -468,6 +473,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_postflight_update:1"
/>
<!-- Add_class_helper_header Field. Type: Radio. (joomla) -->
<field
@ -498,6 +504,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_method_uninstall:1"
/>
<!-- Class_helper_header Field. Type: Editor. (joomla) -->
<field
@ -527,7 +534,7 @@
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_JOOMLA_MODULE_SQL_HINT"
required="true"
showon="add_sql:1"
/>
<!-- Class_helper_code Field. Type: Editor. (joomla) -->
<field
@ -556,7 +563,7 @@
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_JOOMLA_MODULE_SQL_UNINSTALL_HINT"
required="true"
showon="add_sql_uninstall:1"
/>
<!-- Fields Field. Type: Subform. (joomla) -->
<field
@ -761,6 +768,7 @@
buttons="false"
editor="none"
filter="raw"
showon="addreadme:1"
/>
<!-- Add_php_script_construct Field. Type: Radio. (joomla) -->
<field
@ -783,13 +791,13 @@
label="COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATE_SERVER_URL_LABEL"
size="60"
maxlength="150"
default=""
description="COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATE_SERVER_URL_DESCRIPTION"
class="text_area span12"
filter="url"
validated="url"
message="COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATE_SERVER_URL_MESSAGE"
hint="COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATE_SERVER_URL_HINT"
showon="add_update_server:1"
/>
<!-- Php_script_construct Field. Type: Editor. (joomla) -->
<field
@ -806,6 +814,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_script_construct:1"
/>
<!-- Note_update_server_note_ftp Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_update_server_note_ftp" label="COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_UPDATE_SERVER_NOTE_FTP_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_UPDATE_SERVER_NOTE_FTP_DESCRIPTION" heading="h4" class="alert alert-success note_update_server_note_ftp" />
@ -840,6 +849,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_preflight_install:1"
/>
<!-- Add_sales_server Field. Type: Radio. (joomla) -->
<field

View File

@ -195,6 +195,7 @@
class="list_class"
multiple="false"
default="0"
showon="add_sales_server:1"
button="true"
/>
<!-- Note_update_server_note_zip Field. Type: Note. A None Database Field. (joomla) -->
@ -301,7 +302,8 @@
name="addreadme"
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDREADME_LABEL"
class="btn-group btn-group-yesno"
default="0">
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_JOOMLA_PLUGIN_YES</option>
@ -404,6 +406,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_postflight_install:1"
/>
<!-- Plugin_version Field. Type: Text. (joomla) -->
<field
@ -435,6 +438,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_postflight_update:1"
/>
<!-- Fields Field. Type: Subform. (joomla) -->
<field
@ -643,6 +647,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_method_uninstall:1"
/>
<!-- Add_php_script_construct Field. Type: Radio. (joomla) -->
<field
@ -669,7 +674,7 @@
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_SQL_HINT"
required="true"
showon="add_sql:1"
/>
<!-- Php_script_construct Field. Type: Editor. (joomla) -->
<field
@ -686,6 +691,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_script_construct:1"
/>
<!-- Sql_uninstall Field. Type: Textarea. (joomla) -->
<field
@ -698,7 +704,7 @@
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_SQL_UNINSTALL_HINT"
required="true"
showon="add_sql_uninstall:1"
/>
<!-- Add_php_preflight_install Field. Type: Radio. (joomla) -->
<field
@ -725,6 +731,7 @@
buttons="false"
editor="none"
filter="raw"
showon="addreadme:1"
/>
<!-- Php_preflight_install Field. Type: Editor. (joomla) -->
<field
@ -741,6 +748,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_preflight_install:1"
/>
<!-- Update_server_url Field. Type: Url. (joomla) -->
<field
@ -749,13 +757,13 @@
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATE_SERVER_URL_LABEL"
size="60"
maxlength="150"
default=""
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATE_SERVER_URL_DESCRIPTION"
class="text_area span12"
filter="url"
validated="url"
message="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATE_SERVER_URL_MESSAGE"
hint="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATE_SERVER_URL_HINT"
showon="add_update_server:1"
/>
<!-- Add_php_preflight_update Field. Type: Radio. (joomla) -->
<field
@ -788,6 +796,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_preflight_update:1"
/>
<!-- Note_update_server_note_other Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_update_server_note_other" label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_UPDATE_SERVER_NOTE_OTHER_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_UPDATE_SERVER_NOTE_OTHER_DESCRIPTION" heading="h4" class="alert alert-success note_update_server_note_other" />
@ -834,6 +843,7 @@
editor="codemirror|none"
filter="raw"
validate="code"
showon="add_php_preflight_uninstall:1"
/>
<!-- Guid Field. Type: Text. (joomla) -->
<field

View File

@ -84,11 +84,28 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'not_required'
)
),
'dynamic_build' => array(
'libs_helpers' => array(
'fullwidth' => array(
'note_buildcomp_dynamic_mysql',
'buildcomp',
'buildcompsql'
'creatuserhelper',
'adduikit',
'addfootable',
'add_email_helper',
'add_php_helper_both',
'php_helper_both',
'add_php_helper_admin',
'php_helper_admin',
'add_admin_event',
'php_admin_event',
'add_php_helper_site',
'php_helper_site',
'add_site_event',
'php_site_event',
'add_javascript',
'javascript',
'add_css_admin',
'css_admin',
'add_css_site',
'css_site'
)
),
'dynamic_integration' => array(
@ -120,15 +137,6 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'crowdin_account_api_key'
)
),
'mysql' => array(
'fullwidth' => array(
'add_sql',
'sql',
'add_sql_uninstall',
'sql_uninstall',
'assets_table_fix'
)
),
'dash_install' => array(
'left' => array(
'dashboard_type'
@ -148,31 +156,9 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'add_php_postflight_update',
'php_postflight_update',
'add_php_method_uninstall',
'php_method_uninstall'
)
),
'libs_helpers' => array(
'fullwidth' => array(
'creatuserhelper',
'adduikit',
'addfootable',
'add_email_helper',
'add_php_helper_both',
'php_helper_both',
'add_php_helper_admin',
'php_helper_admin',
'add_admin_event',
'php_admin_event',
'add_php_helper_site',
'php_helper_site',
'add_site_event',
'php_site_event',
'add_javascript',
'javascript',
'add_css_admin',
'css_admin',
'add_css_site',
'css_site'
'php_method_uninstall',
'add_php_method_install',
'php_method_install'
)
),
'readme' => array(
@ -184,6 +170,22 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'note_readme'
)
),
'mysql' => array(
'fullwidth' => array(
'add_sql',
'sql',
'add_sql_uninstall',
'sql_uninstall',
'assets_table_fix'
)
),
'dynamic_build' => array(
'fullwidth' => array(
'note_buildcomp_dynamic_mysql',
'buildcomp',
'buildcompsql'
)
),
'settings' => array(
'left' => array(
'note_moved_views',
@ -369,42 +371,18 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$item->metadata = $registry->toArray();
}
if (!empty($item->sql_uninstall))
{
// base64 Decode sql_uninstall.
$item->sql_uninstall = base64_decode($item->sql_uninstall);
}
if (!empty($item->php_postflight_install))
{
// base64 Decode php_postflight_install.
$item->php_postflight_install = base64_decode($item->php_postflight_install);
}
if (!empty($item->php_site_event))
{
// base64 Decode php_site_event.
$item->php_site_event = base64_decode($item->php_site_event);
}
if (!empty($item->php_helper_both))
{
// base64 Decode php_helper_both.
$item->php_helper_both = base64_decode($item->php_helper_both);
}
if (!empty($item->php_admin_event))
{
// base64 Decode php_admin_event.
$item->php_admin_event = base64_decode($item->php_admin_event);
}
if (!empty($item->css_admin))
{
// base64 Decode css_admin.
$item->css_admin = base64_decode($item->css_admin);
}
if (!empty($item->php_preflight_install))
{
// base64 Decode php_preflight_install.
@ -417,6 +395,30 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
}
if (!empty($item->css_admin))
{
// base64 Decode css_admin.
$item->css_admin = base64_decode($item->css_admin);
}
if (!empty($item->php_postflight_install))
{
// base64 Decode php_postflight_install.
$item->php_postflight_install = base64_decode($item->php_postflight_install);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->buildcompsql))
{
// base64 Decode buildcompsql.
$item->buildcompsql = base64_decode($item->buildcompsql);
}
if (!empty($item->php_helper_admin))
{
// base64 Decode php_helper_admin.
@ -453,16 +455,16 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$item->php_postflight_update = base64_decode($item->php_postflight_update);
}
if (!empty($item->sql))
if (!empty($item->php_method_install))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
// base64 Decode php_method_install.
$item->php_method_install = base64_decode($item->php_method_install);
}
if (!empty($item->buildcompsql))
if (!empty($item->sql_uninstall))
{
// base64 Decode buildcompsql.
$item->buildcompsql = base64_decode($item->buildcompsql);
// base64 Decode sql_uninstall.
$item->sql_uninstall = base64_decode($item->sql_uninstall);
}
if (!empty($item->readme))
@ -471,23 +473,29 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$item->readme = base64_decode($item->readme);
}
if (!empty($item->php_helper_both))
{
// base64 Decode php_helper_both.
$item->php_helper_both = base64_decode($item->php_helper_both);
}
// Get the basic encryption.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encryption object.
$basic = new AES($basickey);
if (!empty($item->whmcs_key) && $basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
{
// basic decrypt data whmcs_key.
$item->whmcs_key = rtrim($basic->decryptString($item->whmcs_key), "\0");
}
if (!empty($item->crowdin_username) && $basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true)))
{
// basic decrypt data crowdin_username.
$item->crowdin_username = rtrim($basic->decryptString($item->crowdin_username), "\0");
}
if (!empty($item->whmcs_key) && $basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
{
// basic decrypt data whmcs_key.
$item->whmcs_key = rtrim($basic->decryptString($item->whmcs_key), "\0");
}
if (!empty($item->export_key) && $basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
{
// basic decrypt data export_key.
@ -1441,42 +1449,18 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$data['addcontributors'] = '';
}
// Set the sql_uninstall string to base64 string.
if (isset($data['sql_uninstall']))
{
$data['sql_uninstall'] = base64_encode($data['sql_uninstall']);
}
// Set the php_postflight_install string to base64 string.
if (isset($data['php_postflight_install']))
{
$data['php_postflight_install'] = base64_encode($data['php_postflight_install']);
}
// Set the php_site_event string to base64 string.
if (isset($data['php_site_event']))
{
$data['php_site_event'] = base64_encode($data['php_site_event']);
}
// Set the php_helper_both string to base64 string.
if (isset($data['php_helper_both']))
{
$data['php_helper_both'] = base64_encode($data['php_helper_both']);
}
// Set the php_admin_event string to base64 string.
if (isset($data['php_admin_event']))
{
$data['php_admin_event'] = base64_encode($data['php_admin_event']);
}
// Set the css_admin string to base64 string.
if (isset($data['css_admin']))
{
$data['css_admin'] = base64_encode($data['css_admin']);
}
// Set the php_preflight_install string to base64 string.
if (isset($data['php_preflight_install']))
{
@ -1489,6 +1473,30 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']);
}
// Set the css_admin string to base64 string.
if (isset($data['css_admin']))
{
$data['css_admin'] = base64_encode($data['css_admin']);
}
// Set the php_postflight_install string to base64 string.
if (isset($data['php_postflight_install']))
{
$data['php_postflight_install'] = base64_encode($data['php_postflight_install']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the buildcompsql string to base64 string.
if (isset($data['buildcompsql']))
{
$data['buildcompsql'] = base64_encode($data['buildcompsql']);
}
// Set the php_helper_admin string to base64 string.
if (isset($data['php_helper_admin']))
{
@ -1525,16 +1533,16 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$data['php_postflight_update'] = base64_encode($data['php_postflight_update']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
// Set the php_method_install string to base64 string.
if (isset($data['php_method_install']))
{
$data['sql'] = base64_encode($data['sql']);
$data['php_method_install'] = base64_encode($data['php_method_install']);
}
// Set the buildcompsql string to base64 string.
if (isset($data['buildcompsql']))
// Set the sql_uninstall string to base64 string.
if (isset($data['sql_uninstall']))
{
$data['buildcompsql'] = base64_encode($data['buildcompsql']);
$data['sql_uninstall'] = base64_encode($data['sql_uninstall']);
}
// Set the readme string to base64 string.
@ -1543,23 +1551,29 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$data['readme'] = base64_encode($data['readme']);
}
// Set the php_helper_both string to base64 string.
if (isset($data['php_helper_both']))
{
$data['php_helper_both'] = base64_encode($data['php_helper_both']);
}
// Get the basic encryption key.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encryption object
$basic = new AES($basickey);
// Encrypt data whmcs_key.
if (isset($data['whmcs_key']) && $basickey)
{
$data['whmcs_key'] = $basic->encryptString($data['whmcs_key']);
}
// Encrypt data crowdin_username.
if (isset($data['crowdin_username']) && $basickey)
{
$data['crowdin_username'] = $basic->encryptString($data['crowdin_username']);
}
// Encrypt data whmcs_key.
if (isset($data['whmcs_key']) && $basickey)
{
$data['whmcs_key'] = $basic->encryptString($data['whmcs_key']);
}
// Encrypt data export_key.
if (isset($data['export_key']) && $basickey)
{

View File

@ -2097,7 +2097,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
// #__componentbuilder_joomla_component (a)
'joomla_component' => array(
'search' => array('id', 'system_name', 'php_preflight_install', 'php_postflight_install',
'php_preflight_update', 'php_postflight_update', 'php_method_uninstall',
'php_preflight_update', 'php_postflight_update', 'php_method_uninstall', 'php_method_install',
'php_helper_admin', 'php_admin_event', 'php_helper_both', 'php_helper_site',
'php_site_event', 'javascript', 'readme', 'sql', 'sql_uninstall'),
'views' => 'joomla_components',
@ -2694,31 +2694,36 @@ class ComponentbuilderModelJoomla_components extends ListModel
continue;
}
// decode sql_uninstall
$item->sql_uninstall = base64_decode($item->sql_uninstall);
// decode php_postflight_install
$item->php_postflight_install = base64_decode($item->php_postflight_install);
// decode php_site_event
$item->php_site_event = base64_decode($item->php_site_event);
// decode php_helper_both
$item->php_helper_both = base64_decode($item->php_helper_both);
// decode php_admin_event
$item->php_admin_event = base64_decode($item->php_admin_event);
// decode css_admin
$item->css_admin = base64_decode($item->css_admin);
if ($basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true)))
{
// decrypt crowdin_username
$item->crowdin_username = $basic->decryptString($item->crowdin_username);
}
// decode php_preflight_install
$item->php_preflight_install = base64_decode($item->php_preflight_install);
// decode php_method_uninstall
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
// decode css_admin
$item->css_admin = base64_decode($item->css_admin);
// decode php_postflight_install
$item->php_postflight_install = base64_decode($item->php_postflight_install);
// decode sql
$item->sql = base64_decode($item->sql);
// decode buildcompsql
$item->buildcompsql = base64_decode($item->buildcompsql);
// decode php_helper_admin
$item->php_helper_admin = base64_decode($item->php_helper_admin);
// decode php_helper_site
$item->php_helper_site = base64_decode($item->php_helper_site);
if ($basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
{
// decrypt whmcs_key
$item->whmcs_key = $basic->decryptString($item->whmcs_key);
}
// decode php_helper_admin
$item->php_helper_admin = base64_decode($item->php_helper_admin);
// decode php_helper_site
$item->php_helper_site = base64_decode($item->php_helper_site);
// decode javascript
$item->javascript = base64_decode($item->javascript);
// decode css_site
@ -2727,15 +2732,10 @@ class ComponentbuilderModelJoomla_components extends ListModel
$item->php_preflight_update = base64_decode($item->php_preflight_update);
// decode php_postflight_update
$item->php_postflight_update = base64_decode($item->php_postflight_update);
// decode sql
$item->sql = base64_decode($item->sql);
if ($basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true)))
{
// decrypt crowdin_username
$item->crowdin_username = $basic->decryptString($item->crowdin_username);
}
// decode buildcompsql
$item->buildcompsql = base64_decode($item->buildcompsql);
// decode php_method_install
$item->php_method_install = base64_decode($item->php_method_install);
// decode sql_uninstall
$item->sql_uninstall = base64_decode($item->sql_uninstall);
if ($basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
{
// decrypt export_key
@ -2753,6 +2753,8 @@ class ComponentbuilderModelJoomla_components extends ListModel
// decrypt crowdin_account_api_key
$item->crowdin_account_api_key = $basic->decryptString($item->crowdin_account_api_key);
}
// decode php_helper_both
$item->php_helper_both = base64_decode($item->php_helper_both);
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);

View File

@ -689,42 +689,6 @@ class ComponentbuilderModelJoomla_module extends AdminModel
return $data;
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (isset($data['not_required']) && UtilitiesStringHelper::check($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
// now change the required field attributes value
foreach ($requiredFields as $requiredField)
{
// make sure there is a string value
if (UtilitiesStringHelper::check($requiredField))
{
// change to false
$form->setFieldAttribute($requiredField, 'required', 'false');
// also clear the data set
$data[$requiredField] = '';
}
}
}
return parent::validate($form, $data, $group);
}
/**
* Method to get the unique fields of this table.
*

View File

@ -654,42 +654,6 @@ class ComponentbuilderModelJoomla_plugin extends AdminModel
return $data;
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
if (isset($data['not_required']) && UtilitiesStringHelper::check($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
// now change the required field attributes value
foreach ($requiredFields as $requiredField)
{
// make sure there is a string value
if (UtilitiesStringHelper::check($requiredField))
{
// change to false
$form->setFieldAttribute($requiredField, 'required', 'false');
// also clear the data set
$data[$requiredField] = '';
}
}
}
return parent::validate($form, $data, $group);
}
/**
* Method to get the unique fields of this table.
*

View File

@ -198,7 +198,7 @@ class ComponentbuilderModelServer extends AdminModel
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVymlinked_components()
public function getVydlinked_components()
{
// Get the user object.
$user = Factory::getUser();