Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #10 from LokeyCoding/MP-9

Fixed admin config section ordering bug
  • Loading branch information...
commit 0574aebe055ed111e288d3687d2251fee403914a 2 parents aeba7e2 + 2c3bffa
@LeeSaferite LeeSaferite authored
Showing with 18 additions and 4 deletions.
  1. +18 −4 app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php
View
22 app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php
@@ -81,12 +81,20 @@ public function initTabs()
$sections = $configFields->getSections($current);
$tabs = (array)$configFields->getTabs()->children();
-
- $sections = (array)$sections;
-
- usort($sections, array($this, '_sort'));
usort($tabs, array($this, '_sort'));
+ $tabSections = array();
+ foreach ((array)$sections as $section) {
+ $tab = (string)$section->tab;
+ if (!empty($tab)) {
+ if (!isset($tabSections[$tab])) {
+ $tabSections[$tab] = array();
+ }
+ $tabSections[$tab][] = $section;
+ }
+ }
+ $sections = array();
+
foreach ($tabs as $tab) {
$helperName = $configFields->getAttributeModule($tab);
$label = Mage::helper($helperName)->__((string)$tab->label);
@@ -95,6 +103,12 @@ public function initTabs()
'label' => $label,
'class' => (string) $tab->class
));
+
+ if (isset($tabSections[$tab->getName()])) {
+ $section = $tabSections[$tab->getName()];
+ usort($section, array($this, '_sort'));
+ $sections = array_merge($sections, $section);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.