function mobile_codes_field_formatter in Mobile Codes 5
File
- ./
mobile_codes.formatter.inc, line 26
Code
function mobile_codes_field_formatter($field, $item, $formatter, $node) {
preg_match('/^mobile_codes_(.*)_(.*)$/', $formatter, $matches);
$arguments = array(
'data' => 'text',
'preset' => $matches[1],
);
switch ($matches[2]) {
case 'path':
$output = mobile_codes_generate($item['value'], $arguments);
break;
default:
$output = theme('mobilecode', $item['value'], $arguments);
break;
}
return $output;
}