Commit 838d6a29 authored by David Metzler's avatar David Metzler
Browse files

Added ability to use a column in the database as template data.

parent d89206dd
......@@ -19,7 +19,8 @@ class FrxControls {
'iso_date' => 'ISO Date',
'sprintf' => 'PHP sprintf()',
'number' => 'Number',
'drupal_translation' => 'Translatable Text'
'drupal_translation' => 'Translatable Text',
'template' => 'Field is a forena template',
);
return $formats;
}
......@@ -142,5 +143,23 @@ class FrxControls {
return $value;
}
/**
* Indicates the data in the field is a template that can be used by forena to format.
* @param unknown $value
* @param unknown $format_str
* @param string $teng
* @return Ambigous <string, The, mixed>
*/
public function template($value, $format_str, $teng='') {
if ($value) {
$value = $teng->replace($value);
$value = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
if ($format_str && filter_format_exists($format_str)) {
$value = check_markup($value, $format_str);
}
}
return $value;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment