3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
14 * @copyright CiviCRM LLC https://civicrm.org/licensing
18 * This loads a smarty help file via ajax and returns as html
20 class CRM_Core_Page_Inline_Help
{
22 public function run() {
24 if (!empty($args['file']) && strpos($args['file'], '..') === FALSE) {
25 $file = $args['file'] . '.hlp';
26 $additionalTPLFile = $args['file'] . '.extra.hlp';
27 $smarty = CRM_Core_Smarty
::singleton();
28 $smarty->assign('id', $args['id']);
29 CRM_Utils_Array
::remove($args, 'file', 'class_name', 'type', 'q', 'id');
30 foreach ($args as &$arg) {
31 $arg = strip_tags($arg);
33 $smarty->assign('params', $args);
35 $output = $smarty->fetch($file);
37 if ($smarty->template_exists($additionalTPLFile)) {
38 $extraoutput .= trim($smarty->fetch($additionalTPLFile));
39 // Allow override param to replace default text e.g. {hlp id='foo' override=1}
40 if ($smarty->get_template_vars('override_help_text')) {
44 exit($output . $extraoutput);