From f14b641b91cfaf418ee933f781bae463be208eec Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 15 Jan 2010 09:01:59 +0000 Subject: [PATCH] MDL-21235 new action_link fixed --- lib/outputcomponents.php | 2 +- lib/outputrenderers.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 872d573c6ea..6d609154749 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -308,7 +308,7 @@ class action_link implements renderable { public function __construct(moodle_url $url, $text, component_action $action=null, array $attributes=null) { $this->url = clone($url); $this->text = $text; - if ($actions) { + if ($action) { $this->add_action($action); } } diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 09c0edde93d..4eee2af0a84 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -932,7 +932,7 @@ class core_renderer extends renderer_base { } $link = new action_link($url, $text, $action, $attributes); - $this->render($link); + return $this->render($link); } /** @@ -954,7 +954,7 @@ class core_renderer extends renderer_base { $attributes['href'] = $link->url; if ($link->actions) { - if (empty($attributes[$id])) { + if (empty($attributes['id'])) { $id = html_writer::random_id('action_link'); $attributes['id'] = $id; } else {