1 node.path.inc node_path_info()

Implements hook_path_info().

File

core/modules/node/node.path.inc, line 10
Path integration.

Code

function node_path_info() {
  $info['node'] = array(
    'entity type' => 'node',
    'label' => t('Content'),
    'pattern description' => t('Default URL alias pattern (applies to all content types with blank URL alias patterns below)'),
    'pattern default' => 'content/[node:title]',
    'type delete callback' => 'node_path_type_delete_callback',
    'batch update callback' => 'node_path_bulk_update_batch_process',
    'batch file' => 'node.path.inc',
    'batch file path' => backdrop_get_path('module', 'node'),
    'source prefix' => 'node/',
  );

  $languages = array();
  if (module_exists('locale')) {
    $languages = array(LANGUAGE_NONE => (object) array(
      'name' => t('Language neutral'),
      'langcode' => LANGUAGE_NONE,
    )) + language_list();
  }

  foreach (node_type_get_types() as $node_type_name => $node_type) {
    if (count($languages) && !empty($node_type->settings['language'])) {
      $info['node']['pattern items'][$node_type_name] = t('Default URL alias pattern for %node_type (applies to all %node_type content types with blank URL alias patterns below)', array('%node_type' => $node_type->name));
      foreach ($languages as $langcode => $language) {
        $info['node']['pattern items'][$node_type_name . '_' . $langcode] = t('URL alias pattern for all %node_type URLs in %language', array('%node_type' => $node_type->name, '%language' => $language->name));
      }
    }
    else {
      $info['node']['pattern items'][$node_type_name] = t('URL alias pattern for all %node_type URLs', array('%node_type' => $node_type->name));
    }
  }

  return $info;
}