You are here

public static function OpenGraphMetaDrupalLayer::theme_selector_image in Open Graph meta tags 6

Same name and namespace in other branches
  1. 7 opengraph_meta.common.inc \OpenGraphMetaDrupalLayer::theme_selector_image()

Get rendered IMG tag for the OGMT node image selector.

1 call to OpenGraphMetaDrupalLayer::theme_selector_image()
opengraph_meta_form_alter in ./opengraph_meta.module
Implementation of hook_form_alter.

File

./opengraph_meta.common.inc, line 574

Class

OpenGraphMetaDrupalLayer
Drupal compatibility layer.

Code

public static function theme_selector_image($image) {
  $attributes = array(
    'class' => 'opengraph-thumb',
  );
  $abs_path = url(ltrim($image['url'], '/'), array(
    'absolute' => TRUE,
  ));
  switch (OPENGRAPH_META_DRUPAL_VERSION) {
    case 6:
      return theme('image', $abs_path, $image['alt'], $image['title'], array_merge($attributes, array(
        'width' => '32px',
        'height' => '32px',
      )), FALSE);
      break;
    case 7:
    case 8:
      return theme('image', array(
        'path' => $abs_path,
        'alt' => $image['alt'],
        'height' => '60px',
        'attributes' => array_merge($attributes, array(
          'title' => $image['title'],
        )),
      ));
      break;
    default:
      self::err('No API for theming images');
      return '';
  }
}