
| Current Path : /var/www/html/wirtschaftsclub.web-klick.de/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/wirtschaftsclub.web-klick.de/themes/bootstrap/src/Plugin/Preprocess/Links.php |
<?php
namespace Drupal\bootstrap\Plugin\Preprocess;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
/**
* Pre-processes variables for the "links" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("links")
*/
class Links extends PreprocessBase implements PreprocessInterface {
/**
* {@inheritdoc}
*/
public function preprocessVariables(Variables $variables) {
if ($variables->theme_hook_original === 'links' && $variables->hasClass('operations')) {
$variables->addClass('list-inline');
foreach ($variables->links as &$data) {
$link = Element::create($data['link']);
$link->addClass(['btn', 'btn-sm']);
$link->colorize();
$link->setIcon();
if ($this->theme->getSetting('tooltip_enabled')) {
$link->setAttribute('data-toggle', 'tooltip');
$link->setAttribute('data-placement', 'bottom');
}
}
}
$this->preprocessAttributes();
}
}