Commit 2c24fd40 authored by Dries's avatar Dries

- Patch #668806 by Dave Reid: brought permission handling for node revisions up to standards.

parent 98b84b7a
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment