Commit 6ca0b499 authored by damjan's avatar damjan

[FEATURE] Adds extension groups in select list (Local, System)

parent 73fc07e3
......@@ -184,18 +184,34 @@ abstract class AbstractController extends ActionController {
$extensions = $cacheManager->getCache('lfeditor_select_options_cache')->get('extensionAndLangFileOptions');
if (empty($extensions)) {
$extensionOptions = $this->configurationService->menuExtList();
$extensionGroupCount = 0;
foreach ($extensionOptions as $extAddress => $extLabel) {
$extension['extLabel'] = $extLabel;
$extension['languageFileOptions'] = array();
$isExtensionGroupStart = $extAddress === '###extensionGroup###' . $extLabel;
try {
$extension['languageFileOptions'] = $this->configurationService->menuLangFileList($extAddress);
if (empty($extension['languageFileOptions'])) {
continue;
if (!$isExtensionGroupStart) {
$extension['languageFileOptions'] = $this->configurationService->menuLangFileList($extAddress);
if (empty($extension['languageFileOptions'])) {
continue;
}
} elseif (++$extensionGroupCount > 1) {
$extensions[$extAddress . 'EmptySpaceBefore'] = array(
'extLabel' => '',
'languageFileOptions' => array(),
);
}
} catch (LFException $e) {
continue;
}
$extensions[$extAddress] = $extension;
if ($isExtensionGroupStart) {
$extensions[$extAddress . 'DelimiterAfter'] = array(
'extLabel' => '======',
'languageFileOptions' => array(),
);
}
}
$cacheManager->getCache('lfeditor_select_options_cache')->set('extensionAndLangFileOptions', $extensions);
}
......
......@@ -64,7 +64,7 @@ class Functions {
$prepArray[$extPath] = basename($extPath) . ' [' . $state . ']';
}
ksort($prepArray);
$myArray = array_merge($myArray, $prepArray);
$myArray = array_merge($myArray, array('###extensionGroup###' . $header => $header), $prepArray);
}
return $myArray;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment