개발자가 부럽습니다, 채택완료
저는 단순 이용자입니다,
이게 생각대로 안되네요 질문이 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 .= "웹에디터 시작";
if ($is_dhtml_editor)
$html .= 'document.write("관리자 전용");';
if ($is_dhtml_editor && $js) {
$html .= "\n".'';
$html .= "\n".'var g5_editor_url = "'.$editor_url.'", oEditors = [], ed_nonce = "'.ft_nonce_create('smarteditor').'";';
$html .= "\n".'';
$html .= "\n";
$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("").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";
답변 2개
1번의 질문은 잘 해결이 되신것 같아 2번의 질문에 답을 드리자면
다음과 같이 하시면 되지 않을까 합니다.
if ($is_admin) {
if ($is_dhtml_editor) {
$html .= 'document.write("관리자 전용");';
}
}
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
$html = "";
if($is_admin){
$editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
$html .= "웹에디터 시작";
if ($is_dhtml_editor)
$html .= 'document.write("관리자 전용");';
if ($is_dhtml_editor && $js) {
$html .= "\n".'';
$html .= "\n".'var g5_editor_url = "'.$editor_url.'", oEditors = [], ed_nonce = "'.ft_nonce_create('smarteditor').'";';
$html .= "\n".'';
$html .= "\n";
$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";
}
답변에 대한 댓글 1개
2번 질문은 위에서 감싸니 에디터가 표출안되네요
버튼만 표출안되게 여러가지로 해보는데 어렵군요,,
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인