Resolved gh-323 so we can load fields only in the linked or admin list views or in both. Added the option to also add permission to access fields. Improved the checkArray method to return arry count value. Fixed issue in field permissions when the value is and array, field type can not be made hidden, but should instead just be removed. Fixed an issue in the code search methods to insure all areas are looked at, and search and export.

This commit is contained in:
2018-10-29 18:38:00 +02:00
parent 1e5fda0327
commit 6c4bab5ea9
58 changed files with 556 additions and 355 deletions

View File

@ -35,23 +35,27 @@ class JFormFieldDbtables extends JFormFieldList
*/
protected function getOptions()
{
$db = JFactory::getDBO();
$tables= $db->getTableList();
$config = JFactory::getConfig();
$options = array();
$db = JFactory::getDBO(); $options[] = JHtml::_('select.option', '', 'Select an option');
for ($i=0; $i < count($tables); $i++)
{
//only tables with primary key
$db->setQuery('SHOW FIELDS FROM `'.$tables[$i].'` WHERE LOWER( `Key` ) = \'pri\'');
if ($db->loadResult())
{
$dbprefix = version_compare(JVERSION,'3.0','lt') ? $config->getValue('config.dbprefix') : $config->get('dbprefix'); $key = $i+1;
$options[$key] = new stdClass;
$options[$key]->value = str_replace($dbprefix, '', $tables[$i]);
$options[$key]->text = $tables[$i];
}
}
// get db object
$db = JFactory::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');
$options = array();
$options[] = JHtml::_('select.option', '', 'Select an option');
for ($i=0; $i < count($tables); $i++)
{
//only tables with primary key
$db->setQuery('SHOW FIELDS FROM `'.$tables[$i].'` WHERE LOWER( `Key` ) = \'pri\'');
if ($db->loadResult())
{
$key = $i+1;
$options[$key] = new stdClass;
$options[$key]->value = str_replace($dbprefix, '', $tables[$i]);
$options[$key]->text = $tables[$i];
}
}
return $options;
}
}