You are here

function _sheetnode_template_save in Sheetnode 6

Same name and namespace in other branches
  1. 5 sheetnode.module \_sheetnode_template_save()
  2. 7.2 sheetnode.module \_sheetnode_template_save()
  3. 7 sheetnode.module \_sheetnode_template_save()

Helper function to save a sheetnode template.

2 calls to _sheetnode_template_save()
sheetnode_insert in ./sheetnode.module
Implementation of hook_insert().
sheetnode_update in ./sheetnode.module
Implementation of hook_update().

File

./sheetnode.module, line 1083

Code

function _sheetnode_template_save($vid, $name, $value) {
  $record = (object) array(
    'name' => $name,
    'value' => $value,
    'vid' => $vid,
  );
  if ($tid = db_result(db_query("SELECT tid FROM {sheetnode_template} WHERE name='%s'", db_escape_string($name)))) {
    $record->tid = $tid;
  }
  drupal_write_record('sheetnode_template', $record, $tid ? 'tid' : array());
}