-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.driver.php
executable file
·66 lines (63 loc) · 1.79 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
64
65
66
<?php
/**
* An extension to provide a field that allows users to specify a recurring
* datetime.
*
* @author Timothy Cleaver
* @version 0.0.1
* @since 2.07
*/
Class extension_recurringdatetime extends Extension {
/**
* Accessor for the meta-data of this extension.
*
* @return array[string]mixed
* an array structure reflecting the meta-data of this extension.
*/
public function about() {
return array(
'name' => 'Recurring Date-Time',
'version' => '0.0.1',
'release-date' => '2010-03-4',
'author' => array(
'name' => 'Timothy Cleaver',
'website' => 'http://symphony-cms.com/',
'email' => 'tim@randb.com.au'
),
'type' => 'Field, Interface',
'description' => 'A field for the specification of recurring date-times',
'compatibility' => array(
'2.0.7' => true
)
);
}
/**
* Uninstall this extension. This will remove any trace of the existence
* of this function from the database.
*/
public function uninstall() {
Symphony::Database()->query("DROP TABLE `tbl_fields_recurringdatetime`");
}
/**
* Install this extension. Constructs the required tables in the database
* to make symphony aware of this extension and allow it to instantiate its
* properties.
*
* @return boolean
* true on success, false otherwise.
*/
public function install() {
return Symphony::Database()->query("
CREATE TABLE IF NOT EXISTS `tbl_fields_recurringdatetime` (
`id` int(11) unsigned NOT NULL auto_increment,
`field_id` int(11) unsigned NOT NULL,
`format` text,
`prepopulate` enum('yes','no') NOT NULL default 'yes',
`allow_multiple_dates` enum('yes','no') NOT NULL default 'yes',
PRIMARY KEY (`id`),
KEY `field_id` (`field_id`)
)
");
}
}
?>