/** * Compares two plugins. * @param editor_tinymce_plugin $a * @param editor_tinymce_plugin $b * @return Negative number if $a is before $b */ public static function compare_plugins(editor_tinymce_plugin $a, editor_tinymce_plugin $b) { // Use sort order first. $order = $a->get_sort_order() - $b->get_sort_order(); if ($order != 0) { return $order; } // Then sort alphabetically. return strcmp($a->plugin, $b->plugin); }