timeline: if a section is set to hidden and the user is not capable of editing a...
[moodle-blog-course-format.git] / lib / form / submitlink.php
blobe549ea9c2fdcdccb6edf17167571440eb26e7bdc
1 <?php
2 global $CFG;
3 require_once("$CFG->libdir/form/submit.php");
4 class MoodleQuickForm_submitlink extends MoodleQuickForm_submit {
5 var $_js;
6 var $_onclick;
7 function MoodleQuickForm_submitlink($elementName=null, $value=null, $attributes=null) {
8 parent::MoodleQuickForm_submit($elementName, $value, $attributes);
11 function toHtml() {
12 $text = $this->_attributes['value'];
13 $onmouseover = "window.status=\'" . $text . "\';";
14 $onmouseout = "window.status=\'\';";
16 return "<noscript>" . parent::toHtml() . '</noscript><script type="text/javascript">' . $this->_js . "\n"
17 . 'document.write(\'<a href="#" onclick="' . $this->_onclick . '" onmouseover="' . $onmouseover . '" onmouseout="' . $onmouseout . '">'
18 . $text . "</a>');\n</script>";