Use template for getHtmlForExportOptionsOutputSeparateFiles

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-01-12 17:17:09 -02:00
parent ebb22f8600
commit 31b7b9cc14
2 changed files with 19 additions and 16 deletions

View File

@ -472,27 +472,18 @@ class Export
/**
* Prints Html For Export Options Checkbox - Separate files
*
* @param String $export_type Selected Export Type
* @param string $exportType Selected Export Type
*
* @return string
*/
public static function getHtmlForExportOptionsOutputSeparateFiles($export_type)
public static function getHtmlForExportOptionsOutputSeparateFiles($exportType)
{
$html = '<li>';
$html .= '<input type="checkbox" id="checkbox_as_separate_files" '
. self::exportCheckboxCheck('as_separate_files')
. ' name="as_separate_files" value="' . $export_type . '" />';
$html .= '<label for="checkbox_as_separate_files">';
$isChecked = (bool) self::exportCheckboxCheck('as_separate_files');
if ($export_type == 'server') {
$html .= __('Export databases as separate files');
} elseif ($export_type == 'database') {
$html .= __('Export tables as separate files');
}
$html .= '</label></li>';
return $html;
return Template::get('display/export/options_output_separate_files')->render([
'is_checked' => $isChecked,
'export_type' => $exportType,
]);
}
/**

View File

@ -0,0 +1,12 @@
<li>
<input type="checkbox" id="checkbox_as_separate_files"
name="as_separate_files" value="{{ export_type }}"
{{- is_checked ? ' checked' }}>
<label for="checkbox_as_separate_files">
{% if export_type == 'server' %}
{% trans 'Export databases as separate files' %}
{% elseif export_type == 'database' %}
{% trans 'Export tables as separate files' %}
{% endif %}
</label>
</li>