summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-09-23 08:47:13 +0000
committerDries Buytaert <dries@buytaert.net>2005-09-23 08:47:13 +0000
commit61740bd8ee133c3d0ea2543bccc4d00a62c9e3a0 (patch)
tree814cc9a6da1ec51a6e3eca921dc001ae6b5dee6a /modules/node/node.module
parente3a4085a07647878142d1c51a6977a5b98f707ea (diff)
downloadbrdo-61740bd8ee133c3d0ea2543bccc4d00a62c9e3a0.tar.gz
brdo-61740bd8ee133c3d0ea2543bccc4d00a62c9e3a0.tar.bz2
- Patch #10056: allow the node title forms to be customized.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module20
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 3a17febf5..586ffafba 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1242,13 +1242,6 @@ function node_validate($node) {
// Convert the node to an object, if necessary.
$node = array2object($node);
- // Validate the title field.
- if (isset($node->title)) {
- if (trim($node->title) == '') {
- form_set_error('title', t('You have to specify a title.'));
- }
- }
-
// Make sure the body has the minimum 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)) {
@@ -1325,6 +1318,16 @@ function node_validate($node) {
}
/**
+ * Validate the title of a node
+ */
+function node_validate_title($node, $message = NULL) {
+ // Validate the title field.
+ if (trim($node->title) == '') {
+ form_set_error('title', isset($message) ? $message : t('You have to specify a title.'));
+ }
+}
+
+/**
* Generate the node editing form.
*/
function node_form($edit) {
@@ -1378,9 +1381,8 @@ function node_form($edit) {
$output .= $extras ? '<div class="extra">'. $extras .'</div></div>' : '</div>';
}
- // Add the default fields.
+ // Open the enclosing div.
$output .= '<div class="standard">';
- $output .= form_textfield(t('Title'), 'title', $edit->title, 60, 128, NULL, NULL, TRUE);
// Add the node-type-specific fields.
$output .= $form;