array( 'render element' => 'form', ), ); } /** * Copy of drupal_add_tabledrag(). * * This is a copy of drupal_add_tabledrag used just to instantiate * our own tabledrag class vs Drupal's. * @see drupal_add_tabledrag */ function taxonomy_wrangler_add_tabledrag($table_id, $action, $relationship, $group, $subgroup = NULL, $source = NULL, $hidden = TRUE, $limit = 0) { $js_added = &drupal_static(__FUNCTION__, FALSE); if (!$js_added) { // Add the table drag JavaScript to the page before the module JavaScript // to ensure that table drag behaviors are registered before any module // uses it. drupal_add_library('system', 'jquery.cookie'); drupal_add_js('misc/tabledrag.js', array('weight' => -1)); $js_added = TRUE; } // If a subgroup or source isn't set, assume it is the same as the group. $target = isset($subgroup) ? $subgroup : $group; $source = isset($source) ? $source : $target; $settings['taxonomyWrangler']['tables'][$table_id][$group][] = array( 'target' => $target, 'source' => $source, 'relationship' => $relationship, 'action' => $action, 'hidden' => $hidden, 'limit' => $limit, ); drupal_add_js($settings, 'setting'); }