commit 9ac984479965a47d39eb26f604b63506c235d494
Author: Priyanka M <priyanka.menghani@gmail.com>
Date:   Sat Apr 2 18:49:00 2011 +0530

    Fix for MDL-26754

diff --git a/admin/blocks.php b/admin/blocks.php
old mode 100644
new mode 100755
index 17b0350..9c54409
--- a/admin/blocks.php
+++ b/admin/blocks.php
@@ -109,7 +109,10 @@
     }
 
     $incompatible = array();
-
+    // MDL-26754
+    // Required to fetch the information about the blocks, will later
+    // be sorted on block name, and then pushed in the $table array
+    $table_contents = array();
 /// Print the table of all blocks
 
     $table = new flexible_table('admin-blocks-compatible');
@@ -122,7 +125,6 @@
 
     foreach ($blocks as $blockid=>$block) {
         $blockname = $block->name;
-
         if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
             $blockobject  = false;
             $strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
@@ -190,18 +192,34 @@
         } else {
             $version = "$block->version ($plugin->version)";
         }
-
-
-        $table->add_data(array(
-            '<span'.$class.'>'.$strblockname.'</span>',
-            $blocklist,
-            '<span'.$class.'>'.$version.'</span>',
-            $visible,
-            $delete,
-            $settings
-        ));
+        
+        // MDL-26754
+        array_push($table_contents, array(
+            "strblockname" => $strblockname,
+            "blocklist" => $blocklist,
+            "class" => $class,
+            "version" => $version,
+            "visible" => $visible,
+            "delete" => $delete,
+            "settings" => $settings
+         )); 
     }
-
+    
+    // MDL-26754
+    // The array gets sorted on "strblockname"
+    array_multisort($table_contents, SORT_ASC);
+    foreach($table_contents as &$table_entry) {
+	    // Push nicely dressed HTML into the $table array, as earlier.
+	    $table->add_data(array(
+            '<span'.$class.'>'.$table_entry["strblockname"].'</span>',
+            $table_entry["blocklist"],
+            '<span'.$table_entry["class"].'>'.$table_entry["version"].'</span>',
+            $table_entry["visible"],
+            $table_entry["delete"],
+            $table_entry["settings"]
+        ));
+    } 
+     
     $table->print_html();
 
     if (!empty($incompatible)) {
