summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-28 11:12:55 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-28 11:12:55 +0000
commit2c24fd4040cbc6210682d8d100051111f6dffbcd (patch)
treeb3d0ee7d56464a06180b1637d2b4a713d4b93b57
parent98b84b7adbf2dfee104167e4014ecd03fb965fff (diff)
downloadbrdo-2c24fd4040cbc6210682d8d100051111f6dffbcd.tar.gz
brdo-2c24fd4040cbc6210682d8d100051111f6dffbcd.tar.bz2
- Patch #668806 by Dave Reid: brought permission handling for node revisions up to standards.
-rw-r--r--modules/node/node.pages.inc65
1 files changed, 32 insertions, 33 deletions
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 414db3570..7efd9e464 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -164,39 +164,38 @@ function node_form($form, &$form_state, $node) {
// Add a log field if the "Create new revision" option is checked, or if the
// current user has the ability to check that option.
- if (!empty($node->revision) || user_access('administer nodes')) {
- $form['revision_information'] = array(
- '#type' => 'fieldset',
- '#title' => t('Revision information'),
- '#collapsible' => TRUE,
- // Collapsed by default when "Create new revision" is unchecked
- '#collapsed' => !$node->revision,
- '#group' => 'additional_settings',
- '#attached' => array(
- 'js' => array(drupal_get_path('module', 'node') . '/node.js'),
- ),
- '#weight' => 20,
- );
- $form['revision_information']['revision'] = array(
- '#access' => user_access('administer nodes'),
- '#type' => 'checkbox',
- '#title' => t('Create new revision'),
- '#default_value' => $node->revision,
- '#states' => array(
- // Check the revision log checkbox when the log textarea is filled in.
- 'checked' => array(
- 'textarea[name="log"]' => array('empty' => FALSE),
- ),
+ $form['revision_information'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Revision information'),
+ '#collapsible' => TRUE,
+ // Collapsed by default when "Create new revision" is unchecked
+ '#collapsed' => !$node->revision,
+ '#group' => 'additional_settings',
+ '#attached' => array(
+ 'js' => array(drupal_get_path('module', 'node') . '/node.js'),
+ ),
+ '#weight' => 20,
+ '#access' => $node->revision || user_access('administer nodes'),
+ );
+ $form['revision_information']['revision'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Create new revision'),
+ '#default_value' => $node->revision,
+ '#states' => array(
+ // Check the revision log checkbox when the log textarea is filled in.
+ 'checked' => array(
+ 'textarea[name="log"]' => array('empty' => FALSE),
),
- );
- $form['revision_information']['log'] = array(
- '#type' => 'textarea',
- '#title' => t('Revision log message'),
- '#rows' => 4,
- '#default_value' => !empty($node->log) ? $node->log : '',
- '#description' => t('Provide an explanation of the changes you are making. This will help other authors understand your motivations.'),
- );
- }
+ ),
+ '#access' => user_access('administer nodes'),
+ );
+ $form['revision_information']['log'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Revision log message'),
+ '#rows' => 4,
+ '#default_value' => !empty($node->log) ? $node->log : '',
+ '#description' => t('Provide an explanation of the changes you are making. This will help other authors understand your motivations.'),
+ );
// Node author information for administrators
$form['author'] = array(
@@ -535,7 +534,7 @@ function node_revision_overview($node) {
}
$rows[] = array_merge($row, $operations);
}
-
+
$build['node_revisions_table'] = array(
'#theme' => 'table',
'#rows' => $rows,