Internal: Fix user subscription to course in course "members" tool. Display::toolbarAction() was failing when center element is empty

pull/4588/head
Yannick Warnier 2 years ago
parent 0a371916de
commit 0468779f25
  1. 10
      public/main/inc/lib/display.lib.php

@ -2158,11 +2158,17 @@ class Display
return self::url("$icon $text", $url, $attributes);
}
/**
* Generate an HTML "p-toolbar" div element with the given id attribute.
* @param string $id The HTML div's "id" attribute to set
* @param array $contentList Array of left-center-right elements for the toolbar. If only 2 elements are defined, this becomes left-right (no center)
* @return string HTML div for the toolbar
*/
public static function toolbarAction(string $id, array $contentList): string
{
$contentList = array_filter($contentList);
$contentListPurged = array_filter($contentList);
if (empty($contentList)) {
if (empty($contentListPurged)) {
return '';
}

Loading…
Cancel
Save