You are here

function editor_ckeditor_language_settings_form in Editor 7

Subform constructor to configure the text editor's image upload settings.

Each text editor plugin that is configured to offer the ability to insert images and uses EditorImageDialog for that, should use this form to update the text editor's configuration so that EditorImageDialog knows whether it should allow the user to upload images.

Parameters

object $format: The text format that is being edited.

Return value

array The image upload settings form.

1 call to editor_ckeditor_language_settings_form()
editor_ckeditor_settings_form in modules/editor_ckeditor/includes/editor_ckeditor.admin.inc
Editor settings callback; Provide options for Editor CKEditor module.

File

modules/editor_ckeditor/editor_ckeditor.editor_ckeditor.inc, line 394
Editor CKEditor hooks implemented by the Editor CKEditor module.

Code

function editor_ckeditor_language_settings_form($format) {

  // Defaults.
  $config = array(
    'language_list' => 'un',
  );
  $settings = $format->editor_settings;
  if (isset($settings['plugins']['language'])) {
    $config = $settings['plugins']['language'];
  }
  $predefined_languages = editor_ckeditor_standard_language_list();
  $form['language_list'] = array(
    '#title' => t('Language list'),
    '#title_display' => 'invisible',
    '#type' => 'select',
    '#options' => array(
      'un' => t("United Nations' official languages"),
      'all' => t('All @count languages', array(
        '@count' => count($predefined_languages),
      )),
    ),
    '#default_value' => $config['language_list'],
    '#description' => t('The list of languages to show in the language dropdown. The basic list will only show the <a href="@url">six official languages of the UN</a>. The extended list will show all @count languages that are available in Drupal.', array(
      '@url' => 'http://www.un.org/en/aboutun/languages.shtml/',
      '@count' => count($predefined_languages),
    )),
    '#attached' => array(
      'library' => array(
        'editor_ckeditor',
        'drupal.editor_ckeditor.language.admin',
      ),
    ),
  );
  return $form;
}