-
Notifications
You must be signed in to change notification settings - Fork 1
/
extension.driver.php
62 lines (55 loc) · 1.76 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
<?php
Class extension_seo_guide extends Extension
{
/**
* Return an array with delegates
* @return array
*/
public function getSubscribedDelegates() {
return array(
// Delegates
array(
'page' => '/backend/',
'delegate' => 'InitaliseAdminPageHead',
'callback' => 'addScriptToHead'
)
);
}
public function addScriptToHead($context)
{
Administration::instance()->Page->addScriptToHead(URL.'/extensions/seo_guide/assets/seo_guide.js');
Administration::instance()->Page->addStyleSheetToHead(URL.'/extensions/seo_guide/assets/seo_guide.css');
}
/**
* Installation script
* @return void
*/
public function install()
{
Symphony::Database()->query("CREATE TABLE IF NOT EXISTS `tbl_fields_seo_guide` (
`id` int(11) unsigned NOT NULL auto_increment,
`field_id` int(11) unsigned NOT NULL,
`ignore_h1` int(1),
PRIMARY KEY (`id`),
KEY `field_id` (`field_id`)
)");
Symphony::Database()->query("CREATE TABLE IF NOT EXISTS `tbl_seo_guide_fields` (
`id` int(11) unsigned NOT NULL auto_increment,
`section_id` int(11) unsigned NOT NULL,
`field_id` int(11) unsigned NOT NULL,
`priority` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `section_id` (`section_id`),
KEY `field_id` (`field_id`)
)");
}
/**
* Uninstallation script
* @return void
*/
public function uninstall()
{
Symphony::Database()->query('DROP TABLE `tbl_fields_seo_guide`');
Symphony::Database()->query('DROP TABLE `tbl_seo_guide_fields`');
}
}