mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
1. 회원/게시글/댓글 팝업메뉴를 controller의 method를 이용하여 손쉽게 추가할 수 있도록 변경
2. 게시글/ 댓글 팝업메뉴에 아이콘 추가 3. 쪽지 발송/ 친구 관련 메뉴의 on/off를 member_communication 애드온으로 활성/비활성 할 수 있도록 변경 4. IE에서 페이지를 찾을 수 없다는 오류가 발생하는 window onload이전에 DOM을 건드리는 코드에 대한 보완책 적용 5. XML RPC 결과 출력시 1depth이상의 배열 또는 오브젝트 데이터를 Simple XML 형식으로 출력할 수 있도록 하고 Javascript에서 이를 다차원 배열로 parsing하도록 코드 변경 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4230 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bc963aa72f
commit
4cdce7e4cf
26 changed files with 422 additions and 115 deletions
47
addons/member_communication/conf/info.xml
Normal file
47
addons/member_communication/conf/info.xml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<addon version="0.1">
|
||||
<title xml:lang="ko">커뮤니케이션</title>
|
||||
<title xml:lang="jp">커뮤니케이션</title>
|
||||
<title xml:lang="zh-CN">커뮤니케이션</title>
|
||||
<title xml:lang="en">커뮤니케이션</title>
|
||||
<title xml:lang="ge">커뮤니케이션</title>
|
||||
<title xml:lang="es">커뮤니케이션</title>
|
||||
<title xml:lang="ru">커뮤니케이션</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2008. 5. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<name xml:lang="jp">Zero</name>
|
||||
<name xml:lang="zh-CN">zero</name>
|
||||
<name xml:lang="en">zero</name>
|
||||
<name xml:lang="ge">zero</name>
|
||||
<name xml:lang="es">zero</name>
|
||||
<name xml:lang="ru">zero</name>
|
||||
<description xml:lang="ko">
|
||||
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
|
||||
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
|
||||
</description>
|
||||
<description xml:lang="jp">
|
||||
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
|
||||
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
|
||||
</description>
|
||||
<description xml:lang="zh-CN">
|
||||
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
|
||||
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
|
||||
</description>
|
||||
<description xml:lang="en">
|
||||
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
|
||||
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
|
||||
</description>
|
||||
<description xml:lang="ge">
|
||||
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
|
||||
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
|
||||
</description>
|
||||
<description xml:lang="es">
|
||||
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
|
||||
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
|
||||
</description>
|
||||
<description xml:lang="ru">
|
||||
커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다.
|
||||
쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다.
|
||||
</description>
|
||||
</author>
|
||||
</addon>
|
||||
3
addons/member_communication/lang/en.lang.php
Normal file
3
addons/member_communication/lang/en.lang.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$lang->alert_new_message_arrived = 'You have a new message. Do you want to check now?';
|
||||
?>
|
||||
3
addons/member_communication/lang/es.lang.php
Normal file
3
addons/member_communication/lang/es.lang.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$lang->alert_new_message_arrived = 'Usted tiene un nuevo mensaje. Quiere comprobar ahora?';
|
||||
?>
|
||||
3
addons/member_communication/lang/ge.lang.php
Normal file
3
addons/member_communication/lang/ge.lang.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$lang->alert_new_message_arrived = 'Sie haben eine neue Nachricht. Wollen Sie jetzt prüfen, ob?';
|
||||
?>
|
||||
3
addons/member_communication/lang/jp.lang.php
Normal file
3
addons/member_communication/lang/jp.lang.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$lang->alert_new_message_arrived = '新しいメッセージが届きました。確認しますか。';
|
||||
?>
|
||||
3
addons/member_communication/lang/ko.lang.php
Normal file
3
addons/member_communication/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$lang->alert_new_message_arrived = '새로운 메세지가 도착하였습니다. 확인하시겠습니까?';
|
||||
?>
|
||||
9
addons/member_communication/lang/ru.lang.php
Normal file
9
addons/member_communication/lang/ru.lang.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* @file ru.lang.php
|
||||
* @author zero <zero@nzeo.com> | translation by Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467;
|
||||
* @brief Russian basic language pack for Zeroboard XE
|
||||
**/
|
||||
|
||||
$lang->alert_new_message_arrived = 'У Вас есть новые сообщения. Хотите проверить сейчас?';
|
||||
?>
|
||||
3
addons/member_communication/lang/zh-CN.lang.php
Normal file
3
addons/member_communication/lang/zh-CN.lang.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$lang->alert_new_message_arrived = '您有新消息。要确认吗?';
|
||||
?>
|
||||
89
addons/member_communication/member_communication.addon.php
Normal file
89
addons/member_communication/member_communication.addon.php
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
if(!defined("__ZBXE__")) exit();
|
||||
|
||||
/**
|
||||
* @file member_communication.addon.php
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 사용자의 커뮤니케이션 기능을 활성화
|
||||
*
|
||||
* - 새로운 쪽지가 왔을 경우 팝업으로 띄움
|
||||
* - MemberModel::getMemberMenu 호출시 대상이 회원일 경우 쪽지 보내기 기능 추가합니다.
|
||||
* - MemberModel::getMemberMenu 호출시 친구 등록 메뉴를 추가합니다.
|
||||
**/
|
||||
|
||||
/**
|
||||
* 기능 수행 : 팝업 및 회원정보 보기에서 쪽지/친구 메뉴 추가. 시작할때 새쪽지가 왔는지 검사
|
||||
* 조건 : called_position = 'before_module_init', module = 'member'
|
||||
**/
|
||||
if($called_position == 'before_module_init' && $this->module != 'member' && Context::get('is_logged') ) {
|
||||
|
||||
// 로그인된 사용자 정보를 구함
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// 커뮤니케이션 모듈의 언어파일을 읽음
|
||||
Context::loadLang('./modules/communication/lang');
|
||||
|
||||
// 회원 로그인 정보중에서 쪽지등의 메뉴를 추가
|
||||
$oMemberController = &getController('member');
|
||||
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
|
||||
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
|
||||
|
||||
// 새로운 쪽지에 대한 플래그가 있으면 쪽지 보기 팝업 띄움
|
||||
$flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl);
|
||||
$flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl);
|
||||
|
||||
if(file_exists($flag_file)) {
|
||||
@unlink($flag_file);
|
||||
Context::loadLang('./addons/member_communication/lang');
|
||||
|
||||
$script = sprintf('<script type="text/javascript"> xAddEventListener(window,"load", function() {if(confirm("%s")) { popopen("%s"); }}); </script>', Context::getLang('alert_new_message_arrived'), Context::getRequestUri().'?module=communication&act=dispCommunicationNewMessage');
|
||||
|
||||
Context::addHtmlHeader( $script );
|
||||
}
|
||||
|
||||
/**
|
||||
* 기능 수행 : 사용자 이름을 클릭시 요청되는 팝업메뉴의 메뉴에 쪽지 발송, 친구추가등의 링크 추가
|
||||
* 조건 : called_position == 'after_module_proc', module = 'member', act = 'getMemberMenu'
|
||||
**/
|
||||
} elseif($called_position == 'before_module_proc' && $this->module == 'member' && $this->act == 'getMemberMenu') {
|
||||
// 비로그인 사용자라면 패스
|
||||
if(!Context::get('is_logged')) return;
|
||||
|
||||
$oMemberController = &getController('member');
|
||||
|
||||
// 로그인된 사용자 정보를 구함
|
||||
$logged_info = Context::get('logged_info');
|
||||
$member_srl = Context::get('target_srl');
|
||||
$mid = Context::get('cur_mid');
|
||||
|
||||
// communication 모델 객체 생성
|
||||
$oCommunicationModel = &getModel('communication');
|
||||
|
||||
// 자신이라면 쪽지함 보기 기능 추가
|
||||
if($logged_info->member_srl == $member_srl) {
|
||||
|
||||
// 자신의 쪽지함 보기 기능 추가
|
||||
$oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationMessages'), 'cmd_view_message_box', './modules/communication/tpl/images/icon_message_box.gif', 'self');
|
||||
|
||||
// 친구 목록 보기
|
||||
$oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationFriend'), 'cmd_view_friend', './modules/communication/tpl/images/icon_friend_box.gif', 'self');
|
||||
|
||||
// 아니라면 쪽지 발송, 친구 등록 추가
|
||||
} else {
|
||||
// 대상 회원의 정보를 가져옴
|
||||
$target_member_info = $this->getMemberInfoByMemberSrl($member_srl);
|
||||
if(!$target_member_info->member_srl) return;
|
||||
|
||||
// 로그인된 사용자 정보를 구함
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// 쪽지 발송 메뉴를 만듬
|
||||
if( $logged_info->is_admin == 'Y' || $target_member_info->allow_message =='Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))
|
||||
$oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationSendMessage','receiver_srl',$member_srl), 'cmd_send_message', './modules/communication/tpl/images/icon_write_message.gif', 'popup');
|
||||
|
||||
// 친구 등록 메뉴를 만듬 (이미 등록된 친구가 아닐 경우)
|
||||
if(!$oCommunicationModel->isAddedFriend($member_srl))
|
||||
$oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationAddFriend','target_srl',$member_srl), 'cmd_add_friend', './modules/communication/tpl/images/icon_add_friend.gif', 'popup');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -97,24 +97,35 @@
|
|||
* @brief RequestMethod가 XML이면 XML 데이터로 컨텐츠 생성
|
||||
**/
|
||||
function _toXmlDoc(&$oModule) {
|
||||
$variables = $oModule->getVariables();
|
||||
|
||||
$xmlDoc = "<response>\n";
|
||||
$xmlDoc .= sprintf("<error>%s</error>\n",$oModule->getError());
|
||||
$xmlDoc .= sprintf("<message>%s</message>\n",str_replace(array('<','>','&'),array('<','>','&'),$oModule->getMessage()));
|
||||
|
||||
$variables = $oModule->getVariables();
|
||||
|
||||
if(count($variables)) {
|
||||
foreach($variables as $key => $val) {
|
||||
if(is_string($val)) $val = '<![CDATA['.$val.']]>';
|
||||
$xmlDoc .= "<{$key}>{$val}</{$key}>\n";
|
||||
}
|
||||
}
|
||||
$xmlDoc .= $this->_makeXmlDoc($variables);
|
||||
|
||||
$xmlDoc .= "</response>";
|
||||
|
||||
return $xmlDoc;
|
||||
}
|
||||
|
||||
function _makeXmlDoc($obj) {
|
||||
if(!count($obj)) return;
|
||||
|
||||
$xmlDoc = '';
|
||||
|
||||
foreach($obj as $key => $val) {
|
||||
if(is_numeric($key)) $key = 'item';
|
||||
|
||||
if(is_string($val)) $xmlDoc .= sprintf('<%s><![CDATA[%s]]></%s>%s', $key, $val, $key,"\n");
|
||||
else if(!is_array($val) && !is_object($val)) $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key,"\n");
|
||||
else $xmlDoc .= sprintf('<%s>%s%s</%s>%s',$key, "\n", $this->_makeXmlDoc($val), $key, "\n");
|
||||
}
|
||||
|
||||
return $xmlDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RequestMethod가 XML이 아니면 html 컨텐츠 생성
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -309,18 +309,27 @@ function setFixedPopupSize() {
|
|||
/**
|
||||
* @brief 이름, 게시글등을 클릭하였을 경우 팝업 메뉴를 보여주는 함수
|
||||
**/
|
||||
xAddEventListener(window, 'load', createPopupMenu);
|
||||
xAddEventListener(document, 'click', chkPopupMenu);
|
||||
var loaded_popup_menu_list = new Array();
|
||||
|
||||
var loaded_popup_menus = new Array();
|
||||
|
||||
/* 멤버 팝업 메뉴 레이어를 생성하는 함수 (문서 출력이 완료되었을때 동작) */
|
||||
function createPopupMenu(evt) {
|
||||
var area = xGetElementById("popup_menu_area");
|
||||
if(area) return;
|
||||
area = xCreateElement("div");
|
||||
area.id = "popup_menu_area";
|
||||
area.style.visibility = 'hidden';
|
||||
document.body.appendChild(area);
|
||||
}
|
||||
|
||||
/* 클릭 이벤트 발생시 이벤트가 일어난 대상을 검사하여 적절한 규칙에 맞으면 처리 */
|
||||
function chkPopupMenu(evt) {
|
||||
// 이전에 호출되었을지 모르는 팝업메뉴 숨김
|
||||
var area = xGetElementById("popup_menu_area");
|
||||
if(!area) {
|
||||
area = xCreateElement("div");
|
||||
area.id = "popup_menu_area";
|
||||
document.body.appendChild(area);
|
||||
}
|
||||
if(!area) return;
|
||||
|
||||
if(area.style.visibility!="hidden") area.style.visibility="hidden";
|
||||
|
||||
// 이벤트 대상이 없으면 무시
|
||||
|
|
@ -332,9 +341,7 @@ function chkPopupMenu(evt) {
|
|||
if(!obj) return;
|
||||
|
||||
// obj의 nodeName이 div나 span이 아니면 나올대까지 상위를 찾음
|
||||
if(obj && obj.nodeName != 'DIV' && obj.nodeName != 'SPAN') {
|
||||
obj = obj.parentNode;
|
||||
}
|
||||
if(obj && obj.nodeName != 'DIV' && obj.nodeName != 'SPAN') obj = obj.parentNode;
|
||||
if(!obj || (obj.nodeName != 'DIV' && obj.nodeName != 'SPAN')) return;
|
||||
|
||||
// 객체의 className값을 구함
|
||||
|
|
@ -371,10 +378,9 @@ function chkPopupMenu(evt) {
|
|||
params["page_x"] = e.pageX;
|
||||
params["page_y"] = e.pageY;
|
||||
|
||||
var response_tags = new Array("error","message","menu_list");
|
||||
var response_tags = new Array("error","message","menus");
|
||||
|
||||
if(loaded_popup_menu_list[menu_id]) {
|
||||
params["menu_list"] = loaded_popup_menu_list[menu_id];
|
||||
if(loaded_popup_menus[menu_id]) {
|
||||
displayPopupMenu(params, response_tags, params);
|
||||
return;
|
||||
}
|
||||
|
|
@ -385,44 +391,50 @@ function chkPopupMenu(evt) {
|
|||
}
|
||||
|
||||
function displayPopupMenu(ret_obj, response_tags, params) {
|
||||
var area = xGetElementById("popup_menu_area");
|
||||
|
||||
var menu_list = ret_obj['menu_list'];
|
||||
|
||||
var target_srl = params["target_srl"];
|
||||
var menu_id = params["menu_id"];
|
||||
|
||||
var menus = ret_obj['menus'];
|
||||
var html = "";
|
||||
|
||||
if(loaded_popup_menu_list[menu_id]) {
|
||||
html = loaded_popup_menu_list[menu_id];
|
||||
if(loaded_popup_menus[menu_id]) {
|
||||
html = loaded_popup_menus[menu_id];
|
||||
} else {
|
||||
var infos = menu_list.split("\n");
|
||||
if(infos.length) {
|
||||
for(var i=0;i<infos.length;i++) {
|
||||
var info_str = infos[i];
|
||||
var pos = info_str.indexOf(",");
|
||||
var icon = info_str.substr(0,pos).trim();
|
||||
var item = menus['item'];
|
||||
if(item.length) {
|
||||
for(var i=0;i<item.length;i++) {
|
||||
var url = item[i].url;
|
||||
var str = item[i].str;
|
||||
var icon = item[i].icon;
|
||||
var target = item[i].target;
|
||||
|
||||
info_str = info_str.substr(pos+1, info_str.length).trim();
|
||||
var pos = info_str.indexOf(",");
|
||||
var str = info_str.substr(0,pos).trim();
|
||||
var func = info_str.substr(pos+1, info_str.length).trim();
|
||||
var styleText = "";
|
||||
|
||||
var className = "item";
|
||||
if(icon) styleText = " style=\"background:url('"+icon+"') no-repeat left center; padding-left:18px; \"";
|
||||
switch(target) {
|
||||
case "popup" :
|
||||
click_str = " onclick=\"popopen('"+url+"','"+target+"')\"; return false;";
|
||||
break;
|
||||
case "self" :
|
||||
click_str = " onclick=\"location.href='"+url+"'\"; return false;";
|
||||
break;
|
||||
case "javascript" :
|
||||
click_str = " onclick=\""+url+"\"; return false;";
|
||||
break;
|
||||
default :
|
||||
click_str = " onclick=\"window.open('"+url+"')\"; return false;";
|
||||
break;
|
||||
}
|
||||
|
||||
if(!str || !func) continue;
|
||||
|
||||
if(icon) html += "<div class=\""+className+"\" onmouseover=\"this.className='"+className+"_on'\" onmouseout=\"this.className='"+className+"'\" style=\"background:url("+icon+") no-repeat left center; padding-left:18px;\" onclick=\""+func+"\">"+str+"</div>";
|
||||
else html += "<div class=\""+className+"\" onmouseover=\"this.className='"+className+"_on'\" onmouseout=\"this.className='"+className+"'\" onclick=\""+func+"\">"+str+"</div>";
|
||||
html += '<div class="item" onmouseover="this.className=\'item_on\'" onmouseout="this.className=\'item\'"'+styleText+click_str+'>'+str+'</div> ';
|
||||
}
|
||||
}
|
||||
loaded_popup_menu_list[menu_id] = html;
|
||||
}
|
||||
loaded_popup_menus[menu_id] = html;
|
||||
}
|
||||
|
||||
// 레이어 출력
|
||||
if(html) {
|
||||
// 레이어 출력
|
||||
xInnerHtml('popup_menu_area', "<div class=\"box\">"+html+"</div>");
|
||||
var area = xGetElementById("popup_menu_area");
|
||||
xInnerHtml(area, "<div class=\"box\">"+html+"</div>");
|
||||
xLeft(area, params["page_x"]);
|
||||
xTop(area, params["page_y"]);
|
||||
if(xWidth(area)+xLeft(area)>xClientWidth()+xScrollLeft()) xLeft(area, xClientWidth()-xWidth(area)+xScrollLeft());
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ function xml_handler() {
|
|||
this.addParam = xml_handlerAddParam;
|
||||
this.getResponseXml = xml_handlerGetResponseXML;
|
||||
this.toZMsgObject = xml_handlerToZMsgObject;
|
||||
this.parseXMLDoc = xml_parseXmlDoc;
|
||||
|
||||
this.obj_xmlHttp = this.getXmlHttp();
|
||||
}
|
||||
|
|
@ -157,21 +158,57 @@ function xml_handlerGetResponseXML() {
|
|||
return null;
|
||||
}
|
||||
|
||||
function xml_parseXmlDoc(dom) {
|
||||
if(!dom) return;
|
||||
|
||||
var ret_obj = new Array();
|
||||
|
||||
var obj = dom.firstChild;
|
||||
if(!obj) return;
|
||||
|
||||
while(obj) {
|
||||
if(obj.nodeType == 1) {
|
||||
|
||||
if(obj.firstChild && obj.lastChild && obj.firstChild == obj.lastChild) {
|
||||
var name = obj.nodeName;
|
||||
var value = obj.firstChild.nodeValue;
|
||||
ret_obj[name] = value;
|
||||
} else {
|
||||
var name = obj.nodeName;
|
||||
var value = this.parseXMLDoc(obj);
|
||||
|
||||
if(typeof(ret_obj[name])=='undefined') {
|
||||
ret_obj[name] = value;
|
||||
} else {
|
||||
if(ret_obj[name].length>0) {
|
||||
ret_obj[name][ret_obj[name].length] = value;
|
||||
} else {
|
||||
var tmp_value = ret_obj[name];
|
||||
ret_obj[name] = new Array();
|
||||
ret_obj[name][ret_obj[name].length] = tmp_value;
|
||||
ret_obj[name][ret_obj[name].length] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
obj = obj.nextSibling;
|
||||
}
|
||||
return ret_obj;
|
||||
}
|
||||
|
||||
function xml_handlerToZMsgObject(xmlDoc, tags) {
|
||||
if(!xmlDoc) return null;
|
||||
if(!tags) tags = new Array("error","message");
|
||||
tags[tags.length] = "redirect_url";
|
||||
tags[tags.length] = "act";
|
||||
|
||||
var parsed_array = this.parseXMLDoc(xmlDoc.getElementsByTagName('response')[0]);
|
||||
|
||||
var obj_ret = new Array();
|
||||
for(var i=0; i<tags.length; i++) {
|
||||
var key = tags[i];
|
||||
if(obj_ret[key]) continue;
|
||||
try {
|
||||
obj_ret[key] = xmlDoc.getElementsByTagName(tags[i])[0].firstChild.nodeValue;
|
||||
} catch(e) {
|
||||
obj_ret[key] = "";
|
||||
}
|
||||
if(parsed_array[key]) obj_ret[key] = parsed_array[key];
|
||||
else obj_ret[key] = null;
|
||||
}
|
||||
return obj_ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,18 +281,19 @@
|
|||
if($cur_module_info->module != 'board') return new Object();
|
||||
|
||||
// 자신의 아이디를 클릭한 경우
|
||||
if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
|
||||
else {
|
||||
if($member_srl == $logged_info->member_srl) {
|
||||
$member_info = $logged_info;
|
||||
} else {
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
|
||||
}
|
||||
|
||||
if(!$member_info->user_id) return new Object();
|
||||
|
||||
// 아이디로 검색
|
||||
$menu_str = Context::getLang('cmd_view_own_document');
|
||||
$menu_url = sprintf('./?mid=%s&search_target=user_id&search_keyword=%s', $mid, $member_info->user_id);
|
||||
$obj[] = sprintf('%s,%s,move_url(\'%s\')', Context::getRequestUri().'/modules/member/tpl/images/icon_view_written.gif',$menu_str, $menu_url);
|
||||
// 아이디로 검색기능 추가
|
||||
$url = getUrl('','mid',$mid,'search_target','user_id','search_keyword',$member_info->user_id);
|
||||
$oMemberController = &getController('member');
|
||||
$oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', './modules/member/tpl/images/icon_view_written.gif');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -532,5 +532,21 @@
|
|||
$this->setMessage('success_declared');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 댓글의 이 댓글을.. 클릭시 나타나는 팝업 메뉴를 추가하는 method
|
||||
**/
|
||||
function addCommentPopupMenu($url, $str, $icon = '', $target = 'self') {
|
||||
$comment_popup_menu_list = Context::get('comment_popup_menu_list');
|
||||
if(!is_array($comment_popup_menu_list)) $comment_popup_menu_list = array();
|
||||
|
||||
$obj->url = $url;
|
||||
$obj->str = $str;
|
||||
$obj->icon = $icon;
|
||||
$obj->target = $target;
|
||||
$comment_popup_menu_list[] = $obj;
|
||||
|
||||
Context::set('comment_popup_menu_list', $comment_popup_menu_list);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -32,31 +32,36 @@
|
|||
// trigger 호출
|
||||
ModuleHandler::triggerCall('comment.getCommentMenu', 'before', $menu_list);
|
||||
|
||||
$oCommentController = &getController('comment');
|
||||
|
||||
// 회원이어야만 가능한 기능
|
||||
if($logged_info->member_srl) {
|
||||
|
||||
// 추천 버튼 추가
|
||||
$menu_str = Context::getLang('cmd_vote');
|
||||
$menu_link = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
|
||||
$url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
|
||||
$oCommentController->addCommentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript');
|
||||
|
||||
// 비추천 버튼 추가
|
||||
$menu_str = Context::getLang('cmd_vote_down');
|
||||
$menu_link = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
|
||||
$url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
|
||||
$oCommentController->addCommentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript');
|
||||
|
||||
// 신고 기능 추가
|
||||
$menu_str = Context::getLang('cmd_declare');
|
||||
$menu_link = sprintf("doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
|
||||
|
||||
$url = sprintf("doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl);
|
||||
$oCommentController->addCommentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript');
|
||||
}
|
||||
|
||||
// trigger 호출 (after)
|
||||
ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list);
|
||||
|
||||
// 정보를 저장
|
||||
$this->add("menu_list", implode("\n",$menu_list));
|
||||
// 팝업메뉴의 언어 변경
|
||||
$menus = Context::get('comment_popup_menu_list');
|
||||
$menus_count = count($menus);
|
||||
for($i=0;$i<$menus_count;$i++) {
|
||||
$menus[$i]->str = Context::getLang($menus[$i]->str);
|
||||
}
|
||||
|
||||
// 최종적으로 정리된 팝업메뉴 목록을 구함
|
||||
$this->add('menus', $menus);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -917,5 +917,22 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시물의 이 게시물을.. 클릭시 나타나는 팝업 메뉴를 추가하는 method
|
||||
**/
|
||||
function addDocumentPopupMenu($url, $str, $icon = '', $target = 'self') {
|
||||
$document_popup_menu_list = Context::get('document_popup_menu_list');
|
||||
if(!is_array($document_popup_menu_list)) $document_popup_menu_list = array();
|
||||
|
||||
$obj->url = $url;
|
||||
$obj->str = $str;
|
||||
$obj->icon = $icon;
|
||||
$obj->target = $target;
|
||||
$document_popup_menu_list[] = $obj;
|
||||
|
||||
Context::set('document_popup_menu_list', $document_popup_menu_list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -54,40 +54,44 @@
|
|||
// trigger 호출
|
||||
ModuleHandler::triggerCall('document.getDocumentMenu', 'before', $menu_list);
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 인쇄 버튼 추가
|
||||
$menu_str = Context::getLang('cmd_print');
|
||||
$menu_link = sprintf("%s?document_srl=%s&act=dispDocumentPrint",Context::getRequestUri(),$document_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,winopen('%s','MemberModifyInfo')", '' ,$menu_str, $menu_link);
|
||||
$url = getUrl('','module','document','act','dispDocumentPrint','document_srl',$document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_print','./modules/document/tpl/icons/print.gif','printDocument');
|
||||
|
||||
// 회원이어야만 가능한 기능
|
||||
if($logged_info->member_srl) {
|
||||
|
||||
// 추천 버튼 추가
|
||||
$menu_str = Context::getLang('cmd_vote');
|
||||
$menu_link = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript');
|
||||
|
||||
// 비추천 버튼 추가
|
||||
$menu_str = Context::getLang('cmd_vote_down');
|
||||
$menu_link = sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
|
||||
$url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript');
|
||||
|
||||
// 신고 기능 추가
|
||||
$menu_str = Context::getLang('cmd_declare');
|
||||
$menu_link = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript');
|
||||
|
||||
// 스크랩 버튼 추가
|
||||
$menu_str = Context::getLang('cmd_scrap');
|
||||
$menu_link = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
|
||||
$url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_scrap','./modules/document/tpl/icons/scrap.gif','javascript');
|
||||
}
|
||||
|
||||
// trigger 호출 (after)
|
||||
ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list);
|
||||
|
||||
// 정보를 저장
|
||||
$this->add("menu_list", implode("\n",$menu_list));
|
||||
// 팝업메뉴의 언어 변경
|
||||
$menus = Context::get('document_popup_menu_list');
|
||||
$menus_count = count($menus);
|
||||
for($i=0;$i<$menus_count;$i++) {
|
||||
$menus[$i]->str = Context::getLang($menus[$i]->str);
|
||||
}
|
||||
|
||||
// 최종적으로 정리된 팝업메뉴 목록을 구함
|
||||
$this->add('menus', $menus);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
BIN
modules/document/tpl/icons/declare.gif
Executable file
BIN
modules/document/tpl/icons/declare.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 98 B |
BIN
modules/document/tpl/icons/print.gif
Executable file
BIN
modules/document/tpl/icons/print.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1,017 B |
BIN
modules/document/tpl/icons/scrap.gif
Executable file
BIN
modules/document/tpl/icons/scrap.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 371 B |
BIN
modules/document/tpl/icons/send_trackback.gif
Executable file
BIN
modules/document/tpl/icons/send_trackback.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 118 B |
BIN
modules/document/tpl/icons/vote_down.gif
Executable file
BIN
modules/document/tpl/icons/vote_down.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 345 B |
BIN
modules/document/tpl/icons/vote_up.gif
Executable file
BIN
modules/document/tpl/icons/vote_up.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 343 B |
|
|
@ -965,11 +965,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
// 사용자의 전용 메뉴 구성 (이 메뉴는 애드온등으로 변경될 수 있음)
|
||||
$member_info->menu_list['dispMemberInfo'] = 'cmd_view_member_info';
|
||||
$member_info->menu_list['dispMemberScrappedDocument'] = 'cmd_view_scrapped_document';
|
||||
$member_info->menu_list['dispMemberSavedDocument'] = 'cmd_view_saved_document';
|
||||
$member_info->menu_list['dispMemberOwnDocument'] = 'cmd_view_own_document';
|
||||
// 사용중지 아이디이면 세션 파기
|
||||
if($member_info->denied=='Y') {
|
||||
$this->destroySessionInfo();
|
||||
return;
|
||||
}
|
||||
|
||||
// 오픈아이디인지 체크 (일단 아이디 형식으로만 결정)
|
||||
if(preg_match("/^([0-9a-z]+)$/is", $member_info->user_id)) $member_info->is_openid = false;
|
||||
|
|
@ -997,11 +997,44 @@
|
|||
|
||||
// 세션에 로그인 사용자 정보 저장
|
||||
$_SESSION['logged_info'] = $member_info;
|
||||
|
||||
Context::set('is_logged', true);
|
||||
Context::set('logged_info', $member_info);
|
||||
|
||||
// 사용자의 전용 메뉴 구성 (이 메뉴는 애드온등으로 변경될 수 있음)
|
||||
$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
|
||||
$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
|
||||
$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
|
||||
$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 로그인한 사용자의 개인화된 메뉴 제공을 위한 method
|
||||
* 로그인 정보 출력 위젯 또는 개인화 페이지에서 사용됨
|
||||
**/
|
||||
function addMemberMenu($act, $str) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$logged_info->menu_list[$act] = Context::getLang($str);
|
||||
|
||||
Context::set('logged_info', $logged_info);
|
||||
$_SESSION['logged_info'] = $logged_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 로그인 회원의 닉네임등을 클릭할때 나타나는 팝업 메뉴를 추가하는 method
|
||||
**/
|
||||
function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') {
|
||||
$member_popup_menu_list = Context::get('member_popup_menu_list');
|
||||
if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
|
||||
|
||||
$obj->url = $url;
|
||||
$obj->str = $str;
|
||||
$obj->icon = $icon;
|
||||
$obj->target = $target;
|
||||
$member_popup_menu_list[] = $obj;
|
||||
|
||||
Context::set('member_popup_menu_list', $member_popup_menu_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief member 테이블에 사용자 추가
|
||||
|
|
|
|||
|
|
@ -41,48 +41,56 @@
|
|||
// 변수 정리
|
||||
$user_id = $member_info->user_id;
|
||||
$user_name = $member_info->user_name;
|
||||
$email_address = $member_info->email_address;
|
||||
|
||||
// menu_list 에 "표시할글,target,url" 을 배열로 넣는다
|
||||
$menu_list = array();
|
||||
ModuleHandler::triggerCall('member.getMemberMenu', 'before', $null);
|
||||
|
||||
ModuleHandler::triggerCall('member.getMemberMenu', 'before', $menu_list);
|
||||
$oMemberController = &getController('member');
|
||||
|
||||
// 최고 관리자라면 회원정보 수정 메뉴 만듬
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
$menu_str = Context::getLang('cmd_management');
|
||||
$menu_link = sprintf("%s?module=admin&act=dispMemberAdminInsert&member_srl=%s",Context::getRequestUri(),$member_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,winopen('%s','MemberModifyInfo')", Context::getRequestUri().'/modules/member/tpl/images/icon_management.gif',$menu_str, $menu_link);
|
||||
$url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl);
|
||||
$icon_path = './modules/member/tpl/images/icon_management.gif';
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_management',$icon_path,'MemberModifyInfo');
|
||||
}
|
||||
|
||||
// 회원 정보 보기 (비회원일 경우 볼 수 없도록 수정)
|
||||
if($logged_info->member_srl) {
|
||||
$menu_str = Context::getLang('cmd_view_member_info');
|
||||
$menu_url = sprintf('./?mid=%s&act=dispMemberInfo&member_srl=%s', $mid, $member_srl);
|
||||
$menu_list[] = sprintf('%s,%s,move_url(\'%s\')', Context::getRequestUri().'/modules/member/tpl/images/icon_view_info.gif', $menu_str, $menu_url);
|
||||
$url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl);
|
||||
$icon_path = './modules/member/tpl/images/icon_view_info.gif';
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self');
|
||||
}
|
||||
|
||||
// 다른 사람의 아이디를 클릭한 경우
|
||||
if($member_srl != $logged_info->member_srl) {
|
||||
|
||||
// 메일 보내기
|
||||
$menu_str = Context::getLang('cmd_send_email');
|
||||
//$menu_url = sprintf('%s <%s>', $email_address, $user_name);
|
||||
$menu_url = sprintf('%s', $email_address);
|
||||
$menu_list[] = sprintf('%s,%s,sendMailTo(\'%s\')', Context::getRequestUri().'/modules/member/tpl/images/icon_sendmail.gif', $menu_str, $menu_url);
|
||||
if($member_info->email_address) {
|
||||
$url = 'mailto:'.$member_info->email_address;
|
||||
$icon_path = './modules/member/tpl/images/icon_sendmail.gif';
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
|
||||
}
|
||||
}
|
||||
|
||||
// 홈페이지 보기
|
||||
if($member_info->homepage) $menu_list[] = sprintf("%s,%s,winopen('%s')", Context::getRequestUri().'/modules/member/tpl/images/icon_homepage.gif',Context::getLang('homepage'), $member_info->homepage);
|
||||
if($member_info->homepage)
|
||||
$oMemberController->addMemberPopupMenu($member_info->homepage, 'homepage', './modules/member/tpl/images/icon_homepage.gif','blank');
|
||||
|
||||
// 블로그 보기
|
||||
if($member_info->blog) $menu_list[] = sprintf("%s,%s,winopen('%s')", Context::getRequestUri().'/modules/member/tpl/images/icon_blog.gif', Context::getLang('blog'), $member_info->blog);
|
||||
if($member_info->blog)
|
||||
$oMemberController->addMemberPopupMenu($member_info->blog, 'blog', './modules/member/tpl/images/icon_blog.gif','blank');
|
||||
|
||||
// trigger 호출 (after)
|
||||
ModuleHandler::triggerCall('member.getMemberMenu', 'after', $menu_list);
|
||||
ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
|
||||
|
||||
// 정보를 저장
|
||||
$this->add("menu_list", implode("\n",$menu_list));
|
||||
// 팝업메뉴의 언어 변경
|
||||
$menus = Context::get('member_popup_menu_list');
|
||||
$menus_count = count($menus);
|
||||
for($i=0;$i<$menus_count;$i++) {
|
||||
$menus[$i]->str = Context::getLang($menus[$i]->str);
|
||||
}
|
||||
|
||||
// 최종적으로 정리된 팝업메뉴 목록을 구함
|
||||
$this->add('menus', $menus);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@
|
|||
if($oDocument->getMemberSrl() != $logged_info->member_srl) return new Object();
|
||||
|
||||
// 엮인글 발송 링크 추가
|
||||
$menu_str = Context::getLang('cmd_send_trackback');
|
||||
$menu_link = sprintf("%s?module=trackback&act=dispTrackbackSend&document_srl=%s",Context::getRequestUri(),$document_srl);
|
||||
$menu_list[] = sprintf("\n%s,%s,popopen('%s','SendTrackback')", '', $menu_str, $menu_link);
|
||||
$oDocumentController = &getController('document');
|
||||
$url = getUrl('module','trackback','act','dispTrackbackSend','document_srl', $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_send_trackback','./modules/document/tpl/icons/send_trackback.gif','popup');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue