diff --git a/lib/navigationlib.php b/lib/navigationlib.php index dadd5a827b9..d8ca6f39982 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -402,48 +402,53 @@ class navigation_node { return ''; } if ($shorttext && $this->shorttext!==null) { - $content = clean_text($this->shorttext); + $content = format_string($this->shorttext); } else { - $content = clean_text($this->text); + $content = format_string($this->text); } $title = ''; if ($this->forcetitle || ($this->shorttext!==null && $this->title !== $this->shorttext) || $this->title !== $this->text) { $title = $this->title; } - if ($this->icon!==null) { + if ($this->icon !== null) { $icon = $OUTPUT->pix_icon($this->icon, '', 'moodle', array('class'=>'icon')); $content = $icon.$content; // use CSS for spacing of icons - } else if ($this->helpbutton!==null) { - $content = sprintf('%s%s',trim($this->helpbutton),$content); + } else if ($this->helpbutton !== null) { + $content = sprintf('%s%s', trim($this->helpbutton), $content); } - if ($content != '' && ((is_object($this->action) && ($this->action instanceof moodle_url || $this->action instanceof html_link)) || is_string($this->action))) { - if (!($this->action instanceof html_link)) { - $link = new html_link(); - $link->url = $this->action; - $link->text = clean_text($content); - } else { - $link = $this->action; - } - if ($title !== '') { - $link->title = $title; - } + if ($content === '') { + return ''; + } + + if ($this->action instanceof html_link) { + //TODO: to be replaced with something else + $link = $this->action; if ($this->hidden) { $link->add_class('dimmed'); } $content = $OUTPUT->link($link); - } else { - $span = new html_span(); - $span->contents = $content; + } else if ($this->action instanceof moodle_url) { + $attributes = array(); if ($title !== '') { - $span->title = $title; + $attributes['title'] = $title; } if ($this->hidden) { - $span->add_class('dimmed_text'); + $attributes['class'] = 'dimmed_text'; } - $content = $OUTPUT->span($span); + $content = html_writer::link($this->action, $content, $attributes); + + } else if (is_string($this->action)) { + $attributes = array(); + if ($title !== '') { + $attributes['title'] = $title; + } + if ($this->hidden) { + $attributes['class'] = 'dimmed_text'; + } + $content = html_writer::tag('span', $attributes, $content); } return $content; diff --git a/lib/weblib.php b/lib/weblib.php index 2bb55d9215d..bc0774df59a 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2470,7 +2470,7 @@ function modgradehelpbutton($courseid){ $text = '' . get_string('scales') . ''; $action = new popup_action('click', $link->url, 'ratingscales', array('height' => 400, 'width' => 500)); - return $OUTPUT->link($url, $text, $action, array('title'=>get_string('newwindow'))); + return $OUTPUT->action_link($url, $text, $action, array('title'=>get_string('newwindow'))); } /** diff --git a/message/lib.php b/message/lib.php index 6f17da94d2a..f56a25c3e98 100644 --- a/message/lib.php +++ b/message/lib.php @@ -361,10 +361,9 @@ function message_print_search_results($frm) { 'scrollbars' => true, 'resizable' => true); - $link = html_link::make("/message/discussion.php?id=$user->id", fullname($user)); - $link->add_action(new popup_action('click', $link->url, "message_$user->id", $popupoptions)); - $link->title = get_string('sendmessageto', 'message', fullname($user)); - echo $OUTPUT->link($link); + $link = new moodle_url("/message/discussion.php?id=$user->id"); + $action = new popup_action('click', $link, "message_$user->id", $popupoptions); + echo $OUTPUT->action_link($link, fullname($user), $action, array('title'=>get_string('sendmessageto', 'message', fullname($user)))); echo ''; @@ -549,10 +548,9 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false) { 'scrollbars' => true, 'resizable' => true); - $link = html_link::make("/message/discussion.php?id=$user->id", fullname($user)); - $link->add_action(new popup_action('click', $link->url, "message_$user->id", $popupoptions)); - $link->title = get_string('sendmessageto', 'message', fullname($user)); - echo $OUTPUT->link($link); + $link = new moodle_url("/message/discussion.php?id=$user->id"); + $action = new popup_action('click', $link, "message_$user->id", $popupoptions); + echo $OUTPUT->action_link($link, fullname($user), $action, array('title'=>get_string('sendmessageto', 'message', fullname($user)))); } } @@ -644,10 +642,9 @@ function message_history_link($userid1, $userid2=0, $returnstr=false, $keywords= 'scrollbars' => true, 'resizable' => true); - $link = html_link::make("/message/history.php?user1=$userid1&user2=$userid2$keywords$position", $fulllink); - $link->add_action(new popup_action('click', $link->url, "message_history_$userid1", $popupoptions)); - $link->title = $strmessagehistory; - $str = $OUTPUT->link($link); + $link = html_link::make("/message/history.php?user1=$userid1&user2=$userid2$keywords$position"); + $action = new popup_action('click', $link->url, "message_history_$userid1", $popupoptions); + $str = $OUTPUT->action_link($link, $fulllink, $action, array('title'=>$strmessagehistory)); $str = ''.$str.''; @@ -1074,10 +1071,9 @@ function message_print_contactlist_user($contact, $incontactlist = true){ 'scrollbars' => true, 'resizable' => true); - $link = html_link::make("/message/discussion.php?id=$contact->id", $fullnamelink); - $link->add_action(new popup_action('click', $link->url, "message_$contact->id", $popupoptions)); - $link->title = get_string('sendmessageto', 'message', $fullname); - echo $OUTPUT->link($link); + $link = html_link::make("/message/discussion.php?id=$contact->id"); + $action = new popup_action('click', $link, "message_$contact->id", $popupoptions); + echo $OUTPUT->action_link($link, $fullnamelink, $action, array('title'=>get_string('sendmessageto', 'message', $fullname))); echo ''; echo ' '.$strcontact.$strblock.' '.$strhistory.''; diff --git a/message/send.php b/message/send.php index 16044ba45c5..1443c6dded4 100644 --- a/message/send.php +++ b/message/send.php @@ -113,10 +113,8 @@ if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTE $mform->display(); /* TODO: frames are a nono, this has to be redesigned echo $OUTPUT->box_start('noframesjslink'); - $accesslink = new html_link(); - $accesslink->url = new moodle_url('/message/discussion.php', array('id'=>$userid, 'noframesjs'=>1)); - $accesslink->text = get_string('noframesjs', 'message'); - echo $OUTPUT->link($accesslink); + $aurl = new moodle_url('/message/discussion.php', array('id'=>$userid, 'noframesjs'=>1)); + echo $OUTPUT->action_link($aurl, get_string('noframesjs', 'message'), ); echo $OUTPUT->box_end(); */ diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 3edf341821b..18fab20dedc 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -1344,10 +1344,8 @@ class assignment_base { $popup_url = '/mod/assignment/submissions.php?id='.$this->cm->id . '&userid='.$auser->id.'&mode=single'.'&offset='.$offset++; - $link = html_link::make($popup_url, $buttontext); - $link->add_action(new popup_action('click', $link->url, 'grade'.$auser->id, array('height' => 600, 'width' => 700))); - $link->title = $buttontext; - $button = $OUTPUT->link($link); + $action = new popup_action('click', $popup_url, 'grade'.$auser->id, array('height' => 600, 'width' => 700)); + $button = $OUTPUT->action_link($popup_url, $buttontext, $action); $status = '
'.$button.'
'; diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php index 41e717123ab..f8492d1ba69 100644 --- a/mod/assignment/type/online/assignment.class.php +++ b/mod/assignment/type/online/assignment.class.php @@ -197,10 +197,9 @@ class assignment_online extends assignment_base { return ''; } - $link = html_link::make("/mod/assignment/type/online/file.php?id={$this->cm->id}&userid={$submission->userid}", shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15)); - $link->add_action(new popup_action('click', $link->url, 'file'.$userid, array('height' => 450, 'width' => 580))); - $link->title = get_string('submission', 'assignment'); - $popup = $OUTPUT->link($link); + $link = new moodle_url("/mod/assignment/type/online/file.php?id={$this->cm->id}&userid={$submission->userid}"); + $action = new popup_action('click', $link, 'file'.$userid, array('height' => 450, 'width' => 580)); + $popup = $OUTPUT->action_link($link, shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15), $action, array('title'=>get_string('submission', 'assignment'))); $output = '
'. 'html'. @@ -216,10 +215,9 @@ class assignment_online extends assignment_base { return ''; } - $link = html_link::make("/mod/assignment/type/online/file.php?id={$this->cm->id}&userid={$submission->userid}", shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15)); - $link->add_action(new popup_action('click', $link->url, 'file'.$userid, array('height' => 450, 'width' => 580))); - $link->title = get_string('submission', 'assignment'); - $popup = $OUTPUT->link($link); + $link = new moodle_url("/mod/assignment/type/online/file.php?id={$this->cm->id}&userid={$submission->userid}"); + $action = new popup_action('click', $link, 'file'.$userid, array('height' => 450, 'width' => 580)); + $popup = $OUTPUT->action_link($link, shorten_text(trim(strip_tags(format_text($submission->data1,$submission->data2))), 15), $action, array('title'=>get_string('submission', 'assignment'))); $output = '
'. 'html'. diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index aa6eaaab13b..7537d631970 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -273,10 +273,9 @@ class assignment_upload extends assignment_base { } if ($this->notes_allowed() and !empty($submission->data1)) { - $link = html_link::make("/mod/assignment/type/upload/notes.php?id=$this->cm->id&userid=$userid", get_string('notes', 'assignment')); - $link->add_action(new popup_action('click', $link->url, 'notes', array('height' => 500, 'width' => 780))); - $link->title = get_string('notes', 'assignment'); - $output .= $OUTPUT->link($link); + $link = html_link::make("/mod/assignment/type/upload/notes.php?id=$this->cm->id&userid=$userid"); + $action = new popup_action('click', $link, 'notes', array('height' => 500, 'width' => 780)); + $output .= $OUTPUT->action_link($link, get_string('notes', 'assignment'), $action, array('title'=>get_string('notes', 'assignment'))); $output .= ' '; } diff --git a/mod/chat/view.php b/mod/chat/view.php index 75a29668097..41916aee5fd 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -121,20 +121,16 @@ } echo '

'; - $link = html_link::make($chattarget, $strenterchat); - $link->add_action(new popup_action('click', $link->url, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700))); - $link->title = get_string('modulename', 'chat'); - echo $OUTPUT->link($link); + echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700))); echo '

'; if ($CFG->enableajax) { echo '

'; - $link = html_link::make("/mod/chat/gui_ajax/index.php?id=$chat->id$groupparam", get_string('ajax_gui', 'message')); - $link->add_action(new popup_action('click', $link->url, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700, 'toolbar' => false, 'resizeable' => false, 'status' => false))); - $link->title = get_string('modulename', 'chat'); - echo $OUTPUT->link($link); + $link = new moodle_url("/mod/chat/gui_ajax/index.php?id=$chat->id$groupparam"); + $action = new popup_action('click', $link, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700, 'toolbar' => false, 'resizeable' => false, 'status' => false)); + echo $OUTPUT->action_link($link, get_string('ajax_gui', 'message'), $action, array('title'=>get_string('modulename', 'chat'))); echo '

'; } @@ -142,10 +138,9 @@ if ($CFG->chat_method == 'header_js' && empty($USER->screenreader)) { // show frame/js-less alternative echo '

('; - $link = html_link::make("/mod/chat/gui_basic/index.php?id=$chat->id$groupparam", get_string('noframesjs', 'message')); - $link->add_action(new popup_action('click', $link->url, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700))); - $link->title = get_string('modulename', 'chat'); - echo $OUTPUT->link($link); + $link = new moodle_url("/mod/chat/gui_basic/index.php?id=$chat->id$groupparam"); + $action = new popup_action('click', $link, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700)); + echo $OUTPUT->action_link($link, get_string('noframesjs', 'message'), $action, array('title'=>get_string('modulename', 'chat'))); echo ')

'; } diff --git a/mod/data/lib.php b/mod/data/lib.php index 58a69d1295c..64fea2b4457 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -1584,9 +1584,9 @@ function data_print_ratings_mean($recordid, $scale, $link=true) { echo "$strratings: "; if ($link) { - $link = html_link::make("/mod/data/report.php?id=$recordid", $mean); - $link->add_action(new popup_action('click', $link->url, 'ratings', array('height' => 400, 'width' => 600))); - echo $OUTPUT->link($link); + $link = new moodle_url("/mod/data/report.php?id=$recordid"); + $action = new popup_action('click', $link, 'ratings', array('height' => 400, 'width' => 600)); + echo $OUTPUT->action_link($link, $mean, $action); } else { echo "$mean "; } diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 0ef40ca7311..47fea59a272 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3854,9 +3854,9 @@ function forum_print_ratings($postid, $scale, $aggregatetype, $link=true, $ratin if ($link) { - $link = html_link::make("/mod/forum/report.php?id=$postid", $agg); - $link->add_action(new popup_action('click', $link->url, 'ratings', array('height' => 400, 'width' => 600))); - $strratings .= $OUTPUT->link($link); + $link = new moodle_url("/mod/forum/report.php?id=$postid"); + $action = new popup_action('click', $link, 'ratings', array('height' => 400, 'width' => 600)); + $strratings .= $OUTPUT->action_link($link, $agg, $action); } else { $strratings .= "$agg "; } diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 3d84e0833d7..aeb456d9625 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -2146,9 +2146,9 @@ function glossary_print_ratings_mean($entryid, $scale) { } echo "$strratings: "; - $link = html_link::make("/mod/glossary/report.php?id=$entryid", $mean); - $link->add_action(new popup_action('click', $link->url, "ratings")); - echo $OUTPUT->link($link); + $link = new moodle_url("/mod/glossary/report.php?id=$entryid"); + $action = new popup_action('click', $link, "ratings"); + echo $OUTPUT->action_link($link, $mean, $action); } } diff --git a/mod/lesson/essay.php b/mod/lesson/essay.php index 5d95673839a..70902592f1a 100644 --- a/mod/lesson/essay.php +++ b/mod/lesson/essay.php @@ -331,16 +331,16 @@ switch ($mode) { // link for each essay $url = new moodle_url('/mod/lesson/essay.php', array('id'=>$cm->id,'mode'=>'grade','attemptid'=>$essay->id,'sesskey'=>sesskey())); - $link = html_link::make($url, userdate($essay->timeseen, get_string('strftimedatetime')).' '.format_string($pages[$essay->pageid]->title,true)); + $attributes = array(); // Different colors for all the states of an essay (graded, if sent, not graded) if (!$essayinfo->graded) { - $link->set_classes("graded"); + $attributes['class'] = "graded"; } elseif (!$essayinfo->sent) { - $link->set_classes("sent"); + $attributes['class'] = "sent"; } else { - $link->set_classes("ungraded"); + $attributes['class'] = "ungraded"; } - $essaylinks[] = $OUTPUT->link($link); + $essaylinks[] = html_writer::link($url, userdate($essay->timeseen, get_string('strftimedatetime')).' '.format_string($pages[$essay->pageid]->title,true), $attributes); } } // email link for this user diff --git a/mod/lesson/lib.php b/mod/lesson/lib.php index 879e371da70..d9764d72909 100644 --- a/mod/lesson/lib.php +++ b/mod/lesson/lib.php @@ -1562,7 +1562,7 @@ class lesson extends lesson_base { /** * Returns the link for the related activity - * @return html_link|false + * @return array|false */ public function link_for_activitylink() { global $DB; diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index a255a04f0f9..f0632ce4b15 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -450,10 +450,9 @@ function lesson_mediafile_block_contents($cmid, $lesson) { $options['width'] = $lesson->mediawidth; $options['height'] = $lesson->mediaheight; - $link = html_link::make('/mod/lesson/mediafile.php?id='.$cmid, get_string('mediafilepopup', 'lesson')); - $link->add_action(new popup_action('click', $link->url, 'lessonmediafile', $options)); - $link->title = get_string('mediafilepopup', 'lesson'); - $content = $OUTPUT->link($link); + $link = new moodle_url('/mod/lesson/mediafile.php?id='.$cmid); + $action = new popup_action('click', $link, 'lessonmediafile', $options); + $content = $OUTPUT->action_link($link, get_string('mediafilepopup', 'lesson'), $action, array('title'=>get_string('mediafilepopup', 'lesson'))); $content .= $OUTPUT->help_icon("mediafilestudent", get_string("mediafile", "lesson"), "lesson"); diff --git a/mod/lesson/renderer.php b/mod/lesson/renderer.php index a47db1311a2..8d139935dc3 100644 --- a/mod/lesson/renderer.php +++ b/mod/lesson/renderer.php @@ -390,16 +390,16 @@ class mod_lesson_renderer extends plugin_renderer_base { if ($printmove) { $printmovehtml = new moodle_url('/mod/lesson/lesson.php', array('id'=>$this->page->cm->id, 'action'=>'move', 'pageid'=>$page->id, 'sesskey'=>sesskey())); - $actions[] = html_link::make($printmovehtml, ''.get_string('move').''); + $actions[] = html_writer::link($printmovehtml, ''.get_string('move').''); } $url = new moodle_url('/mod/lesson/editpage.php', array('id'=>$this->page->cm->id, 'pageid'=>$page->id, 'edit'=>1)); - $actions[] = html_link::make($url, ''.get_string('update').''); + $actions[] = html_writer::link($url, ''.get_string('update').''); $url = new moodle_url('/mod/lesson/view.php', array('id'=>$this->page->cm->id, 'pageid'=>$page->id)); - $actions[] = html_link::make($url, ''.get_string('preview').''); + $actions[] = html_writer::link($url, ''.get_string('preview').''); $url = new moodle_url('/mod/lesson/lesson.php', array('id'=>$this->page->cm->id, 'action'=>'confirmdelete', 'pageid'=>$page->id, 'sesskey'=>sesskey())); - $actions[] = html_link::make($url, ''.get_string('delete').''); + $actions[] = html_writer::link($url, ''.get_string('delete').''); if ($printaddpage) { $options = array(); diff --git a/mod/lesson/report.php b/mod/lesson/report.php index 6b3eda58419..d1a6c49d477 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -144,8 +144,8 @@ echo $lessonoutput->header($lesson, $cm, $action); $course_context = get_context_instance(CONTEXT_COURSE, $course->id); if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) { $seeallgradeslink = new moodle_url('/grade/report/grader/index.php', array('id'=>$course->id)); - $seeallgradeslink = html_link::make($seeallgradeslink, get_string('seeallcoursegrades', 'grades')); - echo $OUTPUT->box($OUTPUT->link($seeallgradeslink), 'allcoursegrades'); + $seeallgradeslink = html_writer::link($seeallgradeslink, get_string('seeallcoursegrades', 'grades')); + echo $OUTPUT->box($seeallgradeslink, 'allcoursegrades'); } if ($nothingtodisplay) { diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 3a102ce58d0..07fbc6e9cbe 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -825,11 +825,11 @@ function quiz_question_preview_button($quiz, $question, $label = false) { // Build the icon. $image = $OUTPUT->pix_icon('t/preview', $strpreviewquestion); - $link = new html_link($CFG->wwwroot."/question/preview.php?id=$question->id&quizid=$quiz->id", $image, array('title' => $strpreviewquestion)); + $link = new moodle_url($CFG->wwwroot."/question/preview.php?id=$question->id&quizid=$quiz->id"); parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options); - $link->add_action(new popup_action('click', $link->url, 'questionpreview', $options)); + $action = new popup_action('click', $link, 'questionpreview', $options); - return $OUTPUT->link($link); + return $OUTPUT->action_link($link, $image, $action, array('title' => $strpreviewquestion)); } /** diff --git a/mod/quiz/report/overview/overview_table.php b/mod/quiz/report/overview/overview_table.php index 67063c35442..cbe3c777cbf 100644 --- a/mod/quiz/report/overview/overview_table.php +++ b/mod/quiz/report/overview/overview_table.php @@ -229,10 +229,9 @@ class quiz_report_overview_table extends table_sql { $newgrade; } - $link = html_link::make("/mod/quiz/reviewquestion.php?attempt=$attempt->attempt&question=$question->id", $grade); - $link->add_action(new popup_action('click', $link->url, 'reviewquestion', array('height' => 450, 'width' => 650))); - $link->title = get_string('reviewresponsetoq', 'quiz', $question->formattedname); - $linktopopup = $OUTPUT->link($link); + $link = new moodle_url("/mod/quiz/reviewquestion.php?attempt=$attempt->attempt&question=$question->id"); + $action = new popup_action('click', $link, 'reviewquestion', array('height' => 450, 'width' => 650)); + $linktopopup = $OUTPUT->action-link($link, $grade, $action, array('title'=>get_string('reviewresponsetoq', 'quiz', $question->formattedname))); if (($this->questions[$questionid]->maxgrade != 0)){ $fractionofgrade = $stateforqinattempt->grade diff --git a/mod/quiz/report/responses/responses_table.php b/mod/quiz/report/responses/responses_table.php index 470b0501f5b..fd60e14679b 100644 --- a/mod/quiz/report/responses/responses_table.php +++ b/mod/quiz/report/responses/responses_table.php @@ -164,10 +164,9 @@ class quiz_report_responses_table extends table_sql { QUIZ_REPORT_RESPONSES_MAX_LEN_TO_DISPLAY, $formathtml); if (!$this->is_downloading()) { if ($summary){ - $link = html_link::make("/mod/quiz/reviewquestion.php?attempt=$attempt->attempt&question=$question->id", $summary); - $link->add_action(new popup_action('click', $link->url, 'reviewquestion', array('height' => 450, 'width' => 650))); - $link->title = $question->formattedname; - $summary = $OUTPUT->link($link); + $link = new moodle_url("/mod/quiz/reviewquestion.php?attempt=$attempt->attempt&question=$question->id"); + $action = new popup_action('click', $link, 'reviewquestion', array('height' => 450, 'width' => 650)); + $summary = $OUTPUT->action_link($link, $summary, $action, array('title'=>$question->formattedname)); if (question_state_is_graded($stateforqinattempt) && ($question->maxgrade > 0)){ diff --git a/mod/survey/lib.php b/mod/survey/lib.php index 18196552e97..36ae54ea927 100644 --- a/mod/survey/lib.php +++ b/mod/survey/lib.php @@ -471,7 +471,7 @@ function survey_print_all_responses($cmid, $results, $courseid) { foreach ($results as $a) { $table->data[] = array($OUTPUT->user_picture($a, array('courseid'=>$courseid)), - $OUTPUT->link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)), + html_writer::link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)), userdate($a->time)); } diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index f3080be99fd..4bb740102d7 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -238,7 +238,7 @@ class mod_workshop_renderer extends plugin_renderer_base { $type = mimeinfo_from_type("type", $type); $image = html_writer::empty_tag('img', array('src'=>$this->output->pix_url(file_mimetype_icon($type)), 'alt'=>$type, 'class'=>'icon')); - $linkhtml = html_writer::link($fileurl, $image) . $this->output->link($fileurl, $filename); + $linkhtml = html_writer::link($fileurl, $image) . html_writer::link($fileurl, $filename); $linktxt = "$filename [$fileurl]"; if ($format == "html") { diff --git a/question/editlib.php b/question/editlib.php index 1f2ff4e34d8..f4c86b252a0 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -628,11 +628,11 @@ class question_bank_preview_action_column extends question_bank_action_column_ba // Build the icon. $image = $OUTPUT->pix_icon('t/preview', $this->strpreview); - $link = new html_link($this->qbank->preview_question_url($question->id), $image, array('title' => $this->strpreview)); + $link = new moodle_url($this->qbank->preview_question_url($question->id)); parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options); - $link->add_action(new popup_action('click', $link->url, 'questionpreview', $options)); - - echo $OUTPUT->link($link); + $action = new popup_action('click', $link, 'questionpreview', $options); + + echo $OUTPUT->action_link($link, $image, $action, array('title' => $this->strpreview)); } } diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 82851ed4990..bb7427de29f 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -944,10 +944,9 @@ class default_questiontype { if (!empty($options->questioncommentlink)) { $strcomment = get_string('commentorgrade', 'quiz'); - $link = html_link::make("$options->questioncommentlink?attempt=$state->attempt&question=$actualquestionid", $strcomment); - $link->add_action(new popup_action('click', $link->url, 'commentquestion', array('height' => 480, 'width' => 750))); - $link->title = $strcomment; - $commentlink = $OUTPUT->container($OUTPUT->link($link), 'commentlink'); + $link = new moodle_url("$options->questioncommentlink?attempt=$state->attempt&question=$actualquestionid"); + $action = new popup_action('click', $link->url, 'commentquestion', array('height' => 480, 'width' => 750)); + $commentlink = $OUTPUT->container($OUTPUT->action_link($link, $strcomment, $action), 'commentlink'); } $history = $this->history($question, $state, $number, $cmoptions, $options); @@ -1055,10 +1054,9 @@ class default_questiontype { '" title="' . $stredit . '">' . $linktext . ''; } else { /// We have to edit in a pop-up. - $link = html_link::make($linkurl . '&inpopup=1', $linktext); - $link->add_action(new popup_action('click', $link->url, 'editquestion')); - $link->title = $stredit; - return $OUTPUT->link($link); + $link = new moodle_url($linkurl . '&inpopup=1'); + $action = new popup_action('click', $link, 'editquestion'); + return $OUTPUT->action_link($link, $linktext, $action ,array('title'=>$stredit)); } } @@ -1119,10 +1117,9 @@ class default_questiontype { } else if (isset($options->questionreviewlink)) { $reviewlink = new moodle_url($options->questionreviewlink); $reviewlink->params(array('state'=>$st->id,'question'=>$question->id)); - $link = html_link::make($reviewlink, $st->seq_number); - $link->add_action(new popup_action('click', $link->url, 'reviewquestion', array('height' => 450, 'width' => 650))); - $link->title = $strreviewquestion; - $link = $OUTPUT->link($link); + $link = new moodle_url($reviewlink); + $action = new popup_action('click', $link, 'reviewquestion', array('height' => 450, 'width' => 650)); + $link = $OUTPUT->action_link($link, $st->seq_number, $action, array('title'=>$strreviewquestion)); } else { $link = $st->seq_number; }