You are here

function _i18nblocks_list in Internationalization 6

Get list of blocks i18n properties

2 calls to _i18nblocks_list()
i18nblocks_preprocess_block in i18nblocks/i18nblocks.module
Implementation of hook_preprocess_block().
i18nblocks_translate_block in i18nblocks/i18nblocks.module
Translate block.

File

i18nblocks/i18nblocks.module, line 278
Internationalization (i18n) submodule: Multilingual meta-blocks

Code

function _i18nblocks_list($langcode = '') {
  static $list = array();

  // Handle issues when no $langcode, use a different array index
  $index = $langcode ? $langcode : I18N_BLOCK_LOCALIZE;
  if (!isset($list[$index])) {
    $list[$index] = array();
    $result = db_query("SELECT * FROM {i18n_blocks} WHERE language = '%s'", $langcode);
    while ($info = db_fetch_object($result)) {
      $list[$index][$info->module][$info->delta] = $info;
    }
  }
  return $list[$index];
}