DHTML에디터 높이 변경을 부분적으로 하고 싶습니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
DHTML에디터 높이 변경을 부분적으로 하고 싶습니다.

QA

DHTML에디터 높이 변경을 부분적으로 하고 싶습니다.

본문

안녕하세요.

 

영카트의 상품등록시 /adm/shop_admin/itemform.php 안에 있는 DHTML 에디터의 크기를 변경하고 싶습니다.

검색해보니 /plugin/editor/cheditor5/editor.lib.php 의 23번째줄을 수정하면 된다고 합니다.

(참고로 에디터를 cheditor5를 사용중입니다.)

 

$height = isset($editor_height) ? $editor_height : "250px"; <-- 250px을 600px로 수정하면 잘 됩니다.

 

그런데 제가 원하는 것은 itemform.php의 전체 에디터(6개가 있습니다.)를 변경하는게 아니고

상품설명 등록하는 곳의 에디터의 길이만 길게 하고 싶습니다.

 

그래서 아래처럼 해봤습니다.

 

1. /plugin/editor/cheditor5/editor.lib.php의 4라인  수정

function editor_html($id, $content, $is_dhtml_editor=true) <-- 이것을

function editor_html($id, $content, $is_dhtml_editor=true, $option='')  <-- 이렇게

 

2.  /plugin/editor/cheditor5/editor.lib.php의 23라인  수정

 $height = isset($editor_height) ? $editor_height : "250px";    <-- 이것을

 $height = isset($editor_height) ? "250px" : $option."px";  <-- 이렇게

 

3. itemform.php 수정

 

<th scope="row">상품설명</th>
<td colspan="2"> <?php echo editor_html('it_explan', get_text($it['it_explan'], 0)); ?></td>  <-- 이것을

 

<th scope="row">상품설명</th>
<td colspan="2"> <?php echo editor_html('it_explan', get_text($it['it_explan'], 0,600)); ?></td>  <-- 이렇게

 

 

될 것 같은데 아무 변화가 없습니다...ㅠ_ㅠ

 

어떻게 하면 될까요?

이 질문에 댓글 쓰기 :

답변 2

문제가 있을 것 같아 보이지는 않는데..

사용하신 방법이 왜 안되는지는 잘 모르겠습니다.

 

한번 다음과 같이 시도해보셨으면 합니다.

 

itemform.php

<?php $editor_height = "550px"; echo editor_html('it_explan', get_text($it['it_explan'], 0)); ?>

 

날도 더운데... 불금인데...^^;;; 답변해주셔서 감사드려요~

그런데 변화가 없습니다...ㅠ_ㅠ

아..아닙니다. editor.lib.php 파일을 원본으로 돌려 놓고
하라는데로 해보니 전체 에디터의 크기가 동일하게 커졌습니다.

하다하다 않되서 아래의 방법으로 무식하게 해결했습니다...;;;

 

editor.lib.php  파일을 아래처럼 수정했습니다.

 

    if ($is_dhtml_editor) {
        if ($js) {
            $html .= "<script src=\"{$editor_url}/cheditor.js\"></script>";
        }
        $html .= "<script>\n";
        $html .= "var ed_nonce = \"".ft_nonce_create('cheditor')."\";\n";
        $html .= "var ed_{$id} = new cheditor('ed_{$id}');\n";
        $html .= "ed_{$id}.config.editorWidth = \"{$width}\";\n";             

        if($id == "it_explan") {
        $html .= "ed_it_explan.config.editorHeight = \"600px\";\n"; 
        } else {

        $html .= "ed_{$id}.config.editorHeight = \"{$height}\";\n"; 
        }                 
        $html .= "ed_{$id}.config.imgReSize = false;\n";                    
        $html .= "ed_{$id}.config.fullHTMLSource = false;\n";               
        $html .= "ed_{$id}.config.editorPath = \"{$editor_url}\";\n"; 
        $html .= "ed_{$id}.inputForm = \"tx_{$id}\";\n";
        $html .= "</script>\n";                                             
        $html .= "<span class=\"sound_only\">웹에디터 시작</span>";
        $html .= "<textarea name=\"{$id}\" id=\"tx_{$id}\" style=\"display:none;\">{$content}</textarea>\n";
        $html .= "\n<span class=\"sound_only\">웹 에디터 끝</span>";
        $html .= "<script>ed_{$id}.run();</script>\n";
    } else {
        $html .= "<textarea id=\"$id\" name=\"$id\" style=\"width:{$width};height:{$height};\" maxlength=\"65536\">$content</textarea>\n";
    }
    return $html;
}

 

 

이 방법은 $id 값을 지정해버렸기 때문에 원하는 곳마다 적용하기는 좀 어려운 방법인 것 같습니다.

혹시 더 좋은 방법이 있으면 도와주세요 ㅠ_ㅠ

답변을 작성하시기 전에 로그인 해주세요.
전체 22
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT