You are here

function _heartbeat_attachment_sort_helper in Heartbeat 7

Helper function to sort an array for the Plugin Attachments.

1 string reference to '_heartbeat_attachment_sort_helper'
_heartbeat_plugins_template_attachments_sort_form in modules/heartbeat_plugins/heartbeat_plugins.module
Helper function to create draggable interface for heartbeat plugins.

File

modules/heartbeat_plugins/heartbeat_plugins.module, line 701

Code

function _heartbeat_attachment_sort_helper($a, $b) {
  $a_weight = is_array($a) && isset($a['weight']) ? $a['weight'] : 0;
  $b_weight = is_array($b) && isset($b['weight']) ? $b['weight'] : 0;
  return $a_weight - $b_weight;
}