protected function ProfileFormController::actions

Overrides Drupal\Core\Entity\EntityFormController::actions().

Overrides EntityFormController::actions

File

drupal/core/modules/user/lib/Drupal/user/ProfileFormController.php, line 20
Definition of Drupal\user\ProfileFormController.

Class

ProfileFormController
Form controller for the profile forms.

Namespace

Drupal\user

Code

protected function actions(array $form, array &$form_state) {
  $element = parent::actions($form, $form_state);
  $account = $this
    ->getEntity($form_state);
  $element['delete']['#type'] = 'submit';
  $element['delete']['#value'] = t('Cancel account');
  $element['delete']['#submit'] = array(
    'user_edit_cancel_submit',
  );
  $element['delete']['#access'] = $account->uid > 1 && ($account->uid == $GLOBALS['user']->uid && user_access('cancel account') || user_access('administer users'));
  return $element;
}