Commit 2a18edd9 authored by Dries's avatar Dries

Issue #1751606 by swentel, ry5n, mrfelton, nod_, sun, sannejanssen: Move...

Issue #1751606 by swentel, ry5n, mrfelton, nod_, sun, sannejanssen: Move published status checkbox next to 'Save'.
parent bb91b33d
......@@ -1843,6 +1843,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.
*
......@@ -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,
......
......@@ -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;
......
......@@ -64,7 +64,7 @@ function testNodeDisplay() {
// 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.'));
......
......@@ -71,7 +71,7 @@ function testRevisions() {
// 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;
......
......@@ -149,7 +149,7 @@ function uploadNodeFile($file, $field_name, $nid_or_type, $new_revision = TRUE,
// 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 @@ function removeNodeFile($nid, $new_revision = TRUE) {
);
$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 @@ function replaceNodeFile($file, $field_name, $nid, $new_revision = TRUE) {
);
$this->drupalPost('node/' . $nid . '/edit', array(), t('Remove'));
$this->drupalPost(NULL, $edit, t('Save'));
$this->drupalPost(NULL, $edit, t('Save and keep published'));
}
/**
......
......@@ -37,7 +37,7 @@ function testRequired() {
// 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 @@ function testRequired() {
// 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.
......
......@@ -73,7 +73,7 @@ function testSingleValuedWidget() {
$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 @@ function testMultiValuedWidget() {
$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 @@ function testPrivateFileComment() {
$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 @@ function testPrivateFileComment() {
// 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);
......
......@@ -71,7 +71,7 @@ function testFilterHooks() {
"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.
......
......@@ -172,7 +172,7 @@ protected function createForumTopics($count = 5) {
);
// 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;
}
......
......@@ -55,7 +55,7 @@ function testForumIndexStatus() {
);
// 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 @@ function testForumIndexStatus() {
$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.');
......
......@@ -187,7 +187,7 @@ function testImageFieldSettings() {
$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 @@ function testImageFieldSettings() {
$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,
......
......@@ -118,7 +118,7 @@ function uploadNodeImage($image, $field_name, $type) {
'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();
......
......@@ -239,7 +239,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) {
$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 @@ public function form(array $form, array &$form_state, EntityInterface $node) {
'#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 @@ public function form(array $form, array &$form_state, EntityInterface $node) {
}
/**
* 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) {
......@@ -386,6 +463,34 @@ public function preview(array $form, array &$form_state) {
$form_state['rebuild'] = TRUE;
}
/**
* 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().
*/
......
......@@ -68,13 +68,11 @@ function testMultiStepNodeFormBasicOptions() {
$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');
}
......
......@@ -81,7 +81,7 @@ function testPageEdit() {
$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 @@ function testPageAuthoredBy() {
$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 @@ function testPageAuthoredBy() {
$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.');
......
......@@ -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;
}
......@@ -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();
......
......@@ -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) {
......
......@@ -45,7 +45,7 @@ function setUp() {
$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();
......
......@@ -282,7 +282,7 @@ function testBreadCrumbs() {
$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 @@ function testBreadCrumbs() {
$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
......
......@@ -39,7 +39,7 @@ function testTaxonomyLegacyNode() {
$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.');
......
......@@ -75,9 +75,9 @@ function testContentTranslation() {
// 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 @@ function testLanguageSwitchLinks() {
// 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 @@ function testLanguageSwitchLinks() {
$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');
}
......
......@@ -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;