-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdfbulletin.admin.inc
41 lines (34 loc) · 1.23 KB
/
pdfbulletin.admin.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
<?php
/**
* @file
* PDF Bulletin administration settings.
*/
function pdfbulletin_admin_settings_form($form_state) {
$form = array();
$form['pdfbulletin_pdfinfo'] = array(
'#type' => 'textfield',
'#default_value' => filter_xss_admin(pdfbulletin_util_settings('pdfinfo')),
'#title' => t('Path to pdfinfo program'),
'#required' => TRUE,
);
$form['pdfbulletin_wkhtmltopdf'] = array(
'#type' => 'textfield',
'#default_value' => filter_xss_admin(pdfbulletin_util_settings('wkhtmltopdf')),
'#title' => t('Path to wkhtmltopdf'),
'#required' => TRUE,
);
$form['pdfbulletin_options'] = array(
'#type' => 'textfield',
'#default_value' => filter_xss_admin(pdfbulletin_util_settings('options')),
'#title' => t('Additional wkhtmltopdf options'),
);
return system_settings_form($form);
}
function pdfbulletin_admin_settings_form_validate($form, &$form_state) {
if (! is_executable($form_state['values']['pdfbulletin_pdfinfo'])) {
form_set_error('pdfbulletin_pdfinfo', t('Incorrect path or not executable pdfinfo'));
}
if (! is_executable($form_state['values']['pdfbulletin_wkhtmltopdf'])) {
form_set_error('pdfbulletin_wkhtmltopdf', t('Incorrect path or not executable wkhtmltopdf'));
}
}