Resolved gh-345 by adding whole new mysql table selection options in the admin view, under the mySql tab. Fixed the folder & file loader. Fixed the Update of custom files, so even the custom code and external code placholders will work in external files. Update all tables in JCB to use InnoDB Engine, utf8md4 Charset and utf8mb4_unicode_ci Collation.

This commit is contained in:
2018-09-25 22:02:48 +02:00
parent 6ad253be44
commit 73d383c755
79 changed files with 3139 additions and 1576 deletions

View File

@ -211,28 +211,6 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
}
}
// Set Add Custom Import Selection
$this->add_custom_importOptions = $this->getTheAdd_custom_importSelections();
if ($this->add_custom_importOptions)
{
// Add Custom Import Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
'filter_add_custom_import',
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text', $this->state->get('filter.add_custom_import'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Add Custom Import Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
'batch[add_custom_import]',
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text')
);
}
}
// Set Type Selection
$this->typeOptions = $this->getTheTypeSelections();
if ($this->typeOptions)
@ -255,6 +233,28 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
}
}
// Set Add Custom Import Selection
$this->add_custom_importOptions = $this->getTheAdd_custom_importSelections();
if ($this->add_custom_importOptions)
{
// Add Custom Import Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
'filter_add_custom_import',
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text', $this->state->get('filter.add_custom_import'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Add Custom Import Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
'batch[add_custom_import]',
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text')
);
}
}
// Set Add Custom Button Selection
$this->add_custom_buttonOptions = $this->getTheAdd_custom_buttonSelections();
if ($this->add_custom_buttonOptions)
@ -386,42 +386,6 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
return false;
}
protected function getTheAdd_custom_importSelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('add_custom_import'));
$query->from($db->quoteName('#__componentbuilder_admin_view'));
$query->order($db->quoteName('add_custom_import') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
// get model
$model = $this->getModel();
$results = array_unique($results);
$_filter = array();
foreach ($results as $add_custom_import)
{
// Translate the add_custom_import selection
$text = $model->selectionTranslation($add_custom_import,'add_custom_import');
// Now add the add_custom_import and its text to the options array
$_filter[] = JHtml::_('select.option', $add_custom_import, JText::_($text));
}
return $_filter;
}
return false;
}
protected function getTheTypeSelections()
{
// Get a db connection.
@ -458,6 +422,42 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
return false;
}
protected function getTheAdd_custom_importSelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('add_custom_import'));
$query->from($db->quoteName('#__componentbuilder_admin_view'));
$query->order($db->quoteName('add_custom_import') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
// get model
$model = $this->getModel();
$results = array_unique($results);
$_filter = array();
foreach ($results as $add_custom_import)
{
// Translate the add_custom_import selection
$text = $model->selectionTranslation($add_custom_import,'add_custom_import');
// Now add the add_custom_import and its text to the options array
$_filter[] = JHtml::_('select.option', $add_custom_import, JText::_($text));
}
return $_filter;
}
return false;
}
protected function getTheAdd_custom_buttonSelections()
{
// Get a db connection.

View File

@ -190,7 +190,7 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy
}
// Set Main Get Name Selection
$this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->getOptions();
$this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->options;
if ($this->main_getNameOptions)
{
// Main Get Name Filter

View File

@ -190,7 +190,7 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy
}
// Set Component System Name Selection
$this->componentSystem_nameOptions = JFormHelper::loadFieldType('Component')->getOptions();
$this->componentSystem_nameOptions = JFormHelper::loadFieldType('Component')->options;
if ($this->componentSystem_nameOptions)
{
// Component System Name Filter

View File

@ -207,7 +207,7 @@ class ComponentbuilderViewFields extends JViewLegacy
}
// Set Fieldtype Name Selection
$this->fieldtypeNameOptions = JFormHelper::loadFieldType('Fieldtypes')->getOptions();
$this->fieldtypeNameOptions = JFormHelper::loadFieldType('Fieldtypes')->options;
if ($this->fieldtypeNameOptions)
{
// Fieldtype Name Filter

View File

@ -229,7 +229,7 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy
}
// Set Admin View Selection
$this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->getOptions();
$this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->options;
if ($this->admin_viewOptions)
{
// Admin View Filter
@ -251,7 +251,7 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy
}
// Set Site View Selection
$this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->getOptions();
$this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->options;
if ($this->site_viewOptions)
{
// Site View Filter

View File

@ -190,7 +190,7 @@ class ComponentbuilderViewLayouts extends JViewLegacy
}
// Set Dynamic Get Name Selection
$this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->getOptions();
$this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->options;
if ($this->dynamic_getNameOptions)
{
// Dynamic Get Name Filter

View File

@ -180,7 +180,7 @@ class ComponentbuilderViewLibraries extends JViewLegacy
}
// Set How Selection
$this->howOptions = JFormHelper::loadFieldType('Filebehaviour')->getOptions();
$this->howOptions = JFormHelper::loadFieldType('Filebehaviour')->options;
if ($this->howOptions)
{
// How Filter

View File

@ -190,7 +190,7 @@ class ComponentbuilderViewSite_views extends JViewLegacy
}
// Set Main Get Name Selection
$this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->getOptions();
$this->main_getNameOptions = JFormHelper::loadFieldType('Maingets')->options;
if ($this->main_getNameOptions)
{
// Main Get Name Filter

View File

@ -195,7 +195,7 @@ class ComponentbuilderViewSnippets extends JViewLegacy
}
// Set Type Name Selection
$this->typeNameOptions = JFormHelper::loadFieldType('Snippettype')->getOptions();
$this->typeNameOptions = JFormHelper::loadFieldType('Snippettype')->options;
if ($this->typeNameOptions)
{
// Type Name Filter
@ -217,7 +217,7 @@ class ComponentbuilderViewSnippets extends JViewLegacy
}
// Set Library Name Selection
$this->libraryNameOptions = JFormHelper::loadFieldType('Library')->getOptions();
$this->libraryNameOptions = JFormHelper::loadFieldType('Library')->options;
if ($this->libraryNameOptions)
{
// Library Name Filter

View File

@ -190,7 +190,7 @@ class ComponentbuilderViewTemplates extends JViewLegacy
}
// Set Dynamic Get Name Selection
$this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->getOptions();
$this->dynamic_getNameOptions = JFormHelper::loadFieldType('Dynamicget')->options;
if ($this->dynamic_getNameOptions)
{
// Dynamic Get Name Filter