You are here

function lingotek_admin_prepare_blocks in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.3 lingotek.admin.inc \lingotek_admin_prepare_blocks()
  2. 7.4 lingotek.admin.inc \lingotek_admin_prepare_blocks()
  3. 7.5 lingotek.admin.inc \lingotek_admin_prepare_blocks()
  4. 7.6 lingotek.admin.inc \lingotek_admin_prepare_blocks()
2 calls to lingotek_admin_prepare_blocks()
drush_lingotek_prepare_blocks in ./lingotek.drush.inc
Callback function for drush command lt-prepare-blocks
lingotek_admin_additional_translation_settings_form_submit in ./lingotek.admin.inc

File

./lingotek.admin.inc, line 1212

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;
}