/** * fix_bodycontent */ function fix_bodycontent() { // remove instructions if they are not required $search = '/\\s*<div id="InstructionsDiv" class="StdDiv">\\s*<div id="Instructions">\\s*<\\/div>\\s*<\\/div>/s'; $this->bodycontent = preg_replace($search, '', $this->bodycontent, 1); parent::fix_bodycontent(); }
/** * fix_bodycontent */ function fix_bodycontent() { // switch off auto complete on Rhubarb text boxes $search = '/<form id="Rhubarb"([^>]*)>/'; if (preg_match($search, $this->bodycontent, $matches, PREG_OFFSET_CAPTURE)) { $match = $matches[1][0]; $start = $matches[1][1]; if (strpos($match, 'autocomplete') === false) { $this->bodycontent = substr_replace($this->bodycontent, $match . ' autocomplete="off"', $start, strlen($match)); } } parent::fix_bodycontent(); }
/** * fix_bodycontent */ function fix_bodycontent() { // switch off auto complete on short answer text boxes $search = '/<div class="ShortAnswer"[^>]*><form([^>]*)>/'; if (preg_match_all($search, $this->bodycontent, $matches, PREG_OFFSET_CAPTURE)) { $i_max = count($matches[0]) - 1; for ($i = $i_max; $i >= 0; $i--) { list($match, $start) = $matches[1][$i]; if (strpos($match, 'autocomplete') === false) { $start += strlen($match); $this->bodycontent = substr_replace($this->bodycontent, ' autocomplete="off"', $start, 0); } } } parent::fix_bodycontent(); }
/** * fix_bodycontent * * @return xxx */ function fix_bodycontent() { // we must add a false return value to clue links in order not to trigger the onbeforeunload event handler $search = '/(?<=' . '<a href="javascript:void\\(0\\);" class="GridNum" onclick="' . ')' . 'ShowClue\\([^)]*\\)' . '(?=' . '">' . ')/'; $replace = '$0; return false;'; $this->bodycontent = preg_replace($search, $replace, $this->bodycontent); parent::fix_bodycontent(); }