-
Notifications
You must be signed in to change notification settings - Fork 2
/
extension.driver.php
executable file
·50 lines (43 loc) · 1.54 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
<?php
class extension_field_group extends Extension {
public function uninstall() {
Symphony::Database()->query("DROP TABLE `tbl_fields_field_group_start`");
Symphony::Database()->query("DROP TABLE `tbl_fields_field_group_end`");
}
public function install() {
Symphony::Database()->query(
"CREATE TABLE IF NOT EXISTS `tbl_fields_field_group_start` (
`id` int(11) NOT NULL auto_increment,
`field_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"
);
Symphony::Database()->query(
"CREATE TABLE IF NOT EXISTS `tbl_fields_field_group_end` (
`id` int(11) NOT NULL auto_increment,
`field_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"
);
return true;
}
public function getSubscribedDelegates() {
return array(
array(
'page' => '/backend/',
'delegate' => 'InitaliseAdminPageHead',
'callback' => 'initializeAdmin'
),
);
}
public function initializeAdmin($context) {
$page = Administration::instance()->Page;
$context = $page->getContext();
$callback = Administration::instance()->getPageCallback();
// only proceed on New or Edit publish pages
if ($page instanceof contentPublish and in_array($context['page'], array('new', 'edit'))) {
$page->addStylesheetToHead(URL . '/extensions/field_group/assets/field_group.css', 'screen', 9001);
$page->addScriptToHead(URL . '/extensions/field_group/assets/field_group.js', 9002);
}
}
}