- Patch #506976 by catch: rename hook_perm to hook_permission.
parent
4a4a6570d8
commit
e4a4b7cc7e
|
|
@ -270,9 +270,9 @@ function _aggregator_has_categories() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function aggregator_perm() {
|
function aggregator_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer news feeds' => array(
|
'administer news feeds' => array(
|
||||||
'title' => t('Administer news feeds'),
|
'title' => t('Administer news feeds'),
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,9 @@ function block_theme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function block_perm() {
|
function block_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer blocks' => array(
|
'administer blocks' => array(
|
||||||
'title' => t('Administer blocks'),
|
'title' => t('Administer blocks'),
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ function blog_node_info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function blog_perm() {
|
function blog_permission() {
|
||||||
return node_list_permissions('blog');
|
return node_list_permissions('blog');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ function blogapi_help($path, $arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function blogapi_perm() {
|
function blogapi_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer content with blog api' => array(
|
'administer content with blog api' => array(
|
||||||
'title' => t('Administer content with blog API'),
|
'title' => t('Administer content with blog API'),
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@ function book_theme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function book_perm() {
|
function book_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer book outlines' => array(
|
'administer book outlines' => array(
|
||||||
'title' => t('Administer book outlines'),
|
'title' => t('Administer book outlines'),
|
||||||
|
|
|
||||||
|
|
@ -224,9 +224,9 @@ function comment_node_type($op, $info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function comment_perm() {
|
function comment_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer comments' => array(
|
'administer comments' => array(
|
||||||
'title' => t('Administer comments'),
|
'title' => t('Administer comments'),
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,9 @@ function contact_help($path, $arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function contact_perm() {
|
function contact_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer site-wide contact form' => array(
|
'administer site-wide contact form' => array(
|
||||||
'title' => t('Administer site-wide contact form'),
|
'title' => t('Administer site-wide contact form'),
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,9 @@ function filter_admin_format_title($format) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function filter_perm() {
|
function filter_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer filters' => array(
|
'administer filters' => array(
|
||||||
'title' => t('Administer filters'),
|
'title' => t('Administer filters'),
|
||||||
|
|
|
||||||
|
|
@ -419,9 +419,9 @@ function forum_access($op, $node, $account) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function forum_perm() {
|
function forum_permission() {
|
||||||
$perms = array(
|
$perms = array(
|
||||||
'administer forums' => array(
|
'administer forums' => array(
|
||||||
'title' => t('Administer forums'),
|
'title' => t('Administer forums'),
|
||||||
|
|
|
||||||
|
|
@ -184,9 +184,9 @@ function locale_inc_callback() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function locale_perm() {
|
function locale_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer languages' => array(
|
'administer languages' => array(
|
||||||
'title' => t('Administer languages'),
|
'title' => t('Administer languages'),
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,9 @@ function menu_help($path, $arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function menu_perm() {
|
function menu_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer menu' => array(
|
'administer menu' => array(
|
||||||
'title' => t('Administer menu'),
|
'title' => t('Administer menu'),
|
||||||
|
|
|
||||||
|
|
@ -1261,9 +1261,9 @@ function theme_node_log_message($log) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function node_perm() {
|
function node_permission() {
|
||||||
$perms = array(
|
$perms = array(
|
||||||
'administer content types' => array(
|
'administer content types' => array(
|
||||||
'title' => t('Administer content types'),
|
'title' => t('Administer content types'),
|
||||||
|
|
|
||||||
|
|
@ -256,9 +256,9 @@ function path_form_alter(&$form, $form_state, $form_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function path_perm() {
|
function path_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer url aliases' => array(
|
'administer url aliases' => array(
|
||||||
'title' => t('Administer URL aliases'),
|
'title' => t('Administer URL aliases'),
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ function php_help($path, $arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function php_perm() {
|
function php_permission() {
|
||||||
return array(
|
return array(
|
||||||
'use PHP for settings' => array(
|
'use PHP for settings' => array(
|
||||||
'title' => t('Use PHP for settings'),
|
'title' => t('Use PHP for settings'),
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,9 @@ function poll_theme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function poll_perm() {
|
function poll_permission() {
|
||||||
$perms = node_list_permissions('poll');
|
$perms = node_list_permissions('poll');
|
||||||
$perms += array(
|
$perms += array(
|
||||||
'vote on polls' => array(
|
'vote on polls' => array(
|
||||||
|
|
|
||||||
|
|
@ -141,9 +141,9 @@ function search_theme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function search_perm() {
|
function search_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer search' => array(
|
'administer search' => array(
|
||||||
'title' => t('Administer search'),
|
'title' => t('Administer search'),
|
||||||
|
|
|
||||||
|
|
@ -876,7 +876,7 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||||
static $available;
|
static $available;
|
||||||
|
|
||||||
if (!isset($available) || $reset) {
|
if (!isset($available) || $reset) {
|
||||||
$available = array_keys(module_invoke_all('perm'));
|
$available = array_keys(module_invoke_all('permission'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$valid = TRUE;
|
$valid = TRUE;
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,9 @@ function simpletest_menu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function simpletest_perm() {
|
function simpletest_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer unit tests' => array(
|
'administer unit tests' => array(
|
||||||
'title' => t('Administer unit tests'),
|
'title' => t('Administer unit tests'),
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ define('FIELD_TEST_ELEMENT_ID', 1);
|
||||||
define('FIELD_TEST_BUNDLE', 'test_bundle');
|
define('FIELD_TEST_BUNDLE', 'test_bundle');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function field_test_perm() {
|
function field_test_permission() {
|
||||||
$perms = array(
|
$perms = array(
|
||||||
'access field_test content' => array(
|
'access field_test content' => array(
|
||||||
'title' => t('Access field_test content'),
|
'title' => t('Access field_test content'),
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function module_test_perm() {
|
function module_test_permission() {
|
||||||
return array(
|
return array(
|
||||||
'module_test perm' => t('example perm for module_test module'),
|
'module_test perm' => t('example perm for module_test module'),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,9 @@ function statistics_exit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function statistics_perm() {
|
function statistics_permission() {
|
||||||
return array(
|
return array(
|
||||||
'access statistics' => array(
|
'access statistics' => array(
|
||||||
'title' => t('Access statistics'),
|
'title' => t('Access statistics'),
|
||||||
|
|
|
||||||
|
|
@ -668,7 +668,7 @@ function hook_system_info_alter(&$info, $file) {
|
||||||
*
|
*
|
||||||
* For a detailed usage example, see page_example.module.
|
* For a detailed usage example, see page_example.module.
|
||||||
*/
|
*/
|
||||||
function hook_perm() {
|
function hook_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer my module' => array(
|
'administer my module' => array(
|
||||||
'title' => t('Administer my module'),
|
'title' => t('Administer my module'),
|
||||||
|
|
|
||||||
|
|
@ -193,9 +193,9 @@ function system_theme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function system_perm() {
|
function system_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer site configuration' => array(
|
'administer site configuration' => array(
|
||||||
'title' => t('Administer site configuration'),
|
'title' => t('Administer site configuration'),
|
||||||
|
|
@ -2206,7 +2206,7 @@ function system_get_module_admin_tasks($module) {
|
||||||
$admin_tasks = array();
|
$admin_tasks = array();
|
||||||
$admin_task_count = 0;
|
$admin_task_count = 0;
|
||||||
// Check for permissions.
|
// Check for permissions.
|
||||||
if (in_array($module, module_implements('perm')) && $admin_access) {
|
if (in_array($module, module_implements('permission')) && $admin_access) {
|
||||||
$admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/permissions', array('fragment' => 'module-' . $module));
|
$admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/permissions', array('fragment' => 'module-' . $module));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function taxonomy_perm() {
|
function taxonomy_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer taxonomy' => array(
|
'administer taxonomy' => array(
|
||||||
'title' => t('Administer taxonomy'),
|
'title' => t('Administer taxonomy'),
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_perm().
|
* Implementation of hook_permission().
|
||||||
*/
|
*/
|
||||||
function toolbar_perm() {
|
function toolbar_permission() {
|
||||||
return array(
|
return array(
|
||||||
'access toolbar' => array(
|
'access toolbar' => array(
|
||||||
'title' => t('Access administration toolbar'),
|
'title' => t('Access administration toolbar'),
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,9 @@ function _translation_tab_access($node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function translation_perm() {
|
function translation_permission() {
|
||||||
return array(
|
return array(
|
||||||
'translate content' => array(
|
'translate content' => array(
|
||||||
'title' => t('Translate content'),
|
'title' => t('Translate content'),
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ function upload_theme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function upload_perm() {
|
function upload_permission() {
|
||||||
return array(
|
return array(
|
||||||
'upload files' => array(
|
'upload files' => array(
|
||||||
'title' => t('Upload files'),
|
'title' => t('Upload files'),
|
||||||
|
|
|
||||||
|
|
@ -606,8 +606,8 @@ function user_admin_perm($form_state, $rid = NULL) {
|
||||||
// Render role/permission overview:
|
// Render role/permission overview:
|
||||||
$options = array();
|
$options = array();
|
||||||
$hide_descriptions = !system_admin_compact_mode();
|
$hide_descriptions = !system_admin_compact_mode();
|
||||||
foreach (module_implements('perm') as $module) {
|
foreach (module_implements('permission') as $module) {
|
||||||
if ($permissions = module_invoke($module, 'perm')) {
|
if ($permissions = module_invoke($module, 'permission')) {
|
||||||
$info = drupal_parse_info_file(drupal_get_path('module', $module) . "/$module.info");
|
$info = drupal_parse_info_file(drupal_get_path('module', $module) . "/$module.info");
|
||||||
$form['permission'][] = array(
|
$form['permission'][] = array(
|
||||||
'#markup' => $info['name'],
|
'#markup' => $info['name'],
|
||||||
|
|
@ -933,7 +933,7 @@ function user_modules_installed($modules) {
|
||||||
$rid = variable_get('user_admin_role', 0);
|
$rid = variable_get('user_admin_role', 0);
|
||||||
if ($rid) {
|
if ($rid) {
|
||||||
foreach ($modules as $module) {
|
foreach ($modules as $module) {
|
||||||
if ($permissions = module_invoke($module, 'perm')) {
|
if ($permissions = module_invoke($module, 'permission')) {
|
||||||
foreach (array_keys($permissions) as $permission) {
|
foreach (array_keys($permissions) as $permission) {
|
||||||
db_insert('role_permission')
|
db_insert('role_permission')
|
||||||
->fields(array(
|
->fields(array(
|
||||||
|
|
@ -952,7 +952,7 @@ function user_modules_installed($modules) {
|
||||||
function user_modules_uninstalled($modules) {
|
function user_modules_uninstalled($modules) {
|
||||||
$permissions = array();
|
$permissions = array();
|
||||||
foreach ($modules as $module) {
|
foreach ($modules as $module) {
|
||||||
$permissions = array_merge($permissions, array_keys(module_invoke($module, 'perm')));
|
$permissions = array_merge($permissions, array_keys(module_invoke($module, 'permission')));
|
||||||
}
|
}
|
||||||
if (!empty($permissions)) {
|
if (!empty($permissions)) {
|
||||||
db_delete('role_permission')
|
db_delete('role_permission')
|
||||||
|
|
|
||||||
|
|
@ -745,9 +745,9 @@ function user_is_blocked($name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement hook_perm().
|
* Implement hook_permission().
|
||||||
*/
|
*/
|
||||||
function user_perm() {
|
function user_permission() {
|
||||||
return array(
|
return array(
|
||||||
'administer permissions' => array(
|
'administer permissions' => array(
|
||||||
'title' => t('Administer permissions'),
|
'title' => t('Administer permissions'),
|
||||||
|
|
@ -2394,9 +2394,9 @@ function user_filters() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
foreach (module_implements('perm') as $module) {
|
foreach (module_implements('permission') as $module) {
|
||||||
$function = $module . '_perm';
|
$function = $module . '_permission';
|
||||||
if ($permissions = $function('perm')) {
|
if ($permissions = $function('permission')) {
|
||||||
asort($permissions);
|
asort($permissions);
|
||||||
foreach ($permissions as $permission => $description) {
|
foreach ($permissions as $permission => $description) {
|
||||||
$options[t('@module module', array('@module' => $module))][$permission] = t($permission);
|
$options[t('@module module', array('@module' => $module))][$permission] = t($permission);
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ function default_profile_tasks(&$task, $url) {
|
||||||
variable_set('user_admin_role', $rid);
|
variable_set('user_admin_role', $rid);
|
||||||
|
|
||||||
// Assign all available permissions to this role.
|
// Assign all available permissions to this role.
|
||||||
foreach (module_invoke_all('perm') as $key => $value) {
|
foreach (module_invoke_all('permission') as $key => $value) {
|
||||||
db_insert('role_permission')
|
db_insert('role_permission')
|
||||||
->fields(array(
|
->fields(array(
|
||||||
'rid' => $rid,
|
'rid' => $rid,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue