From: David Mudrak Date: Sat, 2 Jan 2010 21:40:00 +0000 (+0000) Subject: MDL-21198 fixing a regression in the recent action_link() rewrite X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1df1adaacd8369ee81e7b86f822efd93d2fea69b;p=moodle.git MDL-21198 fixing a regression in the recent action_link() rewrite --- diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 3d1498a56e..2192839db4 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1105,7 +1105,7 @@ class core_renderer extends renderer_base { /** * 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 @@ -1137,10 +1137,10 @@ class core_renderer extends renderer_base { 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);