Index: link.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/link/link.module,v
retrieving revision 1.24.2.31
diff -u -p -r1.24.2.31 link.module
--- link.module 31 Oct 2008 16:52:30 -0000 1.24.2.31
+++ link.module 23 Nov 2008 21:24:51 -0000
@@ -434,8 +434,8 @@ function theme_link($element) {
}
$output .= '
' . theme('textfield', $element['url']) . '
';
$output .= '';
- if (!empty($element['attributes'])) {
- $output .= '' . theme('form_element', $element['attributes'], $element['attributes']['#value']) . '
';
+ if (!empty($element['attributes']['target'])) {
+ $output .= '' . theme('checkbox', $element['attributes']['target']) . '
';
}
return $output;
}
@@ -447,7 +447,6 @@ function link_elements() {
$elements = array();
$elements['link'] = array(
'#input' => TRUE,
- '#columns' => array('url', 'title'),
'#process' => array('link_process'),
);
return $elements;
@@ -482,10 +481,12 @@ function link_process($element, $edit, $
);
}
if (!empty($field['attributes']['target']) && $field['attributes']['target'] == 'user') {
+ $attributes = is_array($element['#value']['attributes'])? $element['#value']['attributes'] : unserialize($element['#value']['attributes']);
$element['attributes']['target'] = array(
'#type' => 'checkbox',
'#title' => t('Open URL in a New Window'),
'#return_value' => "_blank",
+ '#default_value' => isset($attributes['target']) ? $attributes['target'] : NULL,
);
}
return $element;