getOutput(); $out->addModules([ "oojs-ui-core" ]); if (!empty($params['page'])) { $title = Title::newFromText($params['page']); if ($title) { $params['href'] = $title->getLocalURL(); } } $framed = true; if (!empty($params['frameless']) && $params['frameless']) { $framed = false; } $flags = []; $primary = true; $type = 'progressive'; if (!empty($params['type'])) { switch ($params['type']) { case 'progressive': // default style break; case 'default': $primary = false; $type = null; break; case 'secondary': $primary = false; break; } } if (!empty($params['destructive']) && $params['destructive']) { $flags[] = 'destructive'; } if ($primary) { $flags[] = 'primary'; } if ($type) { $flags[] = $type; } $classList = ['oo-ui-widget', 'oo-ui-widget-enabled', 'oo-ui-buttonElement', 'oo-ui-labelElement', 'oo-ui-buttonWidget']; if ($framed) { $classList[] = 'oo-ui-buttonElement-framed'; } else { $classList[] = 'oo-ui-buttonElement-frameless'; } foreach ($flags as $flag) { $classList[] = 'oo-ui-flaggedElement-' . $flag; } $html = Html::rawElement('span', ['class' => implode(' ', $classList)], Html::rawElement('a', [ 'class' => 'oo-ui-buttonElement-button', 'role' => 'button', 'tabindex' => '0', 'href' => $params['href'] ?? '#', 'target' => $params['target'] ?? '_self', 'rel' => 'nofollow' ], Html::element('span', ['class' => 'oo-ui-iconElement-icon oo-ui-iconElement-noIcon']) . Html::element('span', ['class' => 'oo-ui-labelElement-label'], $text) . Html::element('span', ['class' => 'oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator']) ) ); return [$html, "markerType" => 'nowiki']; } }