forked from flotwig/OSTEquipmentPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
59 lines (50 loc) · 1.78 KB
/
config.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
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of config
*
* @author Alex Pavlunenko <alexp at xpresstek.net>
*/
require_once(INCLUDE_DIR.'/class.plugin.php');
require_once(INCLUDE_DIR.'/class.forms.php');
class EquipmentConfig extends PluginConfig{
function getOptions() {
$form_choices = array('0' => '--None--');
foreach (DynamicForm::objects()->filter(array('type'=>'G')) as $group)
{
$form_choices[$group->get('id')] = $group->get('title');
}
return array(
'equipment_backend_enable' => new BooleanField(array(
'id' => 'equipment_backend_enable',
'label' => 'Enable Backend',
'configuration' => array(
'desc' => 'Staff backend interface')
)),
'equipment_frontend_enable' => new BooleanField(array(
'id' => 'equipment_frontend_enable',
'label' => 'Enable Frontend',
'configuration' => array(
'desc' => 'Client facing interface')
)),
'equipment_custom_form' => new ChoiceField(array(
'id' => 'equipment_custom_form',
'label' => 'Custom Form Name',
'choices' => $form_choices,
'configuration' => array(
'desc' => 'Custom form to use for equipment')
)),
);
}
function pre_save(&$config, &$errors) {
global $msg;
if (!$errors)
$msg = 'Configuration updated successfully';
return true;
}
}
?>