/[drupal]/contributions/modules/whizzywig/whizzywig.settings.inc
ViewVC logotype

Contents of /contributions/modules/whizzywig/whizzywig.settings.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Wed Nov 4 06:21:15 2009 UTC (3 weeks, 3 days ago) by thenicespider
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-BETA2
Changes since 1.4: +2 -2 lines
File MIME type: text/x-php
6.x-1.0-BETA2: Bug fix: mispelling and XHTML Compability for Single-line-break tag
1 <?php
2 // $Id: whizzywig.settings.inc,v 1.4 2009/10/31 01:43:36 thenicespider Exp $
3 /**
4 * @file
5 * Settings page callback file for the whizzywig module.
6 */
7
8 /**
9 * Menu callback;
10 */
11
12 function whizzywig_admin_settings() {
13 $form = array();
14 // only administrators can access this function
15
16 // Generate the form - settings applying to all patterns first
17 $form['whizzywig_general'] = array(
18 '#type' => 'fieldset',
19 '#title' => t('General settings'),
20 '#collapsible' => TRUE,
21 '#collapsed' => FALSE,
22 );
23 $form['whizzywig_general']['whizzywig_xhtml'] = array(
24 '#type' => 'checkbox',
25 '#title' => t('Use xHTML markup'),
26 '#default_value' => variable_get("whizzywig_xhtml", '0'),
27 '#description' => t('Choose whether xhtml markup should be enabled or not.'),
28 );
29 $form['whizzywig_general']['whizzywig_editor_width'] = array(
30 '#type' => 'textfield',
31 '#title' => t('Editor width'),
32 '#default_value' => variable_get('whizzywig_editor_width', '100%'),
33 '#description' => t("Width of the whizzywig editor (%,px,em), i.e: 520px"),
34 );
35 $form['whizzywig_general']['whizzywig_editor_height'] = array(
36 '#type' => 'textfield',
37 '#title' => t('Editor height'),
38 '#default_value' => variable_get('whizzywig_editor_height', 0),
39 '#description' => t("Height of the whizzywig editor (%,px,em,ex)"),
40 );
41
42 $form['whizzywig_general']['whizzywig_style'] = array(
43 '#type' => 'textfield',
44 '#title' => t('Stylesheet'),
45 '#default_value' => variable_get('whizzywig_style', 'whizzywig.css'),
46 '#description' => t("CSS file for whizzywig. File should be located at: <b>whizzywig/library/styles/</b>")
47 );
48
49 $form['whizzywig_toolbar1'] = array(
50 '#type' => 'fieldset',
51 '#title' => t('Toolbar 1 buttons'),
52 '#collapsible' => TRUE,
53 '#collapsed' => FALSE,
54 );
55
56 return system_settings_form($form);
57 }
58
59 function whizzywig_settings_visibility() {
60 //$form = array();
61
62 $form['whizzywig_visibility'] = array(
63 '#type' => 'fieldset',
64 '#title' => t('Visibility settings'),
65 '#collapsible' => TRUE,
66 '#collapsed' => FALSE,
67 );
68 $form['whizzywig_visibility']['whizzywig_textarea_id'] = array(
69 '#type' => 'radios',
70 '#title' => t('Textarea ID'),
71 '#default_value' => variable_get('whizzywig_textarea_id', 1),
72 '#options' => array(
73 t("Don't show whizzywig editor on this textareas ID:"),
74 t("Only show whizzywig editor on this textareas ID:")),
75 );
76 $form['whizzywig_visibility']['whizzywig_textarea_id_val'] = array(
77 '#type' => 'textfield',
78 '#default_value' => variable_get('whizzywig_textarea_id_val', 'edit-teaser,edit-body'),
79 '#description' => t("Specify the textarea IDs for this rule. Separate by comma."),
80 );
81
82 $form['whizzywig_visibility']['whizzywig_content_type'] = array(
83 '#type' => 'radios',
84 '#title' => t('Content type'),
85 '#default_value' => variable_get('whizzywig_content_type', 1),
86 '#options' => array(
87 t("Don't show whizzywig editor on this content type:"),
88 t("Only show whizzywig editor on this content type:")),
89 );
90 $form['whizzywig_visibility']['whizzywig_content_type_val'] = array(
91 '#type' => 'textfield',
92 '#default_value' => variable_get('whizzywig_content_type_val', 'page'),
93 '#description' => t("Specify the content type for this rule. Separate by comma."),
94 );
95
96 $form['whizzywig_visibility']['whizzywig_comment'] = array(
97 '#type' => 'radios',
98 '#title' => t('Comment box'),
99 '#default_value' => variable_get('whizzywig_comment', 0),
100 '#options' => array(
101 t("Disable editor for Comment"), t("Enable editor for Comment")),
102 );
103
104 $form['whizzywig_visibility']['whizzywig_page'] = array(
105 '#type' => 'radios',
106 '#title' => t('Show editor on specific pages'),
107 '#default_value' => variable_get('whizzywig_page', 0),
108 '#options' => array(
109 t("Show on every page except the listed pages."),
110 t("Show on only the listed pages."),
111 t("Show if the following PHP code returns TRUE (PHP-mode, experts only).")),
112 );
113 $form['whizzywig_visibility']['whizzywig_page_val'] = array(
114 '#type' => 'textarea',
115 '#default_value' => variable_get('whizzywig_page_val', ''),
116 '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are blog for the blog page and blog/* for every personal blog. <front> is the front page. If the PHP-mode is chosen, enter PHP code between <?php ?>. Note that executing incorrect PHP-code can break your Drupal site."),
117 );
118
119 return system_settings_form($form);
120 }
121
122 function whizzywig_settings_file_browser() {
123 //$form = array();
124
125 $form['whizzywig_file_browser'] = array(
126 '#type' => 'fieldset',
127 '#title' => t('File Browser'),
128 '#collapsible' => TRUE,
129 '#collapsed' => FALSE,
130 );
131
132 $form['whizzywig_file_browser']['whizzywig_folder_format'] = array(
133 '#type' => 'textfield',
134 '#title' => t('Folder format for each users'),
135 '#default_value' => variable_get('whizzywig_folder_format', 'u[uid]'),
136 '#description' => t("<ul><li>Specify the format for user folder, if you enter 'u[uid]' then the user folder become files/u1, files/u2, files/u3, etc.</li>".
137 "<li>Available variables: <b>[uid]</b> = User ID, <b>[username]</b> = Username, <b>[domainname]</b> = Domain Name</li>".
138 "<li>For Drupal multisite please use [domainname]-[username] to avoid conflict for same Username in different site.</li></ul>"),
139 );
140 $form['whizzywig_file_browser']['whizzywig_predefine_folder'] = array(
141 '#type' => 'textfield',
142 '#title' => t('Predefine folder for each users'),
143 '#default_value' => variable_get('whizzywig_predefine_folder', ''),
144 '#description' => t("Specify the predefine folder, i.e: if you enter 'article,story'' then this module will automatically create 'article and story' folder for each users, i.e: files/u1/article and files/u1/story"),
145 );
146
147 $form['whizzywig_file_upload'] = array(
148 '#type' => 'fieldset',
149 '#title' => t('File Upload'),
150 '#collapsible' => TRUE,
151 '#collapsed' => FALSE,
152 );
153 $form['whizzywig_file_upload']['whizzywig_file_extension'] = array(
154 '#type' => 'textfield',
155 '#title' => t('Allowed upload file extensions'),
156 '#default_value' => variable_get('whizzywig_file_extension', 'gif jpg jpeg png'),
157 '#description' => t("Specify the file extension for upload, separate by space, i.e: gif jpg png. Leave blank if you allow all file extensions."),
158 );
159 $form['whizzywig_file_upload']['whizzywig_file_size'] = array(
160 '#type' => 'textfield',
161 '#title' => t('Maximum file size (KB)'),
162 '#default_value' => variable_get('whizzywig_file_size', '0'),
163 '#description' => t("Specify the maximum file size for upload in KB. Set 0 for unlimited size."),
164 );
165 $form['whizzywig_file_upload']['whizzywig_image_dimension'] = array(
166 '#type' => 'textfield',
167 '#title' => t('Maximum image dimension'),
168 '#default_value' => variable_get('whizzywig_image_dimension', '480x480'),
169 '#description' => t("Specify the maximum image dimension, i.e: 200x300. If the image size bigger then this module will automatically resize to this value with proportional size (retain image aspect ratio). Leave blank if you don't need this field."),
170 );
171
172 $form['whizzywig_file_resize'] = array(
173 '#type' => 'fieldset',
174 '#title' => t('File Resize'),
175 '#collapsible' => TRUE,
176 '#collapsed' => FALSE,
177 );
178 $form['whizzywig_file_resize']['whizzywig_file_resize_width'] = array(
179 '#type' => 'textfield',
180 '#title' => t('Default resize width'),
181 '#default_value' => variable_get('whizzywig_file_resize_width', '100'),
182 '#description' => t("Specify the default width for image resizing."),
183 );
184 $form['whizzywig_file_resize']['whizzywig_file_resize_height'] = array(
185 '#type' => 'textfield',
186 '#title' => t('Default resize height'),
187 '#default_value' => variable_get('whizzywig_file_resize_height', ''),
188 '#description' => t("Specify the default height for image resizing.<br /><b>NOTE</b>: If you set value for <b>width</b> and leave <b>height</b> as blank then image will be resizing proportional to width size, and vice versa."),
189 );
190 return system_settings_form($form);
191 }

  ViewVC Help
Powered by ViewVC 1.1.2