g4s 2013-03-21일자 코드 반영

This commit is contained in:
chicpro
2013-03-21 14:48:34 +09:00
parent 260381451e
commit 40451a9f48
87 changed files with 2093 additions and 1804 deletions

View File

@ -8,10 +8,30 @@ function editor_html($id, $content, $ckeditor=true, $class="")
$html = "";
$html .= "<span class=\"sound_only\">웹에디터 시작</span>";
if ($ckeditor)
$html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\'>단축키 일람</button></div>");</script>';
if ($js) {
$html .= "\n".'<script src="'.G4_CKEDITOR_URL.'/ckeditor.js"></script>';
$html .= "\n".'<script>var g4_ckeditor_url = "'.G4_CKEDITOR_URL.'";</script>';
$html .= "\n".'<script src="'.G4_CKEDITOR_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 {
$(this).after("<div class=\'cke_sc_def\' />").next("div.cke_sc_def").load("'.G4_CKEDITOR_URL.'/shortcut.html");
$(this).text("단축키 일람 닫기");
}
});
$(".btn_cke_sc_close").live("click",function(){
$(this).parent("div.cke_sc_def").remove();
});
});';
$html .= "\n</script>";
$js = false;
}

View File

@ -43,6 +43,8 @@ CKEDITOR.on('dialogDefinition', function(ev) {
this.selectPage('Upload');
};
/*
alt 를 넘기지 못하는 관계로 주석 처리함. 130314 kagla
dialogDefinition.onOk = function (e) {
var imageSrcUrl = e.sender.originalElement.$.src;
var imgHtml = CKEDITOR.dom.element.createFromHtml('<img src=' + imageSrcUrl + ' alt="" />');
@ -55,6 +57,7 @@ CKEDITOR.on('dialogDefinition', function(ev) {
$(".cke_dialog_ui_button_ok span").click();
}
};
*/
/*
var uploadTab = dialogDefinition.getContents('Upload');
@ -167,4 +170,4 @@ CKEDITOR.editorConfig = function( config ) {
[ CKEDITOR.ALT + 48 /*ZERO*/, 'toolbarCollapse' ],
[ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
];
};
};

View File

@ -14,13 +14,18 @@ $CKEditor = $_GET['CKEditor'] ;
$langCode = $_GET['langCode'] ;
if(isset($_FILES['upload']['tmp_name'])) {
$file_name = $_FILES['upload']['name'];
$ext = substr($file_name, (strrpos($file_name, '.') + 1));
if (!preg_match("/\.(jpe?g|gif|png)$/i", $file_name)) {
echo '이미지만 가능';
$file = $_FILES['upload']['name'];
$pos = strrpos($file, '.');
$filename = substr($file, 0, $pos);
$extension = substr($file, $pos, strlen($file) - $pos);
if (!preg_match("/\.(jpe?g|gif|png)$/i", $extension)) {
echo '이미지 파일만 가능합니다.';
return false;
}
// 윈도우에서 한글파일명으로 업로드 되지 않는 오류 해결
$file_name = sprintf('%u', ip2long($_SERVER['REMOTE_ADDR'])).'_'.get_microtime().$extension;
$save_dir = sprintf('%s/%s', $data_dir, $file_name);
$save_url = sprintf('%s/%s', $data_url, $file_name);