Skip to content
Snippets Groups Projects
Commit 912a3736 authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-08-21-20-13-45

parents d4627782 3fa84c89
No related branches found
No related tags found
No related merge requests found
......@@ -100,23 +100,19 @@ class CRM_Event_Badge {
$img = get_class($this) . "." . $this->imgExtension;
}
$config = CRM_Core_Config::singleton();
$imgFile = $config->customTemplateDir . "/$path/$eventID/$img";
if (file_exists($imgFile)) {
return $imgFile;
}
$imgFile = $config->customTemplateDir . "/$path/$img";
if (file_exists($imgFile)) {
return $imgFile;
}
$imgFile = "$civicrm_root/templates/$path/$eventID/$img";
if (file_exists($imgFile)) {
return $imgFile;
}
$imgFile = "$civicrm_root/templates/$path/$img";
if (!file_exists($imgFile) && !$this->debug) {
return FALSE;
// CRM-13235 - leverage the Smarty path to get all templates directories
$template = CRM_Core_Smarty::singleton();
if (isset($template->template_dir) && $template->template_dir) {
$dirs = is_array( $template->template_dir ) ? $template->template_dir : array($template->template_dir);
foreach ($dirs as $dir) {
foreach (array( "$dir/$path/$eventID/$img", "$dir/$path/$img") as $imgFile) {
if (file_exists($imgFile)) {
return $imgFile;
}
}
}
} else {
$imgFile = 'No template directories defined anywhere??';
}
// not sure it exists, but at least will display a meaniful fatal error in debug mode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment