1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-20 13:21:54 +02:00

Fixes #4083 Column selector displaying improperly defined field.

Admin-UI: Multi-language database language only displays when a table match is found.
This commit is contained in:
Cameron
2020-02-22 10:03:41 -08:00
parent 79c5b3e694
commit d23c65b30c
4 changed files with 52 additions and 34 deletions

View File

@@ -7212,33 +7212,41 @@ class e_admin_form_ui extends e_form
private function renderLanguageTableInfo()
{
$text = '';
if(e107::getConfig()->get('multilanguage'))
if(!e107::getConfig()->get('multilanguage'))
{
$curTable = $this->getController()->getTableName();
$sitelanguage = e107::getConfig()->get('sitelanguage');
if($curTable != e107::getDb()->db_IsLang($curTable))
{
$lang = e107::getDb()->mySQLlanguage;
}
else
{
$lang = $sitelanguage;
}
$def = deftrue('LAN_UI_USING_DATABASE_TABLE','Using [x] database table');
$diz = e107::getParser()->lanVars($def, $lang); // "Using ".$lang." database table";
$class = ($sitelanguage == $lang) ? "default" : "";
$text = "<span class='adminui-language-table-info ".$class." e-tip' title=\"".$diz."\">";
$text .= e107::getParser()->toGlyph('fa-hdd-o'); // '<i class="icon-hdd"></i> ';
$text .= e107::getLanguage()->toNative($lang)."</span>";
return $text;
return null;
}
return false;
$curTable = $this->getController()->getTableName();
$sitelanguage = e107::getConfig()->get('sitelanguage');
$val = e107::getDb()->hasLanguage($curTable, true);
if($val === false)
{
return null;
}
if($curTable != e107::getDb()->hasLanguage($curTable))
{
$lang = e107::getDb()->mySQLlanguage;
}
else
{
$lang = $sitelanguage;
}
$def = deftrue('LAN_UI_USING_DATABASE_TABLE','Using [x] database table');
$diz = e107::getParser()->lanVars($def, $lang); // "Using ".$lang." database table";
$class = ($sitelanguage == $lang) ? "default" : "";
$text = "<span class='adminui-language-table-info ".$class." e-tip' title=\"".$diz."\">";
$text .= e107::getParser()->toGlyph('fa-hdd-o'); // '<i class="icon-hdd"></i> ';
$text .= e107::getLanguage()->toNative($lang)."</span>";
return $text;
}