※제가 한번 아래 소스로 시도해보았는데, 오류가 나더라구요..ㅇ_ㅇ



xe_board_for_extra_vars 확장변수 전용 게시판 스킨[3차수정] 보완용 팁입니다.
1.modules/editor/editor.admin.controller.php line161 부분에 소스를 삽입한다.
$editor_config->enable_autosave = Context::get('enable_autosave');
$editor_config->enable_only_upload_editor = Context::get('enable_only_upload_editor'); if($editor_config->enable_height_resizable != 'Y') $editor_config->enable_height_resizable = 'N';
if($editor_config->enable_comment_height_resizable != 'Y') $editor_config->enable_comment_height_resizable = 'N';
if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N';
if($editor_config->enable_only_upload_editor != 'Y') $editor_config->enable_only_upload_editor = 'N'; 2. modules/editor/editor.model.php line45 부분에 소스를 삽입한다.
if(!$editor_config->editor_height) $editor_config->editor_height = 500;
if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 120;
if($editor_config->enable_height_resizable!='N') $editor_config->enable_height_resizable= "Y";
if($editor_config->enable_comment_height_resizable!='Y') $editor_config->enable_comment_height_resizable= "N";
if($editor_config->enable_autosave!='N') $editor_config->enable_autosave = "Y";
if($editor_config->enable_only_upload_editor != 'Y') $editor_config->enable_only_upload_editor = 'N'; return $editor_config;
} /**
* @brief 에디터 template을 return
* upload_target_srl은 글의 수정시 호출하면 됨.
* 이 upload_target_srl은 첨부파일의 유무를 체크하기 위한 루틴을 구현하는데 사용됨.
**/
function getEditor($upload_target_srl = 0, $option = null) {
/**
* 기본적인 에디터의 옵션을 정리
**/ // 에디터 업로드만 사용 옵션 설정
if(!$option->enable_only_upload_editor) $enable_only_upload_editor = false;
else $enable_only_upload_editor = true; line 166
/**
* 에디터 컴포넌트 체크
**/
if($enable_component) {
if(!Context::get('component_list')) {
$component_list = $this->getComponentList();
Context::set('component_list', $component_list);
}
}
Context::set('enable_component', $enable_component);
Context::set('enable_default_component', $enable_default_component); /**
* 에디터 업로드 기능만 가능한지 변수 설정
**/
Context::set('enable_only_upload_editor', $enable_only_upload_editor); line 220
function getModuleEditor($type = 'document', $module_srl, $upload_target_srl, $primary_key_name, $content_key_name) {
// 지정된 모듈의 에디터 설정을 구해옴
$editor_config = $this->getEditorConfig($module_srl); // type에 따른 설정 정리
if($type == 'document') {
$config->editor_skin = $editor_config->editor_skin;
$config->upload_file_grant = $editor_config->upload_file_grant;
$config->enable_default_component_grant = $editor_config->enable_default_component_grant;
$config->enable_component_grant = $editor_config->enable_component_grant;
$config->enable_html_grant = $editor_config->enable_html_grant;
$config->editor_height = $editor_config->editor_height;
$config->enable_height_resizable = $editor_config->enable_height_resizable;
$config->enable_autosave = $editor_config->enable_autosave;
$config->enable_only_upload_editor = 'N';
} elseif($type == 'extra_vars'){
$config->enable_only_upload_editor = 'Y';
} elseif($type == 'comment') {
$config->editor_skin = $editor_config->comment_editor_skin;
$config->upload_file_grant = $editor_config->comment_upload_file_grant;
$config->enable_default_component_grant = $editor_config->enable_comment_default_component_grant;
$config->enable_component_grant = $editor_config->enable_comment_component_grant;
$config->enable_html_grant = $editor_config->enable_comment_html_grant;
$config->editor_height = $editor_config->comment_editor_height;
$config->enable_height_resizable = $editor_config->enable_comment_height_resizable;
$config->enable_autosave = 'N';
$config->enable_only_upload_editor = 'N';
} line 293
// HTML 편집 권한
$enable_html = false;
if(count($config->enable_html_grant)) {
foreach($group_list as $group_srl => $group_info) {
if(in_array($group_srl, $config->enable_html_grant)) {
$enable_html = true;
break;
}
}
} else $enable_html = true; if($enable_html) $option->disable_html = false;
else $option->disable_html = true; // 에디터 업로드만 설정
$option->enable_only_upload_editor = $config->enable_only_upload_editor=='Y'?true:false; 3. moudles/editor/tpl/js/uploader.js line 247 부분 소스를 삽입한다.
// 이미지 파일의 경우
} else if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) {
html = "<img src=\""+uploaded_filename+"\" border=\"0\" width=\"110\" height=\"110\" onclick=\"copyContent(this.href);return false\" />"; line 끝부분에 아래의 소스를 삽입한다.
function copyContent(trb)
{
var IE=(document.all)?true:false;
if (IE) {
if(confirm("이 글의 주소를 클립보드에 복사하시겠습니까?"))
window.clipboardData.setData("Text", trb);
}
}; <<보충설명>>
1> 이 소스는 글쓰기 폼에서 이미지 파일이 업로드 되면 미리보기가 지원되는데, 미리보기 이미지를 클릭하면 업로드된 파일의 위치를 클립보드에 복사 합니다. 2> 위의 방법으로 복사된 이미지 파일의 주소를 확장변수의 이미지 주소창에 사용자가 붙여넣기하여 사용하기 위함입니다. 4. module/editor/skins/default/editor.html line 9 부분에 소스를 삽입한다.
<!-- 자동저장용 폼 -->
<!--@if($enable_autosave && !$enable_only_upload_editor)-->
<input type="hidden" name="_saved_doc_title" value="{htmlspecialchars($saved_doc->title)}" />
<input type="hidden" name="_saved_doc_content" value="{htmlspecialchars($saved_doc->content)}" />
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
<!--@end--> <!-- 에디터 -->
<div class="xeEditor">
<!--@if(!$enable_only_upload_editor)--> line 142 부분에 소스를 삽입한다.
<!-- 에디터 크기 조절 bar -->
<!--@if($enable_resizable)-->
<div class="textAreaDragIndicator"><div class="textAreaDragIndicatorBar" id="editor_drag_bar_{$editor_sequence}"></div></div>
<!--@end-->
<!--@else-->
<!-- 에디터 출력 -->
<div><iframe id="editor_iframe_{$editor_sequence}" frameborder="0" height="0" style="background-color:transparent;" allowTransparency="true"></iframe></div>
<textarea id="editor_textarea_{$editor_sequence}" class="editor_iframe_textarea" style="display:none; height:0" rows="10" cols="10"></textarea>
<!--@end--> line 169 부분에 소스를 삽입한다.
<!-- 파일 업로드 영역 -->
<div class="fileListArea">
<select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" size="5" class="fileList" onclick="editor_preview(this, '{$editor_sequence}');"></select>
</div>
<div class="fileUploadControl">
<a href="#" onclick="editor_upload_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->upload_file}</span></a>
<a href="#" onclick="editor_remove_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->delete_selected}</span></a>
<!--@if(!$enable_only_upload_editor)-->
<a href="#" onclick="editor_insert_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->link_file}</span></a><!--@end-->
</div> 5. modules/document/document.item.php line 589 부분에 소스를 삽입한다.
/**
* @brief 에디터 html을 구해서 return
**/
function getEditor() {
$module_srl = $this->get('module_srl');
if(!$module_srl) $module_srl = Context::get('module_srl'); $oEditorModel = &getModel('editor');
return $oEditorModel->getModuleEditor('document', $module_srl, $this->document_srl, 'document_srl', 'content');
} function getExtra_vars_Editor() {
$module_srl = $this->get('module_srl');
if(!$module_srl) $module_srl = Context::get('module_srl'); $oEditorModel = &getModel('editor');
return $oEditorModel->getModuleEditor('extra_vars', $module_srl, $this->document_srl, 'document_srl', 'content');
} 6. modules/board/skins/xe_board_for_extra_vars/write_form.html line 103 부분에 소스를 삽입한다.
<!--@if($module_info->enable_editor =='N' && $val->type=='image' || $module_info->enable_editor =='N' && $val->type=='media')-->
<div class="editor">{$oDocument->getExtra_vars_Editor()}</div>
<!--@end-->
<!--@if($module_info->enable_editor !='N')-->
<div class="editor">{$oDocument->getEditor()}</div>
<!--@end-->
by Anna 안나 2008. 6. 21. 23:26