From 9b591d79fb673f6215f96687d2f2ae6e32a02ac3 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 16 Jan 2015 03:34:37 -0800 Subject: [PATCH] CRM_Core_Page, CRM_Core_Form - Fix for PHP 5.3 namespaces --- CRM/Core/Form.php | 11 +++++++---- CRM/Core/Page.php | 9 ++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index b62ce0277a..64ea3867dd 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -709,10 +709,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $tplname = $ext->getTemplatePath(CRM_Utils_System::getClassName($this)) . DIRECTORY_SEPARATOR . $filename; } else { - $tplname = str_replace('_', - DIRECTORY_SEPARATOR, - CRM_Utils_System::getClassName($this) - ) . '.tpl'; + $tplname = strtr( + CRM_Utils_System::getClassName($this), + array( + '_' => DIRECTORY_SEPARATOR, + '\\' => DIRECTORY_SEPARATOR, + ) + ) . '.tpl'; } return $tplname; } diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php index d35d792434..c3e312f33d 100644 --- a/CRM/Core/Page.php +++ b/CRM/Core/Page.php @@ -332,9 +332,12 @@ class CRM_Core_Page { * @return string */ public function getTemplateFileName() { - return str_replace('_', - DIRECTORY_SEPARATOR, - CRM_Utils_System::getClassName($this) + return strtr( + CRM_Utils_System::getClassName($this), + array( + '_' => DIRECTORY_SEPARATOR, + '\\' => DIRECTORY_SEPARATOR, + ) ) . '.tpl'; } -- 2.25.1