2 /* vim: set expandtab sw=4 ts=4 sts=4: */
8 use PMA\libraries\Message
;
9 use PMA\libraries\Response
;
11 if (! defined('PHPMYADMIN')) {
18 * @param resource|bool $result Query result
19 * @param string $error Error to add
20 * @param string $createStatement Query
21 * @param array $errors Errors
25 function checkResult($result, $error, $createStatement, $errors)
31 // OMG, this is really bad! We dropped the query,
32 // failed to create a new one
33 // and now even the backup query does not execute!
34 // This should not happen, but we better handle
36 $errors[] = $error . '<br />'
37 . __('The backed up query was:')
38 . "\"" . htmlspecialchars($createStatement) . "\"" . '<br />'
39 . __('MySQL said: ') . $GLOBALS['dbi']->getError(null);
45 * Send TRI or EVN editor via ajax or by echoing.
47 * @param string $type TRI or EVN
48 * @param string $mode Editor mode 'add' or 'edit'
49 * @param array $item Data necessary to create the editor
50 * @param string $title Title of the editor
51 * @param string $db Database
52 * @param string $operation Operation 'change' or ''
56 function PMA_RTE_sendEditor($type, $mode, $item, $title, $db, $operation = null)
58 $response = Response
::getInstance();
59 if ($item !== false) {
62 $editor = PMA_TRI_getEditorForm($mode, $item);
64 $editor = PMA_EVN_getEditorForm($mode, $operation, $item);
66 if ($response->isAjax()) {
67 $response->addJSON('message', $editor);
68 $response->addJSON('title', $title);
70 echo "\n\n<h2>$title</h2>\n\n$editor";
75 $message = __('Error in processing request:') . ' ';
77 PMA_RTE_getWord('not_found'),
78 htmlspecialchars(PMA\libraries\Util
::backquote($_REQUEST['item_name'])),
79 htmlspecialchars(PMA\libraries\Util
::backquote($db))
81 $message = Message
::error($message);
82 if ($response->isAjax()) {
83 $response->setRequestStatus(false);
84 $response->addJSON('message', $message);