Fix utils::GetClassesForInterface() not working on Windows env. (courtesy from @Steffunky)

This commit is contained in:
Molkobain
2021-03-17 13:13:57 +01:00
parent 50fc7f753e
commit 5452286d8d
2 changed files with 14 additions and 9 deletions

View File

@@ -709,16 +709,17 @@ try {
$oPage->add_header('Location: '.$sURL);
break;
case 'apply_keyboard_shortcuts':
$aShortcutClasses = utils::GetClassesForInterface('iKeyboardShortcut','', array('/lib/', 'node_modules', 'test'));
// Note: Mind the 4 blackslashes, see utils::GetClassesForInterface()
$aShortcutClasses = utils::GetClassesForInterface('iKeyboardShortcut', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]'));
$aShortcutPrefs = [];
foreach($aShortcutClasses as $cShortcutPlugin) {
foreach ($aShortcutClasses as $cShortcutPlugin) {
foreach ($cShortcutPlugin::GetShortcutKeys() as $aShortcutKey) {
$sKey = utils::ReadParam($aShortcutKey['id'], $aShortcutKey['key'], true,'raw_data');
$sKey = utils::ReadParam($aShortcutKey['id'], $aShortcutKey['key'], true, 'raw_data');
$aShortcutPrefs[$aShortcutKey['id']] = strtolower($sKey);
}
}
appUserPreferences::SetPref('keyboard_shortcuts', $aShortcutPrefs);
DisplayPreferences($oPage);
break;
case 'apply_newsroom_preferences':