Use template for getHtmlForExportOptionsOutputRadio

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-01-12 16:44:46 -02:00
parent 5b6bd82145
commit ebb22f8600
2 changed files with 11 additions and 10 deletions

View File

@ -463,16 +463,10 @@ class Export
*/
public static function getHtmlForExportOptionsOutputRadio()
{
$html = '<li>';
$html .= '<input type="radio" id="radio_view_as_text" '
. ' name="output_format" value="astext" ';
if (isset($_GET['repopulate']) || $GLOBALS['cfg']['Export']['asfile'] == false) {
$html .= 'checked="checked"';
}
$html .= '/>';
$html .= '<label for="radio_view_as_text">'
. __('View output as text') . '</label></li>';
return $html;
return Template::get('display/export/options_output_radio')->render([
'has_repopulate' => isset($_GET['repopulate']),
'export_asfile' => $GLOBALS['cfg']['Export']['asfile'],
]);
}
/**

View File

@ -0,0 +1,7 @@
<li>
<input type="radio" id="radio_view_as_text" name="output_format" value="astext"
{{- has_repopulate or export_asfile == false ? ' checked' }}>
<label for="radio_view_as_text">
{% trans 'View output as text' %}
</label>
</li>