Improved on the mysql default selected values to use InnoDB, utf8mb4, utf8mb4_general_ci

This commit is contained in:
2019-05-17 00:43:24 +02:00
parent 42d5b3b55c
commit d3f623d184
7 changed files with 33 additions and 27 deletions

View File

@ -419,6 +419,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_admin_view', $objectUpdate, 'id');
}
// update the mysql_table_engine defaults
if (isset($item->mysql_table_engine) && is_numeric($item->mysql_table_engine))
{
$item->mysql_table_engine = 'MyISAM';
}
// update the mysql_table_charset defaults
if (isset($item->mysql_table_charset) && is_numeric($item->mysql_table_charset))
{
$item->mysql_table_charset = 'utf8';
}
// update the mysql_table_collate defaults
if (isset($item->mysql_table_collate) && is_numeric($item->mysql_table_collate))
{
$item->mysql_table_collate = 'utf8_general_ci';
}
if (!empty($item->id))
{

View File

@ -352,10 +352,8 @@
multiple="false"
filter="CMD"
required="true"
default="1">
default="utf8mb4_general_ci">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_GLOBAL_DEFAULT_UTFEIGHT_GENERAL_CI</option>
<option value="big5_chinese_ci">
COM_COMPONENTBUILDER_ADMIN_VIEW_BIGFIVE_CHINESE_CI_CHARSET_BIGFIVE</option>
<option value="big5_bin">
@ -1168,10 +1166,8 @@
multiple="false"
filter="CMD"
required="true"
default="1">
default="InnoDB">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_GLOBAL_DEFAULT_MYISAM</option>
<option value="MyISAM">
COM_COMPONENTBUILDER_ADMIN_VIEW_MYISAM</option>
<option value="InnoDB">
@ -2267,10 +2263,8 @@
multiple="false"
filter="CMD"
required="true"
default="1">
default="utf8mb4">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_GLOBAL_DEFAULT_UTFEIGHT</option>
<option value="big5">
COM_COMPONENTBUILDER_ADMIN_VIEW_BIGFIVE_BIGFIVE_TRADITIONAL_CHINESE_MOST_SUITABLE_COLLATION_BIGFIVE_CHINESE_CI</option>
<option value="dec8">
@ -2380,10 +2374,10 @@
class="list_class"
multiple="false"
required="true"
default="0">
default="DYNAMIC">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_DEFAULT</option>
COM_COMPONENTBUILDER_ADMIN_VIEW_OMIT</option>
<option value="REDUNDANT">
COM_COMPONENTBUILDER_ADMIN_VIEW_REDUNDANT</option>
<option value="COMPACT">

View File

@ -411,15 +411,13 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
// Only load these values if no id is found
if (0 == $id)
{
// get components global params
$params = JComponentHelper::getParams('com_componentbuilder');
// set company defaults
$form->setValue('companyname', null, $params->get('export_company', ''));
$form->setValue('author', null, $params->get('export_owner', ''));
$form->setValue('email', null, $params->get('export_email', ''));
$form->setValue('website', null, $params->get('export_website', ''));
$form->setValue('copyright', null, $params->get('export_copyright', 'Copyright (C) 2015. All Rights Reserved'));
$form->setValue('license', null, $params->get('export_license', 'GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html'));
$form->setValue('companyname', null, JComponentHelper::getParams('com_componentbuilder')->get('export_company', ''));
$form->setValue('author', null, JComponentHelper::getParams('com_componentbuilder')->get('export_owner', ''));
$form->setValue('email', null, JComponentHelper::getParams('com_componentbuilder')->get('export_email', ''));
$form->setValue('website', null, JComponentHelper::getParams('com_componentbuilder')->get('export_website', ''));
$form->setValue('copyright', null, JComponentHelper::getParams('com_componentbuilder')->get('export_copyright', 'Copyright (C) 2015. All Rights Reserved'));
$form->setValue('license', null, JComponentHelper::getParams('com_componentbuilder')->get('export_license', 'GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html'));
}
return $form;
}