MDL-21235 new action_link fixed
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user