Project

General

Profile

« Previous | Next » 

Revision c5ecf722

Added by Renato Botelho almost 10 years ago

Sort return of get_pkg_info()

View differences:

src/etc/inc/pkg-utils.inc
456 456
		unset($pkg_info);
457 457
	}
458 458

  
459
	/* Sort result alphabetically */
460
	usort($result, function($a, $b) {
461
		return(strcasecmp ($a['name'], $b['name']));
462
	});
463

  
459 464
	return $result;
460 465
}
461 466

  
src/usr/local/www/pkg_mgr.php
154 154
	<tbody>
155 155
<?php
156 156

  
157
	// Sort case insensitve (so we get AbCdEf not ACEcdf)
158
	usort($pkg_info, function($a, $b) {
159
		return(strcasecmp ($a['name'], $b['name']));
160
	});
161

  
162 157
	foreach($pkg_info as $index):
163 158
		if (isset($index['installed'])) {
164 159
			continue;

Also available in: Unified diff