summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Starbow2008-10-24 15:51:17 (GMT)
committerTao Starbow2008-10-24 15:51:17 (GMT)
commit4fd938f55d05b9a56196b379f9cd29c343da0008 (patch)
treec35c53a30bae6ae10cb95d53514a92ca42a7bef9
parent15f932841373b6de5d22b7cfb3209b8eda03b49a (diff)
Using array for targetSelectors5.x-1.0-beta1
-rw-r--r--popups_reference.module23
1 files changed, 4 insertions, 19 deletions
diff --git a/popups_reference.module b/popups_reference.module
index c1c10d3..c6cf7de 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';