From 756847df52a8dddf86bcca08207bdc7653162163 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 27 Sep 2015 18:29:35 -0400 Subject: [PATCH] CRM_Contact_BAO_Contact::getRelativePath - Remove dead code --- CRM/Contact/BAO/Contact.php | 41 ------------------------------------- 1 file changed, 41 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 2902689de1..bc44a92bc6 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -928,47 +928,6 @@ WHERE id={$id}; "; return TRUE; } - /** - * Return relative path. - * - * @todo make this a method of $config->userSystem (i.e. UF classes) rather than a static function - * - * @param string $absolutePath - * Absolute path. - * - * @return string - * Relative url of uploaded image - */ - public static function getRelativePath($absolutePath) { - $relativePath = NULL; - $config = CRM_Core_Config::singleton(); - if ($config->userFramework == 'Joomla') { - $userFrameworkBaseURL = trim(str_replace('/administrator/', '', $config->userFrameworkBaseURL)); - $customFileUploadDirectory = strstr(str_replace('\\', '/', $absolutePath), '/media'); - $relativePath = $userFrameworkBaseURL . $customFileUploadDirectory; - } - elseif ($config->userSystem->is_drupal == '1') { - //ideally we would do a bigger re-factoring & move the getRelativePath onto the UF class - $rootPath = $config->userSystem->cmsRootPath(); - $baseUrl = $config->userFrameworkBaseURL; - - //format url for language negotiation, CRM-7135 - $baseUrl = CRM_Utils_System::languageNegotiationURL($baseUrl, FALSE, TRUE); - - $relativePath = str_replace("{$rootPath}/", - $baseUrl, - str_replace('\\', '/', $absolutePath) - ); - } - elseif ($config->userFramework == 'WordPress') { - $userFrameworkBaseURL = trim(str_replace('/wp-admin/', '', $config->userFrameworkBaseURL)); - $customFileUploadDirectory = strstr(str_replace('\\', '/', $absolutePath), '/wp-content/'); - $relativePath = $userFrameworkBaseURL . $customFileUploadDirectory; - } - - return $relativePath; - } - /** * Return proportional height and width of the image. * -- 2.25.1