Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
831 florian 1
<?php
2
 
3
////////////////////////////////////////////////////////////////////////////////
4
//                                                                            //
5
//   Copyright (C) 2006  Phorum Development Team                              //
6
//   http://www.phorum.org                                                    //
7
//                                                                            //
8
//   This program is free software. You can redistribute it and/or modify     //
9
//   it under the terms of either the current Phorum License (viewable at     //
10
//   phorum.org) or the Phorum License that was distributed with this file    //
11
//                                                                            //
12
//   This program is distributed in the hope that it will be useful,          //
13
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
14
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
15
//                                                                            //
16
//   You should have received a copy of the Phorum License                    //
17
//   along with this program.                                                 //
18
////////////////////////////////////////////////////////////////////////////////
19
 
20
    // Check for possible collisions between modules.
21
 
22
    $phorum_check = "Modules (hook collision checks)";
23
 
24
    function phorum_check_modules() {
25
        $PHORUM = $GLOBALS["PHORUM"];
26
 
27
        // For some hooks, we only want one module enabled to
28
        // prevent collision problems. This is a list of
29
        // those specific hooks.
30
        $only_single_mod_allowed = array(
31
            'quote',
32
            'send_mail',
33
        );
34
 
35
        // Check all hooks that only may appear once.
36
        foreach ($only_single_mod_allowed as $hook) {
37
            if (isset($PHORUM["hooks"][$hook]["mods"])) {
38
                $mods = $PHORUM["hooks"][$hook]["mods"];
39
                if (count($mods) > 1) return array(
40
                    PHORUM_SANITY_WARN,
41
                    "You have activated multiple modules that handle
42
                     Phorum's \"".htmlspecialchars($hook)."\" hook.
43
                     However, this hook is normally only handled by
44
                     one module at a time. Keeping all modules
45
                     activated might lead to some unexpected results.
46
                     The colliding modules are: ".
47
                     implode(" + ", $mods),
48
                    "You can ignore this message in case you
49
                     are sure that the modules can work together. Else,
50
                     make sure you have only one of these modules
51
                     enabled."
52
                );
53
            }
54
        }
55
 
56
        // All checks are OK.
57
        return array(PHORUM_SANITY_OK, NULL);
58
    }
59
?>