diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-27 19:29:12 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-27 19:29:12 +0000 |
commit | 1da73d26c2d8018f389f6290e2be8249280e76bc (patch) | |
tree | dba8b489c55f45796d505229d0c389ad33a08757 /modules/simpletest/tests/common_test.module | |
parent | 37eb92447f21d8acd984df0f3365e174283869ed (diff) | |
download | brdo-1da73d26c2d8018f389f6290e2be8249280e76bc.tar.gz brdo-1da73d26c2d8018f389f6290e2be8249280e76bc.tar.bz2 |
#591794 by chx, Rob Loach, sun, JohnAlbin: Give themes access to alter hooks.
Diffstat (limited to 'modules/simpletest/tests/common_test.module')
-rw-r--r-- | modules/simpletest/tests/common_test.module | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index cc8c22772..e8c6602c2 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -101,6 +101,40 @@ function common_test_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) { } /** + * Implement hook_TYPE_alter() on behalf of Garland theme. + * + * Same as common_test_drupal_alter_alter(), but here, we verify that themes + * can also alter and come last. + */ +function garland_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) { + // Alter first argument. + if (is_array($data)) { + $data['foo'] .= ' theme'; + } + elseif (is_object($data)) { + $data->foo .= ' theme'; + } + // Alter second argument, if present. + if (isset($arg2)) { + if (is_array($arg2)) { + $arg2['foo'] .= ' theme'; + } + elseif (is_object($arg2)) { + $arg2->foo .= ' theme'; + } + } + // Try to alter third argument, if present. + if (isset($arg3)) { + if (is_array($arg3)) { + $arg3['foo'] .= ' theme'; + } + elseif (is_object($arg3)) { + $arg3->foo .= ' theme'; + } + } +} + +/** * Implement hook_theme(). */ function common_test_theme() { |