+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/
else {
$this->template_dir = $config->templateDir;
}
- $this->compile_dir = $config->templateCompileDir;
+ $this->compile_dir = CRM_Utils_File::addTrailingSlash(CRM_Utils_File::addTrailingSlash($config->templateCompileDir) . $this->getLocale());
+ CRM_Utils_File::createDir($this->compile_dir);
+ CRM_Utils_File::restrictAccess($this->compile_dir);
// check and ensure it is writable
// else we sometime suppress errors quietly and this results
}
}
+ $smartyDir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'packages' . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR;
+ $pluginsDir = __DIR__ . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR;
+
if ($customPluginsDir) {
- $this->plugins_dir = array($customPluginsDir, $config->smartyDir . 'plugins', $config->pluginsDir);
+ $this->plugins_dir = array($customPluginsDir, $smartyDir . 'plugins', $pluginsDir);
}
else {
- $this->plugins_dir = array($config->smartyDir . 'plugins', $config->pluginsDir);
+ $this->plugins_dir = array($smartyDir . 'plugins', $pluginsDir);
}
// add the session and the config here
return $this;
}
+ private function getLocale() {
+ global $tsLocale;
+ if (!empty($tsLocale)) {
+ return $tsLocale;
+ }
+
+ $config = CRM_Core_Config::singleton();
+ if (!empty($config->lcMessages)) {
+ return $config->lcMessages;
+ }
+
+ return 'en_US';
+ }
+
}