You are here

function translation_overview_is_manager in Translation Overview 6.2

Determine if a user is a manager for a language (or any langauge if none is specified).

Parameters

$language String with the language code. If no value is provided the: a check will be made to see if they manage any language.

$account Drupal user object.:

Return value

Boolean

3 calls to translation_overview_is_manager()
theme_translation_overview_node_form in ./translation_overview.pages.inc
translation_overview_manager_page in ./translation_overview.pages.inc
Translation overview page.
translation_overview_node_form in ./translation_overview.pages.inc
Overview page for a node's translations.
1 string reference to 'translation_overview_is_manager'
translation_overview_menu in ./translation_overview.module
Implementation of hook_menu().

File

./translation_overview.module, line 213

Code

function translation_overview_is_manager($lang_code = NULL, $account = NULL) {
  if (empty($lang_code)) {
    foreach (locale_language_list() as $lang_code => $language) {
      if (user_access('manage ' . check_plain($lang_code) . ' translation overview priorities', $account)) {
        return TRUE;
      }
    }
    return FALSE;
  }
  return user_access('manage ' . check_plain($lang_code) . ' translation overview priorities', $account);
}