Example #1
0
File: Email.php Project: saiber/www
 protected function getTemplatePath($templateFile)
 {
     if (!file_exists($templateFile)) {
         $locale = $this->getLocale();
         // find the email template file
         if (substr($templateFile, 0, 7) == 'module/') {
             $parts = explode('/', $templateFile, 3);
             $module = $parts[1];
             $path = $parts[2];
             $paths = array('storage.customize.view.email.' . $locale . '.' . $templateFile, 'module.' . $module . '.application.view.email.' . $locale . '.' . $path, 'storage.customize.view.email.en.' . $templateFile, 'module.' . $module . '.application.view.email.en.' . $path);
         } else {
             $paths = array('storage.customize.view.email.' . $locale . '.' . $templateFile, 'application.view.email.' . $locale . '.' . $templateFile, 'storage.customize.view.email.en.' . $templateFile, 'application.view.email.en.' . $templateFile);
         }
         foreach ($paths as $path) {
             $templateFile = array_shift(ClassLoader::mapToMountPoint($path)) . '.tpl';
             if (file_exists($templateFile)) {
                 break;
             }
         }
         if (!file_exists($templateFile)) {
             return false;
         }
     }
     return $templateFile;
 }