Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 17 |
LanguageEditForm | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 17 |
getFormId | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
form | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
actions | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 8 |
|||
save | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\language\Form\LanguageEditForm. | |
*/ | |
namespace Drupal\language\Form; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* Controller for language edit forms. | |
*/ | |
class LanguageEditForm extends LanguageFormBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getFormId() { | |
// @todo Remove in favour of base method. | |
return 'language_admin_edit_form'; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function form(array $form, FormStateInterface $form_state) { | |
$this->commonForm($form); | |
return parent::form($form, $form_state); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function actions(array $form, FormStateInterface $form_state) { | |
$actions['submit'] = array( | |
'#type' => 'submit', | |
'#value' => $this->t('Save language'), | |
'#validate' => array('::validateCommon'), | |
'#submit' => array('::submitForm', '::save'), | |
); | |
return $actions; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function save(array $form, FormStateInterface $form_state) { | |
parent::save($form, $form_state); | |
$form_state->setRedirectUrl($this->entity->urlInfo('collection')); | |
$this->logger('language')->notice('The %language (%langcode) language has been updated.', array('%language' => $this->entity->label(), '%langcode' => $this->entity->id())); | |
} | |
} |