NodePreviewFormSelect.php in Express 8
File
themes/contrib/bootstrap/src/Plugin/Form/NodePreviewFormSelect.php
View source
<?php
namespace Drupal\bootstrap\Plugin\Form;
use Drupal\bootstrap\Annotation\BootstrapForm;
use Drupal\bootstrap\Bootstrap;
use Drupal\bootstrap\Utility\Element;
use Drupal\Core\Form\FormStateInterface;
class NodePreviewFormSelect extends FormBase {
public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
$form
->addClass([
'form-inline',
'bg-info',
'text-center',
'clearfix',
]);
$options = $form->backlink
->getProperty('options', []);
$form->backlink
->addClass(isset($options['attributes']['class']) ? $options['attributes']['class'] : []);
$form->backlink
->addClass([
'btn',
'btn-info',
'pull-left',
]);
$form->backlink
->setButtonSize();
$form->backlink
->setIcon(Bootstrap::glyphicon('chevron-left'));
if ($uuid = $form->uuid
->getProperty('value')) {
$options['query'] = [
'uuid' => $uuid,
];
}
$options['attributes'] = $form->backlink
->getAttributes()
->getArrayCopy();
$form->backlink
->setProperty('options', $options);
$form->view_mode
->addClass('pull-right', $form::WRAPPER);
}
}