1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 15:16:16 +02:00

Merge pull request #1854 from Pico88/ticket/12005

[ticket/12005] Remove code responsible for PM popup completely
This commit is contained in:
Nathan Guse 2013-11-21 14:01:23 -08:00
commit df7fa8e499
12 changed files with 43 additions and 109 deletions

View File

@ -39,11 +39,6 @@
<dd><label><input type="radio" class="radio" name="notifypm" value="1"<!-- IF NOTIFY_PM --> id="notifypm" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="notifypm" value="0"<!-- IF not NOTIFY_PM --> id="notifypm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="popuppm">{L_POPUP_ON_PM}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="popuppm" value="1"<!-- IF POPUP_PM --> id="popuppm" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="popuppm" value="0"<!-- IF not POPUP_PM --> id="popuppm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="lang">{L_BOARD_LANGUAGE}{L_COLON}</label></dt>
<dd><select id="lang" name="lang">{S_LANG_OPTIONS}</select></dd>

View File

@ -1512,7 +1512,6 @@ class acp_users
'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']),
'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']),
'notifypm' => request_var('notifypm', $user_row['user_notify_pm']),
'popuppm' => request_var('popuppm', $this->optionget($user_row, 'popuppm')),
'allowpm' => request_var('allowpm', $user_row['user_allow_pm']),
'topic_sk' => request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'),
@ -1556,7 +1555,6 @@ class acp_users
if (!sizeof($error))
{
$this->optionset($user_row, 'popuppm', $data['popuppm']);
$this->optionset($user_row, 'viewimg', $data['view_images']);
$this->optionset($user_row, 'viewflash', $data['view_flash']);
$this->optionset($user_row, 'viewsmilies', $data['view_smilies']);
@ -1699,7 +1697,6 @@ class acp_users
'NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false,
'NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false,
'NOTIFY_PM' => $data['notifypm'],
'POPUP_PM' => $data['popuppm'],
'BBCODE' => $data['bbcode'],
'SMILIES' => $data['smilies'],
'ATTACH_SIG' => $data['sig'],

View File

@ -5358,7 +5358,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=popup'),
'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '',
'U_LOGIN_LOGOUT' => $u_login_logout,
@ -5386,7 +5385,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false,
'S_REGISTERED_USER' => (!empty($user->data['is_registered'])) ? true : false,
'S_IS_BOT' => (!empty($user->data['is_bot'])) ? true : false,
'S_USER_PM_POPUP' => $user->optionget('popuppm'),
'S_USER_LANG' => $user_lang,
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
'S_USERNAME' => $user->data['username'],

View File

@ -1027,7 +1027,6 @@ function set_user_options()
'attachsig' => array('bit' => 6, 'default' => 0),
'bbcode' => array('bit' => 8, 'default' => 1),
'smilies' => array('bit' => 9, 'default' => 1),
'popuppm' => array('bit' => 10, 'default' => 0),
'sig_bbcode' => array('bit' => 15, 'default' => 1),
'sig_smilies' => array('bit' => 16, 'default' => 1),
'sig_links' => array('bit' => 17, 'default' => 1),

View File

@ -22,7 +22,6 @@ class ucp_pm_info
'compose' => array('title' => 'UCP_PM_COMPOSE', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
'drafts' => array('title' => 'UCP_PM_DRAFTS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
'options' => array('title' => 'UCP_PM_OPTIONS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
'popup' => array('title' => 'UCP_PM_POPUP_TITLE', 'auth' => 'cfg_allow_privmsg', 'display' => false, 'cat' => array('UCP_PM')),
),
);
}

View File

@ -83,33 +83,6 @@ class ucp_pm
switch ($mode)
{
// New private messages popup
case 'popup':
$l_new_message = '';
if ($user->data['is_registered'])
{
if ($user->data['user_new_privmsg'])
{
$l_new_message = ($user->data['user_new_privmsg'] == 1) ? $user->lang['YOU_NEW_PM'] : $user->lang['YOU_NEW_PMS'];
}
else
{
$l_new_message = $user->lang['YOU_NO_NEW_PM'];
}
}
$template->assign_vars(array(
'MESSAGE' => $l_new_message,
'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false,
'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox') . '" onclick="jump_to_inbox(this.href); return false;">', '</a>'),
'U_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
'UA_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox', false))
);
$tpl_file = 'ucp_pm_popup';
break;
// Compose message
case 'compose':
$action = request_var('action', 'post');

View File

@ -153,7 +153,6 @@ $lang = array_merge($lang, array(
1 => '%d character',
2 => '%d characters',
),
'CLICK_VIEW_PRIVMSG' => '%sGo to your inbox%s',
'COLLAPSE_VIEW' => 'Collapse view',
'CLOSE_WINDOW' => 'Close window',
'COLOUR_SWATCH' => 'Colour swatch',
@ -839,9 +838,6 @@ $lang = array_merge($lang, array(
'YES' => 'Yes',
'YIM' => 'YIM',
'YOU_LAST_VISIT' => 'Last visit was: %s',
'YOU_NEW_PM' => 'A new private message is waiting for you in your Inbox.',
'YOU_NEW_PMS' => 'New private messages are waiting for you in your Inbox.',
'YOU_NO_NEW_PM' => 'No new private messages are waiting for you.',
'datetime' => array(
'TODAY' => 'Today',

View File

@ -409,7 +409,6 @@ $lang = array_merge($lang, array(
'PM_SUBJECT' => 'Message subject',
'PM_TO' => 'Send to',
'PM_USERS_REMOVED_NO_PM' => 'Some users couldnt be added as they have disabled private message receipt.',
'POPUP_ON_PM' => 'Pop up window on new private message',
'POST_EDIT_PM' => 'Edit message',
'POST_FORWARD_PM' => 'Forward message',
'POST_NEW_PM' => 'Compose message',
@ -521,8 +520,6 @@ $lang = array_merge($lang, array(
'UCP_PM_COMPOSE' => 'Compose message',
'UCP_PM_DRAFTS' => 'Manage PM drafts',
'UCP_PM_OPTIONS' => 'Rules, folders &amp; settings',
'UCP_PM_POPUP' => 'Private messages',
'UCP_PM_POPUP_TITLE' => 'Private message popup',
'UCP_PM_UNREAD' => 'Unread messages',
'UCP_PM_VIEW' => 'View messages',

View File

@ -0,0 +1,42 @@
<?php
/**
*
* @package migration
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace phpbb\db\migration\data\v310;
class ucp_popuppm_module extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
$sql = 'SELECT module_id
FROM ' . MODULES_TABLE . "
WHERE module_class = 'ucp'
AND module_langname = 'UCP_PM_POPUP_TITLE'";
$result = $this->db->sql_query($sql);
$module_id = $this->db->sql_fetchfield('module_id');
$this->db->sql_freeresult($result);
return $module_id == false;
}
static public function depends_on()
{
return array('\phpbb\db\migration\data\v310\dev');
}
public function update_data()
{
return array(
array('module.remove', array(
'ucp',
'UCP_PM',
'UCP_PM_POPUP_TITLE',
)),
);
}
}

View File

@ -36,7 +36,7 @@ class user extends \phpbb\session
var $img_array = array();
// Able to add new options (up to id 31)
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
/**
* Constructor to set the lang path

View File

@ -1,25 +0,0 @@
<!-- INCLUDE simple_header.html -->
<script type="text/javascript">
// <![CDATA[
/**
* Jump to inbox
*/
function jump_to_inbox(url)
{
opener.document.location.href = url.replace(/&amp;/g, '&');
window.close();
}
// ]]>
</script>
<div class="panel">
<div class="inner">
<div class="content">
<p><!-- IF S_NOT_LOGGED_IN -->{L_LOGIN_CHECK_PM}<!-- ELSE -->{MESSAGE}<br /><br />{CLICK_TO_VIEW}<!-- ENDIF --></p>
<p class="small"><a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></p>
</div>
</div>
</div>
<!-- INCLUDE simple_footer.html -->

View File

@ -1,37 +0,0 @@
<!-- INCLUDE simple_header.html -->
<script type="text/javascript">
// <![CDATA[
/**
* Jump to inbox
*/
function jump_to_inbox(url)
{
opener.document.location.href = url.replace(/&amp;/g, '&');
window.close();
}
// ]]>
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="4" class="tablebg">
<tr class="row1">
<td valign="top" align="center">
<br /><span class="gen">
<!-- IF S_NOT_LOGGED_IN -->
{L_LOGIN_CHECK_PM}
<!-- ELSE -->
{MESSAGE}<br /><br />{CLICK_TO_VIEW}
<!-- ENDIF -->
</span>
<br /><br /><span class="genmed"><a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></span><br /><br />
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- INCLUDE simple_footer.html -->