Skip to content

Commit bae37ae

Browse files
committed
Add setting "allow_remove_tags_in_glossary_export" BT#10895
1 parent 99f39aa commit bae37ae

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

main/glossary/index.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,16 @@ function sorter($item1, $item2)
355355
'ASC'
356356
);
357357

358-
usort($data, "sorter");
358+
usort($data, 'sorter');
359359
$list = [];
360360
$list[] = ['term', 'definition'];
361+
$allowStrip = api_get_configuration_value('allow_remove_tags_in_glossary_export');
361362
foreach ($data as $line) {
362-
$list[] = [$line[0], $line[1]];
363+
$definition = $line[1];
364+
if ($allowStrip) {
365+
$definition = strip_tags($definition);
366+
}
367+
$list[] = [$line[0], $definition];
363368
}
364369
$filename = 'glossary_course_'.api_get_course_id();
365370
Export::arrayToCsv($list, $filename);

main/install/configuration.dist.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,9 @@
738738
// Generate random login when importing users
739739
//$_configuration['generate_random_login'] = false;
740740

741+
// Remove html tags when exporting glossary definitions in a CSV file
742+
//$_configuration['allow_remove_tags_in_glossary_export'] = false;
743+
741744
// ------ Custom DB changes
742745
// Add user activation by confirmation email
743746
// This option prevents the new user to login in the platform if your account is not confirmed via email

0 commit comments

Comments
 (0)