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);
$result = drupal_execute('sheetnode_node_form', $form_state_node, (object) $node);
return $result . '/edit';
}