You are here

oembed.theme.inc in oEmbed 7.0

Same filename and directory in other branches
  1. 8 theme/oembed.theme.inc
  2. 7 theme/oembed.theme.inc

Theme related functions for oEmbed Core

File

theme/oembed.theme.inc
View source
<?php

/**
 * @file
 * Theme related functions for oEmbed Core
 */

/**
 * Theme for oEmbed output.
 */
function theme_oembed($vars) {
  $embed = $vars['embed'];
  $variables = array(
    'path' => $embed['original_url'],
    // oembed_alt_attr() returns output from t() and is sanitized.
    'text' => empty($embed['title']) ? oembed_alt_attr($embed) : check_plain($embed['title']),
    'options' => array(
      'absolute' => TRUE,
      'attributes' => array(
        'class' => 'oembed-link',
      ),
      'html' => TRUE,
    ),
  );
  return theme('link', $variables);
}

/**
 * Theme for photo oEmbed output.
 */
function theme_oembed__photo($vars) {
  $embed = $vars['embed'];
  $variables = array(
    'path' => $embed['url'],
    'alt' => oembed_alt_attr($embed),
    'width' => $embed['width'],
    'height' => $embed['height'],
  );
  return theme('image', $variables);
}

/**
 * Theme for rich oEmbed output.
 */
function theme_oembed__rich($vars) {
  $embed = $vars['embed'];
  return $embed['html'];
}

/**
 * Theme for video oEmbed output.
 */
function theme_oembed__video($vars) {
  $embed = $vars['embed'];
  return $embed['html'];
}

Functions

Namesort descending Description
theme_oembed Theme for oEmbed output.
theme_oembed__photo Theme for photo oEmbed output.
theme_oembed__rich Theme for rich oEmbed output.
theme_oembed__video Theme for video oEmbed output.