',
$hreftagend='',
$casesensitive=false,
$fullmatch=false,
$replacementphrase=NULL) {
$this->phrase = $phrase;
$this->hreftagbegin = $hreftagbegin;
$this->hreftagend = $hreftagend;
$this->casesensitive = $casesensitive;
$this->fullmatch = $fullmatch;
$this->replacementphrase= $replacementphrase;
$this->work_calculated = false;
}
}
/**
* Process phrases intelligently found within a HTML text (such as adding links)
*
* param text the text that we are filtering
* param link_array an array of filterobjects
* param ignoretagsopen an array of opening tags that we should ignore while filtering
* param ignoretagsclose an array of corresponding closing tags
**/
function filter_phrases ($text, &$link_array, $ignoretagsopen=NULL, $ignoretagsclose=NULL) {
global $CFG;
static $usedphrases;
$ignoretags = array(); //To store all the enclosig tags to be completely ignored
$tags = array(); //To store all the simple tags to be ignored
/// A list of open/close tags that we should not replace within
/// No reason why you can't put full preg expressions in here too
/// eg '";
if (stripos($text, '') !== FALSE) {
//try to add it into the head element
$text = str_ireplace('', $js.'', $text);
return $text;
}
//last chance - try adding head element
return preg_replace("//is", "\\0".$js.'', $text);
}
?>