UPDATE 4.4.0.0
[phpmyadmin.git] / libraries / plugins / transformations / abstract / TextFileUploadTransformationsPlugin.class.php
blobf7e3ee1427f207e6b1514b0bd0d58e0d8617c632
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Abstract class for the text file upload input transformations plugins
6 * @package PhpMyAdmin-Transformations
7 * @subpackage TextFileUpload
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
13 /* Get the transformations class */
14 require_once 'libraries/plugins/IOTransformationsPlugin.class.php';
16 /**
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
25 /**
26 * Gets the transformation description of the specific plugin
28 * @return string
30 public static function getInfo()
32 return __(
33 'File upload functionality for TEXT columns. '
34 . 'It does not have a textarea for input.'
38 /**
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
45 * @return string
47 public function applyTransformation($buffer, $options = array(), $meta = '')
49 return $buffer;
52 /**
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
67 ) {
68 $html = '';
69 if (!empty($value)) {
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 . '"/>';
77 return $html;
80 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
83 /**
84 * Gets the transformation name of the specific plugin
86 * @return string
88 public static function getName()
90 return "Text file upload";