forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFE-637: Custom field handlers (input transformations)
Signed-off-by: Chirayu Chiripal <[email protected]>
- Loading branch information
1 parent
43f3179
commit 1f324be
Showing
66 changed files
with
2,557 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
-- ------------------------------------------------------------- | ||
-- SQL Commands to upgrade pmadb.pma__column_info table | ||
-- for normal phpMyAdmin operation | ||
-- | ||
-- This file is meant for use with phpMyAdmin 4.3.0 and above! | ||
-- For older releases, please use create_tables.sql | ||
-- | ||
-- Please don't forget to set up the table names in config.inc.php | ||
-- | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Database : `phpmyadmin` | ||
-- | ||
USE `phpmyadmin`; | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Update table structure for table `pma__column_info` | ||
-- | ||
UPDATE `pma__column_info` | ||
SET `mimetype` = REPLACE(`mimetype`, 'octet-stream', 'octetstream'); | ||
UPDATE `pma__column_info` | ||
SET `transformation` = REPLACE(REPLACE(`transformation`, '__', '_'), 'inc.php', 'class.php'); | ||
UPDATE `pma__column_info` | ||
SET `transformation` = '' | ||
WHERE `transformation` = '_'; | ||
UPDATE `pma__column_info` | ||
SET `transformation` = CONCAT('output/', `transformation`) | ||
WHERE `transformation` IN ( | ||
'application_octetstream_download.class.php', | ||
'application_octetstream_hex.class.php', | ||
'image_jpeg_inline.class.php', | ||
'image_jpeg_link.class.php', | ||
'image_png_inline.class.php', | ||
'text_plain_bool2text.class.php', | ||
'text_plain_dateformat.class.php', | ||
'text_plain_external.class.php', | ||
'text_plain_formatted.class.php', | ||
'text_plain_imagelink.class.php', | ||
'text_plain_sql.class.php' | ||
); | ||
ALTER TABLE `pma__column_info` | ||
ADD `input_transformation` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', | ||
ADD `input_transformation_options` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* Image upload transformations plugin js | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
|
||
AJAX.registerOnload('transformations/image_upload.js', function() { | ||
// Change thumbnail when image file is selected | ||
// through file upload dialog | ||
$('input.image-upload').on('change', function(event) { | ||
if (this.files && this.files[0]) { | ||
var reader = new FileReader(); | ||
var $input = $(this); | ||
reader.onload = function (e) { | ||
$input.prevAll('img').attr('src', e.target.result); | ||
}; | ||
reader.readAsDataURL(this.files[0]); | ||
} | ||
}); | ||
}); | ||
|
||
/** | ||
* Unbind all event handlers before tearing down a page | ||
*/ | ||
AJAX.registerTeardown('transformations/image_upload.js', function() { | ||
$('input.image-upload').off('change'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.