You are here

function lingotek_admin_prepare_blocks in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.admin.inc \lingotek_admin_prepare_blocks()
  2. 7.3 lingotek.admin.inc \lingotek_admin_prepare_blocks()
  3. 7.4 lingotek.admin.inc \lingotek_admin_prepare_blocks()
  4. 7.5 lingotek.admin.inc \lingotek_admin_prepare_blocks()
1 call to lingotek_admin_prepare_blocks()
lingotek_admin_additional_translation_settings_form_submit in ./lingotek.admin.inc

File

./lingotek.admin.inc, line 1122

Code

function lingotek_admin_prepare_blocks() {

  // update all blocks to be translatable in the Languages settings
  $result = db_update('block')
    ->fields(array(
    'i18n_mode' => LINGOTEK_I18N_ENABLED_VALUE,
  ))
    ->execute();
  if ($result) {
    drupal_set_message(format_plural($result, t('Enabled 1 block for translation.'), t('Enabled @num blocks for translation.', array(
      '@num' => (int) $result,
    ))));
  }
  else {
    drupal_set_message(t('All blocks already enabled for translation.'));
  }
  return TRUE;
}