
| Current Path : /var/www/html1/testsite/web/themes/contrib/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/html1/testsite/web/themes/contrib/bootstrap/src/Plugin/Preprocess/TableSortIndicator.php |
<?php
namespace Drupal\bootstrap\Plugin\Preprocess;
use Drupal\bootstrap\Bootstrap;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
/**
* Pre-processes variables for the "tablesort_indicator" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("tablesort_indicator")
*/
class TableSortIndicator extends PreprocessBase implements PreprocessInterface {
/**
* {@inheritdoc}
*/
public function preprocessVariables(Variables $variables) {
if ($variables->style === 'asc') {
$icon = Element::createStandalone(Bootstrap::glyphicon('chevron-down', ['#markup' => $this->t('(asc)')]))
->addClass('icon-after')
->setAttributes([
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => $this->t('Sort ascending'),
]);
}
else {
$icon = Element::createStandalone(Bootstrap::glyphicon('chevron-up', ['#markup' => $this->t('(desc)')]))
->addClass('icon-after')
->setAttributes([
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => $this->t('Sort descending'),
]);
}
$variables->icon = $icon->getArray();
}
}