-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextension.driver.php
More file actions
executable file
·40 lines (33 loc) · 1014 Bytes
/
extension.driver.php
File metadata and controls
executable file
·40 lines (33 loc) · 1014 Bytes
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
<?php
class Extension_LogsDevKit extends Extension {
public static $active = false;
public function getSubscribedDelegates() {
return array(
array(
'page' => '/frontend/',
'delegate' => 'FrontendDevKitResolve',
'callback' => 'frontendDevKitResolve'
),
array(
'page' => '/frontend/',
'delegate' => 'ManipulateDevKitNavigation',
'callback' => 'manipulateDevKitNavigation'
)
);
}
public function frontendDevKitResolve($context) {
if (isset($_GET['logs'])) {
require_once(EXTENSIONS . '/logsdevkit/content/content.logs.php');
$context['devkit'] = new Content_LogsDevKit();
self::$active = true;
}
}
public function manipulateDevKitNavigation($context) {
$xml = $context['xml'];
$item = $xml->createElement('item');
$item->setAttribute('name', __('Logs'));
$item->setAttribute('handle', 'logs');
$item->setAttribute('active', (self::$active ? 'yes' : 'no'));
$xml->documentElement->appendChild($item);
}
}