-
Notifications
You must be signed in to change notification settings - Fork 5
/
extension.driver.php
executable file
·63 lines (55 loc) · 1.67 KB
/
extension.driver.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
<?php
class extension_vimeo_videos extends Extension {
public function about() {
return array(
'name' => 'Vimeo Videos',
'version' => '0.1',
'release-date' => '2009-02-23',
'author' => array(
'name' => 'Nick Dunn',
'website' => 'http://airlock.com',
'email' => '[email protected]'
),
'description' => 'Cache a video from Vimeo.'
);
}
public function getSubscribedDelegates(){
return array(
array(
'page' => '/administration/',
'delegate' => 'AdminPagePreGenerate',
'callback' => '__appendJavaScript'
)
);
}
public function __appendJavaScript($context){
if(isset(Administration::instance()->Page->_context['section_handle']) && in_array(Administration::instance()->Page->_context['page'], array('new', 'edit'))){
Administration::instance()->Page->addStylesheetToHead(URL . '/extensions/vimeo_videos/assets/vimeo_video.css', 'screen', 190);
Administration::instance()->Page->addScriptToHead(URL . '/extensions/vimeo_videos/assets/vimeo_video.js', 195);
}
}
public function fetchNavigation(){
return array(
array(
'location' => __('System'),
'name' => 'Vimeo Videos',
'link' => '/videos/'
)
);
}
public function uninstall() {
$this->_Parent->Database->query("DROP TABLE `tbl_fields_vimeo_video`");
}
public function install() {
return $this->_Parent->Database->query("
CREATE TABLE `tbl_fields_vimeo_video` (
`id` int(11) unsigned NOT NULL auto_increment,
`field_id` int(11) unsigned NOT NULL,
`refresh` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `field_id` (`field_id`)
)
");
}
}
?>