function sheetnode_import_template_submit in Sheetnode 5
Same name and namespace in other branches
- 6 sheetnode.module \sheetnode_import_template_submit()
- 7.2 sheetnode.module \sheetnode_import_template_submit()
- 7 sheetnode.module \sheetnode_import_template_submit()
File
- ./
sheetnode.module, line 329
Code
function sheetnode_import_template_submit($form, $form_values) {
global $user;
$template = db_fetch_object(db_query("SELECT * FROM {sheetnode_template} WHERE tid=%d", $form_values['template']));
$node = array(
'type' => 'sheetnode',
'name' => $user->name,
);
$form_state_node = array();
$form_state_node['title'] = $template->name;
$form_state_node['body'] = '';
$form_state_node['name'] = $user->name;
$form_state_node['sheetsave'] = unserialize($template->value);
// Allow other modules to modify the new node's creation parameters.
// Hook signature: hook_sheetnode_alter(&$form_state_node, $form, $form_state);
//drupal_alter('sheetnode', $form_state_node, $form, $form_state);
$result = drupal_execute('sheetnode_node_form', $form_state_node, (object) $node);
return $result . '/edit';
}