forked from pointybeard-archives/xmlfield
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathextension.driver.php
executable file
·43 lines (37 loc) · 1.24 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
<?php
class extension_XMLField extends Extension
{
public function getSubscribedDelegates()
{
return array(
array(
'page' => '/backend/',
'delegate' => 'InitaliseAdminPageHead',
'callback' => 'initaliseAdminPageHead'
)
);
}
public function initaliseAdminPageHead($context)
{
$callback = Symphony::Engine()->getPageCallback();
if($callback['driver'] == 'publish' && $callback['context']['page'] != 'index') {
Administration::instance()->Page->addStylesheetToHead(URL . '/extensions/xmlfield/assets/publish.xmlfield.css');
}
}
public function install()
{
return Symphony::Database()->query(
"CREATE TABLE IF NOT EXISTS `tbl_fields_xml` (
`id` int(11) unsigned NOT NULL auto_increment,
`field_id` int(11) unsigned NOT NULL,
`size` int(3) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `field_id` (`field_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"
);
}
public function uninstall()
{
Symphony::Database()->query("DROP TABLE `tbl_fields_xml`");
}
}