/**
* Implements hook_field_formatter_info().
*/
function _field_formatter_info() {
return array(
'_name; ?>' => array(
'label' => t('label; ?>'),
'field types' => array('field_types)); ?>'),
form)) : ?>
'settings' => array(
form as $form_key => $element) : ?>
'' =>
array(
$value) : ?>
=> '',
),
'',
),
),
);
}
form)) : ?>
/**
* Implements hook_field_formatter_settings_summary().
*/
function _field_formatter_settings_summary($field, $instance, $view_mode) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
$summary = '';
if ($display['type'] == '_name; ?>') {
form) as $key) : ?>
// form[$key]['#title'] ?>.
$value = empty($settings['']) ? '' . t('Empty') . '' : $settings[''];
$value = is_array($value) ? implode(', ', array_filter($value)) : $value;
$summary .= "form[$key]['#title'] ?>: {$value}
";
}
return $summary;
}
/**
* Implements hook_field_formatter_settings_form().
*/
function _field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
fapi) as $line) : ?>
return $form;
}
/**
* Implements hook_field_formatter_view().
*/
function _field_formatter_view($obj_type, $object, $field, $instance, $langcode, $items, $display) {
$element = array();
// Build variables array for formatter.
$variables = array(
'#obj_type' => $obj_type,
'#object' => $object,
'#field' => $field,
'#instance' => $instance,
'#langcode' => $langcode,
'#items' => $items,
'#display' => $display,
);
if (function_exists($function = "{$display['module']}_field_formatter_{$display['type']}")) {
$element[0] = array(
'#markup' => $function($variables),
);
}
return $element;
}
/**
* Field Formatter; label; ?>.
*/
function _field_formatter__name; ?>($variables) {
code) as $line) : ?>
}