CHEditor에서 이미지 업로드시 get_editor_upload_url Hook에 파일의 정보 추가
`get_editor_upload_url` Hook의 세번째 인자에 파일의 추가 정보를 전달. smarteditor2에서 정의한 것과 동일한 유형으로 데이터를 담음.
This commit is contained in:
@ -126,7 +126,22 @@ try {
|
|||||||
$file_url = SAVE_URL . '/' . $filename;
|
$file_url = SAVE_URL . '/' . $filename;
|
||||||
|
|
||||||
if (function_exists('run_replace')) {
|
if (function_exists('run_replace')) {
|
||||||
$file_url = run_replace('get_editor_upload_url', $file_url, $savefile, array());
|
$fileInfo = new \stdClass();
|
||||||
|
$fileInfo->name = (string) $filename;
|
||||||
|
$fileInfo->size = (int) $filesize;
|
||||||
|
$fileInfo->url = (string) $file_url;
|
||||||
|
|
||||||
|
if (isset($_POST['origname'])) {
|
||||||
|
$fileInfo->oriname = (string) $_POST['origname'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($imgsize) {
|
||||||
|
$fileInfo->width = (int) $imgsize[0];
|
||||||
|
$fileInfo->height = (int) $imgsize[1];
|
||||||
|
$fileInfo->type = (string) $imgsize['mime'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$file_url = run_replace('get_editor_upload_url', $file_url, $savefile, $fileInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rdata = sprintf(
|
$rdata = sprintf(
|
||||||
|
|||||||
Reference in New Issue
Block a user