atr_method_availability

Versions
6.1
atr_method_availability($method, $language)

Check if a review method is available for a certain language.

Parameters

$method The method to check.

$language The language as per ISO 639.

Return value

Method information as defined in hook_atr_method_info(), but with one review callback or FALSE if the method is not available for the given language.

Code

atr/atr.module, line 204

<?php
function atr_method_availability($method, $language) {
  $method_info = atr_method_info($method);
  $languages = array($language, 'zxx');
  foreach ($languages as $possible_language) {
    if (isset($method_info['#review_callback'][$possible_language])) {
      $method_info['#review_callback'] = $method_info['#review_callback'][$possible_language];
      return $method_info;
    }
  }
  return FALSE;
}
?>