You are here

function ueditor_settings_form_validate_uploadpath in UEditor - 百度编辑器 7.2

Same name and namespace in other branches
  1. 7.3 editors/ueditor.inc \ueditor_settings_form_validate_uploadpath()
  2. 7 editors/ueditor.inc \ueditor_settings_form_validate_uploadpath()

Deal with settings form submit.

1 string reference to 'ueditor_settings_form_validate_uploadpath'
ueditor_settings_form in editors/ueditor.inc
Enhances the editor profile settings form for UEditor.

File

editors/ueditor.inc, line 249
Editor integration functions for ueditor.

Code

function ueditor_settings_form_validate_uploadpath($element, &$form_state) {
  $uploadpath = array();
  if (!empty($element['imagePathFormat']['#value'])) {
    $uploadpath['imagePathFormat'] = $element['imagePathFormat']['#value'];
  }
  if (!empty($element['scrawlPathFormat']['#value'])) {
    $uploadpath['scrawlPathFormat'] = $element['scrawlPathFormat']['#value'];
  }
  if (!empty($element['filePathFormat']['#value'])) {
    $uploadpath['filePathFormat'] = $element['filePathFormat']['#value'];
  }
  if (!empty($element['fileManagerListPath']['#value'])) {
    $uploadpath['fileManagerListPath'] = $element['fileManagerListPath']['#value'];
  }
  if (!empty($element['catcherPathFormat']['#value'])) {
    $uploadpath['catcherPathFormat'] = $element['catcherPathFormat']['#value'];
  }
  if (!empty($element['imageManagerListPath']['#value'])) {
    $uploadpath['imageManagerListPath'] = $element['imageManagerListPath']['#value'];
  }
  if (!empty($element['snapscreenPathFormat']['#value'])) {
    $uploadpath['snapscreenPathFormat'] = $element['snapscreenPathFormat']['#value'];
  }
  if (!empty($element['videoPathFormat']['#value'])) {
    $uploadpath['videoPathFormat'] = $element['videoPathFormat']['#value'];
  }
  if (!empty($uploadpath)) {
    variable_set('ueditor_uploadpath_config', $uploadpath);
  }
}