You are here

protected function Dropdown::preprocessLinks in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()
  2. 8 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()
  3. 8.2 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()
  4. 8.4 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()
  5. 8.5 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()
  6. 8.6 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()
  7. 8.7 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()
  8. 8.8 themes/socialbase/src/Plugin/Preprocess/Dropdown.php \Drupal\socialbase\Plugin\Preprocess\Dropdown::preprocessLinks()

Function to preprocess the links.

Overrides BootstrapDropdown::preprocessLinks

File

themes/socialbase/src/Plugin/Preprocess/Dropdown.php, line 40

Class

Dropdown
Pre-processes variables for the "bootstrap_dropdown" theme hook.

Namespace

Drupal\socialbase\Plugin\Preprocess

Code

protected function preprocessLinks(Variables $variables) {
  parent::preprocessLinks($variables);
  $operations = !!Unicode::strpos($variables->theme_hook_original, 'operations');

  // Make operations button small, not smaller ;).
  // Bootstrap basetheme override.
  if ($operations) {
    $variables->toggle['#attributes']['class'] = [
      'btn-sm',
    ];
    $variables['btn_context'] = 'operations';
    $variables['alignment'] = 'right';
  }
}