You are here

function _insert_style_sort in Insert 6

Same name and namespace in other branches
  1. 7 insert.module \_insert_style_sort()

Sort the styles.

1 string reference to '_insert_style_sort'
insert_styles in ./insert.module
Get a list of all supported image styles.

File

./insert.module, line 113
Allows insertion of files, images, and other media directly into the body field by using an "Insert" button next to the uploaded file.

Code

function _insert_style_sort($a, $b) {
  $a = (array) $a + array(
    'weight' => 0,
    'label' => '',
  );
  $b = (array) $b + array(
    'weight' => 0,
    'label' => '',
  );
  return $a['weight'] < $b['weight'] ? -1 : ($a['weight'] > $b['weight'] ? 1 : strnatcasecmp($a['label'], $b['label']));
}