Переглянути джерело

Clean more $modSettings['custom_avatar_enabled'] leftovers

Signed-off-by: Suki <[email protected]>
Suki 10 роки тому
батько
коміт
59e7294175

+ 1 - 1
Sources/ManageAttachments.php

@@ -278,7 +278,7 @@ function ManageAvatarSettings($return_config = false)
 	$testImg = get_extension_funcs('gd') || class_exists('Imagick');
 
 	$context['valid_avatar_dir'] = is_dir($modSettings['avatar_directory']);
-	$context['valid_custom_avatar_dir'] = empty($modSettings['custom_avatar_enabled']) || (!empty($modSettings['custom_avatar_dir']) && is_dir($modSettings['custom_avatar_dir']) && is_writable($modSettings['custom_avatar_dir']));
+	$context['valid_custom_avatar_dir'] = !empty($modSettings['custom_avatar_dir']) && is_dir($modSettings['custom_avatar_dir']) && is_writable($modSettings['custom_avatar_dir']);
 
 	$config_vars = array(
 		// Server stored avatars!

+ 2 - 7
Sources/Profile-Modify.php

@@ -2877,12 +2877,7 @@ function profileSaveAvatarData(&$value)
 	require_once($sourcedir . '/ManageAttachments.php');
 
 	// We need to know where we're going to be putting it..
-	if (!empty($modSettings['custom_avatar_enabled']))
-	{
-		$uploadDir = $modSettings['custom_avatar_dir'];
-		$id_folder = 1;
-	}
-	elseif (!empty($modSettings['currentAttachmentUploadDir']))
+	if (!empty($modSettings['currentAttachmentUploadDir']))
 	{
 		if (!is_array($modSettings['attachmentUploadDir']))
 			$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
@@ -2893,7 +2888,7 @@ function profileSaveAvatarData(&$value)
 	}
 	else
 	{
-		$uploadDir = $modSettings['attachmentUploadDir'];
+		$uploadDir = $modSettings['custom_avatar_dir'];
 		$id_folder = 1;
 	}
 

+ 0 - 2
Themes/default/ManageAttachments.template.php

@@ -24,8 +24,6 @@ function template_avatar_settings_below()
 		document.getElementById("avatar_max_width_external").disabled = document.getElementById("avatar_download_external").checked;
 		document.getElementById("avatar_max_height_external").disabled = document.getElementById("avatar_download_external").checked;
 		document.getElementById("avatar_action_too_large").disabled = document.getElementById("avatar_download_external").checked;
-		document.getElementById("custom_avatar_dir").disabled = document.getElementById("custom_avatar_enabled").value == 0;
-		document.getElementById("custom_avatar_url").disabled = document.getElementById("custom_avatar_enabled").value == 0;
 
 	}
 	addLoadEvent(fUpdateStatus);

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

@@ -466,7 +466,6 @@ $txt['avatar_upload_groups'] = 'Membergroups allowed to upload an avatar to the
 $txt['avatar_external_url_groups'] = 'Membergroups allowed to select an external URL';
 $txt['avatar_select_permission'] = 'Select permissions for each group';
 $txt['avatar_download_external'] = 'Download avatar at given URL';
-$txt['custom_avatar_enabled'] = 'Upload avatars to...';
 $txt['option_attachment_dir'] = 'Attachment directory';
 $txt['option_specified_dir'] = 'Specific directory...';
 $txt['custom_avatar_dir'] = 'Upload directory';