-
Notifications
You must be signed in to change notification settings - Fork 4
/
settings.inc
225 lines (225 loc) · 11.3 KB
/
settings.inc
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
// $Id$
function hackathon_submission_settings_form($form, $form_state)
{
/************************** SoC Marathon date and extension settings **************************/
$form['extensions']['soc_marathon_literature_report_extensions'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading SoC Marathon Literature report'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('soc_marathon_literature_report_extensions', '')
);
$form['extensions']['soc_marathon_literature_report_start_date'] = array(
'#type' => 'textfield',
'#title' => t('SoC marathon Literature Survey start date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('soc_marathon_literature_report_start_date', '')
);
$form['extensions']['soc_marathon_literature_report_last_date'] = array(
'#type' => 'textfield',
'#title' => t('SoC marathon Literature Survey Last date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('soc_marathon_literature_report_last_date', '')
);
$form['extensions']['soc_marathon_final_report_extensions'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading SoC Design Marathon Final report'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('soc_marathon_final_report_extensions', '')
);
$form['extensions']['soc_marathon_project_files_extensions'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading SoC Design Marathon Project Files'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('soc_marathon_project_files_extensions', '')
);
$form['extensions']['soc_marathon_final_submission_start_date'] = array(
'#type' => 'textfield',
'#title' => t('SoC Design Marathon Final start date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('soc_marathon_final_submission_start_date', '')
);
$form['extensions']['soc_marathon_final_submission_last_date'] = array(
'#type' => 'textfield',
'#title' => t('SoC Design Marathon Final Submission Last date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('soc_marathon_final_submission_last_date', '')
);
/************************* Settings for SoC marathon ends *****************************************/
$form['extensions']['mscd_literature_report_extensions'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading MSCD Literature report'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('mscd_literature_report_extensions', '')
);
$form['extensions']['mscd_literature_report_start_date'] = array(
'#type' => 'textfield',
'#title' => t('MSCD Literature Survey start date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('mscd_literature_report_start_date', '')
);
$form['extensions']['mscd_literature_report_last_date'] = array(
'#type' => 'textfield',
'#title' => t('MSCD Literature Survey Last date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('mscd_literature_report_last_date', '')
);
$form['extensions']['mscd_final_report_extensions'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading MSCD Final report'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('mscd_final_report_extensions', '')
);
$form['extensions']['mscd_project_files_extensions'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading MSCD Project Files'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('mscd_project_files_extensions', '')
);
$form['extensions']['mscd_final_submission_start_date'] = array(
'#type' => 'textfield',
'#title' => t('MSCD Final start date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('mscd_final_submission_start_date', '')
);
$form['extensions']['mscd_final_submission_last_date'] = array(
'#type' => 'textfield',
'#title' => t('MSCD Final Submission Last date'),
'#description' => t('For eg: 2022-02-28 23:59:59.0, enter in this format'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('mscd_final_submission_last_date', '')
);
$form['extensions']['reference_circuit'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading reference circuit file'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('reference_circuit_extensions', '')
);
$form['extensions']['reference_waveform'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading reference waveform file'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('reference_waveform_extensions', '')
);
$form['extensions']['main_netlist'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading Main netlist file'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('main_netlist_file_extensions', '')
);
$form['extensions']['sub_circuit_file'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading sub circuit file'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('subcircuit_file_extensions', '')
);
$form['extensions']['read_me'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading Read me file'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('readme_file_extensions', '')
);
/*$form['no_of_images_allowed_project_submission'] = array(
'#type' => 'textfield',
'#title' => t('Enter the number of images that can be uploaded during project submission'),
'#size' => 50,
'#default_value' => variable_get('no_of_images_allowed_project_submission', '')
);
$form['extensions']['project_design_files'] = array(
'#type' => 'textfield',
'#title' => t('Allowed file extensions for uploading project design files'),
'#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'),
'#size' => 50,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => variable_get('project_design_files_extensions', '')
);*/
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit')
);
return $form;
}
function hackathon_submission_settings_form_validate($form, &$form_state)
{
return;
}
function hackathon_submission_settings_form_submit($form, &$form_state)
{
variable_set('soc_marathon_literature_report_extensions', $form_state['values']['soc_marathon_literature_report_extensions']);
variable_set('soc_marathon_literature_report_start_date', $form_state['values']['soc_marathon_literature_report_start_date']);
variable_set('soc_marathon_literature_report_last_date', $form_state['values']['soc_marathon_literature_report_last_date']);
variable_set('soc_marathon_final_report_extensions', $form_state['values']['soc_marathon_final_report_extensions']);
variable_set('soc_marathon_project_files_extensions', $form_state['values']['soc_marathon_project_files_extensions']);
variable_set('soc_marathon_final_submission_start_date', $form_state['values']['soc_marathon_final_submission_start_date']);
variable_set('soc_marathon_final_submission_last_date', $form_state['values']['soc_marathon_final_submission_last_date']);
variable_set('mscd_literature_report_extensions', $form_state['values']['mscd_literature_report_extensions']);
variable_set('mscd_literature_report_start_date', $form_state['values']['mscd_literature_report_start_date']);
variable_set('mscd_literature_report_last_date', $form_state['values']['mscd_literature_report_last_date']);
variable_set('mscd_final_report_extensions', $form_state['values']['mscd_final_report_extensions']);
variable_set('mscd_project_files_extensions', $form_state['values']['mscd_project_files_extensions']);
variable_set('mscd_final_submission_start_date', $form_state['values']['mscd_final_submission_start_date']);
variable_set('mscd_final_submission_last_date', $form_state['values']['mscd_final_submission_last_date']);
variable_set('reference_circuit_extensions', $form_state['values']['reference_circuit']);
variable_set('reference_waveform_extensions', $form_state['values']['reference_waveform']);
variable_set('main_netlist_file_extensions', $form_state['values']['main_netlist']);
variable_set('subcircuit_file_extensions', $form_state['values']['sub_circuit_file']);
variable_set('readme_file_extensions', $form_state['values']['read_me']);
drupal_set_message(t('Settings updated'), 'status');
}