| 393 |
// path and some extra processing to it. |
// path and some extra processing to it. |
| 394 |
// Add a validation step where the value can be unwrapped. |
// Add a validation step where the value can be unwrapped. |
| 395 |
$field_key = $element['#columns'][0]; |
$field_key = $element['#columns'][0]; |
| 396 |
|
|
| 397 |
|
// Special checking for default value on creation of field. |
| 398 |
|
$comments_from_node = $element['comments_from_node'] == '1' ? 'node' : 'all'; |
| 399 |
|
$comments_limit = (isset($element['#comments_limit'])) ? $element['#comments_limit'] : '0'; |
| 400 |
|
$comments_order = (isset($element['#comments_order'])) ? $element['#comments_order'] : '0'; |
| 401 |
|
$comments_status = (isset($element['#comments_status'])) ? $element['#comments_status'] : '0'; |
| 402 |
|
if (empty($comments_limit)) $comments_limit = '0'; |
| 403 |
|
if (empty($comments_order)) $comments_order = '0'; |
| 404 |
|
if (empty($comments_status)) $comments_status = '0'; |
| 405 |
|
$node_id = arg(1); |
| 406 |
|
if (!is_numeric($node_id)) $node_id = '0'; |
| 407 |
|
|
| 408 |
$element[$field_key] = array( |
$element[$field_key] = array( |
| 409 |
'#type' => 'text_textfield', |
'#type' => 'text_textfield', |
| 410 |
'#default_value' => isset($element['#value']) ? $element['#value'] : '', |
'#default_value' => isset($element['#value']) ? $element['#value'] : '', |
| 411 |
'#autocomplete_path' => 'commentreference/autocomplete/'. $element['#comments_from_node'] .'/'. arg(1) .'/'. $element['#comments_limit'] .'/'. $element['#comments_order'] .'/'. $element['#comments_status'] .'/'. $element['#field_name'], |
'#autocomplete_path' => 'commentreference/autocomplete/'. $element['#comments_from_node'] .'/'. $node_id .'/'. $comments_limit .'/'. $comments_order .'/'. $comments_status .'/'. $element['#field_name'], |
| 412 |
'#element_validate' => array('commentreference_autocomplete_validate'), |
'#element_validate' => array('commentreference_autocomplete_validate'), |
| 413 |
|
|
| 414 |
// The following values were set by the content module and need |
// The following values were set by the content module and need |