Skip to content

Commit

Permalink
add extra parameter to "hotpot_print_show_links" function so that lin…
Browse files Browse the repository at this point in the history
…ks can be printed (the default action) or returned to the calling function as a string
  • Loading branch information
gbateson committed Aug 1, 2007
1 parent 620aca0 commit 1094f06
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions mod/hotpot/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,7 @@ function hotpot_utf8_to_html_entity($char) {
return '&#x'.sprintf('%04X', $dec).';';
}

function hotpot_print_show_links($course, $location, $reference, $actions='', $spacer='   ', $new_window=false) {
function hotpot_print_show_links($course, $location, $reference, $actions='', $spacer='   ', $new_window=false, $return=false) {
global $CFG;
if (is_string($actions)) {
if (empty($actions)) {
Expand All @@ -2355,7 +2355,12 @@ function hotpot_print_show_links($course, $location, $reference, $actions='', $s
<script type="text/javascript">
//<![CDATA[
function setLink(lnk) {
var form = document.forms['form'];
var form = null;
if (document.forms['mform1']) {
var form = document.forms['mform1'];
} else if (document.forms['form']) {
var form = document.forms['form'];
}
return setLinkAttribute(lnk, 'reference', form) && setLinkAttribute(lnk, 'location', form);
}
function setLinkAttribute(lnk, name, form) {
Expand Down Expand Up @@ -2426,7 +2431,12 @@ function getDir(s) {
. '>'.get_string($action, 'hotpot').'</a>'
;
}
print '<span class="helplink">'.$html.'</span>';
$html = '<span class="helplink">'.$html.'</span>';
if ($return) {
return $html;
} else {
print $html;
}
}

?>

0 comments on commit 1094f06

Please sign in to comment.