summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/color/color.module2
-rw-r--r--modules/comment/comment.module9
-rw-r--r--modules/forum/forum.module4
-rw-r--r--modules/menu/menu.module2
-rw-r--r--modules/node/node.module8
-rw-r--r--modules/path/path.module2
-rw-r--r--modules/taxonomy/taxonomy.module7
-rw-r--r--modules/upload/upload.module7
-rw-r--r--modules/user/user.module8
9 files changed, 15 insertions, 34 deletions
diff --git a/modules/color/color.module b/modules/color/color.module
index bb94bf0c1..32f618f7e 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -4,7 +4,7 @@
/**
* Implementation of hook_form_alter().
*/
-function color_form_alter($form_id, &$form) {
+function color_form_alter(&$form, $form_id) {
// Insert the color changer into the theme settings page.
// TODO: Last condition in the following if disables color changer when private files are used this should be solved in a different way. See issue #92059.
if ($form_id == 'system_theme_settings' && color_get_info(arg(4)) && function_exists('gd_info') && variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 499db5a0e..8f060c300 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -374,7 +374,7 @@ function comment_link($type, $node = NULL, $teaser = FALSE) {
return $links;
}
-function comment_form_alter($form_id, &$form) {
+function comment_form_alter($form, $form_id) {
if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
$form['workflow']['comment'] = array(
'#type' => 'radios',
@@ -403,6 +403,7 @@ function comment_form_alter($form_id, &$form) {
);
}
}
+ return $form;
}
/**
@@ -963,11 +964,7 @@ function comment_render($node, $cid = 0) {
if ($comment = db_fetch_object($result)) {
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
$links = module_invoke_all('link', 'comment', $comment, 1);
-
- foreach (module_implements('link_alter') as $module) {
- $function = $module .'_link_alter';
- $function($node, $links);
- }
+ drupal_alter('link', $links, $node);
$output .= theme('comment_view', $comment, $links);
}
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 4ff56a177..a7dd2b79b 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -207,7 +207,7 @@ function forum_admin_settings() {
/**
* Implementation of hook_form_alter().
*/
-function forum_form_alter($form_id, &$form) {
+function forum_form_alter(&$form, $form_id) {
// hide critical options from forum vocabulary
if ($form_id == 'taxonomy_form_vocabulary') {
if ($form['vid']['#value'] == _forum_get_vid()) {
@@ -657,7 +657,7 @@ function _forum_parent_select($tid, $title, $child_type) {
return array('#type' => 'select', '#title' => $title, '#default_value' => $parent, '#options' => $options, '#description' => $description, '#required' => TRUE);
}
-function forum_link_alter(&$node, &$links) {
+function forum_link_alter(&$links, $node) {
foreach ($links as $module => $link) {
if (strstr($module, 'taxonomy_term')) {
// Link back to the forum and not the taxonomy term page. We'll only
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 9c14c6571..3a4eae773 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -172,7 +172,7 @@ function menu_perm() {
* Implementation of hook_form_alter().
* Add menu item fields to the node form.
*/
-function menu_form_alter($form_id, &$form) {
+function menu_form_alter(&$form, $form_id) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$item = array();
if ($form['nid']['#value'] > 0) {
diff --git a/modules/node/node.module b/modules/node/node.module
index 3d57ed162..5e9bce1a6 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -673,11 +673,7 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
if ($links) {
$node->links = module_invoke_all('link', 'node', $node, !$page);
-
- foreach (module_implements('link_alter') AS $module) {
- $function = $module .'_link_alter';
- $function($node, $node->links);
- }
+ drupal_alter('link', $node->links, $node);
}
// Set the proper node part, then unset unused $node part so that a bad
@@ -2456,7 +2452,7 @@ function node_update_index() {
/**
* Implementation of hook_form_alter().
*/
-function node_form_alter($form_id, &$form) {
+function node_form_alter(&$form, $form_id) {
// Advanced node search form
if ($form_id == 'search_form' && $form['module']['#value'] == 'node' && user_access('use advanced search')) {
// Keyword boxes:
diff --git a/modules/path/path.module b/modules/path/path.module
index ba70970e5..c245fb63b 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -267,7 +267,7 @@ function path_nodeapi(&$node, $op, $arg) {
/**
* Implementation of hook_form_alter().
*/
-function path_form_alter($form_id, &$form) {
+function path_form_alter(&$form, $form_id) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$path = isset($form['#node']->path) ? $form['#node']->path : NULL;
$form['path'] = array(
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index c05c866f0..bbde8d8d1 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -39,10 +39,7 @@ function taxonomy_link($type, $node = NULL) {
}
// We call this hook again because some modules and themes call taxonomy_link('taxonomy terms') directly
- foreach (module_implements('link_alter') as $module) {
- $function = $module .'_link_alter';
- $function($node, $links);
- }
+ drupal_alter('link', $links, $node);
return $links;
}
@@ -654,7 +651,7 @@ function taxonomy_get_vocabularies($type = NULL) {
* Implementation of hook_form_alter().
* Generate a form for selecting terms to associate with a node.
*/
-function taxonomy_form_alter($form_id, &$form) {
+function taxonomy_form_alter(&$form, $form_id) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$node = $form['#node'];
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index bd0d5568b..e2a729489 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -333,7 +333,7 @@ function _upload_prepare(&$node) {
}
}
-function upload_form_alter($form_id, &$form) {
+function upload_form_alter(&$form, $form_id) {
if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
$form['workflow']['upload'] = array(
'#type' => 'radios',
@@ -883,10 +883,7 @@ function upload_js() {
_upload_validate($node);
$form = _upload_form($node);
- foreach (module_implements('form_alter') as $module) {
- $function = $module .'_form_alter';
- $function('upload_js', $form);
- }
+ drupal_alter('form', $form, 'upload_js');
$form = form_builder('upload_js', $form);
$output = theme('status_messages') . drupal_render($form);
// We send the updated file attachments form.
diff --git a/modules/user/user.module b/modules/user/user.module
index d3bad45d9..173b1656a 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1605,13 +1605,7 @@ function user_view($account) {
}
}
- // Let modules change the returned fields - useful for personal privacy
- // controls. Since modules communicate changes by reference, we cannot use
- // module_invoke_all().
- foreach (module_implements('profile_alter') as $module) {
- $function = $module .'_profile_alter';
- $function($account, $fields);
- }
+ drupal_alter('profile', $fields, $account);
drupal_set_title(check_plain($account->name));
return theme('user_profile', $account, $fields);