- Patch #506976 by catch: rename hook_perm to hook_permission.

merge-requests/26/head
Dries Buytaert 2009-07-05 18:00:11 +00:00
parent 4a4a6570d8
commit e4a4b7cc7e
30 changed files with 63 additions and 63 deletions

View File

@ -270,9 +270,9 @@ function _aggregator_has_categories() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function aggregator_perm() {
function aggregator_permission() {
return array(
'administer news feeds' => array(
'title' => t('Administer news feeds'),

View File

@ -105,9 +105,9 @@ function block_theme() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function block_perm() {
function block_permission() {
return array(
'administer blocks' => array(
'title' => t('Administer blocks'),

View File

@ -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');
}

View File

@ -21,9 +21,9 @@ function blogapi_help($path, $arg) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function blogapi_perm() {
function blogapi_permission() {
return array(
'administer content with blog api' => array(
'title' => t('Administer content with blog API'),

View File

@ -37,9 +37,9 @@ function book_theme() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function book_perm() {
function book_permission() {
return array(
'administer book outlines' => array(
'title' => t('Administer book outlines'),

View File

@ -224,9 +224,9 @@ function comment_node_type($op, $info) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function comment_perm() {
function comment_permission() {
return array(
'administer comments' => array(
'title' => t('Administer comments'),

View File

@ -33,9 +33,9 @@ function contact_help($path, $arg) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function contact_perm() {
function contact_permission() {
return array(
'administer site-wide contact form' => array(
'title' => t('Administer site-wide contact form'),

View File

@ -145,9 +145,9 @@ function filter_admin_format_title($format) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function filter_perm() {
function filter_permission() {
return array(
'administer filters' => array(
'title' => t('Administer filters'),

View File

@ -419,9 +419,9 @@ function forum_access($op, $node, $account) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function forum_perm() {
function forum_permission() {
$perms = array(
'administer forums' => array(
'title' => t('Administer forums'),

View File

@ -184,9 +184,9 @@ function locale_inc_callback() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function locale_perm() {
function locale_permission() {
return array(
'administer languages' => array(
'title' => t('Administer languages'),

View File

@ -33,9 +33,9 @@ function menu_help($path, $arg) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function menu_perm() {
function menu_permission() {
return array(
'administer menu' => array(
'title' => t('Administer menu'),

View File

@ -1261,9 +1261,9 @@ function theme_node_log_message($log) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function node_perm() {
function node_permission() {
$perms = array(
'administer content types' => array(
'title' => t('Administer content types'),

View File

@ -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(
'administer url aliases' => array(
'title' => t('Administer URL aliases'),

View File

@ -22,9 +22,9 @@ function php_help($path, $arg) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function php_perm() {
function php_permission() {
return array(
'use PHP for settings' => array(
'title' => t('Use PHP for settings'),

View File

@ -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 += array(
'vote on polls' => array(

View File

@ -141,9 +141,9 @@ function search_theme() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function search_perm() {
function search_permission() {
return array(
'administer search' => array(
'title' => t('Administer search'),

View File

@ -876,7 +876,7 @@ class DrupalWebTestCase extends DrupalTestCase {
static $available;
if (!isset($available) || $reset) {
$available = array_keys(module_invoke_all('perm'));
$available = array_keys(module_invoke_all('permission'));
}
$valid = TRUE;

View File

@ -44,9 +44,9 @@ function simpletest_menu() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function simpletest_perm() {
function simpletest_permission() {
return array(
'administer unit tests' => array(
'title' => t('Administer unit tests'),

View File

@ -5,9 +5,9 @@ define('FIELD_TEST_ELEMENT_ID', 1);
define('FIELD_TEST_BUNDLE', 'test_bundle');
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function field_test_perm() {
function field_test_permission() {
$perms = array(
'access field_test content' => array(
'title' => t('Access field_test content'),

View File

@ -2,9 +2,9 @@
// $Id$
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function module_test_perm() {
function module_test_permission() {
return array(
'module_test perm' => t('example perm for module_test module'),
);

View File

@ -81,9 +81,9 @@ function statistics_exit() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function statistics_perm() {
function statistics_permission() {
return array(
'access statistics' => array(
'title' => t('Access statistics'),

View File

@ -668,7 +668,7 @@ function hook_system_info_alter(&$info, $file) {
*
* For a detailed usage example, see page_example.module.
*/
function hook_perm() {
function hook_permission() {
return array(
'administer my module' => array(
'title' => t('Administer my module'),

View File

@ -193,9 +193,9 @@ function system_theme() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function system_perm() {
function system_permission() {
return array(
'administer site configuration' => array(
'title' => t('Administer site configuration'),
@ -2206,7 +2206,7 @@ function system_get_module_admin_tasks($module) {
$admin_tasks = array();
$admin_task_count = 0;
// 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));
}

View File

@ -7,9 +7,9 @@
*/
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function taxonomy_perm() {
function taxonomy_permission() {
return array(
'administer taxonomy' => array(
'title' => t('Administer taxonomy'),

View File

@ -7,9 +7,9 @@
*/
/**
* Implementation of hook_perm().
* Implementation of hook_permission().
*/
function toolbar_perm() {
function toolbar_permission() {
return array(
'access toolbar' => array(
'title' => t('Access administration toolbar'),

View File

@ -82,9 +82,9 @@ function _translation_tab_access($node) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function translation_perm() {
function translation_permission() {
return array(
'translate content' => array(
'title' => t('Translate content'),

View File

@ -40,9 +40,9 @@ function upload_theme() {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function upload_perm() {
function upload_permission() {
return array(
'upload files' => array(
'title' => t('Upload files'),

View File

@ -606,8 +606,8 @@ function user_admin_perm($form_state, $rid = NULL) {
// Render role/permission overview:
$options = array();
$hide_descriptions = !system_admin_compact_mode();
foreach (module_implements('perm') as $module) {
if ($permissions = module_invoke($module, 'perm')) {
foreach (module_implements('permission') as $module) {
if ($permissions = module_invoke($module, 'permission')) {
$info = drupal_parse_info_file(drupal_get_path('module', $module) . "/$module.info");
$form['permission'][] = array(
'#markup' => $info['name'],
@ -933,7 +933,7 @@ function user_modules_installed($modules) {
$rid = variable_get('user_admin_role', 0);
if ($rid) {
foreach ($modules as $module) {
if ($permissions = module_invoke($module, 'perm')) {
if ($permissions = module_invoke($module, 'permission')) {
foreach (array_keys($permissions) as $permission) {
db_insert('role_permission')
->fields(array(
@ -952,7 +952,7 @@ function user_modules_installed($modules) {
function user_modules_uninstalled($modules) {
$permissions = array();
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)) {
db_delete('role_permission')

View File

@ -745,9 +745,9 @@ function user_is_blocked($name) {
}
/**
* Implement hook_perm().
* Implement hook_permission().
*/
function user_perm() {
function user_permission() {
return array(
'administer permissions' => array(
'title' => t('Administer permissions'),
@ -2394,9 +2394,9 @@ function user_filters() {
}
$options = array();
foreach (module_implements('perm') as $module) {
$function = $module . '_perm';
if ($permissions = $function('perm')) {
foreach (module_implements('permission') as $module) {
$function = $module . '_permission';
if ($permissions = $function('permission')) {
asort($permissions);
foreach ($permissions as $permission => $description) {
$options[t('@module module', array('@module' => $module))][$permission] = t($permission);

View File

@ -222,7 +222,7 @@ function default_profile_tasks(&$task, $url) {
variable_set('user_admin_role', $rid);
// 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')
->fields(array(
'rid' => $rid,