/**
* Given a moodle_action_icon object, outputs an image linking to an action (URL or AJAX).
*
- * @param mixed $link A html_link object or a string URL (text param required in second case)
+ * @param mixed $url_or_link A html_link object or a string URL (text param required in second case)
* @param string $title link title and also image alt if no alt specified in $options
* @param html_image|moodle_url|string $image_or_url image or url of the image,
* it is also possible to use short pix name for core images
if ($url_or_link instanceof html_link) {
$link = clone($url_or_link);
$link->text = ($icon);
- $url = $link->url;
} else {
- $link = new html_link($url, $icon);
+ $link = new html_link($url_or_link, $icon);
}
+ $url = $link->url;
$link->add_action(new popup_action('click', $url));
return $this->link($link);