Stable release of v3.2.0-beta5

Add custom file file mapping for Joomla 4 and 5.
This commit is contained in:
2024-03-09 21:41:29 +02:00
parent 5675f186cd
commit 91e922b993
28 changed files with 207 additions and 93 deletions

View File

@ -40,14 +40,14 @@ class JFormFieldDbtables extends JFormFieldList
protected function getOptions()
{
// get db object
$db = JFactory::getDBO();
$db = Factory::getDBO();
// get all tables
$tables= $db->getTableList();
// get config
$config = JFactory::getConfig();
$dbprefix = version_compare(JVERSION,'3.0','lt') ? $config->getValue('config.dbprefix') : $config->get('dbprefix');
$config = Factory::getConfig();
$dbprefix = \version_compare(JVERSION,'3.0','lt') ? $config->getValue('config.dbprefix') : $config->get('dbprefix');
$options = array();
$options[] = JHtml::_('select.option', '', 'Select an option');
$options[] = Html::_('select.option', '', 'Select an option');
for ($i=0; $i < count($tables); $i++)
{
//only tables with primary key
@ -55,7 +55,7 @@ class JFormFieldDbtables extends JFormFieldList
if ($db->loadResult())
{
$key = $i+1;
$options[$key] = new stdClass;
$options[$key] = new \stdClass;
$options[$key]->value = str_replace($dbprefix, '', $tables[$i]);
$options[$key]->text = $tables[$i];
}