You are here

function _pathauto_verbose in Pathauto 7

Same name and namespace in other branches
  1. 6.2 pathauto.inc \_pathauto_verbose()
  2. 6 pathauto.inc \_pathauto_verbose()

Output a helpful message if verbose output is enabled.

Verbose output is only enabled when:

  • The 'pathauto_verbose' setting is enabled.
  • The current user has the 'notify of path changes' permission.
  • The $op parameter is anything but 'bulkupdate' or 'return'.

Parameters

$message: An optional string of the verbose message to display. This string should already be run through t().

$op: An optional string with the operation being performed.

Return value

TRUE if verbose output is enabled, or FALSE otherwise.

2 calls to _pathauto_verbose()
pathauto_create_alias in ./pathauto.inc
Apply patterns to create an alias.
_pathauto_set_alias in ./pathauto.inc
Private function for Pathauto to create an alias.

File

./pathauto.inc, line 594
Miscellaneous functions for Pathauto.

Code

function _pathauto_verbose($message = NULL, $op = NULL) {
  static $verbose;
  if (!isset($verbose)) {
    $verbose = variable_get('pathauto_verbose', FALSE) && user_access('notify of path changes');
  }
  if (!$verbose || isset($op) && in_array($op, array(
    'bulkupdate',
    'return',
  ))) {
    return FALSE;
  }
  if ($message) {
    drupal_set_message($message);
  }
  return $verbose;
}