*/
public function link_to_popup($link, $image=null) {
$link = clone($link);
- $link->prepare();
-
- $this->prepare_event_handlers($link);
-
- if (empty($link->url)) {
- throw new coding_exception('Called $OUTPUT->link_to_popup($link) method without $link->url set.');
- }
-
- $linkurl = prepare_url($link->url);
-
- $tagoptions = array(
- 'title' => $link->title,
- 'id' => $link->id,
- 'href' => ($linkurl) ? $linkurl : prepare_url($popup->url),
- 'class' => $link->get_classes_string());
// Use image if one is given
if (!empty($image) && $image instanceof html_image) {
}
}
+ $link->prepare();
+ $this->prepare_event_handlers($link);
+
+ if (empty($link->url)) {
+ throw new coding_exception('Called $OUTPUT->link_to_popup($link) method without $link->url set.');
+ }
+
+ $linkurl = prepare_url($link->url);
+
+ $tagoptions = array(
+ 'title' => $link->title,
+ 'id' => $link->id,
+ 'href' => ($linkurl) ? $linkurl : prepare_url($popup->url),
+ 'class' => $link->get_classes_string());
+
return $this->output_tag('a', $tagoptions, $link->text);
}