function _textimage_preset_flush in Textimage 6.2
Same name and namespace in other branches
- 5.2 textimage_admin.inc \_textimage_preset_flush()
- 5 textimage.module \_textimage_preset_flush()
- 7.2 textimage.admin.inc \_textimage_preset_flush()
flush cached media for a preset.
Parameters
pid: a preset id.
4 calls to _textimage_preset_flush()
File
- ./
textimage_admin.inc, line 692
Code
function _textimage_preset_flush($pid) {
if ($pid !== 0) {
drupal_set_message(t('Flushed Preset Images (ID: @pid)', array(
'@pid' => $pid,
)));
}
$preset = _textimage_preset_load($pid);
$presetdir = realpath(file_directory_path() . '/textimage/' . $pid);
if (is_dir($presetdir)) {
_textimage_recursive_delete($presetdir);
@unlink($presetdir);
}
db_query("DELETE FROM {textimage_image} where pid = %d", $pid);
}