function biblio_nodeapi in Bibliography Module 6
Same name and namespace in other branches
- 5 biblio.module \biblio_nodeapi()
- 6.2 biblio.module \biblio_nodeapi()
File
- ./
biblio.module, line 1056
Code
function biblio_nodeapi(&$node, $op, $a3, $a4) {
if ($node->type == 'biblio') {
switch ($op) {
case 'delete revision':
db_query('DELETE FROM {biblio} WHERE vid = %d', $node->vid);
db_query('DELETE FROM {biblio_contributor} WHERE nid = %d AND vid = %d', array(
$node->nid,
$node->vid,
));
db_query('DELETE FROM {biblio_keyword} WHERE nid = %d AND vid = %d', array(
$node->nid,
$node->vid,
));
break;
/* case 'presave':
if ($node->type == 'biblio')
{
// $node->body = '';
// $node_clone = clone($node); // we need a clone since objects get passed by reference regardless and we don't want to change the whole node object
// $node->body = theme('biblio_tabular', $node_clone, $base, $teaser);
$style = biblio_get_style();
$node->teaser = theme('biblio_style', $node_clone, $base, $style);
}
break;
*/
case 'insert':
if (variable_get('biblio_index', 0)) {
_node_index_node($node);
search_update_totals();
}
break;
case 'update':
if (variable_get('biblio_index', 0)) {
// _node_index_node performs a node_load without resetting the node_load cache,
// so it would index the old version. We reset the cache here.
// Don't assign node_load to $node because node_load resets e.g. the menus mlid etc.
$mynode = node_load($node->nid, NULL, TRUE);
_node_index_node($mynode);
search_update_totals();
}
break;
case 'view':
if ($node->type == 'biblio' && variable_get('biblio_hide_bibtex_braces', 0) && !empty($a4)) {
drupal_set_title(filter_xss($node->title, biblio_get_allowed_tags()));
}
break;
}
}
}