Merge pull request #3837 from eileenmcnaughton/CRM-15113
[civicrm-core.git] / CRM / Core / Smarty / plugins / function.help.php
index b3e79bb53008432defb1606e257f191aaa884941..f369d6d01118b9d59e483e422bc38dd6d19b3694 100644 (file)
@@ -51,7 +51,7 @@ function smarty_function_help($params, &$smarty) {
     $params['file'] = $smarty->_tpl_vars['tplFile'];
   }
   elseif (empty($params['file'])) {
-    return $help;
+    return NULL;
   }
 
   $params['file'] = str_replace(array('.tpl', '.hlp'), '', $params['file']);
@@ -61,11 +61,16 @@ function smarty_function_help($params, &$smarty) {
     $oldID = $smarty->get_template_vars('id');
     $smarty->assign('id', $params['id'] . '-title');
     $name = trim($smarty->fetch($params['file'] . '.hlp'));
+    $additionalTPLFile = $params['file'] . '.extra.hlp';
+    if ($smarty->template_exists($additionalTPLFile)) {
+      $name .= trim($smarty->fetch($additionalTPLFile));
+    }
     $smarty->assign('id', $oldID);
   }
   else {
     $name = trim(strip_tags($params['title']));
   }
+
   // Escape for html
   $title = htmlspecialchars(ts('%1 Help', array(1 => $name)));
   // Escape for html and js