diff options
author | Spun Nakandala <supun.nakandala@gmail.com> | 2013-08-18 19:48:52 +0400 |
---|---|---|
committer | Spun Nakandala <supun.nakandala@gmail.com> | 2013-08-18 19:48:52 +0400 |
commit | fb05c019cfcc4f99462e52de66254a869dd6fae4 (patch) | |
tree | 45ff5f6d8380cdfbd205be377632845b760f162a /tbl_create.php | |
parent | f5b20c9828bcf212a1a764a3b68b0fce50900184 (diff) |
added possibility of setting the MIME type and transformation
Diffstat (limited to 'tbl_create.php')
-rw-r--r-- | tbl_create.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tbl_create.php b/tbl_create.php index 0b96917f11..13d67003e4 100644 --- a/tbl_create.php +++ b/tbl_create.php @@ -61,7 +61,27 @@ if (isset($_REQUEST['do_save_data'])) { // Executes the query $result = $GLOBALS['dbi']->tryQuery($sql_query); - if (!$result) { + if ($result) { + // If comments were sent, enable relation stuff + include_once 'libraries/transformations.lib.php'; + // Update comment table for mime types [MIME] + if (isset($_REQUEST['field_mimetype']) + && is_array($_REQUEST['field_mimetype']) + && $cfg['BrowseMIME'] + ) { + foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) { + if (isset($_REQUEST['field_name'][$fieldindex]) + && strlen($_REQUEST['field_name'][$fieldindex]) + ) { + PMA_setMIME( + $db, $table, $_REQUEST['field_name'][$fieldindex], $mimetype, + $_REQUEST['field_transformation'][$fieldindex], + $_REQUEST['field_transformation_options'][$fieldindex] + ); + } + } + } + } else { $response = PMA_Response::getInstance(); $response->isSuccess(false); $response->addJSON('message', $GLOBALS['dbi']->getError()); |