From e34624947f2b65840f35b00eeb3a1d0550f23126 Mon Sep 17 00:00:00 2001
From: Damien Regad <dregad@mantisbt.org>
Date: Wed, 12 May 2021 08:06:11 +0200
Subject: [PATCH] Remove custom plugin_lang_get_defaulted()

Function was introduced in #215 to fix the problem in the plugin, until
the update was implemented in MantisBT core (which happened in 2.24.0).

Fixes #339
---
 Source/Source.API.php | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/Source/Source.API.php b/Source/Source.API.php
index d689bf1..2d07f4f 100644
--- a/Source/Source.API.php
+++ b/Source/Source.API.php
@@ -10,33 +10,6 @@ require_once( 'MantisSourcePlugin.class.php' );
  * @author John Reese
  */
 
-if (!function_exists('plugin_lang_get_defaulted')) {
-	/**
-	 * Get a language string for the plugin.
-	 * - If found, return the appropriate string.
-	 * - If not found, no default supplied, return the supplied string as is.
-	 * - If not found, default supplied, return default.
-	 * Automatically prepends plugin_<basename> to the string requested.
-	 * @param string $p_name     Language string name.
-	 * @param string $p_default  The default value to return.
-	 * @param string $p_basename Plugin basename.
-	 * @return string Language string
-	 */
-	function plugin_lang_get_defaulted( $p_name, $p_default = null, $p_basename = null ) {
-		if( !is_null( $p_basename ) ) {
-			plugin_push_current( $p_basename );
-		}
-		$t_basename = plugin_get_current();
-		$t_name = 'plugin_' . $t_basename . '_' . $p_name;
-		$t_string = lang_get_defaulted( $t_name, $p_default );
-
-		if( !is_null( $p_basename ) ) {
-			plugin_pop_current();
-		}
-		return $t_string;
-	}
-}
-
 # branch mapping strategies
 define( 'SOURCE_EXPLICIT',		1 );
 define( 'SOURCE_NEAR',			2 );
-- 
GitLab