function comment_entity_info

Implements hook_entity_info().

File

drupal/core/modules/comment/comment.module, line 103
Enables users to comment on published content.

Code

function comment_entity_info(&$info) {
  foreach (node_type_get_names() as $type => $name) {
    $info['comment']['bundles']['comment_node_' . $type] = array(
      'label' => t('@node_type comment', array(
        '@node_type' => $name,
      )),
      // Provide the node type/bundle name for other modules, so it does not
      // have to be extracted manually from the bundle name.
      'node bundle' => $type,
      'admin' => array(
        // Place the Field UI paths for comments one level below the
        // corresponding paths for nodes, so that they appear in the same set
        // of local tasks. Note that the paths use a different placeholder name
        // and thus a different menu loader callback, so that Field UI page
        // callbacks get a comment bundle name from the node type in the URL.
        // See comment_node_type_load() and comment_menu_alter().
        'path' => 'admin/structure/types/manage/%comment_node_type/comment',
        'bundle argument' => 4,
        'real path' => 'admin/structure/types/manage/' . $type . '/comment',
        'access arguments' => array(
          'administer content types',
        ),
      ),
    );
  }
}