You are here

function bueditor_editor_import_form in BUEditor 7

Same name and namespace in other branches
  1. 6.2 admin/bueditor.admin.inc \bueditor_editor_import_form()

Editor import form.

1 string reference to 'bueditor_editor_import_form'
bueditor_menu in ./bueditor.module
Implements hook_menu().

File

admin/bueditor.admin.inc, line 614

Code

function bueditor_editor_import_form($form, &$form_state) {
  bueditor_set_quick_import();
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Editor name'),
    '#maxlength' => 255,
    '#required' => TRUE,
  );
  $form['dirname'] = array(
    '#type' => 'textfield',
    '#title' => t('Directory of editor files'),
    '#maxlength' => 255,
    '#field_prefix' => bueditor_public_dir() . '/',
    '#description' => t('Define a directory to store the library files imported from the editor code. Icons will be stored in a directory named "icons" under this directory. If you do not want to import the files or if the editor uses existing ones you can leave this field blank.'),
  );
  $form['code'] = array(
    '#type' => 'textarea',
    '#title' => t('Editor code (PHP)'),
    '#rows' => 20,
    '#required' => TRUE,
    '#description' => t('Enter previously exported editor code.') . '<div class="messages warning">' . t('This code will be evaluated as PHP, therefore you must be sure that it is harmless and produces proper editor data.') . '</div>',
  );
  $form['overwrite'] = array(
    '#type' => 'select',
    '#title' => t('Overwrite'),
    '#options' => bueditor_editor_options(),
    '#empty_value' => '0',
    '#description' => t('You can optionally select the editor you want to overwrite. Otherwise, a new one will be created.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Import'),
  );
  $form['#validate'][] = 'bueditor_editor_import_validate';
  $form['#submit'][] = 'bueditor_editor_import_submit';
  return $form;
}