File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -490,13 +490,33 @@ class Dashboard extends Process implements Module
490490 /**
491491 * Render icon as markup.
492492 *
493- * @param string $ icon
493+ * @param string|array $icons Icon or icon array, in order of preference
494494 *
495495 * @return string Icon markup
496496 */
497- public function renderIcon($icon )
497+ public function renderIcon($icons )
498498 {
499- return $icon ? wireIconMarkup($icon, 'fw') : '';
499+ $class = '';
500+
501+ if (empty($icons)) {
502+ $icons = [];
503+ } elseif (is_string($icons)) {
504+ $icons = [$icons];
505+ }
506+ if (is_array($icons)) {
507+ $classes = array_map(function ($icon) {
508+ if (strpos($icon, 'icon-') === 0) {
509+ $icon = str_replace('icon-', 'fa-', $icon);
510+ }
511+ if (strpos($icon, 'fa-') !== 0) {
512+ $icon = "fa-{$icon}";
513+ }
514+ return $icon;
515+ }, $icons);
516+ $class = implode(' ', $classes);
517+ }
518+
519+ return "<i class='fa fa-fw {$class}'></i>";
500520 }
501521
502522 /**
You can’t perform that action at this time.
0 commit comments