<?php

/**
 * @file
 * Primary hook implementations for the Metatag: OpenGraph module.
 */

/**
 * Implements hook_preprocess_html().
 */
function metatag_opengraph_preprocess_html(&$variables) {
  // Fall back to hook_rdf_namespaces if the rdf module is enabled.
  if (module_exists('rdf')) {
    return;
  }

  // @todo Would it be worth dynamically identifying whether these should be
  // added, or just output them all?
  // Need an extra namespace for the 'og' tags.
  $variables['rdf_namespaces'] .= "\n  xmlns:og=\"https://ogp.me/ns#\"";
}

/**
 * Implements hook_rdf_namespaces().
 */
function metatag_opengraph_rdf_namespaces() {
  return array(
    'og' => 'https://ogp.me/ns#',
  );
}

/**
 * Implements hook_ctools_plugin_api().
 */
function metatag_opengraph_ctools_plugin_api($owner, $api) {
  if ($owner == 'metatag' && $api == 'metatag') {
    return array('version' => 1);
  }
}

/*
og:title = [node:title] / [user:name]
og:type = article / profile
og:image = ? / [user:picture:url]
og:url = [node:url] / [user:url]
og:description
og:site_name = [site:name]

og:latitude
og:longitude
og:street-address
og:locality
og:region
og:postal-code
og:country-name

og:email
og:phone_number
og:fax_number

og:video:url
og:video:secure_url
og:video:height
og:video:width
og:video:type

og:audio
og:audio:title
og:audio:artist
og:audio:album
og:audio:type

og:upc
og:isbn
 */
