options = &EL_Options::get_instance(); $this->functions = &EL_Admin_Functions::get_instance(); $this->db = &EL_Db::get_instance(); $this->categories = &EL_Categories::get_instance(); $this->example_file_path = EL_URL.'/files/events-import-example.csv'; } public function show_import() { if(!current_user_can('edit_posts')) { wp_die(__('You do not have sufficient permissions to access this page.')); } echo '
'.sprintf(__('You can download an example file %1$shere%2$s (CSV delimiter is a comma!)','event-list'), '', '').'
'.__('Note','event-list').': '.__('Do not change the column header and separator line (first two lines), otherwise the import will fail!','event-list').'
'; } private function show_import_review() { $file = $_FILES['el_import_file']['tmp_name']; // check for file existence (upload failed?) if(!is_file($file)) { echo '' . esc_html($import_data->get_error_message()).'
'; return; } // TODO: $this->import_data vs. $import_data ? $this->import_data = $import_data; $serialized = serialize($this->import_data); // show review page echo '
'.__('Title','event-list').': '.$event['title'].'
'.__('Start Date','event-list').': '.$event['start_date'].'
'.__('End Date','event-list').': '.$event['end_date'].'
'.__('Time','event-list').': '.$event['time'].'
'.__('Location','event-list').': '.$event['location'].'
'.__('Details','event-list').': '.$event['details'].'