PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.11
Code Manager v1.0.11
1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / Code_Manager / Code_Manager_Import.php
code-manager / Code_Manager Last commit date
Code_Manager.php 4 years ago Code_Manager_Dashboard.php 4 years ago Code_Manager_Export.php 4 years ago Code_Manager_Form.php 4 years ago Code_Manager_Import.php 4 years ago Code_Manager_Import_File.php 4 years ago Code_Manager_List.php 4 years ago Code_Manager_List_View.php 4 years ago Code_Manager_Model.php 4 years ago Code_Manager_Preview.php 4 years ago Code_Manager_Settings.php 4 years ago Code_Manager_Tabs.php 4 years ago Message_Box.php 4 years ago WP_List_Table.php 4 years ago
Code_Manager_Import.php
38 lines
1 <?php
2
3 namespace Code_Manager {
4
5 /**
6 * Class Code_Manager_Import
7 *
8 * Add import feature to plugin (reached from list table).
9 *
10 * @author Peter Schulz
11 * @since 1.0.0
12 */
13 class Code_Manager_Import {
14
15 public static function import() {
16 if ( isset( $_FILES['filename'] ) &&
17 UPLOAD_ERR_OK === $_FILES['filename']['error']
18 && is_uploaded_file( $_FILES['filename']['tmp_name'] )
19 ) {
20 // Get file content
21 $import_file = new Code_Manager_Import_File( $_FILES['filename']['tmp_name'] );
22 $import_file->import();
23 } else {
24 // File upload failed
25 $msg = new Message_Box(
26 [
27 'message_text' => __( 'File upload failed', 'code-manager' ),
28 'message_type' => 'error',
29 'message_is_dismissible' => false,
30 ]
31 );
32 $msg->box();
33 }
34 }
35
36 }
37
38 }