summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/story.module32
-rw-r--r--modules/story/story.module32
2 files changed, 32 insertions, 32 deletions
diff --git a/modules/story.module b/modules/story.module
index 3357e27c4..f58fa4381 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -61,32 +61,32 @@ function story_link($type) {
return $links;
}
-function story_form(&$node, &$help, &$error) {
-
- if (isset($node->body)) {
+function story_validate(&$node) {
- /*
- ** Validate the size of the story:
- */
-
- if (count(explode(" ", $node->body)) < variable_get("minimum_story_size", 0)) {
- $error["body"] = "<div class=\"error\">". t("The body of your story is too short.") ."</div>";
- }
+ /*
+ ** Validate the size of the story:
+ */
+ if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_story_size", 0)) {
+print "body : $node->body";
+ $error["body"] = "<div class=\"error\">". t("The body of your story is too short.") ."</div>";
}
- else {
- /*
- ** Carry out some explanation or submission guidelines:
- */
+ return $error;
+}
+
+function story_form(&$node, &$help, &$error) {
- $help = variable_get("story_help", "");
+ /*
+ ** Carry out some explanation or submission guidelines:
+ */
- }
+ $help = variable_get("story_help", "");
if (function_exists("taxonomy_node_form")) {
$output .= implode("", taxonomy_node_form("story", $node));
}
+
$output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : form_allowed_tags_text());
return $output;
diff --git a/modules/story/story.module b/modules/story/story.module
index 3357e27c4..f58fa4381 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -61,32 +61,32 @@ function story_link($type) {
return $links;
}
-function story_form(&$node, &$help, &$error) {
-
- if (isset($node->body)) {
+function story_validate(&$node) {
- /*
- ** Validate the size of the story:
- */
-
- if (count(explode(" ", $node->body)) < variable_get("minimum_story_size", 0)) {
- $error["body"] = "<div class=\"error\">". t("The body of your story is too short.") ."</div>";
- }
+ /*
+ ** Validate the size of the story:
+ */
+ if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_story_size", 0)) {
+print "body : $node->body";
+ $error["body"] = "<div class=\"error\">". t("The body of your story is too short.") ."</div>";
}
- else {
- /*
- ** Carry out some explanation or submission guidelines:
- */
+ return $error;
+}
+
+function story_form(&$node, &$help, &$error) {
- $help = variable_get("story_help", "");
+ /*
+ ** Carry out some explanation or submission guidelines:
+ */
- }
+ $help = variable_get("story_help", "");
if (function_exists("taxonomy_node_form")) {
$output .= implode("", taxonomy_node_form("story", $node));
}
+
$output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : form_allowed_tags_text());
return $output;