function theme_user_permission_description

theme_user_permission_description($variables)

Returns HTML for an individual permission description.

Parameters

$variables: An associative array containing:

  • permission_item: An associative array representing the permission whose description is being themed. Useful keys include:
    • description: The text of the permission description.
    • warning: A security-related warning message about the permission (if there is one).
  • hide: A boolean indicating whether or not the permission description was requested to be hidden rather than shown.

Related topics

File

modules/user/user.admin.inc, line 822
Admin page callback file for the user module.

Code

function theme_user_permission_description($variables) {
  if (!$variables['hide']) {
    $description = array();
    $permission_item = $variables['permission_item'];
    if (!empty($permission_item['description'])) {
      $description[] = $permission_item['description'];
    }
    if (!empty($permission_item['warning'])) {
      $description[] = '<em class="permission-warning">' . $permission_item['warning'] . '</em>';
    }
    if (!empty($description)) {
      return implode(' ', $description);
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.admin.inc/function/theme_user_permission_description/7.x