|
1 | 1 | <?php |
| 2 | + |
| 3 | +namespace texnixe\Related; |
| 4 | + |
2 | 5 | /** |
3 | 6 | * Kirby 3 Related Pages Plugin |
4 | 7 | * |
5 | | - * @version 0.9.2 |
| 8 | + * @version 1.0.0 |
6 | 9 | * @author Sonja Broda <info@texniq.de> |
7 | 10 | * @copyright Sonja Broda <info@texniq.de> |
8 | 11 | * @link https://github.com/texnixe/kirby-related |
|
13 | 16 | 'texnixe\\related\\related' => 'src/Related.php' |
14 | 17 | ], __DIR__); |
15 | 18 |
|
16 | | -Kirby::plugin('texnixe/related', [ |
| 19 | +\Kirby::plugin('texnixe/related', [ |
17 | 20 | 'options' => [ |
18 | | - 'cache' => true, |
| 21 | + 'cache' => option('texnixe.related.cache', true), |
19 | 22 | 'expires' => (60*24*7), // minutes |
20 | 23 | 'defaults' => [ |
21 | 24 | 'searchField' => 'tags', |
|
26 | 29 | ], |
27 | 30 | 'pageMethods' => [ |
28 | 31 | 'related' => function (array $options = []) { |
29 | | - return Texnixe\Related\Related::getRelated($this, $options); |
| 32 | + return Related::getRelated($this, $options); |
30 | 33 | } |
31 | 34 | ], |
32 | 35 | 'fileMethods' => [ |
33 | 36 | 'related' => function (array $options = []) { |
34 | | - return Texnixe\Related\Related::getRelated($this, $options); |
| 37 | + return Related::getRelated($this, $options); |
35 | 38 | } |
36 | 39 | ], |
37 | | - 'hooks' => [ |
38 | | - 'page.update:after' => function() { |
39 | | - Texnixe\Related\Related::flush(); |
40 | | - }, |
41 | | - 'page.create:after' => function() { |
42 | | - Texnixe\Related\Related::flush(); |
43 | | - }, |
44 | | - 'file.create:after' => function() { |
45 | | - Texnixe\Related\Related::flush(); |
46 | | - }, |
47 | | - 'page.update:after' => function() { |
48 | | - Texnixe\Related\Related::flush(); |
49 | | - } |
50 | | - ] |
| 40 | + 'hooks' => require __DIR__ . '/hooks.php' |
51 | 41 | ]); |
52 | 42 |
|
53 | 43 |
|
|
0 commit comments