You are here

public function dsFieldFunction::formatContent in Display Suite 6.3

Format content for use in an item

Overrides dsField::formatContent

File

plugins/ds_field/function.inc, line 22

Class

dsFieldFunction
The function field type

Code

public function formatContent() {
  $content = NULL;
  if (isset($this->settings['function'])) {

    // Load includes
    if (isset($this->settings['file'])) {
      include_once $this->settings['file'];
    }

    // If its a function, call it
    if (isset($this->settings['function']) && !empty($this->settings['function'])) {
      if (function_exists($this->settings['function'])) {
        $this->content = call_user_func($this->settings['function'], $this->settings);
        return $this->content;
      }
    }
  }
  return FALSE;
}