You are here

function _content_sort_items_value_helper in Content Construction Kit (CCK) 6.3

Same name and namespace in other branches
  1. 6.2 content.module \_content_sort_items_value_helper()

Same as above, using ['_weight']['#value']

1 string reference to '_content_sort_items_value_helper'
theme_content_multiple_values in ./content.module
Theme an individual form element.

File

./content.module, line 974
Allows administrators to associate custom fields to content types.

Code

function _content_sort_items_value_helper($a, $b) {
  $a_weight = is_array($a) && isset($a['_weight']['#value']) ? $a['_weight']['#value'] : 0;
  $b_weight = is_array($b) && isset($b['_weight']['#value']) ? $b['_weight']['#value'] : 0;
  if ($a_weight == $b_weight) {
    return 0;
  }
  return $a_weight < $b_weight ? -1 : 1;
}