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
20 * This loads a smarty help file via ajax and returns as html
22 class CRM_Core_Page_Inline_Help
{
24 public function run() {
26 if (!empty($args['file']) && strpos($args['file'], '..') === FALSE) {
27 $file = $args['file'] . '.hlp';
28 $additionalTPLFile = $args['file'] . '.extra.hlp';
29 $smarty = CRM_Core_Smarty
::singleton();
30 $smarty->assign('id', $args['id']);
31 CRM_Utils_Array
::remove($args, 'file', 'class_name', 'type', 'q', 'id');
32 foreach ($args as &$arg) {
33 $arg = strip_tags($arg);
35 $smarty->assign('params', $args);
37 $output = $smarty->fetch($file);
39 if ($smarty->template_exists($additionalTPLFile)) {
40 $extraoutput .= trim($smarty->fetch($additionalTPLFile));
41 // Allow override param to replace default text e.g. {hlp id='foo' override=1}
42 if ($smarty->get_template_vars('override_help_text')) {
46 exit($output . $extraoutput);