
| Current Path : /var/www/html/12park_old/web/themes/bootstrap/src/Plugin/Preprocess/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/12park_old/web/themes/bootstrap/src/Plugin/Preprocess/FieldMultipleValueForm.php |
<?php
namespace Drupal\bootstrap\Plugin\Preprocess;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
/**
* Pre-processes variables for the "field_multiple_value_form" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("field_multiple_value_form")
*/
class FieldMultipleValueForm extends PreprocessBase implements PreprocessInterface {
/**
* {@inheritdoc}
*/
public function preprocessElement(Element $element, Variables $variables) {
// Wrap header columns in label element for Bootstrap.
if ($variables['multiple']) {
$header = [
[
'data' => [
'#prefix' => '<label class="label">',
'title' => ['#markup' => $element->getProperty('title')],
'#suffix' => '</label>',
],
'colspan' => 2,
'class' => [
'field-label',
!empty($element['#required']) ? 'form-required' : '',
],
],
t('Order', [], ['context' => 'Sort order']),
];
$variables['table']['#header'] = $header;
}
}
}