Update to Drupal 8.0.5. For more information, see https://www.drupal.org/node/2679347

This commit is contained in:
Pantheon Automation 2016-03-02 12:40:24 -08:00 committed by Greg Anderson
parent 2a9f1f148d
commit fd3b12cf27
251 changed files with 5439 additions and 957 deletions

View file

@ -131,7 +131,7 @@ class TimestampFormatter extends FormatterBase implements ContainerFactoryPlugin
);
$elements['custom_date_format']['#states']['visible'][] = array(
':input[name="name="fields[' . $this->fieldDefinition->getName() . '][settings_edit_form][settings][date_format]"]' => array('value' => 'custom'),
':input[name="fields[' . $this->fieldDefinition->getName() . '][settings_edit_form][settings][date_format]"]' => array('value' => 'custom'),
);
$elements['timezone'] = array(

View file

@ -10,6 +10,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\Email;
/**
* Plugin implementation of the 'email_default' widget.
@ -29,6 +30,7 @@ class EmailDefaultWidget extends WidgetBase {
*/
public static function defaultSettings() {
return array(
'size' => 60,
'placeholder' => '',
) + parent::defaultSettings();
}
@ -37,6 +39,13 @@ class EmailDefaultWidget extends WidgetBase {
* {@inheritdoc}
*/
public function settingsForm(array $form, FormStateInterface $form_state) {
$element['size'] = array(
'#type' => 'number',
'#title' => $this->t('Textfield size'),
'#default_value' => $this->getSetting('size'),
'#required' => TRUE,
'#min' => 1,
);
$element['placeholder'] = array(
'#type' => 'textfield',
'#title' => t('Placeholder'),
@ -59,6 +68,7 @@ class EmailDefaultWidget extends WidgetBase {
else {
$summary[] = t('No placeholder');
}
$summary[] = t('Textfield size: @size', array('@size' => $this->getSetting('size')));
return $summary;
}
@ -71,6 +81,8 @@ class EmailDefaultWidget extends WidgetBase {
'#type' => 'email',
'#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : NULL,
'#placeholder' => $this->getSetting('placeholder'),
'#size' => $this->getSetting('size'),
'#maxlength' => Email::EMAIL_MAX_LENGTH,
);
return $element;
}