You are here

function i18nBlocksTestCase::setBlockLanguages in Internationalization 7

Update block visibility for languages

1 call to i18nBlocksTestCase::setBlockLanguages()
i18nBlocksTestCase::testBlockTranslation in i18n_block/i18n_block.test

File

i18n_block/i18n_block.test, line 183
Test case for multilingual blocks

Class

i18nBlocksTestCase
@file Test case for multilingual blocks

Code

function setBlockLanguages($block, $languages = array()) {
  $edit = array();
  foreach ($this
    ->getEnabledLanguages() as $langcode => $language) {
    $edit["languages[{$langcode}]"] = in_array($langcode, $languages) ? TRUE : FALSE;
  }
  $this
    ->updateBlock($block, $edit);
}