瀏覽代碼

Merge pull request #865 from Arantor/release-2.1

More minor mischief managed
Arantor 11 年之前
父節點
當前提交
369ee1ee38
共有 5 個文件被更改,包括 16 次插入39 次删除
  1. 12 2
      Sources/PersonalMessage.php
  2. 0 22
      Sources/Profile-Modify.php
  3. 1 14
      Sources/Profile.php
  4. 3 0
      Sources/Subs.php
  5. 0 1
      Themes/default/languages/Profile.english.php

+ 12 - 2
Sources/PersonalMessage.php

@@ -3091,6 +3091,8 @@ function MessageSettings()
 	loadLanguage('Profile');
 	loadTemplate('Profile');
 
+	// Since this is internally handled with the profile code because that's how it was done ages ago
+	// we have to set everything up for handling this...
 	$context['page_title'] = $txt['pm_settings'];
 	$context['user']['is_owner'] = true;
 	$context['id_member'] = $user_info['id'];
@@ -3098,6 +3100,11 @@ function MessageSettings()
 	$context['menu_item_selected'] = 'settings';
 	$context['submit_button_text'] = $txt['pm_settings'];
 	$context['profile_header_text'] = $txt['personal_messages'];
+	$context['sub_template'] = 'edit_options';
+	$context['page_desc'] = $txt['pm_settings_desc'];
+
+	loadThemeOptions($user_info['id']);
+	loadCustomFields($user_info['id'], 'pmprefs');
 
 	// Add our position to the linktree.
 	$context['linktree'][] = array(
@@ -3121,8 +3128,11 @@ function MessageSettings()
 			updateMemberData($user_info['id'], $profile_vars);
 	}
 
-	// Load up the fields.
-	pmprefs($user_info['id']);
+	setupProfileContext(
+		array(
+			'pm_prefs',
+		)
+	);
 }
 
 /**

+ 0 - 22
Sources/Profile-Modify.php

@@ -1618,28 +1618,6 @@ function forumProfile($memID)
 	);
 }
 
-/**
- * Allow the edit of *someone elses* personal message settings.
- *
- * @param int $memID id_member
- */
-function pmprefs($memID)
-{
-	global $sourcedir, $context, $txt, $scripturl;
-
-	loadThemeOptions($memID);
-	loadCustomFields($memID, 'pmprefs');
-
-	$context['sub_template'] = 'edit_options';
-	$context['page_desc'] = $txt['pm_settings_desc'];
-
-	setupProfileContext(
-		array(
-			'pm_prefs',
-		)
-	);
-}
-
 /**
  * Recursive function to retrieve server-stored avatar files
  *

+ 1 - 14
Sources/Profile.php

@@ -230,19 +230,6 @@ function ModifyProfile($post_errors = array())
 						'any' => array('profile_extra_any'),
 					),
 				),
-				// Without profile_extra_own, settings are accessible from the PM section.
-				'pmprefs' => array(
-					'label' => $txt['pmprefs'],
-					'file' => 'Profile-Modify.php',
-					'function' => 'pmprefs',
-					'enabled' => allowedTo(array('profile_extra_own', 'profile_extra_any')),
-					'sc' => 'post',
-					'token' => 'profile-pm%u',
-					'permission' => array(
-						'own' => array('pm_read'),
-						'any' => array('profile_extra_any'),
-					),
-				),
 				'ignoreboards' => array(
 					'label' => $txt['ignoreboards'],
 					'file' => 'Profile-Modify.php',
@@ -590,7 +577,7 @@ function ModifyProfile($post_errors = array())
 		{
 			authentication($memID, true);
 		}
-		elseif (in_array($current_area, array('account', 'forumprofile', 'theme', 'pmprefs')))
+		elseif (in_array($current_area, array('account', 'forumprofile', 'theme')))
 			saveProfileFields();
 		else
 		{

+ 3 - 0
Sources/Subs.php

@@ -4070,7 +4070,10 @@ function setupMenuContext()
 		$context['menu_buttons'][$current_action]['active_button'] = true;
 
 	if (!empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1' && $context['open_mod_reports'] > 0)
+	{
 		$context['menu_buttons']['moderate']['title'] .= ' <span class="amt">' . $context['open_mod_reports'] . '</span>';
+		$context['menu_buttons']['moderate']['sub_buttons']['reports']['title'] .= ' <span class="amt">' . $context['open_mod_reports'] . '</span>';
+	}
 
 	if (!empty($context['unapproved_members']))
 	{

+ 0 - 1
Themes/default/languages/Profile.english.php

@@ -178,7 +178,6 @@ $txt['groupmembership'] = 'Group Membership';
 $txt['groupMembership_info'] = 'In this section of your profile you can change which groups you belong to.';
 $txt['ignoreboards'] = 'Ignore Boards Options';
 $txt['ignoreboards_info'] = 'This page lets you ignore particular boards.  When a board is ignored, the new post indicator will not show up on the board index.  New posts will not show up using the "unread post" search link (when searching it will not look in those boards) however, ignored boards will still appear on the board index and upon entering will show which topics have new posts.  When using the "unread replies" link, new posts in an ignored board will still be shown.';
-$txt['pmprefs'] = 'Personal Messaging';
 
 $txt['profileAction'] = 'Actions';
 $txt['deleteAccount'] = 'Delete this account';