function.inc in Display Suite 6.3
File
plugins/ds_field/function.inc
View source
<?php
$plugin = array(
'type' => DS_FIELD_TYPE_FUNCTION,
'name' => t('Custom function'),
'description' => t('Retrieves content using a PHP function.'),
'function' => 'dsFieldFunction',
);
class dsFieldFunction extends dsField {
public function formatContent() {
$content = NULL;
if (isset($this->settings['function'])) {
if (isset($this->settings['file'])) {
include_once $this->settings['file'];
}
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;
}
}