diff --git a/public/main/inc/lib/display.lib.php b/public/main/inc/lib/display.lib.php index 04ff591114..c7abc62e66 100644 --- a/public/main/inc/lib/display.lib.php +++ b/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 ''; }