function theme_phonefield_formatter_phonefield_separate_plain in Phone Field 7
Theme function for 'separate_plain' text field formatter.
File
- ./
phonefield.module, line 508 - Hooks for a module that defines a simple phone number field type.
Code
function theme_phonefield_formatter_phonefield_separate_plain($vars) {
$element = $vars['element'];
// Display label and link if both link label and phone number are available.
$linklabel = _phonefield_linklabel($element['linklabel'], $vars['field']['settings']);
if (!empty($linklabel) && !empty($element['phonenumber'])) {
return t('@prefix: @phone', array(
'@prefix' => $linklabel,
'@phone' => $element['phonenumber'],
));
}
elseif (!empty($linklabel)) {
return t('@label', array(
'@label' => $linklabel,
));
}
else {
return !empty($element['phonenumber']) ? check_plain($element['phonenumber']) : t('no phone');
}
}