/** * Project Import Action * * @return void */ function action_project_import() : void { if (!($file = http_files('import'))) { message(_('No file to import')); } elseif ($file['ext'] === 'zip') { import_zip($file['tmp_name']); } elseif (in_array($file['ext'], ['html', 'odt'])) { $path = path('tmp', uniqid($file['name'], true)); file_copy($file['tmp_name'], $path . '/' . $file['name']); import_page($path . '/' . $file['name']); file_delete($path); } redirect(url('*/admin')); }
<fieldset><legend>MySQL Hostname</legend> <input type="text" name="host" /> </fieldset> <fieldset><legend>MySQL Database</legend> <input type="text" name="database" /> </fieldset> <fieldset><legend>MySQL Username</legend> <input type="text" name="user" /> </fieldset> <fieldset><legend>MySQL Password</legend> <input type="password" name="password" /> </fieldset> <fieldset><legend>MySQL Table Prefix</legend> <input type="text" name="prefix" /> </fieldset> <!-- Form options. --> <p class="submit"> <input type="submit" name="submit" value="Import Forums Data" /> <input type="hidden" name="importing" value="true" /> </p> </form> <?php } ?> </body> </html> <?php } import_page();