function ueditor_file_register in UEditor - 百度编辑器 7.2
Registers the file as an ueditor file.
3 calls to ueditor_file_register()
- ueditor_block_save_form_submit in ./
ueditor.module - support block when create a custom block with use ueditor.
- ueditor_entity_insert in ./
ueditor.module - Implements hook_entity_insert().
- ueditor_entity_update in ./
ueditor.module - Implementation of hook_entity_update().
File
- ./
ueditor.module, line 933 - Integration ueditor for wysiwyg.
Code
function ueditor_file_register($matchs = '', $type = '', $field_key = '', $id = '') {
$result = FALSE;
if (!empty($matchs)) {
foreach ($matchs as $key => $mat) {
if (!is_numeric($key)) {
$field_key = $key;
}
if (is_array($mat)) {
ueditor_file_register($mat, $type, $field_key, $id);
}
else {
$filename = ueditor_get_savepath($mat);
$uri = file_build_uri($filename);
$file = ueditor_register_filepath($uri, $type, $field_key, $id);
if (is_object($file)) {
$file->status = 1;
$file = file_save($file);
$result = TRUE;
}
}
}
}
return $result;
}