-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextension.driver.php
More file actions
executable file
·59 lines (50 loc) · 1.53 KB
/
extension.driver.php
File metadata and controls
executable file
·59 lines (50 loc) · 1.53 KB
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
<?php
class Extension_BrowseDevKit extends Extension {
/*-------------------------------------------------------------------------
Definition:
-------------------------------------------------------------------------*/
public static $active = false;
public function about() {
return array(
'name' => 'Browse DevKit',
'version' => '1.0.1',
'release-date' => '2009-05-20',
'author' => array(
'name' => 'Rowan Lewis',
'website' => 'http://pixelcarnage.com/',
'email' => 'rowan@pixelcarnage.com'
)
);
}
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['browse'])) {
require_once(EXTENSIONS . '/browsedevkit/content/content.browse.php');
$context['devkit'] = new Content_BrowseDevkit_Browse();
$context['full_generate'] = false;
self::$active = true;
}
}
public function manipulateDevKitNavigation($context) {
$xml = $context['xml'];
$item = $xml->createElement('item');
$item->setAttribute('name', __('Browse'));
$item->setAttribute('handle', 'browse');
$item->setAttribute('active', (self::$active ? 'yes' : 'no'));
$xml->documentElement->appendChild($item);
}
}
?>