You are here

function i18n_block_update_strings in Internationalization 7

Update block strings

1 call to i18n_block_update_strings()
i18n_block_form_block_admin_configure_submit in i18n_block/i18n_block.module
Form submit handler for block configuration form.

File

i18n_block/i18n_block.module, line 299
Internationalization (i18n) submodule: Multilingual meta-blocks

Code

function i18n_block_update_strings($block, $i18n_mode = TRUE) {
  $title = $i18n_mode && $block['title'] !== '<none>' ? $block['title'] : '';
  i18n_string_update(array(
    'blocks',
    $block['module'],
    $block['delta'],
    'title',
  ), $title);
  if (isset($block['body'])) {
    if ($i18n_mode) {
      i18n_string_update(array(
        'blocks',
        $block['module'],
        $block['delta'],
        'body',
      ), $block['body']['value'], array(
        'format' => $block['body']['format'],
      ));
    }
    else {
      i18n_string_remove(array(
        'blocks',
        $block['module'],
        $block['delta'],
        'body',
      ));
    }
  }
}