function _biblio_prepare_submit in Bibliography Module 7
Same name and namespace in other branches
- 6.2 biblio.module \_biblio_prepare_submit()
- 6 biblio.module \_biblio_prepare_submit()
- 7.2 biblio.module \_biblio_prepare_submit()
Prepare a node for submit to database. Contains code common to insert and update.
Parameters
$node:
Return value
none
2 calls to _biblio_prepare_submit()
- biblio_insert in ./
biblio.module - Implements hook_insert().
- biblio_update in ./
biblio.module - Implements hook_update().
File
- ./
biblio.module, line 1744 - Bibliography Module for Drupal.
Code
function _biblio_prepare_submit(&$node) {
$node->biblio_sort_title = biblio_normalize_title($node->title);
if (!isset($node->biblio_year)) {
$node->biblio_year = 9999;
}
$node->biblio_year = _biblio_numeric_year($node->biblio_year);
if (variable_get('biblio_auto_citekey', 1) && empty($node->biblio_citekey)) {
$node->biblio_citekey = biblio_citekey_generate($node);
}
foreach (_biblio_get_formatted_fields() as $field) {
if (isset($node->{$field}) && is_array($node->{$field})) {
$node->biblio_formats[$field] = $node->{$field}['format'];
$node->{$field} = $node->{$field}['value'];
}
else {
if (!isset($node->biblio_formats) || !is_array($node->biblio_formats)) {
$node->biblio_formats = array();
}
$node->biblio_formats[$field] = filter_default_format();
}
}
}