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
NateWr committed Oct 18, 2024
1 parent b8d985f commit b67bf3a
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions classes/components/forms/context/PKPAppearanceSetupForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,18 @@ public function __construct($action, $locales, $context, $baseUrl, $temporaryFil
$this->action = $action;
$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 b67bf3a

Please sign in to comment.