Skip to content
Snippets Groups Projects
Commit 81733948 authored by Dave Greenberg's avatar Dave Greenberg
Browse files

CRM-13235

----------------------------------------
* CRM-13235: Custom event name badges cannot be created as extensions
  http://issues.civicrm.org/jira/browse/CRM-13235
parent dce95f9e
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