mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Merge branch 'MDL-48493-master-autodetect' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
6e91426e73
@ -55,11 +55,15 @@ if ($form->is_cancelled()) {
|
||||
if (empty($data->plugintype)) {
|
||||
$versiondir = make_temp_directory('tool_installaddon/'.$jobid.'/version');
|
||||
$detected = $installer->detect_plugin_component($sourcedir.'/'.$zipfilename, $versiondir);
|
||||
list($detectedtype, $detectedname) = core_component::normalize_component($detected);
|
||||
if ($detectedtype and $detectedname and $detectedtype !== 'core') {
|
||||
$data->plugintype = $detectedtype;
|
||||
} else {
|
||||
if (empty($detected)) {
|
||||
$form->require_explicit_plugintype();
|
||||
} else {
|
||||
list($detectedtype, $detectedname) = core_component::normalize_component($detected);
|
||||
if ($detectedtype and $detectedname and $detectedtype !== 'core') {
|
||||
$data->plugintype = $detectedtype;
|
||||
} else {
|
||||
$form->require_explicit_plugintype();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Redirect to the validation page.
|
||||
|
Loading…
x
Reference in New Issue
Block a user