public function getDispErrors()
{
// Not sure why but seen in https://reports.phpmyadmin.net/
if (empty($GLOBALS['cfg']['SendErrorReports'])) {
$GLOBALS['cfg']['SendErrorReports'] = 'ask';
}
$retval = '';
// display errors if SendErrorReports is set to 'ask'.
if ($GLOBALS['cfg']['SendErrorReports'] != 'never') {
foreach ($this->getErrors() as $error) {
if ($error instanceof Error) {
if (!$error->isDisplayed()) {
$retval .= $error->getDisplay();
}
} else {
$retval .= var_export($error, true);
}
}
} else {
$retval .= $this->getDispUserErrors();
}
// if preference is not 'never' and
// there are 'actual' errors to be reported
if ($GLOBALS['cfg']['SendErrorReports'] != 'never' && $this->countErrors() != $this->countUserErrors()) {
// add report button.
$retval .= '<form method="post" action="error_report.php"' . ' id="pma_report_errors_form"';
if ($GLOBALS['cfg']['SendErrorReports'] == 'always') {
// in case of 'always', generate 'invisible' form.
$retval .= ' style="display:none;"';
}
$retval .= '>' . '<input type="hidden" name="token" value="' . $_SESSION[' PMA_token '] . '"/>' . '<input type="hidden" name="exception_type" value="php"/>' . '<input type="hidden" name="send_error_report" value="1" />' . '<input type="submit" value="' . __('Report') . '" id="pma_report_errors" class="floatright">' . '<input type="checkbox" name="always_send"' . ' id="always_send_checkbox" value="true"/>' . '<label for="always_send_checkbox">' . __('Automatically send report next time') . '</label>';
if ($GLOBALS['cfg']['SendErrorReports'] == 'ask') {
// add ignore buttons
$retval .= '<input type="submit" value="' . __('Ignore') . '" id="pma_ignore_errors_bottom" class="floatright">';
}
$retval .= '<input type="submit" value="' . __('Ignore All') . '" id="pma_ignore_all_errors_bottom" class="floatright">';
$retval .= '</form>';
}
return $retval;
}