Skip to content

Commit

Permalink
Templating error report form.
Browse files Browse the repository at this point in the history
Signed-off-by: Hugues Peccatte <[email protected]>
  • Loading branch information
Tithugues committed Jul 17, 2015
1 parent 2c108f3 commit ef16b1e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 39 deletions.
49 changes: 10 additions & 39 deletions libraries/error_report.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,49 +343,20 @@ function PMA_translateStacktrace($stack)
*/
function PMA_getErrorReportForm()
{
$html = "";
$html .= '<form action="error_report.php" method="post" name="report_frm"'
. ' id="report_frm" class="ajax">'
. '<fieldset style="padding-top:0px">';

$html .= '<p>' . __(
'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.'
) . '</p>';

$html .= '<div class="label"><label><p>'
. __('You may examine the data in the error report:')
. '</p></label></div>'
. '<pre class="report-data">'
. htmlspecialchars(PMA_getPrettyReportData())
. '</pre>';

$html .= '<div class="label"><label><p>'
. __('Please explain the steps that lead to the error:')
. '</p></label></div>'
. '<textarea class="report-description" name="description"'
. 'id="report_description"></textarea>';

$html .= '<input type="checkbox" name="always_send"'
. ' id="always_send_checkbox"/>'
. '<label for="always_send_checkbox">'
. __('Automatically send report next time')
. '</label>';

$html .= '</fieldset>';

$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 .= '</form>';

return $html;
include_once './libraries/Template.class.php';
return PMA\Template::get('error/report_form')
->render($datas);
}

/**
Expand Down
35 changes: 35 additions & 0 deletions templates/error/report_form.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<form action="error_report.php" method="post" name="report_frm" id="report_frm"
class="ajax">
<fieldset style="padding-top:0px">

<p>
<?php echo __(
'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.'
) ?>
</p>

<div class="label"><label><p>
<?php echo __('You may examine the data in the error report:') ?>
</p></label></div>
<pre class="report-data"><?php echo htmlspecialchars($report_data) ?></pre>

<div class="label"><label><p>
<?php echo __('Please explain the steps that lead to the error:') ?>
</p></label>
</div>
<textarea class="report-description" name="description"
id="report_description"></textarea>

<input type="checkbox" name="always_send" id="always_send_checkbox" />
<label for="always_send_checkbox">
<?php echo __('Automatically send report next time') ?>
</label>

</fieldset>

<?php echo $hidden_inputs ?>
<?php echo $hidden_fields ?>
</form>

0 comments on commit ef16b1e

Please sign in to comment.