diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index ba2d937afd..488e5df72e 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -99,41 +99,41 @@ public function form(array $form, FormStateInterface $form_state) { $form['advanced']['#attributes']['class'][] = 'entity-meta'; - $form['meta'] = array( + $form['meta'] = [ '#type' => 'details', '#group' => 'advanced', '#weight' => -10, '#title' => t('Status'), - ); - $form['meta']['published'] = array( + ]; + $form['meta']['published'] = [ '#type' => 'item', '#markup' => $node->isPublished() ? t('Published') : t('Not published'), '#access' => !$node->isNew(), - ); + ]; $changed = !$node->isNew() ? format_date($node->getChangedTime(), 'short') : t('Not saved yet'); - $form['meta']['changed'] = array( + $form['meta']['changed'] = [ '#type' => 'item', '#title' => t('Last saved'), '#markup' => $changed, - ); + ]; // Add a revision_log field if the "Create new revision" option is checked, // or if the current user has the ability to check that option. - $form['revision_information'] = array( + $form['revision_information'] = [ '#type' => 'details', '#group' => 'advanced', '#title' => t('Revision information'), // Open by default when "Create new revision" is checked. '#open' => $node->isNewRevision(), - '#attributes' => array( - 'class' => array('node-form-revision-information'), - ), - '#attached' => array( - 'library' => array('node/drupal.node'), - ), + '#attributes' => [ + 'class' => ['node-form-revision-information'], + ], + '#attached' => [ + 'library' => ['node/drupal.node'], + ], '#weight' => 20, '#optional' => TRUE, - ); + ]; // Node author information for administrators. $form['author'] = [ diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 4c50390f22..4cee1e93aa 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -158,22 +158,22 @@ function seven_form_node_form_alter(&$form, FormStateInterface $form_state) { $form['advanced']['#type'] = 'container'; - $form['meta']['#attributes'] = array('class' => array('entity-meta__header')); + $form['meta']['#attributes'] = ['class' => ['entity-meta__header']]; $form['meta']['#type'] = 'container'; $form['meta']['published']['#type'] = 'html_tag'; $form['meta']['published']['#tag'] = 'h3'; $form['meta']['published']['#value'] = $form['meta']['published']['#markup']; unset($form['meta']['published']['#markup']); - $form['meta']['published']['#attributes'] = array( + $form['meta']['published']['#attributes'] = [ 'class' => 'entity-meta__title', - ); + ]; $form['meta']['changed']['#title'] = '

' . t('Last saved') . '

'; - $form['meta']['changed']['#wrapper_attributes'] = array('class' => array('entity-meta__last-saved', 'container-inline')); - $form['meta']['author'] = array( + $form['meta']['changed']['#wrapper_attributes'] = ['class' => ['entity-meta__last-saved', 'container-inline']]; + $form['meta']['author'] = [ '#type' => 'item', - '#wrapper_attributes' => array('class' => array('author', 'container-inline')), + '#wrapper_attributes' => ['class' => ['author', 'container-inline']], '#markup' => '

' . t('Author') . '

' . $node->getOwner()->getUsername(), - ); + ]; $form['revision_information']['#type'] = 'container'; $form['revision_information']['#group'] = 'meta';