Commit 989e2915 authored by Sven Decabooter's avatar Sven Decabooter Committed by Steven Jones
Browse files

[#3244450] feat: Adding title to attached export icons

By: samalander
By: drasgardian
By: svendecabooter
By: kala4ek
By: steven jones
parent 918f0837
Loading
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -615,13 +615,8 @@ class DataExport extends RestExport {
    $clone->setArguments($this->view->args);
    $clone->setDisplay($this->display['id']);
    $clone->buildTitle();
    $displays = $clone->storage->get('display');
    $title = $clone->getTitle();

    if (!empty($displays[$this->display['id']])) {
      $title = $displays[$this->display['id']]['display_title'];
    }

    if ($plugin = $clone->display_handler->getPlugin('style')) {
      if ($clone->hasUrl()) {
        $plugin->attachTo($build, $display_id, $clone->getUrl(), $title);
+1 −0
Original line number Diff line number Diff line
@@ -297,6 +297,7 @@ class DataExport extends Serializer {
      '#theme' => 'export_icon',
      '#url' => $url,
      '#format' => mb_strtoupper($format),
      '#title' => $title,
      '#theme_wrappers' => [
        'container' => [
          '#attributes' => [
+10 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ function views_data_export_theme() {
      'variables' => [
        'format' => NULL,
        'url' => NULL,
        'title' => NULL,
      ],
    ],
  ];
@@ -86,3 +87,12 @@ function views_data_export_views_query_alter(ViewExecutable $view, QueryPluginBa
    $facet_manager->alterQuery($search_query, $facet_source);
  }
}

/**
 * Implements hook_preprocess_export_icon().
 */
function views_data_export_preprocess_export_icon(&$variables) {
  if (isset($variables['title'])) {
    $variables['attributes']['title'] = $variables['title'];
  }
}