ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTextHighlighterGUI Class Reference

Text highlighter. More...

+ Collaboration diagram for ilTextHighlighterGUI:

Static Public Member Functions

static highlight ($a_dom_node_id, $a_text, $a_tpl=null)
 Searches for all occurences of a text (case-insensitive) and highlights it. More...
 

Detailed Description

Text highlighter.

Definition at line 7 of file class.ilTextHighlighterGUI.php.

Member Function Documentation

◆ highlight()

static ilTextHighlighterGUI::highlight (   $a_dom_node_id,
  $a_text,
  $a_tpl = null 
)
static

Searches for all occurences of a text (case-insensitive) and highlights it.

Definition at line 12 of file class.ilTextHighlighterGUI.php.

References $tpl.

Referenced by ilLMPresentationGUI\ilPage(), ilGlossaryPresentationGUI\listDefinitions(), and ilWikiPageGUI\preview().

13  {
14  global $tpl;
15 
16  if(!trim($a_text))
17  {
18  return;
19  }
20 
21  if ($a_tpl == null)
22  {
23  $a_tpl = $tpl;
24  }
25  $a_tpl->addJavascript("./Services/UIComponent/TextHighlighter/js/ilTextHighlighter.js");
26  $a_tpl->addOnLoadCode("il.TextHighlighter.highlight('".$a_dom_node_id."','".$a_text."');");
27  }
global $tpl
Definition: ilias.php:8
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: