function slick_get_admin_summary in Slick Carousel 7.2
Same name and namespace in other branches
- 7.3 includes/slick.admin.inc \slick_get_admin_summary()
Returns reusable summaries across Slick field formatters.
1 call to slick_get_admin_summary()
- slick_fields_field_formatter_settings_summary in slick_fields/
slick_fields.module - Implements hook_field_formatter_settings_summary().
File
- includes/
slick.admin.inc, line 906 - Contains optional functions called only if needed by admin pages.
Code
function slick_get_admin_summary($field, $instance, $view_mode, $module) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
$summary = $form = $form_state = array();
$function = $module . '_field_formatter_settings_form';
$elements = $function($field, $instance, $view_mode, $form, $form_state);
foreach ($settings as $key => $setting) {
$title = isset($elements[$key]['#title']) ? $elements[$key]['#title'] : '';
if (is_array($setting) || empty($title)) {
continue;
}
if (is_numeric($setting) || is_bool($setting)) {
$setting = empty($setting) ? t('No') : t('Yes');
}
elseif (empty($setting)) {
continue;
}
if (isset($settings[$key])) {
$summary[] = t('@title: <strong>@setting</strong>', array(
'@title' => $title,
'@setting' => $setting,
));
}
}
return $summary;
}