function theme_biblio_tabular in Bibliography Module 6.2
Same name and namespace in other branches
- 6 biblio_theme.inc \theme_biblio_tabular()
- 7 includes/biblio_theme.inc \theme_biblio_tabular()
- 7.2 includes/biblio.theme.inc \theme_biblio_tabular()
Parameters
object $node: A node object
string $base:
$teaser:
1 theme call to theme_biblio_tabular()
- biblio_view in ./
biblio.module - Implements hook_view().
File
- includes/
biblio_theme.inc, line 230
Code
function theme_biblio_tabular($node, $base = 'biblio', $teaser = false) {
static $citeproc;
if (module_exists('popups')) {
popups_add_popups();
}
$tid = $node->biblio_type;
$fields = _biblio_get_field_information($node->biblio_type, TRUE);
$extra_fields = module_invoke_all('get_biblio_field_info');
$fields = array_merge($fields, $extra_fields);
_biblio_localize_fields($fields);
$rows[] = array(
array(
'data' => t('Title'),
'class' => 'biblio-row-title biblio-field-title-title',
),
array(
'data' => filter_xss($node->title, biblio_get_allowed_tags()),
'class' => 'biblio-field-contents-title',
),
);
$rows[] = array(
array(
'data' => t('Publication Type'),
'class' => 'biblio-row-title biblio-field-title-type',
),
array(
'data' => isset($node->biblio_type_name) ? _biblio_localize_type($node->biblio_type, $node->biblio_type_name) : $node->biblio_type,
'class' => 'biblio-field-contents-type',
),
);
if ($node->biblio_url) {
$attrib = variable_get('biblio_links_target_new_window', null) ? array(
'target' => '_blank',
) : array();
$node->biblio_url = l($node->biblio_url, $node->biblio_url, $attrib);
}
if ($node->biblio_doi) {
$doi_url = '';
$attrib = variable_get('biblio_links_target_new_window', null) ? array(
'target' => '_blank',
) : array();
if (($doi_start = strpos($node->biblio_doi, '10.')) !== FALSE) {
$doi = substr($node->biblio_doi, $doi_start);
$doi_url .= 'http://dx.doi.org/' . $doi;
}
$node->biblio_doi = l($node->biblio_doi, $doi_url, $attrib);
}
foreach ($fields as $key => $row) {
// handling the contributor categories like any other field orders them correctly by weight
if ($row['type'] == 'contrib_widget' && !empty($node->biblio_contributors[$row['fid']][0]['name'])) {
$data = biblio_format_authors($node->biblio_contributors[$row['fid']]);
}
elseif (empty($node->{$row}['name']) || $row['name'] == 'biblio_coins') {
continue;
}
else {
switch ($row['name']) {
case 'biblio_keywords':
$data = _biblio_keyword_links($node->{$row}['name'], $base);
break;
case 'biblio_url':
case 'biblio_doi':
// check_plain is not need on these since they have gone through
// the l() function which does a check_plain
$data = $node->{$row}['name'];
break;
default:
if ($row['type'] == 'textarea') {
$format = isset($node->biblio_formats[$row['name']]) ? $node->biblio_formats[$row['name']] : $node->format;
$data = check_markup($node->{$row}['name'], $format, FALSE);
}
else {
$data = check_plain($node->{$row}['name']);
}
}
}
$rows[] = array(
array(
'data' => t($row['title']),
'class' => 'biblio-row-title biblio-field-title-' . str_replace('_', '-', str_replace('biblio_', '', $row['name'])),
),
array(
'data' => $data,
'class' => 'biblio-field-contents-' . str_replace('_', '-', str_replace('biblio_', '', $row['name'])),
),
);
}
if (strlen(trim($node->body)) && user_access('view full text')) {
$rows[] = array(
array(
'data' => t('Full Text'),
'valign' => 'top',
),
array(
'data' => check_markup($node->body, $node->format, FALSE),
),
);
}
$output = '<div id="biblio-node">';
$output .= filter_xss($node->biblio_coins, array(
'span',
));
$header = array();
$output .= theme('table', $header, $rows);
$output .= '</div>';
return $output;
}