You are here

function _fe_block_build_id in Features Extra 7

Same name and namespace in other branches
  1. 6 fe_block.module \_fe_block_build_id()

Generate block ID.

2 calls to _fe_block_build_id()
fe_block_settings_features_export_options in fe_block/fe_block.module
Implements hook_features_export_options().
_fe_block_info_by_theme in fe_block/fe_block.module
Returns the block definitions for a specific theme.

File

fe_block/fe_block.module, line 1061
Provide features components for exporting core blocks and settings.

Code

function _fe_block_build_id($block) {
  if (empty($block['module']) || empty($block['delta']) && !is_numeric($block['delta'])) {
    return NULL;
  }
  if ($block['module'] == 'block') {
    $machine_name = fe_block_get_machine_name($block['delta']);
    if (empty($machine_name)) {
      return NULL;
    }
    return $block['module'] . '-' . $machine_name;
  }
  else {
    return $block['module'] . '-' . $block['delta'];
  }
}