/**
* Get untracked tables
*
* @param string $db current database
*
* @return array $untracked_tables
*/
function PMA_getUntrackedTables($db)
{
$untracked_tables = array();
$sep = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
// Get list of tables
$table_list = PMA\libraries\Util::getTableList($db);
// For each table try to get the tracking version
foreach ($table_list as $key => $value) {
// If $value is a table group.
if (array_key_exists('is' . $sep . 'group', $value) && $value['is' . $sep . 'group']) {
foreach ($value as $temp_table) {
// If $temp_table is a table with the value for 'Name' is set,
// rather than a property of the table group.
if (is_array($temp_table) && array_key_exists('Name', $temp_table)) {
$tracking_version = Tracker::getVersion($db, $temp_table['Name']);
if ($tracking_version == -1) {
$untracked_tables[] = $temp_table['Name'];
}
}
}
} else {
// If $value is a table.
if (Tracker::getVersion($db, $value['Name']) == -1) {
$untracked_tables[] = $value['Name'];
}
}
}
return $untracked_tables;
}