forked from tbaddade/redaxo_watson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.inc.php
66 lines (36 loc) · 1.79 KB
/
config.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* This file is part of the Watson package.
*
* @author (c) Thomas Blum <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
if ($REX['REDAXO'] && $REX['USER']) {
$package = require __DIR__ . '/lib/Package/start.php';
$name = $package::get('name', 'watson', 'watson');
//if ($package::get('rex.backend', false, $name) && $package::get('rex.user', false, $name)) {
$providers = $package::get('package.providers', false, $name);
if (count($providers)) {
$searchers = array();
foreach ($providers as $provider) {
if ($provider instanceof \Watson\Foundation\Search) {
$searchers[] = $provider;
}
if ($provider instanceof \Watson\Foundation\Console) {
$console_instances[] = $provider;
}
}
if (count($searchers)) {
rex_register_extension('PAGE_HEADER' , '\Watson\Foundation\Extension::searchHead');
rex_register_extension('OUTPUT_FILTER' , '\Watson\Foundation\Extension::searchAgent');
rex_register_extension('ADDONS_INCLUDED', '\Watson\Foundation\Extension::searchRun', array('searchers' => $searchers), REX_EXTENSION_LATE);
}
if (count($console_instances)) {
rex_register_extension('PAGE_HEADER' , '\Watson\Foundation\Extension::consoleHead');
rex_register_extension('OUTPUT_FILTER' , '\Watson\Foundation\Extension::consoleAgent');
rex_register_extension('ADDONS_INCLUDED', '\Watson\Foundation\Extension::consoleRun', array('console_instances' => $console_instances), REX_EXTENSION_LATE);
}
}
}