You are here

function theme_document_info in Document 6

Same name and namespace in other branches
  1. 7 document.module \theme_document_info()
  2. 8.x document.module \theme_document_info()

A custom theme function.

By using this function to format our node-specific information, themes can override this presentation if they wish. We also wrap the default presentation in a CSS class that is prefixed by the module name. This way, style sheets can modify the output without requiring theme code.

1 theme call to theme_document_info()
document_view in ./document.module
Implementation of hook_view().

File

./document.module, line 424

Code

function theme_document_info($node) {
  $output = '<div class="document_info">';
  $output .= '<div class="document_info_type"><b>Type</b>: %s</div>';
  $output .= '<div class="document_info_author"><b>Author</b>: %s</div>';
  $output .= '<div class="document_info_year"><b>Year of Publishing</b>: %d</div>';
  $output .= '<div class="document_info_keywords"><b>Keywords</b>: %s</div>';
  $output .= '<div class="document_info_download">%s</div>';
  $output .= '</div>';
  $url = l(t('Download'), $node->document_url, array(
    'attributes' => array(
      'target' => '_blank',
    ),
  ));
  $output = sprintf($output, check_plain($node->document_type), check_plain($node->document_author), $node->document_year, check_plain($node->document_keywords), $url);
  return $output;
}