function execute(HTTPRequestCustom $request) { // Define template $this->views = new FileTemplate('wpimport/import.tpl'); // Load lang $this->lang = LangLoader::get('common', 'wpimport'); // Add lang $this->views->add_lang($this->lang); // Build Form $this->build_form(); // Add Form to template $this->views->put('FORM', $this->form->display()); // Check max_execution_time $maxExecutionTime = ini_get('max_execution_time'); $this->views->put('CAN_SET_EXECUTION_TIME', false); $this->views->put('MAX_EXECUTION_TIME', $maxExecutionTime); @ini_set('max_execution_time', 0); if (ini_get('max_execution_time') == 0) { $this->views->put('CAN_SET_EXECUTION_TIME', true); } if ($this->submit_button->has_been_submited() && $this->form->validate()) { $importer = array(); $listImporter = self::listImporters(); foreach ($listImporter as $i) { if ($this->form->get_field_by_id('importer_' . $i['name'])->get_value()) { $importer[] = $i['name']; } } session_start(); $_SESSION['wpimport'] = array('phpboostpath' => $this->form->get_field_by_id('phpboostpath')->get_value(), 'wppath' => $this->form->get_field_by_id('wppath')->get_value(), 'default_author' => $this->form->get_field_by_id('default_author')->get_value(), 'default_cat_image' => $this->form->get_field_by_id('default_cat_image')->get_value(), 'import_location' => $this->form->get_field_by_id('import_location')->get_value(), 'importer' => implode(',', $importer)); AppContext::get_response()->redirect(DispatchManager::get_url('../wpimport', '/admin/import/start')); } return $this->build_response(); }