You are here

function epub_field_formatter_settings_summary in Epub 7

Implements hook_field_formatter_settings_summary().

File

includes/epub.field.inc, line 115

Code

function epub_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  switch ($display['type']) {
    case 'epub_cover':
      return t('Width: @width', array(
        '@width' => $settings['width'] ? $settings['width'] : '100%',
      ));
    case 'epub_default':
      $args = array(
        '@width' => $settings['width'] ? $settings['width'] : '100%',
        '@height' => $settings['height'] ? $settings['height'] : 'auto',
      );
      return t('Width: @width, Height: @height', $args);
    case 'epub_js':
      $args = array(
        '@width' => $settings['width'] ? $settings['width'] : '100%',
        '@height' => $settings['height'] ? $settings['height'] : 'auto',
      );
      return t('Let epub.js reader use unzipped epub contents from server: @unzipped', array(
        '@unzipped' => $settings['unzipped'] ? t('Yes') : t('No'),
      )) . t('Width: @width, Height: @height', $args);
    case 'epub_js_reader':
      return t('Let epub.js reader use unzipped epub contents from server: @unzipped', array(
        '@unzipped' => $settings['unzipped'] ? t('Yes') : t('No'),
      ));
  }
  return '';
}