You are here

protected function ShareMessage::getImageUrl in Share Message 7

Gets the image url of the ShareMessage.

Parameters

array $context: The context for the token replacements.

Return value

bool|string The found URL or FALSE.

3 calls to ShareMessage::getImageUrl()
ShareMessage::addOGTags in includes/sharemessage.entity.inc
Function that adds OG tags in the header of the page.
ShareMessage::addTwitterCardTags in includes/sharemessage.entity.inc
Adds meta tags in order to share images on Twitter.
ShareMessage::buildContent in includes/sharemessage.entity.inc
Overrides Entity::buildContent().

File

includes/sharemessage.entity.inc, line 443
Definition of ShareMessage entity class.

Class

ShareMessage

Code

protected function getImageUrl($context) {

  // Get image url either from dedicated file field or by resolving token.
  if ($items = field_get_items('sharemessage', $this, 'sharemessage_image')) {
    $image_url = file_create_url($items[0]['uri']);
  }
  else {
    $image_url = $this
      ->getTokenizedField('sharemessage_image_url', $context);
  }
  return $image_url;
}