You are here

function theme_ds_eval_code in Display Suite 6.3

Same name and namespace in other branches
  1. 6 theme/theme.inc \theme_ds_eval_code()
  2. 6.2 theme/theme.inc \theme_ds_eval_code()

Evaluate custom code.

Parameters

array $field The field with all its properties.:

File

theme/theme.inc, line 96
Theming functions for ds.

Code

function theme_ds_eval_code($field) {
  if (isset($field['properties']['code'])) {
    $value = ds_eval($field['properties']['code'], $field['object']);

    // Token support - check on token property so we don't run every single field through token.
    if (module_exists('token') && isset($field['properties']['token']) && $field['properties']['token'] == TRUE) {
      $value = token_replace($value, $field['object_type'], $field['object']);
    }
    return $value;
  }
}