Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.450 diff -u -F^f -r1.450 node.module --- modules/node.module 24 Jan 2005 21:20:16 -0000 1.450 +++ modules/node.module 26 Jan 2005 00:14:05 -0000 @@ -53,6 +53,10 @@ function node_help($section) { if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'revisions') { return t('The revisions let you track differences between multiple versions of a post.'); } + + if (arg(0) == 'node' && arg(1) == 'add' && $type = arg(2)) { + return variable_get($type .'_help', ''); + } } /** @@ -825,14 +829,19 @@ function node_types() { print theme('page', theme('table', $header, $rows)); } -function node_types_configure($type = NULL) { +function node_types_configure() { // Go to the listing page when we submit this form, system_settings_save() calls drupal_goto(). if ($_POST['op']) { $_GET['q'] = 'admin/node/configure/types'; } system_settings_save(); - $output .= implode('', node_invoke_nodeapi($type, 'settings')); + $type = arg(4); + + $group = form_textarea(t('Explanation or submission guidelines'), $type .'_help', variable_get($type .'_help', ''), 70, 5, t('This text will be displayed at the top of the %type submission form. It is useful for helping or instructing your users.', array('%type' => node_invoke($type, 'node_name')))); + $group .= form_select(t('Minimum number of words'), 'minimum_'. $type .'_size', variable_get('minimum_'. $type .'_size', 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)), t('The minimum number of words a %type must be to be considered valid. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.', array('%type' => node_invoke($type, 'node_name')))); + $output = form_group(t('Submission form'), $group); + $output .= form_group(t('Workflow'), implode('', node_invoke_nodeapi($type, 'settings'))); print theme('page', system_settings_form($output)); } @@ -1060,6 +1069,12 @@ function node_validate($node) { if (!$node->title) { form_set_error('title', t('You have to specify a valid title.')); } + } + + // Make sure the body has the minimim number of words. + // todo use a better word counting algorithm that will work in other languages + if (isset($node->body) && count(explode(' ', $node->body)) < variable_get('minimum_'. $node->type .'_size', 0)) { + form_set_error('body', t('The body of your %type is too short. You need at least %words words.', array('%words' => variable_get('minimum_'. $node->type .'_size', 0), '%type' => node_invoke($node->type, 'node_name')))); } // Auto-generate the teaser, but only if it hasn't been set (e.g. by a Index: modules/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog.module,v retrieving revision 1.210 diff -u -F^f -r1.210 blog.module --- modules/blog.module 25 Jan 2005 20:38:03 -0000 1.210 +++ modules/blog.module 26 Jan 2005 00:14:05 -0000 @@ -7,15 +7,6 @@ */ /** - * Implementation of hook_settings(). - */ -function blog_settings() { - $output = form_textarea(t('Explanation or submission guidelines'), 'blog_help', variable_get('blog_help', ''), 70, 5, t('This text will be displayed at the top of the blog submission form. It is useful for helping or instructing your users.')); - $output .= form_select(t('Minimum number of words in a blog entry'), 'minimum_blog_size', variable_get('minimum_blog_size', 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)), t("The minimum number of words a personal blog entry should contain. This is useful to rule out submissions that do not meet the site's standards, such as short test posts.")); - return $output; -} - -/** * Implementation of hook_node_name(). */ function blog_node_name($node) { @@ -68,10 +59,6 @@ function blog_help($section) {

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

", array('%scripting-com' => 'http://www.scripting.com/')); case 'admin/modules#description': return t('Enables keeping an easily and regularly updated web page or a blog.'); - case 'admin/settings/blog': - return t("

A weblog is a running journal of a user's ideas. Enter the minimum word count for a single entry, and the text displayed on the entry submission form.

"); - case 'node/add/blog': - return variable_get('blog_help', ''); case 'node/add#blog': return t("A blog is a regularly updated journal or diary made up of individual posts shown in reversed chronological order. A blog is tightly coupled to the author so each user will have his 'own' blog."); } @@ -190,17 +177,6 @@ function blog_page_last() { drupal_set_html_head(''); print theme('page', $output); -} - -/** - * Implementation of hook_validate(). - * - * Ensures the blog entry is of adequate length. - */ -function blog_validate(&$node) { - if (isset($node->body) && count(explode(' ', $node->body)) < variable_get('minimum_blog_size', 0)) { - form_set_error('body', t('The body of your blog is too short. You need at least %words words to submit your blog.', array('%words' => variable_get('minimum_story_size', 0)))); - } } /** Index: modules/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum.module,v retrieving revision 1.224 diff -u -F^f -r1.224 forum.module --- modules/forum.module 24 Jan 2005 21:01:57 -0000 1.224 +++ modules/forum.module 26 Jan 2005 00:14:06 -0000 @@ -26,11 +26,6 @@ function forum_help($section) { case 'node/add#forum': return t('A forum is a threaded discussion, enabling users to communicate about a particular topic.'); } - - // The 'add forum topic' form takes a variable argument: - if (substr($section, 0, 14) == 'node/add/forum'){ - return variable_get('forum_help', ''); - } } /** @@ -80,7 +75,6 @@ function forum_settings() { $group .= _taxonomy_term_select(t('Containers'), 'forum_containers', variable_get('forum_containers', array()), variable_get('forum_nav_vocabulary', ''), t('You can choose forums which will not have topics, but will be just containers for other forums. This lets you both group and nest forums.'), 1, '<'. t('none') .'>'); $output = form_group(t('Forum structure settings'), $group); - $group = form_textarea(t('Explanation or submission guidelines'), 'forum_help', variable_get('forum_help', ''), 70, 5, t('This text will be displayed at the top of the forum submission form. It is useful for helping or instructing your users.')); $group .= form_textfield(t('Forum icon path'), 'forum_icon_path', variable_get('forum_icon_path', ''), 30, 255, t('The path to the forum icons. Leave blank to disable icons. Don\'t add a trailing slash. Default icons are available in the "misc" directory.')); $group .= form_select(t('Hot topic threshold'), 'forum_hot_topic', variable_get('forum_hot_topic', 15), drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 10000)), t('The number of posts a topic must have to be considered hot.')); $group .= form_select(t('Topics per page'), 'forum_per_page', variable_get('forum_per_page', 25), drupal_map_assoc(array(10, 25, 50, 75, 100)), t('The default number of topics displayed per page; links to browse older messages are automatically being displayed.')); Index: modules/story.module =================================================================== RCS file: /cvs/drupal/drupal/modules/story.module,v retrieving revision 1.164 diff -u -F^f -r1.164 story.module --- modules/story.module 15 Jan 2005 08:01:09 -0000 1.164 +++ modules/story.module 26 Jan 2005 00:14:06 -0000 @@ -13,28 +13,14 @@ function story_help($section) { switch ($section) { case 'admin/modules#description': return t('Enables users to submit stories, articles or similar content.'); - case 'admin/settings/story': - return t("Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extended by other modules. The teaser is part of the body too. Stories may be used as a personal blog or for news articles."); case 'admin/help#story': return t("Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extended by other modules. The teaser is part of the body too. Stories may be used as a personal blog or for news articles. By default, no menu item, or navigation element is created for a story. An extra feature of a story is, that an administrator can specify a submission guideline and enforce a minimum word count for user submitted stories"); - case 'node/add/story': - return variable_get('story_help', ''); case 'node/add#story': return t('Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extended by other modules. The teaser is part of the body too. Stories may be used as a personal blog or for news articles.'); } } /** - * Implementation of hook_settings(). - */ -function story_settings() { - $output .= form_textarea(t('Explanation or submission guidelines'), 'story_help', variable_get('story_help', ''), 70, 5, t('This text will be displayed at the top of the story submission form. It is useful for helping or instructing your users.')); - $output .= form_select(t('Minimum number of words'), 'minimum_story_size', variable_get('minimum_story_size', 0), drupal_map_assoc(array(0, 10, 25, 50, 75, 100, 125, 150, 175, 200)), t('The minimum number of words a story must be to be considered valid. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.')); - - return $output; -} - -/** * Implementation of hook_node_name(). */ function story_node_name($node) { @@ -77,17 +63,6 @@ function story_menu($may_cache) { } return $items; -} - -/** - * Implementation of hook_validate(). - * - * Ensures the story is of adequate length. - */ -function story_validate(&$node) { - if (isset($node->body) && count(explode(' ', $node->body)) < variable_get('minimum_story_size', 0)) { - form_set_error('body', t('The body of your story is too short. You need at least %words words to submit your story.', array('%words' => variable_get('minimum_story_size', 0)))); - } } /**