diff --git a/popups_reference.module b/popups_reference.module index c1c10d34a9f5044f479009b9025831596e5db87e..c6cf7deed2c0bd0e237ab571a96f43b32ea59164 100644 --- a/popups_reference.module +++ b/popups_reference.module @@ -16,28 +16,13 @@ function _popups_reference_counter() { * for each allowed content type */ function _popups_reference_links($field, $src_type, $id=null) { -/* popups_add_popups(); - $links = array(); - $all_types = node_get_types(); - foreach ($field['referenceable_types'] as $type => $value) { - if (!empty($value) && user_access("create $type content")) { - // If we have an id, do a swap. - if ($id) { - $attributes['class'] = 'popups-form'; - $attributes['on-popups-options'] = '{targetSelector: {"#'. $id .'": "#'. $id .'"}}'; - } - else { - $attributes['class'] = 'popups'; - } - $path = "node/add/$type"; - $links[] = l("Add $type", $path, $attributes, "destination=node/add/$src_type"); - } - } - return $links; */ if ($id) { // Creating link to select box. $pclass = $id; // Target just the select box for replacing. - popups_add_popups(array('.'.$pclass=>array('targetSelectors'=>array('#'.$id=>'#'.$id)))); + popups_add_popups(array('.'.$pclass=>array( + 'targetSelectors'=>array('#'.$id), + 'behaviors' => array("Drupal.popups.collapsibleBehavior"), + ))); } else { // Creating link to autofill box. $pclass = 'popups';