2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Abstract class for the text file upload input transformations plugins
6 * @package PhpMyAdmin-Transformations
7 * @subpackage TextFileUpload
9 if (! defined('PHPMYADMIN')) {
13 /* Get the transformations class */
14 require_once 'libraries/plugins/IOTransformationsPlugin.class.php';
17 * Provides common methods for all of the text file upload
18 * input transformations plugins.
20 * @package PhpMyAdmin-Transformations
21 * @subpackage TextFileUpload
23 abstract class TextFileUploadTransformationsPlugin
extends IOTransformationsPlugin
26 * Gets the transformation description of the specific plugin
30 public static function getInfo()
33 'File upload functionality for TEXT columns. '
34 . 'It does not have a textarea for input.'
39 * Does the actual work of each specific transformations plugin.
41 * @param string $buffer text to be transformed
42 * @param array $options transformation options
43 * @param string $meta meta information
47 public function applyTransformation($buffer, $options = array(), $meta = '')
53 * Returns the html for input field to override default textarea.
54 * Note: Return empty string if default textarea is required.
56 * @param array $column column details
57 * @param int $row_id row number
58 * @param string $column_name_appendix the name attribute
59 * @param array $options transformation options
60 * @param string $value Current field value
61 * @param string $text_dir text direction
63 * @return string the html for input field
65 public function getInputHtml(
66 $column, $row_id, $column_name_appendix, $options, $value, $text_dir
70 $html = '<input type="hidden" name="fields_prev' . $column_name_appendix
71 . '" value="' . htmlspecialchars($value) . '"/>';
72 $html .= '<input type="hidden" name="fields' . $column_name_appendix
73 . '" value="' . htmlspecialchars($value) . '"/>';
75 $html .= '<input type="file" name="fields_upload'
76 . $column_name_appendix . '"/>';
80 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
84 * Gets the transformation name of the specific plugin
88 public static function getName()
90 return "Text file upload";