Skip to content

Commit

Permalink
pkp#10529 Remove workaround to FieldOptions orderable bug
Browse files Browse the repository at this point in the history
  • Loading branch information
blesildaramirez committed Oct 24, 2024
1 parent f60a7ff commit 48c2209
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions classes/components/forms/context/PKPAppearanceSetupForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,18 @@ public function __construct($action, $locales, $context, $baseUrl, $temporaryFil
$this->locales = $locales;

$sidebarOptions = [];
$enabledOptions = [];
$disabledOptions = [];

$currentBlocks = (array) $context->getData('sidebar');

$plugins = \PluginRegistry::loadCategory('blocks', true);

foreach ($currentBlocks as $plugin) {
if (isset($plugins[$plugin])) {
$enabledOptions[] = [
'value' => $plugin,
'label' => htmlspecialchars($plugins[$plugin]->getDisplayName()),
];
}
}

foreach ($plugins as $pluginName => $plugin) {
if (!in_array($pluginName, $currentBlocks)) {
$disabledOptions[] = [
'value' => $pluginName,
'label' => htmlspecialchars($plugin->getDisplayName()),
];
}
$sidebarOptions[] = [
'value' => $pluginName,
'label' => htmlspecialchars($plugin->getDisplayName()),
];
}

$sidebarOptions = array_merge($enabledOptions, $disabledOptions);

$this->addField(new FieldUploadImage('pageHeaderLogoImage', [
'label' => __('manager.setup.logo'),
'value' => $context->getData('pageHeaderLogoImage'),
Expand Down

0 comments on commit 48c2209

Please sign in to comment.