You are here

function nd_eval_code in Node displays 6

Evaluate custom code.

Parameters

string $key The name of the key to create.:

array $value The field array.:

stdClass The node object.:

1 call to nd_eval_code()
_nd_nodeapi in ./nd.module
Helper function to alter node properties

File

./nd.module, line 340
Main node displays file.

Code

function nd_eval_code($key, $field, &$node) {
  if (isset($field['code'])) {
    $node_key = $key . '_rendered';
    $value = nd_eval($field['code'], $node);

    // Token support.
    if (module_exists('token')) {
      $value = token_replace($value, 'node', $node);
    }
    $node->{$node_key} = $value;
  }
}