@@ 34-41 (lines=8) @@ | ||
31 | */ |
|
32 | public function __construct($options = array()) |
|
33 | { |
|
34 | if (isset($options['allowed_file_extensions'])) { |
|
35 | if (!is_array($options['allowed_file_extensions'])) { |
|
36 | throw new InvalidArgumentException(esc_html__('A valid allowed_file_extensions array was not provided to EE_File_Input', 'event_espresso')); |
|
37 | } |
|
38 | $this->allowed_file_extensions = $options['allowed_file_extensions']; |
|
39 | } else { |
|
40 | $this->allowed_file_extensions = ['csv']; |
|
41 | } |
|
42 | if (isset($options['allowed_mime_types'])) { |
|
43 | if (!is_array($options['allowed_mime_types'])) { |
|
44 | throw new InvalidArgumentException(esc_html__('A valid allowed_mime_types array was not provided to EE_File_Input', 'event_espresso')); |
|
@@ 42-49 (lines=8) @@ | ||
39 | } else { |
|
40 | $this->allowed_file_extensions = ['csv']; |
|
41 | } |
|
42 | if (isset($options['allowed_mime_types'])) { |
|
43 | if (!is_array($options['allowed_mime_types'])) { |
|
44 | throw new InvalidArgumentException(esc_html__('A valid allowed_mime_types array was not provided to EE_File_Input', 'event_espresso')); |
|
45 | } |
|
46 | $this->allowed_mime_types = $options['allowed_file_extensions']; |
|
47 | } else { |
|
48 | $this->allowed_mime_types = ['text/csv']; |
|
49 | } |
|
50 | ||
51 | $this->_set_display_strategy(new EE_File_Input_Display_Strategy()); |
|
52 | $this->_set_normalization_strategy(new EE_File_Normalization()); |