PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.41
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.41
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
wp-data-access / WPDataAccess / Simple_Form / WPDA_Simple_Form_Item_File.php

WPDA_Simple_Form_Item_File.php in WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards 5.5.41, at WPDataAccess/Simple_Form/WPDA_Simple_Form_Item_File.php

60 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Suppress "error - 0 - No summary was found for this file" on phpdoc generation
5 *
6 * @package WPDataAccess\Simple_Form
7 */
8
9 namespace WPDataAccess\Simple_Form {
10
11 /**
12 * Class WPDA_Simple_Form_Item_File
13 *
14 * Database column is handled files
15 *
16 * @author Peter Schulz
17 * @since 5.1.3
18 */
19 class WPDA_Simple_Form_Item_File extends WPDA_Simple_Form_Item {
20
21 /**
22 * WPDA_Simple_Form_Item_File constructor.
23 *
24 * @param array $args
25 */
26 public function __construct( $args = array() ) {
27 parent::__construct( $args );
28 }
29
30 /**
31 * Overwrite method
32 *
33 * @param string $action
34 * @param string $update_keys_allowed
35 */
36 public function show( $action, $update_keys_allowed ) {
37 parent::show( $action, $update_keys_allowed );
38 }
39
40 /**
41 * Overwrite method
42 */
43 protected function show_item() {
44 if ( isset( $_FILES[ $this->item_name ] ) && '' !== $_FILES[ $this->item_name ]['name'] ) {
45 // Process uploaded file.
46 // TODO
47 // var_dump($_FILES[ $this->item_name ]);
48 }
49 ?>
50 <label>
51 Select file to upload
52 </label>
53 <input type="file" name="<?php echo esc_attr( $this->item_name ); ?>" id="<?php echo esc_attr( $this->item_name ); ?>">
54 <?php
55 }
56
57 }
58
59 }
60