Conditions | 5 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | protected function init() { |
||
14 | |||
15 | $this->addHandler('active', function (array $data) { |
||
16 | |||
17 | return (($data['visibility'] === VISIBILITY_PUBLISHED) && !$data['locked']); |
||
18 | }); |
||
19 | |||
20 | $this->addHandler('link', function (array $data) { |
||
21 | |||
22 | if ('' === $data['slug']) return ''; |
||
23 | |||
24 | return (INSTALL_PATH . '/' . $data['slug']); |
||
25 | }); |
||
26 | |||
27 | $this->addHandler('canonical', function (array $data) { |
||
28 | |||
29 | if ('' === $data['slug']) return ''; |
||
30 | |||
31 | return (Settings::get('system_url') . (($data['id'] !== 1) ? ('/' . $data['slug']) : '')); |
||
32 | }); |
||
33 | } |
||
34 | } |
||
36 |