function ueditor_entity_presave in UEditor - 百度编辑器 7.3
Same name and namespace in other branches
- 7.2 ueditor.module \ueditor_entity_presave()
Implements hook_entity_presave().
File
- ./
ueditor.module, line 621 - Integration ueditor for wysiwyg.
Code
function ueditor_entity_presave($entity, $type) {
if ($type != 'file') {
$info = entity_get_info($type);
list($id) = entity_extract_ids($type, $entity);
$editor_profiles = _ueditor_get_wysiwyg();
$fields = _ueditor_get_editor_fields($entity, $type, $editor_profiles);
if (variable_get('ueditor_enable_paging') == 1 && module_exists('paging')) {
$words = variable_get('paging_separator', '<!--pagebreak-->');
if ($words) {
if (!empty($words) && $fields) {
foreach ($fields as $key => $field) {
if (!empty($field[0]['value'])) {
$language = field_language($type, $entity, $key);
$entity->{$key}[$language][0]['value'] = ueditor_replace_pagebeaketag($entity->{$key}[$language][0]['value'], $words);
}
}
}
}
}
}
}