https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114012
Revision: 114012
Author: reedy
Date: 2012-03-16 14:39:52 +0000 (Fri, 16 Mar 2012)
Log Message:
-----------
Partial revert r113986
Bug 35253 - PHP warning in Collection from use of undefined callback
I hate computers
Modified Paths:
--------------
trunk/extensions/Collection/Collection.suggest.php
Modified: trunk/extensions/Collection/Collection.suggest.php
===================================================================
--- trunk/extensions/Collection/Collection.suggest.php 2012-03-16 11:54:17 UTC
(rev 114011)
+++ trunk/extensions/Collection/Collection.suggest.php 2012-03-16 14:39:52 UTC
(rev 114012)
@@ -598,3 +598,24 @@
return count( $this->mPropList );
}
}
+
+/**
+ * sort $mPropList by the entries values
+ * sort alphabetically by equal values
+ *
+ * @param $a, $b: arrays that contain two entries
+ * the keys: 'name' & 'val'
+ * 'name': an articlename
+ * 'val' : a value from 1 to 1.5
+ * @return 1, -1 or 0
+ */
+function wgCollectionCompareProps( $a, $b ) {
+ if ( $a['val'] == $b['val'] ) {
+ return strcmp( $a['name'], $b['name'] );
+ }
+ if ( $a['val'] < $b['val'] ) {
+ return 1;
+ } else {
+ return - 1;
+ }
+}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs