You are here

function l10n_client_access in Localization client 7

Same name and namespace in other branches
  1. 6.2 l10n_client.module \l10n_client_access()
  2. 6 l10n_client.module \l10n_client_access()

Detects whether a user can access l10n_client.

3 calls to l10n_client_access()
l10n_client_init in ./l10n_client.module
Implement hook_init().
l10n_client_page_alter in ./l10n_client.module
Implement hook_page_alter().
l10n_client_save_string in ./l10n_client.module
Menu callback. Saves a string translation coming as POST data.
1 string reference to 'l10n_client_access'
l10n_client_menu in ./l10n_client.module
Implement hook_menu().

File

./l10n_client.module, line 113
Localization client. Provides on-page translation editing.

Code

function l10n_client_access($account = NULL) {
  if (!isset($account)) {
    global $user;
    $account = $user;
  }
  $user_enabled = empty($account->data['l10n_client_disabled']);
  $user_access = user_access('use on-page translation', $account);
  $paths = variable_get('l10n_client_disabled_paths', '');
  $paths_disabled = !empty($paths) && drupal_match_path(current_path(), $paths);
  return $user_access && $user_enabled && !$paths_disabled;
}