[WORK IN PROGRESS] First draft of a Tools menu with direct install (#990)

* First draft of a Tools menu with direct install

* Basic styling

* Translate GPM messages

* Basic frontend validation

* Fix form action path

* Added lang strings for offical_gpm_only toggle
This commit is contained in:
Flavio Copes
2017-02-22 21:34:21 +01:00
committed by Andy Miller
parent c473a8db84
commit c7256134ba
11 changed files with 199 additions and 54 deletions

View File

@@ -2090,4 +2090,30 @@ class AdminController extends AdminBaseController
return $filename . '.md';
}
/**
* Handle direct install.
*
*/
protected function taskDirectInstall()
{
$file_path = '';
if (isset($_FILES['uploaded_file'])) {
$file_path = $_FILES['uploaded_file']['tmp_name'];
} else {
$file_path = $this->data['file_path'];
}
$result = Gpm::directInstall($file_path);
if ($result === true) {
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_SUCCESSFUL'), 'info');
} else {
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_FAILED') . ': ' . $result, 'error');
}
$this->setRedirect('/tools');
}
}