-
Notifications
You must be signed in to change notification settings - Fork 1
/
ckeditor_inline_image_style.admin.inc
40 lines (34 loc) · 1.12 KB
/
ckeditor_inline_image_style.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
<?php
/**
* @file
* CKEditor inline image style.
*/
/**
* Chooses which image styles are available in the CKEditor image dialog.
*/
function ckeditor_inline_image_style_admin_settings() {
$form = array();
$image_styles = image_styles();
$ckeditor_mappings = config_get('ckeditor_inline_image_style.settings', 'ckeditor_inline_image_style_ckeditor_mappings');
$options = array();
foreach ($image_styles as $image_style) {
$options[$image_style['name']] = $image_style['label'];
}
$form['ckeditor_inline_image_style_ckeditor_mappings'] = array(
'#title' => t('Select the image styles that are available inside CKEditor'),
'#type' => 'checkboxes',
'#options' => $options,
'#default_value' => $ckeditor_mappings,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
);
return $form;
}
/**
* Submit handler.
*/
function ckeditor_inline_image_style_admin_settings_submit($form, &$form_state) {
config_set('ckeditor_inline_image_style.settings', 'ckeditor_inline_image_style_ckeditor_mappings', $form_state['values']['ckeditor_inline_image_style_ckeditor_mappings']);
}