You are here

function menu_custom_configuration_export_render in Configuration Management 7

Implements hook_configuration_export_render()

2 calls to menu_custom_configuration_export_render()
configuration_check_menu_custom in includes/configuration.menu.inc
configuration_hash_menu_custom in includes/configuration.menu.inc

File

includes/configuration.menu.inc, line 80

Code

function menu_custom_configuration_export_render($module, $data) {
  $code = array();
  $code[] = '  $menus = array();';
  $code[] = '';
  $translatables = array();
  foreach ($data as $menu_name) {
    $row = db_select('menu_custom')
      ->fields('menu_custom')
      ->condition('menu_name', $menu_name)
      ->execute()
      ->fetchAssoc();
    if ($row) {
      $export = configuration_var_export($row, '  ');
      $code[] = "  // Exported menu: {$menu_name}";
      $code[] = "  \$menus['{$menu_name}'] = {$export};";
      $translatables[] = $row['title'];
      $translatables[] = $row['description'];
    }
  }
  if (!empty($translatables)) {
    $code[] = configuration_translatables_export($translatables, '  ');
  }
  $code[] = '';
  $code[] = '  return $menus;';
  $code = implode("\n", $code);
  return array(
    'menu_default_menu_custom' => $code,
  );
}