From d4692d569cd923f777dd6b12b84d4df7b74382de Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 23 Nov 2005 16:18:28 +0000
Subject: [PATCH] - Patch #35644 by webchick: fixed the sizes of the textareas
 on the node edit forms.

---
 modules/blog.module        |  2 +-
 modules/blog/blog.module   |  2 +-
 modules/book.module        |  2 +-
 modules/book/book.module   |  2 +-
 modules/forum.module       |  2 +-
 modules/forum/forum.module |  2 +-
 modules/node.module        | 10 ++++++++--
 modules/node/node.module   | 10 ++++++++--
 modules/page.module        |  2 +-
 modules/page/page.module   |  2 +-
 modules/story.module       |  2 +-
 modules/story/story.module |  2 +-
 12 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/modules/blog.module b/modules/blog.module
index d3339d049b71..a901da8e3330 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -229,7 +229,7 @@ function blog_form(&$node) {
   }
 
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE);
+  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE);
   $form = array_merge($form, filter_form($node->format));
   return $form;
 }
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index d3339d049b71..a901da8e3330 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -229,7 +229,7 @@ function blog_form(&$node) {
   }
 
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE);
+  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE);
   $form = array_merge($form, filter_form($node->format));
   return $form;
 }
diff --git a/modules/book.module b/modules/book.module
index a8c1362d595d..1768ab6e94d3 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -249,7 +249,7 @@ function book_form(&$node) {
 
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
   $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
diff --git a/modules/book/book.module b/modules/book/book.module
index a8c1362d595d..1768ab6e94d3 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -249,7 +249,7 @@ function book_form(&$node) {
 
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
   $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
diff --git a/modules/forum.module b/modules/forum.module
index d749444118a3..265a96cbf765 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -589,7 +589,7 @@ function forum_form(&$node) {
     $form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.'));
   }
 
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index d749444118a3..265a96cbf765 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -589,7 +589,7 @@ function forum_form(&$node) {
     $form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.'));
   }
 
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
diff --git a/modules/node.module b/modules/node.module
index d9b725ee43cd..4983b11af80a 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -729,7 +729,7 @@ function node_search($op = 'search', $keys = null) {
       $form = array();
 
       // Keyword boxes
-      $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => true, '#collapsed' => true, '#attributes' => array('class' => 'search-advanced'));
+      $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced'));
 
       $form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '<div class="criterium">', '#suffix' => '</div>');
       $form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255);
@@ -1325,12 +1325,18 @@ function node_revision_rollback($nid, $revision) {
  * Delete the revision with specified revision number.
  */
 function node_revision_delete($nid, $revision) {
+
   if (user_access('administer nodes')) {
     $count_revisions = db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $nid));
     // Don't delete the last revision of the node or the current revision
     if ($count_revisions > 1) {
+      $node = node_load($nid, $revision);
+
       db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $nid, $revision);
-      drupal_set_message(t('Deleted revision with the ID %revision.', array('%revision' => theme('placeholder', $revision))));
+
+      node_invoke_nodeapi($node, 'delete revision');
+      drupal_set_message(t('Deleted %title revision %revision.', array('%title' => theme('placeholder', $node->title), '%revision' => theme('placeholder', $revision))));
+      watchdog('content', t('%type: deleted %title revision %revision.', array('%type' => theme('placeholder', t($node->type)), '%title' => theme('placeholder', $node->title), '%revision' => theme('placeholder', $revision))));
     }
     else {
       drupal_set_message(t('Deletion failed. You tried to delete the current revision.'));
diff --git a/modules/node/node.module b/modules/node/node.module
index d9b725ee43cd..4983b11af80a 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -729,7 +729,7 @@ function node_search($op = 'search', $keys = null) {
       $form = array();
 
       // Keyword boxes
-      $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => true, '#collapsed' => true, '#attributes' => array('class' => 'search-advanced'));
+      $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced'));
 
       $form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '<div class="criterium">', '#suffix' => '</div>');
       $form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255);
@@ -1325,12 +1325,18 @@ function node_revision_rollback($nid, $revision) {
  * Delete the revision with specified revision number.
  */
 function node_revision_delete($nid, $revision) {
+
   if (user_access('administer nodes')) {
     $count_revisions = db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $nid));
     // Don't delete the last revision of the node or the current revision
     if ($count_revisions > 1) {
+      $node = node_load($nid, $revision);
+
       db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $nid, $revision);
-      drupal_set_message(t('Deleted revision with the ID %revision.', array('%revision' => theme('placeholder', $revision))));
+
+      node_invoke_nodeapi($node, 'delete revision');
+      drupal_set_message(t('Deleted %title revision %revision.', array('%title' => theme('placeholder', $node->title), '%revision' => theme('placeholder', $revision))));
+      watchdog('content', t('%type: deleted %title revision %revision.', array('%type' => theme('placeholder', t($node->type)), '%title' => theme('placeholder', $node->title), '%revision' => theme('placeholder', $revision))));
     }
     else {
       drupal_set_message(t('Deletion failed. You tried to delete the current revision.'));
diff --git a/modules/page.module b/modules/page.module
index 64b81c99b53c..64b5c7c47451 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -94,7 +94,7 @@ function page_form(&$node) {
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
 
   $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
diff --git a/modules/page/page.module b/modules/page/page.module
index 64b81c99b53c..64b5c7c47451 100644
--- a/modules/page/page.module
+++ b/modules/page/page.module
@@ -94,7 +94,7 @@ function page_form(&$node) {
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
 
   $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
diff --git a/modules/story.module b/modules/story.module
index d9c49771d8b9..8ffb375ca22b 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -89,7 +89,7 @@ function story_form(&$node) {
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
 
   $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
diff --git a/modules/story/story.module b/modules/story/story.module
index d9c49771d8b9..8ffb375ca22b 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -89,7 +89,7 @@ function story_form(&$node) {
   $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
 
   $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#required' => TRUE
+    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
   );
   $form = array_merge($form, filter_form($node->format));
 
-- 
GitLab