protected function getTableFields($tableName, $languageTable)
{
$result = array();
$sql = "SHOW COLUMNS FROM " . $tableName . " " . $this->joinQuery() . " ";
$fields = ipDb()->fetchColumn($sql);
foreach ($fields as $fieldName) {
$result[] = array('label' => $fieldName, 'field' => $fieldName);
}
if ($this->isMultilingual()) {
$sql = "SHOW COLUMNS FROM " . $languageTable . " ";
$fields = ipDb()->fetchColumn($sql);
foreach ($fields as $fieldName) {
if (in_array($fieldName, array($this->languageCodeField(), $this->languageForeignKeyField()))) {
continue;
}
$result[] = array('label' => $fieldName, 'field' => $fieldName, 'multilingual' => 1);
}
}
return $result;
}