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.