summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2017-02-12 11:19:32 (GMT)
committerxjm2017-02-12 11:19:32 (GMT)
commit9f208e6f9789b277798a2b696e8a407c17d90edb (patch)
treea5a2dab2c36ea670014aa6c4c17bc961c70fdb7b
parentc87ebca4d8870bdd150a36677811289edfc50909 (diff)
Issue #2049921 by jibran, tim.plunkett: Update the markup in UserMultipleCancelConfirm::buildForm()
-rw-r--r--core/modules/user/src/Form/UserMultipleCancelConfirm.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/modules/user/src/Form/UserMultipleCancelConfirm.php b/core/modules/user/src/Form/UserMultipleCancelConfirm.php
index 1fb6ab1..a97f803 100644
--- a/core/modules/user/src/Form/UserMultipleCancelConfirm.php
+++ b/core/modules/user/src/Form/UserMultipleCancelConfirm.php
@@ -96,6 +96,7 @@ class UserMultipleCancelConfirm extends ConfirmFormBase {
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// Retrieve the accounts to be canceled from the temp store.
+ /* @var \Drupal\user\Entity\User[] $accounts */
$accounts = $this->tempStoreFactory
->get('user_user_operations_cancel')
->get($this->currentUser()->id());
@@ -104,22 +105,27 @@ class UserMultipleCancelConfirm extends ConfirmFormBase {
}
$root = NULL;
- $form['accounts'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
+ $names = [];
+ $form['accounts'] = ['#tree' => TRUE];
foreach ($accounts as $account) {
$uid = $account->id();
+ $names[$uid] = $account->label();
// Prevent user 1 from being canceled.
if ($uid <= 1) {
$root = intval($uid) === 1 ? $account : $root;
continue;
}
- $form['accounts'][$uid] = array(
+ $form['accounts'][$uid] = [
'#type' => 'hidden',
'#value' => $uid,
- '#prefix' => '<li>',
- '#suffix' => $account->label() . "</li>\n",
- );
+ ];
}
+ $form['account']['names'] = [
+ '#theme' => 'item_list',
+ '#items' => $names,
+ ];
+
// Output a notice that user 1 cannot be canceled.
if (isset($root)) {
$redirect = (count($accounts) == 1);