function geshinode_view in GeSHi Filter for syntax highlighting 6
Same name and namespace in other branches
- 5.2 geshinode.module \geshinode_view()
Implementation of hook_view()
File
- ./
geshinode.module, line 147 - Implementation of a GeSHi node.
Code
function geshinode_view($node, $teaser = FALSE, $page = FALSE) {
require_once drupal_get_path('module', 'geshifilter') . '/geshifilter.pages.inc';
$node->readmore = strlen($node->teaser) < strlen($node->body);
$line_numbering = variable_get('geshinode_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE);
$source_code = $teaser ? $node->teaser : $node->body;
$node->content['body'] = array(
'#value' => geshifilter_process($source_code, $node->source_code_language, $line_numbering),
'#weight' => 0,
);
return $node;
}