_tpl_vars['config'])) { return NULL; } if (empty($params['file']) && isset($smarty->_tpl_vars['tplFile'])) { $params['file'] = $smarty->_tpl_vars['tplFile']; } elseif (empty($params['file'])) { return NULL; } $params['file'] = str_replace(array('.tpl', '.hlp'), '', $params['file']); if (empty($params['title'])) { $vars = $smarty->get_template_vars(); $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)); } // Ensure we didn't change any existing vars CRM-11900 foreach ($vars as $key => $value) { if ($smarty->get_template_vars($key) !== $value) { $smarty->assign($key, $value); } } } else { $name = trim(strip_tags($params['title'])); } $class = "helpicon"; if (!empty($params['class'])) { $class .= " {$params['class']}"; } // Escape for html $title = htmlspecialchars(ts('%1 Help', array(1 => $name))); // Escape for html and js $name = htmlspecialchars(json_encode($name), ENT_QUOTES); // Format params to survive being passed through json & the url unset($params['text'], $params['title']); foreach ($params as &$param) { $param = is_bool($param) || is_numeric($param) ? (int) $param : (string) $param; } return ' '; }