/** * Interface with the model: retrieve the custom field definitions, sorted. * * @return array */ public static function get_custom_field_defs() { if (isset(self::$data['custom_field_defs'])) { // print '<pre>'.print_r(self::$data['custom_field_defs'],true).'</pre>'; // sort them $defs = self::$data['custom_field_defs']; usort($defs, CCTM::sort_custom_fields('name', 'strnatcasecmp')); foreach ($defs as $i => $d) { $field_name = $d['name']; $defs[$field_name] = $d; // re-establish the key version. unset($defs[$i]); // kill the integer version } return $defs; } else { return array(); } }