diff --git a/protected/humhub/widgets/BootstrapComponent.php b/protected/humhub/widgets/BootstrapComponent.php index a5e5718de3..5023ab01bf 100644 --- a/protected/humhub/widgets/BootstrapComponent.php +++ b/protected/humhub/widgets/BootstrapComponent.php @@ -55,6 +55,8 @@ abstract class BootstrapComponent extends Widget public const TYPE_WARNING = 'warning'; public const TYPE_DANGER = 'danger'; public const TYPE_SUCCESS = 'success'; + public const TYPE_LIGHT = 'light'; + public const TYPE_DARK = 'dark'; public const TYPE_NONE = 'none'; public $type; @@ -148,6 +150,24 @@ abstract class BootstrapComponent extends Widget return new static(['type' => self::TYPE_DANGER, 'text' => $text]); } + /** + * @param string $text Button text + * @return static + */ + public static function light($text = null) + { + return new static(['type' => self::TYPE_LIGHT, 'text' => $text]); + } + + /** + * @param string $text Button text + * @return static + */ + public static function dark($text = null) + { + return new static(['type' => self::TYPE_DARK, 'text' => $text]); + } + /** * @param $color * @param null $text diff --git a/protected/humhub/widgets/Label.php b/protected/humhub/widgets/Label.php index 3dead55148..1069c0e5f6 100644 --- a/protected/humhub/widgets/Label.php +++ b/protected/humhub/widgets/Label.php @@ -20,10 +20,6 @@ use humhub\helpers\Html; */ class Label extends BootstrapComponent { - /** - * @since 1.9 - */ - public const TYPE_LIGHT = 'light'; public $_sortOrder = 1000; public $encode = true; @@ -31,15 +27,6 @@ class Label extends BootstrapComponent public $_link; public $_action; - /** - * @param string $text Label text - * @return static - * @since 1.9 - */ - public static function light($text) - { - return new static(['type' => static::TYPE_LIGHT, 'text' => $text]); - } public function sortOrder($sortOrder) {