summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries2013-01-25 19:49:49 (GMT)
committerDries2013-01-25 19:49:49 (GMT)
commit2a18edd9338430be1a9a93d543eb48183d850650 (patch)
tree143776975751c56beb56d4d0d08103820cb5d97b
parentbb91b33df84609af587a7673a9a5a8fe0b0e6cbe (diff)
Issue #1751606 by swentel, ry5n, mrfelton, nod_, sun, sannejanssen: Move published status checkbox next to 'Save'.
-rw-r--r--core/includes/theme.inc21
-rw-r--r--core/misc/dropbutton/dropbutton.base.css9
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php2
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php2
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php6
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php4
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php11
-rw-r--r--core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php2
-rw-r--r--core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php2
-rw-r--r--core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php7
-rw-r--r--core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php4
-rw-r--r--core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php2
-rw-r--r--core/modules/node/lib/Drupal/node/NodeFormController.php119
-rw-r--r--core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php2
-rw-r--r--core/modules/node/lib/Drupal/node/Tests/PageEditTest.php10
-rw-r--r--core/modules/node/node.admin.css127
-rw-r--r--core/modules/node/node.admin.inc2
-rw-r--r--core/modules/node/node.js15
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php4
-rw-r--r--core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php2
-rw-r--r--core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php10
-rw-r--r--core/themes/seven/style.css23
23 files changed, 330 insertions, 58 deletions
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 5dd028b91..a38dbe0 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1844,6 +1844,24 @@ function theme_dropbutton_wrapper($variables) {
}
/**
+ * Returns HTML for wrapping a dropbutton list.
+ *
+ * Use this function if the dropbutton contains submit buttons. These elements
+ * need to have a #prefix and #suffix element that wraps those into an <li>
+ * element.
+ *
+ * @param array $variables
+ * An associative array containing:
+ * - element: An associative array containing the properties and children of
+ * the dropbutton list. Properties used: #children.
+ */
+function theme_dropbutton_list_wrapper($variables) {
+ if (!empty($variables['element']['#children'])) {
+ return '<ul class="dropbutton">' . $variables['element']['#children'] . '</ul>';
+ }
+}
+
+/**
* Returns HTML for an image.
*
* @param $variables
@@ -3154,6 +3172,9 @@ function drupal_common_theme() {
'dropbutton_wrapper' => array(
'render element' => 'element',
),
+ 'dropbutton_list_wrapper' => array(
+ 'render element' => 'element',
+ ),
'image' => array(
// HTML 4 and XHTML 1.0 always require an alt attribute. The HTML 5 draft
// allows the alt attribute to be omitted in some cases. Therefore,
diff --git a/core/misc/dropbutton/dropbutton.base.css b/core/misc/dropbutton/dropbutton.base.css
index 65ef314..9c1a3ef 100644
--- a/core/misc/dropbutton/dropbutton.base.css
+++ b/core/misc/dropbutton/dropbutton.base.css
@@ -22,6 +22,13 @@
.js .dropbutton-widget {
max-width: 100%;
}
+
+@media screen and (max-width:600px) {
+ .js .dropbutton-wrapper {
+ width: 100%;
+ }
+}
+
.js .dropbutton-widget {
position: absolute;
}
@@ -72,7 +79,7 @@
text-indent: 110%;
top: 0;
white-space: nowrap;
- width: 2em;
+ width: 2.08em;
}
.dropbutton-toggle button {
background: none;
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
index 9d7dd30..9d30a2f 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
@@ -64,7 +64,7 @@ class FileFieldDisplayTest extends FileFieldTestBase {
// Turn the "display" option off and check that the file is no longer displayed.
$edit = array($field_name . '[' . LANGUAGE_NOT_SPECIFIED . '][0][display]' => FALSE);
- $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save and keep published'));
$this->assertNoRaw($default_output, t('Field is hidden when "display" option is unchecked.'));
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
index 480f411..47d19d1 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
@@ -71,7 +71,7 @@ class FileFieldRevisionTest extends FileFieldTestBase {
// Save a new version of the node without any changes.
// Check that the file is still the same as the previous revision.
- $this->drupalPost('node/' . $nid . '/edit', array('revision' => '1'), t('Save'));
+ $this->drupalPost('node/' . $nid . '/edit', array('revision' => '1'), t('Save and keep published'));
$node = node_load($nid, TRUE);
$node_file_r3 = file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid']);
$node_vid_r3 = $node->vid;
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
index 458eb4c..60b5f52 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
@@ -149,7 +149,7 @@ abstract class FileFieldTestBase extends WebTestBase {
// Attach a file to the node.
$edit['files[' . $field_name . '_' . $langcode . '_0]'] = drupal_realpath($file->uri);
- $this->drupalPost("node/$nid/edit", $edit, t('Save'));
+ $this->drupalPost("node/$nid/edit", $edit, t('Save and keep published'));
return $nid;
}
@@ -165,7 +165,7 @@ abstract class FileFieldTestBase extends WebTestBase {
);
$this->drupalPost('node/' . $nid . '/edit', array(), t('Remove'));
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPost(NULL, $edit, t('Save and keep published'));
}
/**
@@ -178,7 +178,7 @@ abstract class FileFieldTestBase extends WebTestBase {
);
$this->drupalPost('node/' . $nid . '/edit', array(), t('Remove'));
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPost(NULL, $edit, t('Save and keep published'));
}
/**
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
index 050931b..7a40a1c 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
@@ -37,7 +37,7 @@ class FileFieldValidateTest extends FileFieldTestBase {
// Try to post a new node without uploading a file.
$langcode = LANGUAGE_NOT_SPECIFIED;
$edit = array("title" => $this->randomName());
- $this->drupalPost('node/add/' . $type_name, $edit, t('Save'));
+ $this->drupalPost('node/add/' . $type_name, $edit, t('Save and publish'));
$this->assertRaw(t('!title field is required.', array('!title' => $instance['label'])), t('Node save failed when required file field was empty.'));
// Create a new node with the uploaded file.
@@ -56,7 +56,7 @@ class FileFieldValidateTest extends FileFieldTestBase {
// Try to post a new node without uploading a file in the multivalue field.
$edit = array('title' => $this->randomName());
- $this->drupalPost('node/add/' . $type_name, $edit, t('Save'));
+ $this->drupalPost('node/add/' . $type_name, $edit, t('Save and publish'));
$this->assertRaw(t('!title field is required.', array('!title' => $instance['label'])), t('Node save failed when required multiple value file field was empty.'));
// Create a new node with the uploaded file into the multivalue field.
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
index 7fcf35f..3d5f782 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
@@ -73,7 +73,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
$this->assertTrue(isset($label[0]), 'Label for upload found.');
// Save the node and ensure it does not have the file.
- $this->drupalPost(NULL, array(), t('Save'));
+ $this->drupalPost(NULL, array(), t('Save and keep published'));
$node = node_load($nid, TRUE);
$this->assertTrue(empty($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid']), t('File was successfully removed from the node.'));
}
@@ -191,7 +191,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
$this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), t('After removing all files, there is no "Remove" button displayed (JSMode=%type).', array('%type' => $type)));
// Save the node and ensure it does not have any files.
- $this->drupalPost(NULL, array('title' => $this->randomName()), t('Save'));
+ $this->drupalPost(NULL, array('title' => $this->randomName()), t('Save and publish'));
$matches = array();
preg_match('/node\/([0-9]+)/', $this->getUrl(), $matches);
$nid = $matches[1];
@@ -268,7 +268,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
$edit = array(
'title' => $this->randomName(),
);
- $this->drupalPost('node/add/article', $edit, t('Save'));
+ $this->drupalPost('node/add/article', $edit, t('Save and publish'));
$node = $this->drupalGetNodeByTitle($edit['title']);
// Add a comment with a file.
@@ -302,10 +302,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
// Unpublishes node.
$this->drupalLogin($this->admin_user);
- $edit = array(
- 'status' => FALSE,
- );
- $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $node->nid . '/edit', array(), t('Save and unpublish'));
// Ensures normal user can no longer download the file.
$this->drupalLogin($user);
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php
index 71e89fb..442eff4 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterHooksTest.php
@@ -71,7 +71,7 @@ class FilterHooksTest extends WebTestBase {
"body[$language_not_specified][0][value]" => $this->randomName(32),
"body[$language_not_specified][0][format]" => $format_id,
);
- $this->drupalPost("node/add/{$type->type}", $edit, t('Save'));
+ $this->drupalPost("node/add/{$type->type}", $edit, t('Save and publish'));
$this->assertText(t('@type @title has been created.', array('@type' => $type_name, '@title' => $title)));
// Disable the text format.
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
index f36c5a9..d54e30a 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
@@ -172,7 +172,7 @@ class ForumBlockTest extends WebTestBase {
);
// Create the forum topic, preselecting the forum ID via a URL parameter.
- $this->drupalPost('node/add/forum/1', $edit, t('Save'));
+ $this->drupalPost('node/add/forum/1', $edit, t('Save and publish'));
$topics[] = $title;
}
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php
index 7ae7d5f..27e4384 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumIndexTest.php
@@ -55,7 +55,7 @@ class ForumIndexTest extends WebTestBase {
);
// Create the forum topic, preselecting the forum ID via a URL parameter.
- $this->drupalPost('node/add/forum/' . $tid, $edit, t('Save'));
+ $this->drupalPost('node/add/forum/' . $tid, $edit, t('Save and publish'));
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($title);
@@ -66,10 +66,7 @@ class ForumIndexTest extends WebTestBase {
$this->assertText($title, 'Published forum topic appears on index.');
// Unpublish the node.
- $edit = array(
- 'status' => FALSE,
- );
- $this->drupalPost("node/{$node->nid}/edit", $edit, t('Save'));
+ $this->drupalPost("node/{$node->nid}/edit", array(), t('Save and unpublish'));
$this->drupalGet("node/{$node->nid}");
$this->assertText(t('Access denied'), 'Unpublished node is no longer accessible.');
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
index 1cfda9f..7c42a5b 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
@@ -187,7 +187,7 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
$field_name . '[' . LANGUAGE_NOT_SPECIFIED . '][0][alt]' => $image_info['alt'],
$field_name . '[' . LANGUAGE_NOT_SPECIFIED . '][0][title]' => $image_info['title'],
);
- $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save and keep published'));
$default_output = theme('image', $image_info);
$this->assertRaw($default_output, 'Image displayed using user supplied alt and title attributes.');
@@ -197,7 +197,7 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
$field_name . '[' . LANGUAGE_NOT_SPECIFIED . '][0][alt]' => $this->randomName($test_size),
$field_name . '[' . LANGUAGE_NOT_SPECIFIED . '][0][title]' => $this->randomName($test_size),
);
- $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save and keep published'));
$this->assertRaw(t('Alternate text cannot be longer than %max characters but is currently %length characters long.', array(
'%max' => $schema['fields'][$field_name .'_alt']['length'],
'%length' => $test_size,
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php
index f3f7f86..5a4e20e 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldTestBase.php
@@ -118,7 +118,7 @@ abstract class ImageFieldTestBase extends WebTestBase {
'title' => $this->randomName(),
);
$edit['files[' . $field_name . '_' . LANGUAGE_NOT_SPECIFIED . '_0]'] = drupal_realpath($image->uri);
- $this->drupalPost('node/add/' . $type, $edit, t('Save'));
+ $this->drupalPost('node/add/' . $type, $edit, t('Save and publish'));
// Retrieve ID of the newly created node from the current URL.
$matches = array();
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 47e1f30..a7354ee 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -239,7 +239,7 @@ class NodeFormController extends EntityFormController {
$form['options'] = array(
'#type' => 'details',
'#access' => user_access('administer nodes'),
- '#title' => t('Publishing options'),
+ '#title' => t('Promotion options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#group' => 'advanced',
@@ -252,12 +252,6 @@ class NodeFormController extends EntityFormController {
'#weight' => 95,
);
- $form['options']['status'] = array(
- '#type' => 'checkbox',
- '#title' => t('Published'),
- '#default_value' => $node->status,
- );
-
$form['options']['promote'] = array(
'#type' => 'checkbox',
'#title' => t('Promoted to front page'),
@@ -281,6 +275,89 @@ class NodeFormController extends EntityFormController {
}
/**
+ * Overrides Drupal\entity\EntityFormController::actionsElement().
+ */
+ protected function actionsElement(array $form, array &$form_state) {
+ $element = parent::actionsElement($form, $form_state);
+ $node = $this->getEntity($form_state);
+
+ // Because some of the 'links' are actually submit buttons, we have to
+ // manually wrap each item in <li> and the whole list in <ul>. The
+ // <ul> is added with a #theme_wrappers function.
+ $element['operations'] = array(
+ '#type' => 'operations',
+ '#subtype' => 'node',
+ '#attached' => array (
+ 'css' => array(
+ drupal_get_path('module', 'node') . '/node.admin.css',
+ ),
+ ),
+ );
+
+ $element['operations']['actions'] = array(
+ '#theme_wrappers' => array('dropbutton_list_wrapper')
+ );
+
+ // Depending on the state of the node (published or unpublished) and
+ // whether the current user has the permission to change the status, the
+ // labels and order of the buttons will vary.
+ if (user_access('administer nodes')) {
+ $element['operations']['actions']['publish'] = array(
+ '#type' => 'submit',
+ '#value' => t('Save and publish'),
+ '#submit' => array(array($this, 'publish'), array($this, 'submit'), array($this, 'save')),
+ '#validate' => array(array($this, 'validate')),
+ '#button_type' => $node->status ? 'primary' : '',
+ '#weight' => 0,
+ '#prefix' => '<li class="publish">',
+ '#suffix' => '</li>',
+ );
+ $element['operations']['actions']['unpublish'] = array(
+ '#type' => 'submit',
+ '#value' => t('Save as unpublished'),
+ '#submit' => array(array($this, 'unpublish'), array($this, 'submit'), array($this, 'save')),
+ '#validate' => array(array($this, 'validate')),
+ '#button_type' => empty($node->status) ? 'primary' : '',
+ '#weight' => $node->status ? 1 : -1,
+ '#prefix' => '<li class="unpublish">',
+ "#suffix" => '</li>',
+ );
+
+ if (!empty($node->nid)) {
+ if ($node->status) {
+ $publish_label = t('Save and keep published');
+ $unpublish_label = t('Save and unpublish');
+ }
+ else {
+ $publish_label = t('Save and publish');
+ $unpublish_label = t('Save and keep unpublished');
+ }
+ $element['operations']['actions']['publish']['#value'] = $publish_label;
+ $element['operations']['actions']['unpublish']['#value'] = $unpublish_label;
+ }
+ }
+ // The user has no permission to change the status of the node. Just
+ // show a save button without the 'publish' or 'unpublish' callback in
+ // the #submit definition.
+ else {
+ $element['operations']['actions']['save'] = array(
+ '#type' => 'submit',
+ '#value' => t('Save'),
+ '#submit' => array(array($this, 'submit'), array($this, 'save')),
+ '#validate' => array(array($this, 'validate')),
+ '#button_type' => 'primary',
+ '#weight' => 1,
+ '#prefix' => '<li class="save">',
+ "#suffix" => '</li>',
+ );
+ }
+
+ unset($element['submit']);
+
+ return $element;
+ }
+
+ /*
* Overrides Drupal\Core\Entity\EntityFormController::actions().
*/
protected function actions(array $form, array &$form_state) {
@@ -387,6 +464,34 @@ class NodeFormController extends EntityFormController {
}
/**
+ * Form submission handler for the 'publish' action.
+ *
+ * @param $form
+ * An associative array containing the structure of the form.
+ * @param $form_state
+ * A reference to a keyed array containing the current state of the form.
+ */
+ public function publish(array $form, array &$form_state) {
+ $node = $this->getEntity($form_state);
+ $node->status = TRUE;
+ return $node;
+ }
+
+ /**
+ * Form submission handler for the 'unpublish' action.
+ *
+ * @param $form
+ * An associative array containing the structure of the form.
+ * @param $form_state
+ * A reference to a keyed array containing the current state of the form.
+ */
+ public function unpublish(array $form, array &$form_state) {
+ $node = $this->getEntity($form_state);
+ $node->status = FALSE;
+ return $node;
+ }
+
+ /**
* Overrides Drupal\Core\Entity\EntityFormController::save().
*/
public function save(array $form, array &$form_state) {
diff --git a/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php
index 2821f7e..7ee1e85 100644
--- a/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/MultiStepNodeFormBasicOptionsTest.php
@@ -68,13 +68,11 @@ class MultiStepNodeFormBasicOptionsTest extends NodeTestBase {
$edit = array(
'title' => 'a',
- 'status' => FALSE,
'promote' => FALSE,
'sticky' => 1,
"$this->field_name[$langcode][0][value]" => $this->randomString(32),
);
$this->drupalPost('node/add/page', $edit, t('Add another item'));
- $this->assertNoFieldChecked('edit-status', 'status stayed unchecked');
$this->assertNoFieldChecked('edit-promote', 'promote stayed unchecked');
$this->assertFieldChecked('edit-sticky', 'sticky stayed checked');
}
diff --git a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
index 20ebfbd..b461492 100644
--- a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
@@ -81,7 +81,7 @@ class PageEditTest extends NodeTestBase {
$edit['title'] = $this->randomName(8);
$edit[$body_key] = $this->randomName(16);
$edit['revision'] = TRUE;
- $this->drupalPost(NULL, $edit, t('Save'));
+ $this->drupalPost(NULL, $edit, t('Save and keep published'));
// Ensure that the node revision has been created.
$revised_node = $this->drupalGetNodeByTitle($edit['title'], TRUE);
@@ -108,7 +108,7 @@ class PageEditTest extends NodeTestBase {
$edit = array();
$edit['title'] = $this->randomName(8);
$edit[$body_key] = $this->randomName(16);
- $this->drupalPost('node/add/page', $edit, t('Save'));
+ $this->drupalPost('node/add/page', $edit, t('Save and publish'));
// Check that the node was authored by the currently logged in user.
$node = $this->drupalGetNodeByTitle($edit['title']);
@@ -118,20 +118,20 @@ class PageEditTest extends NodeTestBase {
$edit = array(
'name' => 'invalid-name',
);
- $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
$this->assertText('The username invalid-name does not exist.');
// Change the authored by field to an empty string, which should assign
// authorship to the anonymous user (uid 0).
$edit['name'] = '';
- $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
$node = node_load($node->nid, TRUE);
$this->assertIdentical($node->uid, '0', 'Node authored by anonymous user.');
// Change the authored by field to another user's name (that is not
// logged in).
$edit['name'] = $this->web_user->name;
- $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
$node = node_load($node->nid, TRUE);
$this->assertIdentical($node->uid, $this->web_user->uid, 'Node authored by normal user.');
diff --git a/core/modules/node/node.admin.css b/core/modules/node/node.admin.css
index 101a38d..9ef08e1 100644
--- a/core/modules/node/node.admin.css
+++ b/core/modules/node/node.admin.css
@@ -9,3 +9,130 @@
.revision-current {
background: #ffc;
}
+
+/**
+ * Node form dropbuttons.
+ */
+.form-actions .dropbutton-wrapper {
+ float: left;
+ margin-right: 1em;
+}
+
+.form-actions .dropbutton-wrapper .dropbutton-widget {
+ position: static;
+}
+
+.form-actions .dropbutton-wrapper li a,
+.form-actions .dropbutton-wrapper input {
+ padding: 5px 17px 6px 17px;
+ margin-bottom: 0em;
+ border: medium;
+ border-radius: 0;
+ background: none;
+}
+
+.form-actions .dropbutton-wrapper input:hover {
+ background: none;
+ border: none;
+}
+
+.form-actions .button {
+ background: #fefefe;
+ background-image: -webkit-linear-gradient(top, #fefefe, #e0e0e0);
+ background-image: -moz-linear-gradient(top, #fefefe, #e0e0e0);
+ background-image: -o-linear-gradient(top, #fefefe, #e0e0e0);
+ background-image: linear-gradient(to bottom, #fefefe, #e0e0e0);
+ border: 1px solid #c8c8c8;
+ border-radius: 3px;
+ text-decoration: none;
+ padding: 6px 17px 6px 17px;
+ margin-left: 0;
+}
+
+.form-actions .button:focus,
+.form-actions .button:hover {
+ background: #fefefe;
+ background-image: -webkit-linear-gradient(top, #fefefe, #eaeaea);
+ background-image: -moz-linear-gradient(top, #fefefe, #eaeaea);
+ background-image: -o-linear-gradient(top, #fefefe, #eaeaea);
+ background-image: linear-gradient(to bottom, #fefefe, #eaeaea);
+ -webkit-box-shadow: 1px 1px 3px rgba(50, 50, 50, 0.1);
+ box-shadow: 1px 1px 3px rgba(50, 50, 50, 0.1);
+ color: #2e2e2e;
+ text-decoration: none;
+}
+.form-actions .button:active {
+ border: 1px solid #c8c8c8;
+ background: #fefefe;
+ background-image: -webkit-linear-gradient(top, #eaeaea, #fefefe);
+ background-image: -moz-linear-gradient(top, #eaeaea, #fefefe);
+ background-image: -o-linear-gradient(top, #eaeaea, #fefefe);
+ background-image: linear-gradient(to bottom, #eaeaea, #fefefe);
+ -webkit-box-shadow: 1px 1px 3px rgba(50, 50, 50, 0.1);
+ box-shadow: 1px 1px 3px rgba(50, 50, 50, 0.1);
+ color: #2e2e2e;
+ text-decoration: none;
+ text-shadow: none;
+}
+
+/* Delete button */
+.form-actions .button-danger {
+ color: #c72100;
+ background: none;
+ border: none;
+ float: right;
+ margin-right: 0;
+ margin-left: 0;
+ padding-right: 0;
+ padding-left: 0;
+}
+.form-actions .button-danger:hover,
+.form-actions .button-danger:focus {
+ color: #ff2a00;
+ background: none;
+ border: none;
+ text-decoration: underline;
+}
+.form-actions .button-danger:active {
+ color: #ff2a00;
+ background: none;
+ border: none;
+ text-decoration: underline;
+}
+
+
+/**
+ * Form edit action theming
+ */
+.js .form-actions .dropbutton-widget {
+ background-color: #50a0e9;
+ background-image: -moz-linear-gradient(-90deg, #50a0e9, #4481dc);
+ background-image: -o-linear-gradient(-90deg, #50a0e9, #4481dc);
+ background-image: -webkit-linear-gradient(-90deg, #50a0e9, #4481dc);
+ background-image: linear-gradient(180deg, #50a0e9, #4481dc);
+ border-radius: 3px;
+ border: 1px solid #3974ae;
+}
+.js .form-actions .dropbutton-widget .dropbutton li {
+ border-top: 1px solid rgba(255, 255, 255, 0.5);
+ border-top-left-radius: 3px;
+}
+.js .form-actions .dropbutton-widget .dropbutton .dropbutton-toggle {
+ border-top-left-radius: 0px;
+ border-top-right-radius: 3px;
+ top: 1px;
+}
+.js .form-actions .dropbutton-widget .dropbutton .secondary-action {
+ border-top: 1px solid rgba(255, 255, 255, 0.3);
+ border-top-left-radius: 0px;
+}
+.js .form-actions .dropbutton-widget .button {
+ color: #ffffff;
+ text-shadow: 1px 1px 1px rgba(31, 83, 131, 0.8);
+}
+.js .form-actions .dropbutton-multiple.open .dropbutton-action:hover {
+ background-color: #50a0e9;
+}
+
+
+
diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc
index 74f100c..10a12c6 100644
--- a/core/modules/node/node.admin.inc
+++ b/core/modules/node/node.admin.inc
@@ -435,7 +435,7 @@ function node_admin_nodes() {
'#attributes' => array('class' => array('container-inline')),
'#access' => $admin_access,
'#attached' => array (
- 'css' => array(drupal_get_path('module', 'node') . '/node.admin.css'),
+ 'css' => array(drupal_get_path('module', 'node') . '/css/node-admin.theme.css'),
),
);
$options = array();
diff --git a/core/modules/node/node.js b/core/modules/node/node.js
index cdc8cbe..b61c117 100644
--- a/core/modules/node/node.js
+++ b/core/modules/node/node.js
@@ -38,14 +38,15 @@ Drupal.behaviors.nodeDetailsSummaries = {
var $context = $(context);
var vals = [];
- $context.find('input:checked').parent().each(function () {
- vals.push(Drupal.checkPlain($.trim($(this).text())));
- });
-
- if (!$context.find('.form-item-status input').is(':checked')) {
- vals.unshift(Drupal.t('Not published'));
+ if ($context.find('input').is(':checked')) {
+ $context.find('input:checked').parent().each(function () {
+ vals.push(Drupal.checkPlain($.trim($(this).text())));
+ });
+ return vals.join(', ');
+ }
+ else {
+ return Drupal.t('Not promoted');
}
- return vals.join(', ');
});
$context.find('fieldset.node-translation-options').drupalSetSummary(function (context) {
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
index 3e80c72..894fd67 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
@@ -45,7 +45,7 @@ class SearchConfigSettingsFormTest extends SearchTestBase {
$langcode = LANGUAGE_NOT_SPECIFIED;
$body_key = "body[$langcode][0][value]";
$edit[$body_key] = l($node->label(), 'node/' . $node->nid) . ' pizza sandwich';
- $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+ $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
node_update_index();
search_update_totals();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index dcf53b0..60d526b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -282,7 +282,7 @@ class BreadcrumbTest extends MenuTestBase {
$edit = array(
'menu[parent]' => $link['menu_name'] . ':' . $link['mlid'],
);
- $this->drupalPost("node/{$parent->nid}/edit", $edit, t('Save'));
+ $this->drupalPost("node/{$parent->nid}/edit", $edit, t('Save and keep published'));
$expected = array(
"node" => $link['link_title'],
);
@@ -308,7 +308,7 @@ class BreadcrumbTest extends MenuTestBase {
$edit = array(
"field_tags[$langcode]" => implode(',', array_keys($tags)),
);
- $this->drupalPost("node/{$parent->nid}/edit", $edit, t('Save'));
+ $this->drupalPost("node/{$parent->nid}/edit", $edit, t('Save and keep published'));
// Put both terms into a hierarchy Drupal ยป Breadcrumbs. Required for both
// the menu links and the terms itself, since taxonomy_term_page() resets
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php
index d00f373..b9898c6 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php
@@ -39,7 +39,7 @@ class LegacyTest extends TaxonomyTestBase {
$edit['date'] = '1969-01-01 00:00:00 -0500';
$edit["body[$langcode][0][value]"] = $this->randomName();
$edit["field_tags[$langcode]"] = $this->randomName();
- $this->drupalPost('node/add/article', $edit, t('Save'));
+ $this->drupalPost('node/add/article', $edit, t('Save and publish'));
// Checks that the node has been saved.
$node = $this->drupalGetNodeByTitle($edit['title']);
$this->assertEqual($node->created, strtotime($edit['date']), 'Legacy node was saved with the right date.');
diff --git a/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php b/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php
index b3c1ec1..5dfd181 100644
--- a/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php
+++ b/core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php
@@ -75,9 +75,9 @@ class TranslationTest extends WebTestBase {
// Unpublish the original node to check that this has no impact on the
// translation overview page, publish it again afterwards.
$this->drupalLogin($this->admin_user);
- $this->drupalPost('node/' . $node->nid . '/edit', array('status' => FALSE), t('Save'));
+ $this->drupalPost('node/' . $node->nid . '/edit', array(), t('Save and unpublish'));
$this->drupalGet('node/' . $node->nid . '/translate');
- $this->drupalPost('node/' . $node->nid . '/edit', array('status' => NODE_PUBLISHED), t('Save'));
+ $this->drupalPost('node/' . $node->nid . '/edit', array(), t('Save and publish'));
$this->drupalLogin($this->translator);
// Check that the "add translation" link uses a localized path.
@@ -169,8 +169,7 @@ class TranslationTest extends WebTestBase {
// Unpublish the Spanish translation to check that the related language
// switch link is not shown.
$this->drupalLogin($this->admin_user);
- $edit = array('status' => FALSE);
- $this->drupalPost("node/$translation_es->nid/edit", $edit, t('Save'));
+ $this->drupalPost("node/$translation_es->nid/edit", array(), t('Save and unpublish'));
$this->drupalLogin($this->translator);
$this->assertLanguageSwitchLinks($node, $translation_es, FALSE);
@@ -180,8 +179,7 @@ class TranslationTest extends WebTestBase {
$edit = array('language_interface[enabled][language-url]' => FALSE);
$this->drupalPost('admin/config/regional/language/detection', $edit, t('Save settings'));
$this->resetCaches();
- $edit = array('status' => TRUE);
- $this->drupalPost("node/$translation_es->nid/edit", $edit, t('Save'));
+ $this->drupalPost("node/$translation_es->nid/edit", array(), t('Save and publish'));
$this->drupalLogin($this->translator);
$this->assertLanguageSwitchLinks($node, $translation_es, TRUE, 'node');
}
diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css
index d6486c7..a72d686 100644
--- a/core/themes/seven/style.css
+++ b/core/themes/seven/style.css
@@ -794,9 +794,12 @@ select.form-select:focus {
margin-right: 0;
margin-top: 10px;
padding-bottom: 6px;
- padding-top: 6px;
width: 100%;
}
+ .form-actions input:first-child,
+ .form-wrapper input[type="submit"]:first-child {
+ margin-top: 0;
+ }
.exposed-filters .filters,
.exposed-filters .form-item label,
.exposed-filters .form-select {
@@ -1114,6 +1117,24 @@ div.add-or-remove-shortcuts {
text-overflow: clip;
}
+.js .form-actions .dropbutton-widget:focus,
+.js .form-actions .dropbutton-widget:hover {
+ background-color: #73b3dd;
+ border: 1px solid #6ea3bf;
+ border-bottom-color: #4680a0;
+}
+.js .form-actions .dropbutton-widget:active {
+ background-color: #3981b1;
+ border: 1px solid #36647c;
+ border-bottom-color: #284657;
+}
+.js .form-actions .dropbutton-multiple.open .dropbutton-widget:hover {
+ background-color: #9dcae7;
+}
+.js .form-actions .dropbutton-multiple.open .dropbutton-action:hover {
+ background-color: #73b3dd;
+}
+
/* Disable overlay message */
#overlay-disable-message {
background-color: #addafc;