You are here

function i18n_block_i18n_string_objects in Internationalization 7

Implements hook_i18n_string_objects().

File

i18n_block/i18n_block.i18n.inc, line 55
Internationalization (i18n) hooks

Code

function i18n_block_i18n_string_objects($type) {
  if ($type == 'block') {
    $query = db_select('block', 'b')
      ->distinct()
      ->fields('b', array(
      'module',
      'delta',
      'title',
      'i18n_mode',
    ))
      ->fields('bc', array(
      'body',
      'format',
    ))
      ->condition('i18n_mode', I18N_MODE_LOCALIZE);
    $query
      ->leftJoin('block_custom', 'bc', 'b.bid = bc.bid');
    return $query
      ->execute()
      ->fetchAll(PDO::FETCH_OBJ);
  }
}