You are here

function i18ncontent_node_add_page in Internationalization 6

Replacement for node_add_page.

1 string reference to 'i18ncontent_node_add_page'
i18ncontent_menu_alter in i18ncontent/i18ncontent.module
Implementation of hook_menu_alter().

File

i18ncontent/i18ncontent.module, line 180
Internationalization (i18n) package - translatable content type parameters

Code

function i18ncontent_node_add_page() {
  $item = menu_get_item();
  $content = system_admin_menu_block($item);

  // The node type isn't available in the menu path, but 'title' is equivalent
  // to the human readable name, so check this against node_get_types() to get
  // the correct values. First we build an array of node types indexed by names
  $type_names = array_flip(node_get_types('names'));
  foreach ($content as $key => $item) {
    if ($type = $type_names[$item['link_title']]) {

      // We just need to translate the description, the title is translated by the menu system
      $content[$key]['description'] = i18nstrings("nodetype:type:{$type}:description", $item['description']);
    }
  }
  return theme('node_add_list', $content);
}