From ef16b1e3584e08f42647cc2c92542ae07568057c Mon Sep 17 00:00:00 2001 From: Hugues Peccatte Date: Fri, 17 Jul 2015 23:36:23 +0200 Subject: [PATCH] Templating error report form. Signed-off-by: Hugues Peccatte --- libraries/error_report.lib.php | 49 +++++++------------------------ templates/error/report_form.phtml | 35 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 templates/error/report_form.phtml diff --git a/libraries/error_report.lib.php b/libraries/error_report.lib.php index 4ab60d7de25b..70615d6926bc 100644 --- a/libraries/error_report.lib.php +++ b/libraries/error_report.lib.php @@ -343,49 +343,20 @@ function PMA_translateStacktrace($stack) */ function PMA_getErrorReportForm() { - $html = ""; - $html .= '
' - . '
'; - - $html .= '

' . __( - 'phpMyAdmin has encountered an error. We have collected data about' - . ' this error as well as information about relevant configuration' - . ' settings to send to the phpMyAdmin team to help us in' - . ' debugging the problem.' - ) . '

'; - - $html .= '
' - . '
'
-            . htmlspecialchars(PMA_getPrettyReportData())
-            . '
'; - - $html .= '
' - . ''; - - $html .= '' - . ''; - - $html .= '
'; - - $html .= PMA_URL_getHiddenInputs(); + $datas = array( + 'report_data' => PMA_getPrettyReportData(), + 'hidden_inputs' => PMA_URL_getHiddenInputs(), + 'hidden_fields' => null, + ); $reportData = PMA_getReportData(); - if (! empty($reportData)) { - $html .= PMA_getHiddenFields($reportData); + if (!empty($reportData)) { + $datas['hidden_fields'] = PMA_getHiddenFields($reportData); } - $html .= '
'; - - return $html; + include_once './libraries/Template.class.php'; + return PMA\Template::get('error/report_form') + ->render($datas); } /** diff --git a/templates/error/report_form.phtml b/templates/error/report_form.phtml new file mode 100644 index 000000000000..847923d86271 --- /dev/null +++ b/templates/error/report_form.phtml @@ -0,0 +1,35 @@ +
+
+ +

+ +

+ +
+
+ +
+
+ + + + + +
+ + + +
\ No newline at end of file