개발자가 부럽습니다,

개발자가 부럽습니다,

QA

개발자가 부럽습니다,

본문

저는 단순 이용자입니다,

이게 생각대로 안되네요  질문이 2개 인데요

아래에서

1)url을 이렇게 하면

../theme/basic/test/modal.php?mb_id=testman&bo_table=test>&wr_id=12&num=0

모달창이 뜨는데

 

../theme/basic/test/modal.php?mb_id=testman&bo_table=<?php echo $bo_table?>&wr_id=<?php echo $wr_id?>&num=0

 

<?php echo $bo_table?>

<?php echo $wr_id?>

이렇게 변수로 하면

 

모달이 안뜹니다,

html .= 안에 있어서 그런거 같은데,,잘 모르겠습니다,

 

어떻게 해야 링크에 변수로 넣을 수 있을까요?

 

2)그리고 관리자 전용버튼이므로 회원은 보이지 않게 하려고

 

    if ($is_dhtml_editor) 

        $html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\' num=\'0\'>관리자 전용</button></div>");</script>';

 

여기서

    if ($is_dhtml_editor && $is_admin) 이렇게 하니 안먹히는거 같습니다,

도움을 기다려봅니다,

 


    $editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
    $html = "";
    $html .= "<span class=\"sound_only\">웹에디터 시작</span>";

    if ($is_dhtml_editor) 
        $html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\' num=\'0\'>관리자 전용</button></div>");</script>';
 
    if ($is_dhtml_editor && $js) {
        $html .= "\n".'<script src="'.$editor_url.'/js/service/HuskyEZCreator.js"></script>';
        $html .= "\n".'<script>var g5_editor_url = "'.$editor_url.'", oEditors = [], ed_nonce = "'.ft_nonce_create('smarteditor').'";</script>';
        $html .= "\n".'<script src="'.$editor_url.'/config.js"></script>';
        $html .= "\n<script>";
        $html .= '
        $(function(){
            $(".btn_cke_sc").click(function(){
                if ($(this).next("div.cke_sc_def").length) {
                    $(this).next("div.cke_sc_def").remove();
                    $(this).text("관리자전용");
                } else {
  
                   $("#only_admin").load("../theme/basic/test/modal.php?mb_id=testman&bo_table=test>&wr_id=12&num=0"); 
 
                    //$(this).after("<div class=\'cke_sc_def\' />").next("div.cke_sc_def").load("'.$editor_url.'/shortcut.html");
                    //$(this).text("단축키 일람 닫기");
                }
            });
            $(document).on("click", ".btn_cke_sc_close", function(){
                $(this).parent("div.cke_sc_def").remove();
            });
        });';
        $html .= "\n</script>";

 

이 질문에 댓글 쓰기 :

답변 2

1번의 질문은 잘 해결이 되신것 같아 2번의 질문에 답을 드리자면

다음과 같이 하시면 되지 않을까 합니다.

 


if ($is_admin) {
    if ($is_dhtml_editor) {
        $html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\' num=\'0\'>관리자 전용</button></div>");</script>';
    }
}

   
    $html = "";
    if($is_admin){
        $editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
        $html .= "<span class=\"sound_only\">웹에디터 시작</span>";
 
        if ($is_dhtml_editor)
        $html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\' num=\'0\'>관리자 전용</button></div>");</script>';
 
        if ($is_dhtml_editor && $js) {
        $html .= "\n".'<script src="'.$editor_url.'/js/service/HuskyEZCreator.js"></script>';
        $html .= "\n".'<script>var g5_editor_url = "'.$editor_url.'", oEditors = [], ed_nonce = "'.ft_nonce_create('smarteditor').'";</script>';
        $html .= "\n".'<script src="'.$editor_url.'/config.js"></script>';
        $html .= "\n<script>";
        $html .= '
        $(function(){
            $(".btn_cke_sc").click(function(){
                if ($(this).next("div.cke_sc_def").length) {
                    $(this).next("div.cke_sc_def").remove();
                    $(this).text("관리자전용");
                } else {
 
                   $("#only_admin").load("../theme/basic/test/modal.php?mb_id=testman&bo_table='.$bo_table.'&wr_id='.$wr_id.'&num=0");
 
                }
            });
            $(document).on("click", ".btn_cke_sc_close", function(){
                $(this).parent("div.cke_sc_def").remove();
            });
        });';
        $html .= "\n</script>";
    }
   

 

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

회원로그인

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