1 block.admin.inc block_custom_block_translate_access($delta, $langcode = NULL)

Menu access callback for translating a single block.

File

core/modules/block/block.admin.inc, line 370
Admin page callbacks for the Block module.

Code

function block_custom_block_translate_access($delta, $langcode = NULL) {
  // If the block does not exist, or does not have translation enabled.
  $block = block_custom_block_load($delta);
  if (!$block || $block['default_langcode'] === LANGUAGE_NONE) {
    return FALSE;
  }
  // Check the specified language is enabled.
  $enabled_languages = language_list(TRUE);
  if ($langcode && !isset($enabled_languages[$langcode])) {
    return FALSE;
  }
  return user_access('administer blocks');
}