diff -rup ../drupal-cvs/modules/blog.module ./modules/blog.module --- ../drupal-cvs/modules/blog.module Thu May 18 13:00:08 2006 +++ ./modules/blog.module Wed Jun 14 22:29:30 2006 @@ -10,7 +10,7 @@ * Implementation of hook_node_info(). */ function blog_node_info() { - return array('blog' => array('name' => t('blog entry'), 'base' => 'blog')); + return array('blog' => array('name' => t('blog entry'), 'base' => 'blog', 'singular' => '1 blog entry', 'plural' => '%count blog entries')); } /** diff -rup ../drupal-cvs/modules/book.module ./modules/book.module --- ../drupal-cvs/modules/book.module Mon Jun 5 13:00:07 2006 +++ ./modules/book.module Wed Jun 14 22:29:30 2006 @@ -10,7 +10,7 @@ * Implementation of hook_node_info(). */ function book_node_info() { - return array('book' => array('name' => t('book page'), 'base' => 'book')); + return array('book' => array('name' => t('book page'), 'base' => 'book', 'singular' => '1 book page', 'plural' => '%count book pages')); } /** diff -rup ../drupal-cvs/modules/forum.module ./modules/forum.module --- ../drupal-cvs/modules/forum.module Mon Jun 12 05:00:04 2006 +++ ./modules/forum.module Wed Jun 14 22:29:30 2006 @@ -107,7 +107,7 @@ function forum_menu($may_cache) { * Implementation of hook_node_info(). */ function forum_node_info() { - return array('forum' => array('name' => t('forum topic'), 'base' => 'forum')); + return array('forum' => array('name' => t('forum topic'), 'base' => 'forum', 'singular' => '1 forum topic', 'plural' => '%count forum topics')); } /** diff -rup ../drupal-cvs/modules/node.module ./modules/node.module --- ../drupal-cvs/modules/node.module Thu May 18 13:00:08 2006 +++ ./modules/node.module Wed Jun 14 22:32:33 2006 @@ -226,6 +226,10 @@ function _node_names($op = '', $node = N return $node_list; case 'name': return $node_list[$type]; + case 'singular': + return $node_names[$type]['singular']; + case 'plural': + return $node_names[$type]['plural']; } } @@ -251,6 +255,20 @@ function node_get_base($node) { */ function node_get_name($node) { return _node_names('name', $node); +} + +/** + * Determine the human readable form for $count nodes of a given type. + * + * @param $count + * The number of nodes. + * @param $node + * Either a node object, a node array, or a string containing the node type. + * @return + * The human readable form for $count nodes of this type. + */ +function node_get_enumerated_names($count, $node){ + return format_plural($count,_node_names('singular',$node),_node_names('plural',$node)); } /** diff -rup ../drupal-cvs/modules/page.module ./modules/page.module --- ../drupal-cvs/modules/page.module Sat May 6 21:00:04 2006 +++ ./modules/page.module Wed Jun 14 22:29:30 2006 @@ -45,7 +45,7 @@ function page_perm() { * Implementation of hook_node_info(). */ function page_node_info() { - return array('page' => array('name' => t('page'), 'base' => 'page')); + return array('page' => array('name' => t('page'), 'base' => 'page', 'singular' => '1 page', 'plural' => '%count pages')); } /** diff -rup ../drupal-cvs/modules/poll.module ./modules/poll.module --- ../drupal-cvs/modules/poll.module Tue May 30 13:00:05 2006 +++ ./modules/poll.module Wed Jun 14 22:29:30 2006 @@ -271,7 +271,7 @@ function poll_load($node) { * Implementation of hook_node_info(). */ function poll_node_info() { - return array('poll' => array('name' => t("poll"), 'base' => 'poll')); + return array('poll' => array('name' => t("poll"), 'base' => 'poll', 'singular' => '1 poll', 'plural' => '%count polls')); } function poll_page() { diff -rup ../drupal-cvs/modules/story.module ./modules/story.module --- ../drupal-cvs/modules/story.module Sat May 6 21:00:04 2006 +++ ./modules/story.module Wed Jun 14 22:29:30 2006 @@ -33,7 +33,7 @@ function story_help($section) { * Implementation of hook_node_info(). */ function story_node_info() { - return array('story' => array('name' => t('story'), 'base' => 'story')); + return array('story' => array('name' => t('story'), 'base' => 'story', 'singular' => '1 story', 'plural' => '%count stories')); } /**