|
diff --git a/src/Plugin/views/style/Table.php b/src/Plugin/views/style/Table.php |
|
index 89f5212..b219f85 100644 |
|
--- a/src/Plugin/views/style/Table.php |
|
+++ b/src/Plugin/views/style/Table.php |
|
@@ -121,6 +121,21 @@ class Table extends ViewsTable { |
|
], |
|
], |
|
]; |
|
+ |
|
+ $form['info'][$field]['aggr_strip_tags'] = [ |
|
+ '#type' => 'checkbox', |
|
+ '#title' => $this->t('Strip tags'), |
|
+ '#description' => $this->t('Keep it enabled if you are not sure. Disabling it may make up more groups if its markup are dissimilar, especially having link with different href values.'), |
|
+ '#default_value' => isset($this->options['info'][$field]['aggr_strip_tags']) ? $this->options['info'][$field]['aggr_strip_tags'] : TRUE, |
|
+ '#states' => [ |
|
+ 'visible' => [ |
|
+ 'input[name="style_options[info][' . $field . '][has_aggr]"]' => [ |
|
+ 'checked' => TRUE, |
|
+ ], |
|
+ ], |
|
+ ], |
|
+ ]; |
|
+ |
|
// Optional parameter for the selected aggregation function. |
|
$parameter_label = $this->t('Parameter'); |
|
$form['info'][$field]['aggr_par'] = [ |
|
@@ -155,6 +170,7 @@ class Table extends ViewsTable { |
|
], |
|
], |
|
]; |
|
+ |
|
// Optional parameter for the selected column aggregation function. |
|
$form['info'][$field]['aggr_par_column'] = [ |
|
'#type' => 'textfield', |
|
@@ -647,11 +663,16 @@ class Table extends ViewsTable { |
|
else { |
|
$field_name = $field_handler->options['id']; |
|
} |
|
+ $strip_tags = isset($this->options['info'][$field_name]['aggr_strip_tags']) ? $this->options['info'][$field_name]['aggr_strip_tags'] : TRUE; |
|
if (isset($this->rendered_fields[$row_num][$field_name])) { |
|
// Special handling of rendered fields, "Global: Custom text", |
|
// "Global: View" and custom plugin fields. |
|
if ($render === TRUE || $this->isCustomTextField($field_handler) || $this->isViewsFieldView($field_handler) || !in_array($field_handler->getProvider(), ['views', 'webform_views'])) { |
|
- return trim((string) $this->rendered_fields[$row_num][$field_name]); |
|
+ $output = trim((string) $this->rendered_fields[$row_num][$field_name]); |
|
+ if ($strip_tags) { |
|
+ $output = strip_tags($output); |
|
+ } |
|
+ return $output; |
|
} |
|
// Special handling of "Webform submission data". |
|
if ($this->isWebformNumeric($field_handler) || $this->isWebformField($field_handler)) { |
|
diff --git a/views_aggregator.theme.inc b/views_aggregator.theme.inc |
|
index 0973816..825f8f8 100644 |
|
--- a/views_aggregator.theme.inc |
|
+++ b/views_aggregator.theme.inc |
|
@@ -61,6 +61,7 @@ function template_preprocess_views_aggregator_plugin_style_table(array &$variabl |
|
|
|
$multicell_group[] = $form['info'][$id]['has_aggr']; |
|
$multicell_group[] = $form['info'][$id]['aggr']; |
|
+ $multicell_group[] = $form['info'][$id]['aggr_strip_tags']; |
|
$multicell_group[] = $form['info'][$id]['aggr_par']; |
|
$row[]['data'] = $multicell_group; |
|
|