| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
// $Id: skeleton_instance.inc,v 1.20 2009/05/29 00:49:04 deviantintegral Exp $ |
// $Id: skeleton_instance.inc,v 1.21 2009/07/16 18:09:19 deviantintegral Exp $ |
| 4 |
|
|
| 5 |
/** |
/** |
| 6 |
* @file |
* @file |
| 734 |
// We've done this template, so remove it. |
// We've done this template, so remove it. |
| 735 |
unset($nodes[0]); |
unset($nodes[0]); |
| 736 |
} |
} |
| 737 |
|
|
| 738 |
$parent_node = array( |
$parent_node = array( |
| 739 |
'values' => array( |
'values' => array( |
| 740 |
'uid' => $user->uid, |
'uid' => $user->uid, |
| 748 |
'op' => t('Save'), |
'op' => t('Save'), |
| 749 |
), |
), |
| 750 |
); |
); |
| 751 |
|
|
| 752 |
if (module_exists('translation')) { |
if (module_exists('translation')) { |
| 753 |
$parent_node['values']['language'] = $form_state['values']['language']; |
$parent_node['values']['language'] = $form_state['values']['language']; |
| 754 |
} |
} |
| 755 |
|
|
| 756 |
|
// Copy CCK fields. |
| 757 |
|
if (module_exists('content')) { |
| 758 |
|
$content_type = content_types('book'); |
| 759 |
|
$fields = $content_type['fields']; |
| 760 |
|
if (is_array($fields)) { |
| 761 |
|
foreach ($fields as $field) { |
| 762 |
|
if (isset($node['values']->{$field['field_name']})) { |
| 763 |
|
$parent_node['values'][$field['field_name']] = $node['values'][$field['field_name']]; |
| 764 |
|
} |
| 765 |
|
} |
| 766 |
|
} |
| 767 |
|
} |
| 768 |
|
|
| 769 |
$parent_node['values']['book']['bid'] = 'new'; |
$parent_node['values']['book']['bid'] = 'new'; |
| 770 |
$parent_node['values']['book']['options'] = array(); |
$parent_node['values']['book']['options'] = array(); |
| 771 |
drupal_execute('book_node_form', $parent_node, $parent_node['values']); |
drupal_execute('book_node_form', $parent_node, $parent_node['values']); |