summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-22 22:36:01 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-22 22:36:01 +0000
commit453032c1171756066f0d2de2367b0098e9fd8d46 (patch)
tree87497d2f3271e9f09dce199d6e8b979df4b8b210 /modules
parentdf17569a0443ed474051583f1db0d11f5fbdedae (diff)
downloadbrdo-453032c1171756066f0d2de2367b0098e9fd8d46.tar.gz
brdo-453032c1171756066f0d2de2367b0098e9fd8d46.tar.bz2
#692950 by effulgentsia, chx, aaron, catch, moshe weitzman, sun: Use hook_module_implements_alter() to allow modules to alter the weight of hooks in module_implements().
Diffstat (limited to 'modules')
-rw-r--r--modules/system/system.api.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 4c97cd757..6faa6afb6 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -982,6 +982,32 @@ function hook_mail_alter(&$message) {
}
/**
+ * Alter the registry of modules implementing a hook.
+ *
+ * This hook is invoked during module_implements(). A module may implement this
+ * hook in order to reorder the implementing modules, which are otherwise
+ * ordered by the module's system weight.
+ *
+ * @param &$implementations
+ * An array keyed by the module's name. The value of each item corresponds
+ * to a $group, which is usually FALSE, unless the implementation is in a
+ * file named $module.$group.inc.
+ * @param $hook
+ * The name of the module hook being implemented.
+ */
+function hook_module_implements_alter(&$implementations, $hook) {
+ if ($hook == 'rdf_mapping') {
+ // Move my_module_rdf_mapping() to the end of the list. module_implements()
+ // iterates through $implementations with a foreach loop which PHP iterates
+ // in the order that the items were added, so to move an item to the end of
+ // the array, we remove it and then add it.
+ $group = $implementations['my_module'];
+ unset($implementations['my_module']);
+ $implementations['my_module'] = $group;
+ }
+}
+
+/**
* Alter the information parsed from module and theme .info files
*
* This hook is invoked in _system_rebuild_module_data() and in