diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-05-04 15:29:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-05-04 15:29:56 +0000 |
commit | 388af20eb9c0c025a35ec53dbdac43381f98c44b (patch) | |
tree | 8451a72caa15ab2b8eb797e93dc26ad6e51a5bc3 /modules/block | |
parent | 97b7f029cee6415d43ff8e9505ed4cda408f490b (diff) | |
download | brdo-388af20eb9c0c025a35ec53dbdac43381f98c44b.tar.gz brdo-388af20eb9c0c025a35ec53dbdac43381f98c44b.tar.bz2 |
- Patch #354133 by NancyDru, AlexisWilke, yoroy: sort disabled blocks by title, not by weight.
Diffstat (limited to 'modules/block')
-rw-r--r-- | modules/block/block.admin.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 920b0d2c8..a5187b58e 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -170,10 +170,12 @@ function _block_compare($a, $b) { if ((!empty($a['region']) && !empty($b['region'])) && ($place = ($regions[$a['region']] - $regions[$b['region']]))) { return $place; } - // Sort by weight. - $weight = $a['weight'] - $b['weight']; - if ($weight) { - return $weight; + // Sort by weight, unless disabled. + if ($a['region'] != BLOCK_REGION_NONE) { + $weight = $a['weight'] - $b['weight']; + if ($weight) { + return $weight; + } } // Sort by title. return strcmp($a['info'], $b['info']); |