diff --git a/php_library/directory_content.php b/php_library/directory_content.php index 686407cc6d55e1833db569302aa8b3549424e51c..530e94f7247253b6395e8869da342d8415f42633 100644 --- a/php_library/directory_content.php +++ b/php_library/directory_content.php @@ -178,7 +178,7 @@ foreach ($scholars as $scholar) { if ($scholar['keywords'] != null) { // TODO change strategy : add email, check if we want to keep phone // if (($scholar['keywords'] != null) || ($scholar['address'] != null) || ($scholar['phone'] != null)) { - $content .= '<div class="span3" align="justify">'; + $content .= '<div class="span3" align="left">'; if ($scholar['keywords'] != null){ $content .= '<i class="icon-tags"></i> ' . clean_exp($scholar['keywords']). '.<br/><br/>'; diff --git a/php_library/normalize.php b/php_library/normalize.php index 308c4b722d5b44c4d10c1b2c0878e215c3d7a05b..ad136609a7f2821ef46ab22fe933af70329dc949 100644 --- a/php_library/normalize.php +++ b/php_library/normalize.php @@ -68,4 +68,21 @@ function sanitize_input($value) { return $value; } +// for html display of concatenated lists +// to make spaces insides the elements unbreakable +function split_join_keywords_for_html($str_value) { + $arr = explode(',', $str_value); + $mod_arr = []; + + foreach ($arr as $kw) { + if (strlen(str_replace(' ', '', $kw))) { + $mod_kw = str_replace(' ', ' ', $kw) ; + array_push($mod_arr, $mod_kw); + } + + } + + return join(', ', $mod_arr); +} + ?> diff --git a/print_directory.php b/print_directory.php index bfd0358dc13832acfafc02e153de19371da98cdf..ef685f2434783252977244b95e077da7d05c989b 100644 --- a/print_directory.php +++ b/print_directory.php @@ -316,7 +316,7 @@ foreach ($base->query($sql) as $row) { // retrieved from secondary table and GROUP_CONCATenated $info['keywords_ids'] = explode(',', $row['keywords_ids']); $info['nb_keywords'] = $row['keywords_nb']; - $info['keywords'] = $row['keywords_list']; + $info['keywords'] = split_join_keywords_for_html($row['keywords_list']); // $info['status'] = $row['status']; diff --git a/print_scholar_directory.php b/print_scholar_directory.php index 0006ff7432fdc3916b60c40d42d80d454b357aa8..8a4d55307e0af76c96aec73a6d05412d5b9f111d 100644 --- a/print_scholar_directory.php +++ b/print_scholar_directory.php @@ -155,7 +155,7 @@ foreach ($base->query($sql) as $row) { // retrieved from secondary table and GROUP_CONCATenated $info['keywords_ids'] = explode(',', $row['keywords_ids']); $info['nb_keywords'] = $row['keywords_nb']; - $info['keywords'] = $row['keywords_list']; + $info['keywords'] = split_join_keywords_for_html($row['keywords_list']); // $info['status'] = $row['status']; $info['record_status'] = $row['record_status']; // TODO use this one