Project

General

Profile

Revision d719f12f

Added by Assos Assos over 8 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/views/views.module
1020 1020
 * permissions. If the $account argument is omitted, the current user
1021 1021
 * is used.
1022 1022
 */
1023
function views_check_perm($perm, $account = NULL) {
1024
  return user_access($perm, $account) || user_access('access all views', $account);
1023
function views_check_perm($perms, $account = NULL) {
1024
  // Backward compatibility to ensure also a single permission string is
1025
  // properly processed.
1026
  $perms = is_array($perms) ? $perms : array($perms);
1027
  if (user_access('access all views', $account)) {
1028
    return TRUE;
1029
  }
1030
  // Perms are handled as OR, as soon one permission allows access TRUE is
1031
  // returned.
1032
  foreach ($perms as $perm) {
1033
    if (user_access($perm, $account)) {
1034
      return TRUE;
1035
    }
1036
  }
1037
  return FALSE;
1025 1038
}
1026 1039

  
1027 1040
/**
......
1298 1311
 *   Either 'display', 'style' or 'row'
1299 1312
 * @param $key
1300 1313
 *   For style plugins, this is an optional type to restrict to. May be 'normal',
1301
 *   'summary', 'feed' or others based on the neds of the display.
1314
 *   'summary', 'feed' or others based on the needs of the display.
1302 1315
 * @param $base
1303 1316
 *   An array of possible base tables.
1304 1317
 *
......
2413 2426
 * Trim the field down to the specified length.
2414 2427
 *
2415 2428
 * @param $alter
2416
 *   - max_length: Maximum lenght of the string, the rest gets truncated.
2429
 *   - max_length: Maximum length of the string, the rest gets truncated.
2417 2430
 *   - word_boundary: Trim only on a word boundary.
2418 2431
 *   - ellipsis: Show an ellipsis (...) at the end of the trimmed string.
2419 2432
 *   - html: Take sure that the html is correct.

Also available in: Unified diff