function fckeditor_settings_form in FCKeditor - WYSIWYG HTML editor 5
1 string reference to 'fckeditor_settings_form'
File
- ./
fckeditor.module, line 127 - FCKeditor Module for Drupal 5.x
Code
function fckeditor_settings_form() {
// do a quick check for existence of needed fckeditor files
$module_drupal_path = drupal_get_path('module', 'fckeditor');
$fckconfig_file = $module_drupal_path . '/fckeditor/fckconfig.js';
if (!file_exists($fckconfig_file)) {
drupal_set_message(t('checking for %filename', array(
'%filename' => $fckconfig_file,
)));
drupal_set_message(t('The FCKeditor component is not installed correctly. Please go to the !fckeditorlink to download the latest version. After that you must extract the files to %modulepath and make sure that the directory %modulesubdir and the file %modulefile exist. Refer to the !readme for more information.', array(
'!fckeditorlink' => l(t('FCKeditor homepage'), 'http://www.fckeditor.net'),
'!readme' => l('readme.txt', 'admin/help/fckeditor'),
'%modulepath' => base_path() . $module_drupal_path . '/fckeditor/',
'%modulesubdir' => base_path() . $module_drupal_path . '/fckeditor/editor',
'%modulefile' => base_path() . $module_drupal_path . '/fckeditor/fckeditor.js',
)), 'error');
return false;
}
// Settings form
$toolbar_options = array(
'Default' => 'Default',
'DrupalFull' => 'Drupal Full',
'DrupalBasic' => 'Drupal Basic',
'Basic' => 'Basic',
);
// Generate the form - settings applying to all patterns first
$form['fckeditor_settings'] = array(
'#type' => 'fieldset',
'#weight' => -20,
'#title' => t('Basic settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['fckeditor_settings']['fckeditor_popup'] = array(
'#type' => 'checkbox',
'#title' => t('Use FCKeditor in a popup window'),
'#default_value' => variable_get('fckeditor_popup', '0'),
'#description' => t('If this option is selected a link to a popup window will be used instead of a textarea replace.'),
);
$form['fckeditor_settings']['fckeditor_default_toolbar'] = array(
'#type' => 'select',
'#title' => t('Default Toolbar'),
'#default_value' => variable_get('fckeditor_default_toolbar', 'DrupalBasic'),
'#options' => $toolbar_options,
'#description' => t('Choose a default toolbar set for users with "use default fckeditor" permission..'),
);
$form['fckeditor_settings']['fckeditor_advanced_toolbar'] = array(
'#type' => 'select',
'#title' => t('Advanced Toolbar'),
'#default_value' => variable_get('fckeditor_advanced_toolbar', 'DrupalFull'),
'#options' => $toolbar_options,
'#description' => t('Choose a toolbar set for users with "use advanced fckeditor" permission.'),
);
$form['fckeditor_exclude_settings'] = array(
'#type' => 'fieldset',
'#weight' => -15,
'#title' => t('Visibility settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['fckeditor_exclude_settings']['fckeditor_minimum_rows'] = array(
'#type' => 'textfield',
'#title' => t('Minimum rows'),
'#default_value' => variable_get('fckeditor_minimum_rows', 5),
'#description' => t("FCKeditor will be triggered if the textarea has more rows than entered here. Enter '1' if you do not want to use this feature."),
);
$form['fckeditor_exclude_settings']['fckeditor_exclude_toggle'] = array(
'#type' => 'radios',
'#title' => t('Use inclusion or exclusion mode'),
'#default_value' => variable_get('fckeditor_exclude_toggle', '0'),
'#options' => array(
'0' => t('Exclude fields, will disable the editor on all selected fields'),
'1' => t('Include fields, will only load the editor for the selected fields'),
'2' => t('Exclude paths, will disable the editor for all textareas at the configured paths'),
'3' => t('Include paths, will load the editor for all large enough textareas at the configured paths.'),
),
'#description' => t('Choose what to do with the following values.'),
);
/**
* get excluded fields - so we can have normal textareas too
* split the phrase by any number of commas or space characters,
* which include " ", \r, \t, \n and \f
*/
$form['fckeditor_exclude_settings']['fckeditor_exclude'] = array(
'#type' => 'textarea',
'#title' => t('Selected fields or paths'),
'#cols' => 60,
'#rows' => 5,
'#default_value' => variable_get("fckeditor_exclude", ''),
'#description' => t("Enter fieldnames or drupal paths here, depending on the chosen option for the inclusion mode.<br />\nNames (HTML ID's) of fields that may or may not have an FCKeditor.<br />\nPaths may be used the same way as in the drupal blocks configuration.<br />\nYou may separate the different entries by commas, spaces or newlines. You may also use * as a wildcard character.<br />\nYou can not mix paths and ID's."),
);
$form['fckeditor_special_settings'] = array(
'#type' => 'fieldset',
'#weight' => -10,
'#title' => t('Advanced settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['fckeditor_special_settings']['fckeditor_toolbar_start_expanded'] = array(
'#type' => 'checkbox',
'#title' => t('Start the toolbar expanded'),
'#default_value' => variable_get('fckeditor_toolbar_start_expanded', '1'),
'#description' => t('The toolbar start expanded or collapsed.'),
);
$form['fckeditor_special_settings']['fckeditor_width'] = array(
'#type' => 'textfield',
'#title' => t('Width'),
'#default_value' => variable_get("fckeditor_width", "100%"),
'#description' => t("Width in pixels or percent. Ex: 400 or 100%"),
);
$form['fckeditor_special_settings']['fckeditor_stylesheet'] = array(
'#type' => 'textfield',
'#title' => t('Custom stylesheet'),
'#default_value' => variable_get("fckeditor_stylesheet", ""),
'#description' => t("If you enter a path to a stylesheet here it will be used in the FCKeditor area while editing. Be advised that using the default theme stylesheet will not give the correct results."),
);
// don't show useless options if IMCE is preferred
if (function_exists('imce_integrate') && variable_get('imce_settings_fck', 0)) {
$form['fckeditor_upload_settings'] = array(
'#type' => 'fieldset',
'#weight' => -5,
'#title' => t('File browser settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#description' => t('The file browser settings are not diplayed because you have configured IMCE to handle file browsing.'),
);
}
else {
$form['fckeditor_upload_settings'] = array(
'#type' => 'fieldset',
'#weight' => -5,
'#title' => t('File browser settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#description' => t('Set file browser settings. If you choose none of these you will need to manage your images and other files with the core upload module or a contrib module like !imce. Please note that these options require manual configuration, check !readme for more information.<br />Also remember to change the !permissions.', array(
'!imce' => l(t('IMCE'), 'http://drupal.org/project/imce'),
'!readme' => l('readme.txt', 'admin/help/fckeditor'),
'!permissions' => l('FCKeditor permissions', 'admin/user/access', array(), null, 'module-fckeditor'),
)),
);
$form['fckeditor_upload_settings']['fckeditor_upload_basic'] = array(
'#type' => 'checkbox',
'#title' => t('Allow basic file management'),
'#default_value' => variable_get("fckeditor_upload_basic", '0'),
'#description' => t("Allow quick uploads. All files will be placed in the directory designated in the configuration file."),
);
$form['fckeditor_upload_settings']['fckeditor_upload_advanced'] = array(
'#type' => 'checkbox',
'#title' => t('Allow advanced file management'),
'#default_value' => variable_get('fckeditor_upload_advanced', '0'),
'#description' => t('Allow file management in the advanced file manager. All files will be placed in subdirectories of the default drupal upload directory.'),
);
}
return system_settings_form($form);
}