forked from webflo/wysiwyg_imageupload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wysiwyg_imageupload.admin.inc
90 lines (81 loc) · 4 KB
/
wysiwyg_imageupload.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
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
<?php
// $Id$
// Copyright (c) 2010 KontextWork
// Author: Eugen Mayer
/**
* Providing a administration interface for tagging.
*/
function wysiwyg_imageupload_admin_settings() {
$form['wysiwyg_imageupload_skip_dependencies_check'] = array(
'#type' => 'checkbox',
'#title' => t('Do the requirements checks'),
'#description' => t('If this is set, requirements checks will be done. If something is not correct, you get a anoying error message!'),
'#default_value' => variable_get('wysiwyg_imageupload_skip_dependencies_check', TRUE),
);
$form['wysiwyg_imageupload_filename_as_title_default'] = array(
'#type' => 'checkbox',
'#title' => t('Filename as title'),
'#description' => t('Should the filename be used as title by default. If not checked, the title will be empty and not shown by default'),
'#default_value' => variable_get('wysiwyg_imageupload_filename_as_title_default', FALSE),
);
$form['styles'] = array(
'#type' => 'fieldset',
'#title' => t('Styles'),
'#description' => t('Set the available styles (css) here'),
'#collapsed' => TRUE,
'#collapsible' => TRUE,
'#weight' => -2,
);
$form['styles']['wysiwyg_imageupload_imgstyles'] = array(
'#type' => 'textarea',
'#title' => t('Image style'),
'#description' => t('Define which CSS styles the user can chose when adding an image. Please do not define floating or size in that CSS classes, as this is handled seperately. You can give the style a descriptive name to make it easier to handle. The syntax is "Descriptive Name=imgupl_style_XYC". You _must_ prefix the style with imgupl_style_*! For each style use on separate line.'),
'#default_value' => variable_get('wysiwyg_imageupload_imgstyles', '')
);
$presets = imagecache_presets();
$styles = array();
foreach ($presets as $preset) {
// We can use the presetid here (http://drupal.org/node/694188).
$styles[$preset['presetname']] = t("!preset", array('!preset' => $preset['presetname']));
}
$form['wysiwyg_imageupload_allow_presets'] = array(
'#type' => 'fieldset',
'#title' => t('Allowed presets'),
'#description' => t('Only the selected presets are allowed to be chosen in the dialog'),
'#collapsed' => TRUE,
'#collapsible' => TRUE,
'#weight' => -2,
);
$form['wysiwyg_imageupload_allow_presets']['wysiwyg_imageupload_presets_whitelist'] = array(
'#type' => 'checkboxes',
'#title' => t('Presets'),
'#default_value' => variable_get('wysiwyg_imageupload_presets_whitelist', $styles),
'#options' => $styles
);
$form['paths'] = array(
'#type' => 'fieldset',
'#title' => t('Paths'),
'#collapsed' => TRUE,
'#collapsible' => TRUE,
'#weight' => -2,
);
$form['wysiwyg_imageupload_max_filesize'] = array(
'#type' => 'textfield',
'#title' => t('Maximal filesize in KB'),
'#description' => t('Maximal filesize in KB for an image, which gets uploaded. 0 for "no limitation"'),
'#default_value' => variable_get('wysiwyg_imageupload_max_filesize', 0),
);
$form['paths']['wysiwyg_imageupload_destdir_group']['wysiwyg_imageupload_dest_root'] = array(
'#type' => 'textfield',
'#title' => t('Root destination'),
'#description' => t('This is the root destination relative to the current files directory ("' . file_directory_path() . '"). Neither insert a preceding nor successive slash.'),
'#default_value' => variable_get('wysiwyg_imageupload_dest_root', 'wysiwyg_imageupload')
);
$form['paths']['wysiwyg_imageupload_destdir_group']['wysiwyg_imageupload_relative_user'] = array(
'#type' => 'textfield',
'#title' => t('Subdirectory for private uploads'),
'#description' => t('This is the user-files destination relative to the current wysiwyg_imageupload root destination(see above) directory (e.g. "' . file_directory_path() . '/rootdest/$uid"). $uid will be replaced by the current user-id. Keep blanc to save it in the root.'),
'#default_value' => variable_get('wysiwyg_imageupload_relative_user', '$uid')
);
return system_settings_form($form);
}