function webformblock_insert in Webform Block 6.3
Same name and namespace in other branches
- 6 webformblock.module \webformblock_insert()
Insert a block and a reference to the webform node into the database.
2 calls to webformblock_insert()
- webformblock_config_form_submit in ./
webformblock.module - Webform 3 configure form submit handler (node/[nid]/webform/configure)
- webformblock_nodeapi in ./
webformblock.module - Implements hook_nodeapi().
File
- ./
webformblock.module, line 218 - Expose webform nodes as Drupal blocks.
Code
function webformblock_insert($nid) {
if (webformblock_exists($nid)) {
return;
}
global $theme_key;
$node = node_load($nid);
db_query("INSERT INTO {webform_block} (nid) VALUES (%d)", $nid);
db_query('INSERT INTO {blocks} (module, delta, theme, status, weight, region, custom, throttle, visibility, pages, title, cache) VALUES ("webformblock", %d, "%s", 1, 0, "", 0, 0, 1, "", "%s", 1)', $nid, $theme_key, $node->title);
}