Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Drupal\Core\Form; /** * Provides a generic base class for a confirmatio..
Decoded Output download
<?php
namespace Drupal\Core\Form;
/**
* Provides a generic base class for a confirmation form.
*/
abstract class ConfirmFormBase extends FormBase implements ConfirmFormInterface {
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->t('This action cannot be undone.');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this->t('Confirm');
}
/**
* {@inheritdoc}
*/
public function getCancelText() {
return $this->t('Cancel');
}
/**
* {@inheritdoc}
*/
public function getFormName() {
return 'confirm';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['#title'] = $this->getQuestion();
$form['#attributes']['class'][] = 'confirmation';
$form['description'] = ['#markup' => $this->getDescription()];
$form[$this->getFormName()] = ['#type' => 'hidden', '#value' => 1];
$form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->getConfirmText(),
'#button_type' => 'primary',
];
$form['actions']['cancel'] = ConfirmFormHelper::buildCancelLink($this, $this->getRequest());
// By default, render the form using theme_confirm_form().
if (!isset($form['#theme'])) {
$form['#theme'] = 'confirm_form';
}
return $form;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Drupal\Core\Form;
/**
* Provides a generic base class for a confirmation form.
*/
abstract class ConfirmFormBase extends FormBase implements ConfirmFormInterface {
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->t('This action cannot be undone.');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this->t('Confirm');
}
/**
* {@inheritdoc}
*/
public function getCancelText() {
return $this->t('Cancel');
}
/**
* {@inheritdoc}
*/
public function getFormName() {
return 'confirm';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['#title'] = $this->getQuestion();
$form['#attributes']['class'][] = 'confirmation';
$form['description'] = ['#markup' => $this->getDescription()];
$form[$this->getFormName()] = ['#type' => 'hidden', '#value' => 1];
$form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->getConfirmText(),
'#button_type' => 'primary',
];
$form['actions']['cancel'] = ConfirmFormHelper::buildCancelLink($this, $this->getRequest());
// By default, render the form using theme_confirm_form().
if (!isset($form['#theme'])) {
$form['#theme'] = 'confirm_form';
}
return $form;
}
}
Function Calls
None |
Stats
MD5 | c9069c1e5deabfd9aaec124dbe957040 |
Eval Count | 0 |
Decode Time | 80 ms |