You are here

function ueditor_delete_file in UEditor - 百度编辑器 7.2

Deletes a file in the file list.

3 calls to ueditor_delete_file()
ueditor_block_save_form_submit in ./ueditor.module
support block when create a custom block with use ueditor.
ueditor_entity_delete in ./ueditor.module
Implements hook_entity_delete().
ueditor_entity_update in ./ueditor.module
Implementation of hook_entity_update().

File

./ueditor.module, line 871
Integration ueditor for wysiwyg.

Code

function ueditor_delete_file($matchs = '', $type = '', $field_key = '', $id = '') {
  if (!empty($matchs)) {
    foreach ($matchs as $key => $mat) {
      if (!is_numeric($key)) {
        $field_key = $key;
      }
      if (is_array($mat)) {
        ueditor_delete_file($mat, $type, $field_key, $id);
      }
      else {
        $filename = ueditor_get_savepath($mat);
        $uri = file_build_uri($filename);
        if (ueditor_delete_filepath($uri, $type, $field_key, $id)) {
          drupal_set_message(t('%name already deleted!', array(
            '%name' => basename($filename),
          )));
        }
      }
    }
  }
}