Q&A

CMS/프레임워크 Rhymix 2.1
개발 언어 PHP 8.2

외부페이지에서 에디터를 불러와 아래처럼 사용하고 있습니다.

 

{@

    $option = new stdClass();

    $oEditorModel = getModel('editor');

 

    // 에디터 스킨 목록을 구함

    Context::set('editor_skin_list', $oEditorModel->getEditorSkinList());

 

    // 에디터를 받음

    $option->primary_key_name = 'content';

    $option->content_key_name = 'content';

    $option->allow_fileupload = true;

    $option->enable_autosave = true;

    $option->enable_default_component = true;

    $option->enable_component = false;

    $option->resizable = true;

    $option->height = 300;

    $option->skin = "ckeditor";

    $option->module_srl = '258';

    $editor = $oEditorModel->getEditor($row['no'], $option);

 

}

{$editor}

 

여기서 option의 module_srl은 별도로 등록을 원하는 게시판의 module_srl 로 지정 하였습니다.

 

별도의 모듈에서 아래 코드를 활용해 File을 Valid 처리하고 하고 싶은데

 

$oFileController = getController('file');

$fresult = $oFileController->setFilesValid($tar_srl, $upload_target_type = 'doc', $file_srl = null);

 

보통 게시글을 작성할때 임시 저장을 하거나, 첨부파일을 등록할때 input hidden으로 document_srl 값을 리턴 받던데

외부페이지에서도 동일하게 이를 수행하고자 하는 경우에는 어떻게 하면 될까요?

 

input hidden으로 document_srl을 넣어줬는데 자동으로 탁! 붙지는 않네요...

 

예술이 이끄는 기술, 기술이 빚은 예술을 지향합니다.

댓글 1

  • 13시간 전 #1915279

    exec_json으로는 파일 첨부가 어려운 것으로 판단되어서

    form에 module과 act를 명시하여 모듈.act 로 파일을 보내게 하였습니다.

     

    insertDocument한 후 나오는 값이 $data->document_srl이 아니더군요..

    $output->variables['document_srl']; 로 하니 새로 작성된 게시글의 번호를 알 수 있었습니다.

     

    폼의 upload_file 에서 파일이 있는 경우 파일 컨트롤러에서 해당  document_srl로 주입하니 정상적으로 매칭 됩니다!

     

    헌데, form에서 multiple로 파일을 받아 처리할 수는 없는걸까요?

    여러개를 집어넣는 경우 --> <input type="file" id="files" name="upload_file" multiple>

     

    정상적으로 처리되지 않는 느낌이네요 ㅜ

     

    사실 에디터를 쓰면서 파일 첨부를 일일이 file_insert를 하는 수고스러움을 덜고자 했는데, 혹시 이를 해결할 수 있는 방법은 없을까요 @_@?