CRM_Core_Page, CRM_Core_Form - Fix for PHP 5.3 namespaces
authorTim Otten <totten@civicrm.org>
Fri, 16 Jan 2015 11:34:37 +0000 (03:34 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 17 Jan 2015 12:16:06 +0000 (04:16 -0800)
CRM/Core/Form.php
CRM/Core/Page.php

index b62ce0277ac259aba68049bd4ffbfb17e5e0cec5..64ea3867ddf5d5a77a4ea0e99d3a56166d5a8e43 100644 (file)
@@ -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;
   }
index d35d792434ad44e9e3ba1aa40432a038bd2068a5..c3e312f33d0cd801b31ab05bec53a8ea2ac2389b 100644 (file)
@@ -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';
   }