Skip to content

Commit

Permalink
Update lang.php
Browse files Browse the repository at this point in the history
Modified clean_tables() to really clean up unused language entries in all content language tables and setting table.
  • Loading branch information
kochinc committed May 9, 2014
1 parent 272543e commit c0029c2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions application/controllers/admin/lang.php
Expand Up @@ -152,10 +152,22 @@ function save()
*/
function clean_tables()
{
$tables = array('page', 'article', 'media');

//$tables = array('page', 'article', 'media');
// Some other content language tables need to be cleaned up too. -- Kochin
// Retrieve a list of all content language table names.
$tables = $this->lang_model->list_lang_tables();
if ($tables != FALSE)
{
// Remove the postfix _lang.
$tables = preg_replace('/_lang$/', '', $tables);
}
log_message('debug', 'Content language tables w/o _lang: '.print_r($tables, TRUE));

$deleted_rows = $this->lang_model->clean_lang_tables($tables);

// Also delete rows belong to unused languages in the setting table. -- Kochin
$deleted_rows = $this->settings_model->clean_lang_settings();

$result = array(
'title' => lang('ionize_button_clean_lang_tables'),
'status' => 'success',
Expand Down

0 comments on commit c0029c2

Please sign in to comment.