mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Fix deprecated BoostrapComponent with BS5 light and dark colors
This commit is contained in:
parent
77638f0c5c
commit
ad049c3e51
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user