Skip to content

Commit

Permalink
rtrim
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinkc committed Oct 9, 2019
1 parent fb8588d commit 34d5241
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions multilingualPDF.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
//currently js adds download links to a specific Data Entry Form as we test

namespace CMH\Multilingual;

use ExternalModules\AbstractExternalModule;
Expand Down Expand Up @@ -72,13 +74,14 @@
if($translations['questions'][$values['field_name']]['text']){
$metadata[$key]['element_label'] = $translations['questions'][$values['field_name']]['text'];
}
else if($translations['answers'][$values['field_name']]['text']){

if($translations['answers'][$values['field_name']]['text']){
$element_enum = null;
foreach($translations['answers'][$values['field_name']]['text'] AS $k => $v){
$element_enum .= $k . ', ' . $v . ' \n ';
}
$element_enum = trim($element_enum);
$metadata[$key]['element_enum'] = $element_enum;

$metadata[$key]['element_enum'] = rtrim($element_enum, ' \n ');
}
}

Expand Down

0 comments on commit 34d5241

Please sign in to comment.