2007-12-04 10:35:25 +00:00
|
|
|
<?php
|
|
|
|
global $CFG;
|
|
|
|
require_once("$CFG->libdir/form/submit.php");
|
|
|
|
class MoodleQuickForm_submitlink extends MoodleQuickForm_submit {
|
|
|
|
var $_js;
|
|
|
|
var $_onclick;
|
2009-06-07 09:43:27 +00:00
|
|
|
function MoodleQuickForm_submitlink($elementName=null, $value=null, $attributes=null) {
|
|
|
|
parent::MoodleQuickForm_submit($elementName, $value, $attributes);
|
|
|
|
}
|
2009-11-01 11:42:23 +00:00
|
|
|
|
2007-12-04 10:35:25 +00:00
|
|
|
function toHtml() {
|
|
|
|
$text = $this->_attributes['value'];
|
|
|
|
$onmouseover = "window.status=\'" . $text . "\';";
|
2009-11-01 11:42:23 +00:00
|
|
|
$onmouseout = "window.status=\'\';";
|
2007-12-04 10:35:25 +00:00
|
|
|
|
2010-10-13 17:35:21 +00:00
|
|
|
return "<noscript><div>" . parent::toHtml() . '</div></noscript><script type="text/javascript">' . $this->_js . "\n"
|
2009-11-01 11:42:23 +00:00
|
|
|
. 'document.write(\'<a href="#" onclick="' . $this->_onclick . '" onmouseover="' . $onmouseover . '" onmouseout="' . $onmouseout . '">'
|
2007-12-04 10:35:25 +00:00
|
|
|
. $text . "</a>');\n</script>";
|
|
|
|
}
|
|
|
|
}
|