123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?php
- function module_test_permission() {
- return array(
- 'module_test perm' => t('example perm for module_test module'),
- );
- }
- function module_test_system_info_alter(&$info, $file, $type) {
- if (variable_get('dependency_test', FALSE) == 'missing dependency') {
- if ($file->name == 'forum') {
-
- $info['dependencies'][] = 'poll';
- }
- elseif ($file->name == 'poll') {
-
- $info['dependencies'][] = 'foo';
- }
- }
- elseif (variable_get('dependency_test', FALSE) == 'dependency') {
- if ($file->name == 'forum') {
-
- $info['dependencies'][] = 'poll';
- }
- elseif ($file->name == 'poll') {
-
- $info['dependencies'][] = 'php';
- }
- }
- elseif (variable_get('dependency_test', FALSE) == 'version dependency') {
- if ($file->name == 'forum') {
-
- $info['dependencies'][] = 'poll';
- }
- elseif ($file->name == 'poll') {
-
- $info['dependencies'][] = 'php (1.x)';
- }
- elseif ($file->name == 'php') {
-
- $info['version'] = '7.x-1.0';
- }
- }
- if ($file->name == 'seven' && $type == 'theme') {
- $info['regions']['test_region'] = t('Test region');
- }
- }
- function module_test_hook_info() {
- $hooks['test_hook'] = array(
- 'group' => 'file',
- );
- return $hooks;
- }
- function module_test_menu() {
- $items['module-test/hook-dynamic-loading-invoke'] = array(
- 'title' => 'Test hook dynamic loading (invoke)',
- 'page callback' => 'module_test_hook_dynamic_loading_invoke',
- 'access arguments' => array('access content'),
- );
- $items['module-test/hook-dynamic-loading-invoke-all'] = array(
- 'title' => 'Test hook dynamic loading (invoke_all)',
- 'page callback' => 'module_test_hook_dynamic_loading_invoke_all',
- 'access arguments' => array('access content'),
- );
- return $items;
- }
- function module_test_hook_dynamic_loading_invoke() {
- $result = module_invoke('module_test', 'test_hook');
- return $result['module_test'];
- }
- function module_test_hook_dynamic_loading_invoke_all() {
- $result = module_invoke_all('test_hook');
- return $result['module_test'];
- }
- function module_test_modules_enabled($modules) {
-
-
- variable_set('test_module_enable_order', $modules);
- }
- function module_test_modules_disabled($modules) {
-
-
- variable_set('test_module_disable_order', $modules);
- }
- function module_test_modules_uninstalled($modules) {
-
-
- variable_set('test_module_uninstall_order', $modules);
- }
|