mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Also support plain window for adding friend & friend group #2154
This commit is contained in:
parent
e635970c6a
commit
64b2918559
6 changed files with 95 additions and 30 deletions
|
|
@ -76,6 +76,8 @@
|
||||||
'dispCommunicationFriend',
|
'dispCommunicationFriend',
|
||||||
'dispCommunicationMessages',
|
'dispCommunicationMessages',
|
||||||
'dispCommunicationSendMessage',
|
'dispCommunicationSendMessage',
|
||||||
|
'dispCommunicationAddFriend',
|
||||||
|
'dispCommunicationAddFriendGroup',
|
||||||
'dispNcenterliteUserConfig',
|
'dispNcenterliteUserConfig',
|
||||||
'dispNcenterliteNotifyList',
|
'dispNcenterliteNotifyList',
|
||||||
'dispNcenterliteUnsubscribeList',
|
'dispNcenterliteUnsubscribeList',
|
||||||
|
|
|
||||||
|
|
@ -593,13 +593,20 @@ class communicationController extends communication
|
||||||
|
|
||||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
|
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
|
||||||
{
|
{
|
||||||
global $lang;
|
if (Context::get('window_type') === 'self')
|
||||||
htmlHeader();
|
{
|
||||||
alertScript($lang->success_registed);
|
$this->setRedirectUrl(getNotEncodedUrl('', 'act', 'dispCommunicationFriend'));
|
||||||
closePopupScript();
|
}
|
||||||
htmlFooter();
|
else
|
||||||
Context::close();
|
{
|
||||||
exit;
|
global $lang;
|
||||||
|
htmlHeader();
|
||||||
|
alertScript($lang->success_registed);
|
||||||
|
closePopupScript();
|
||||||
|
htmlFooter();
|
||||||
|
Context::close();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -767,13 +774,20 @@ class communicationController extends communication
|
||||||
{
|
{
|
||||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
|
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
|
||||||
{
|
{
|
||||||
global $lang;
|
if (Context::get('window_type') === 'self')
|
||||||
htmlHeader();
|
{
|
||||||
alertScript($lang->fail_to_registed);
|
$this->setRedirectUrl(getNotEncodedUrl('', 'act', 'dispCommunicationFriend'));
|
||||||
closePopupScript();
|
}
|
||||||
htmlFooter();
|
else
|
||||||
Context::close();
|
{
|
||||||
exit;
|
global $lang;
|
||||||
|
htmlHeader();
|
||||||
|
alertScript($lang->fail_to_registed);
|
||||||
|
closePopupScript();
|
||||||
|
htmlFooter();
|
||||||
|
Context::close();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -784,14 +798,21 @@ class communicationController extends communication
|
||||||
{
|
{
|
||||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
|
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
|
||||||
{
|
{
|
||||||
global $lang;
|
if (Context::get('window_type') === 'self')
|
||||||
htmlHeader();
|
{
|
||||||
alertScript($lang->success_registed);
|
$this->setRedirectUrl(getNotEncodedUrl('', 'act', 'dispCommunicationFriend'));
|
||||||
reload(true);
|
}
|
||||||
closePopupScript();
|
else
|
||||||
htmlFooter();
|
{
|
||||||
Context::close();
|
global $lang;
|
||||||
exit;
|
htmlHeader();
|
||||||
|
alertScript($lang->success_registed);
|
||||||
|
reload(true);
|
||||||
|
closePopupScript();
|
||||||
|
htmlFooter();
|
||||||
|
Context::close();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -976,13 +997,15 @@ class communicationController extends communication
|
||||||
// Add a menu for sending message
|
// Add a menu for sending message
|
||||||
if($config->enable_message == 'Y' && ($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))))
|
if($config->enable_message == 'Y' && ($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))))
|
||||||
{
|
{
|
||||||
$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup');
|
$url = getUrl('', 'mid', $mid, 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl, 'window_type', 'self');
|
||||||
|
$oMemberController->addMemberPopupMenu($url, 'cmd_send_message', '', 'self');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a menu for listing friends (if a friend is new)
|
// Add a menu for listing friends (if a friend is new)
|
||||||
if($config->enable_friend == 'Y' && !$oCommunicationModel->isAddedFriend($member_srl))
|
if($config->enable_friend == 'Y' && !$oCommunicationModel->isAddedFriend($member_srl))
|
||||||
{
|
{
|
||||||
$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup');
|
$url = getUrl('', 'mid', $mid, 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl, 'window_type', 'self');
|
||||||
|
$oMemberController->addMemberPopupMenu($url, 'cmd_add_friend', '', 'self');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -374,8 +374,22 @@ class communicationView extends communication
|
||||||
*/
|
*/
|
||||||
function dispCommunicationAddFriend()
|
function dispCommunicationAddFriend()
|
||||||
{
|
{
|
||||||
$this->setLayoutPath('./common/tpl/');
|
// If window type is self, use member module layout.
|
||||||
$this->setLayoutFile("popup_layout");
|
// Otherwise, assume it's a popup window on PC for backward compatibility.
|
||||||
|
if(Context::get('window_type') === 'self')
|
||||||
|
{
|
||||||
|
$oMemberView = MemberView::getInstance();
|
||||||
|
if (!$oMemberView->checkMidAndRedirect())
|
||||||
|
{
|
||||||
|
$this->setRedirectUrl($oMemberView->getRedirectUrl());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif(!Context::get('m'))
|
||||||
|
{
|
||||||
|
$this->setLayoutPath('./common/tpl/');
|
||||||
|
$this->setLayoutFile("popup_layout");
|
||||||
|
}
|
||||||
|
|
||||||
if($this->config->enable_friend == 'N')
|
if($this->config->enable_friend == 'N')
|
||||||
{
|
{
|
||||||
|
|
@ -432,8 +446,22 @@ class communicationView extends communication
|
||||||
*/
|
*/
|
||||||
function dispCommunicationAddFriendGroup()
|
function dispCommunicationAddFriendGroup()
|
||||||
{
|
{
|
||||||
$this->setLayoutPath('./common/tpl/');
|
// If window type is self, use member module layout.
|
||||||
$this->setLayoutFile("popup_layout");
|
// Otherwise, assume it's a popup window on PC for backward compatibility.
|
||||||
|
if(Context::get('window_type') === 'self')
|
||||||
|
{
|
||||||
|
$oMemberView = MemberView::getInstance();
|
||||||
|
if (!$oMemberView->checkMidAndRedirect())
|
||||||
|
{
|
||||||
|
$this->setRedirectUrl($oMemberView->getRedirectUrl());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif(!Context::get('m'))
|
||||||
|
{
|
||||||
|
$this->setLayoutPath('./common/tpl/');
|
||||||
|
$this->setLayoutFile("popup_layout");
|
||||||
|
}
|
||||||
|
|
||||||
if($this->config->enable_friend == 'N')
|
if($this->config->enable_friend == 'N')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
<load target="filter/add_friend.xml" />
|
<load target="filter/add_friend.xml" />
|
||||||
<load target="css/communication.css" />
|
<load target="css/communication.css" />
|
||||||
<load target="js/communication.js" />
|
<load target="js/communication.js" />
|
||||||
|
|
||||||
|
<!--@if(isset($window_type) && $window_type === 'self')-->
|
||||||
|
<include target="./common_header.html" />
|
||||||
|
<!--@endif-->
|
||||||
|
|
||||||
<div class="xc">
|
<div class="xc">
|
||||||
<h1>{$lang->cmd_add_friend}</h1>
|
<h1>{$lang->cmd_add_friend}</h1>
|
||||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/communication/skins/default/add_friend/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/communication/skins/default/add_friend/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
|
|
@ -11,6 +16,7 @@
|
||||||
<input type="hidden" name="act" value="procCommunicationAddFriend" />
|
<input type="hidden" name="act" value="procCommunicationAddFriend" />
|
||||||
<input type="hidden" name="target_srl" value="{$target_info->member_srl}" />
|
<input type="hidden" name="target_srl" value="{$target_info->member_srl}" />
|
||||||
<input type="hidden" name="xe_validator_id" value="modules/communication/skins/default/add_friend/1" />
|
<input type="hidden" name="xe_validator_id" value="modules/communication/skins/default/add_friend/1" />
|
||||||
|
<input type="hidden" name="window_type" value="{escape($window_type ?? '')}" />
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{$lang->nick_name}</th>
|
<th scope="row">{$lang->nick_name}</th>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
<load target="css/communication.css" />
|
<load target="css/communication.css" />
|
||||||
<load target="js/communication.js" />
|
<load target="js/communication.js" />
|
||||||
|
|
||||||
|
<!--@if(isset($window_type) && $window_type === 'self')-->
|
||||||
|
<include target="./common_header.html" />
|
||||||
|
<!--@endif-->
|
||||||
|
|
||||||
<div class="xc">
|
<div class="xc">
|
||||||
<h1 style="border-bottom:1px solid #ccc">
|
<h1 style="border-bottom:1px solid #ccc">
|
||||||
<!--@if($friend_group->friend_group_srl)-->
|
<!--@if($friend_group->friend_group_srl)-->
|
||||||
|
|
@ -16,6 +21,7 @@
|
||||||
<input type="hidden" name="act" value="procCommunicationAddFriendGroup" />
|
<input type="hidden" name="act" value="procCommunicationAddFriendGroup" />
|
||||||
<input type="hidden" name="friend_group_srl" value="{$friend_group->friend_group_srl}" />
|
<input type="hidden" name="friend_group_srl" value="{$friend_group->friend_group_srl}" />
|
||||||
<input type="hidden" name="xe_validator_id" value="modules/communication/skins/default/add_friend_group/1" />
|
<input type="hidden" name="xe_validator_id" value="modules/communication/skins/default/add_friend_group/1" />
|
||||||
|
<input type="hidden" name="window_type" value="{escape($window_type ?? '')}" />
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="title" class="control-label">{$lang->msg_insert_group_name}</label>
|
<label for="title" class="control-label">{$lang->msg_insert_group_name}</label>
|
||||||
<div class="controls"><input name="title" id="title" type="text" value="{htmlspecialchars($friend_group->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}"/></div>
|
<div class="controls"><input name="title" id="title" type="text" value="{htmlspecialchars($friend_group->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}"/></div>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<span class="btn-group">
|
<span class="btn-group">
|
||||||
<button type="button" class="btn" cond="count($friend_group_list)" onclick="doRenameFriendGroup();return false;">{$lang->cmd_rename_friend_group}</button>
|
<button type="button" class="btn" cond="count($friend_group_list)" onclick="doRenameFriendGroup();return false;">{$lang->cmd_rename_friend_group}</button>
|
||||||
<button type="button" class="btn" cond="count($friend_group_list)" onclick="doDeleteFriendGroup();return false;">{$lang->cmd_delete_friend_group}</button>
|
<button type="button" class="btn" cond="count($friend_group_list)" onclick="doDeleteFriendGroup();return false;">{$lang->cmd_delete_friend_group}</button>
|
||||||
<a href="{getUrl('','module','communication','act','dispCommunicationAddFriendGroup')}" class="btn" onclick="popopen(this.href);return false;">{$lang->cmd_add_friend_group}</a>
|
<a href="{getUrl('','module','communication','act','dispCommunicationAddFriendGroup','window_type','self')}" class="btn">{$lang->cmd_add_friend_group}</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue