You are here

function coder_upgrade_upgrade_hook_perm_alter in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/conversions/function.inc \coder_upgrade_upgrade_hook_perm_alter()

Implements hook_upgrade_hook_perm_alter().

File

coder_upgrade/conversions/function.inc, line 499
Provides conversion routines applied to functions (or hooks).

Code

function coder_upgrade_upgrade_hook_perm_alter(&$node, &$reader) {

  // Changes: hook_permission and descriptions_permissions
  $item =& $node->data;

  // Rename function.
  $item->name .= 'ission';

  // Update document comment.
  $item->comment = preg_replace('@hook_perm([^i])@', "hook_permission\$1", $item->comment);

  // Restructure the permissions array.
  coder_upgrade_convert_return($node->data->body, 'perm', '', 0, 0);
}