From 99610166839aed5b215bfb03f38f4239c00169b3 Mon Sep 17 00:00:00 2001 From: xinatorus Date: Tue, 12 May 2020 20:28:04 +0200 Subject: [PATCH] widget types --- app/models/types/WidgetTypes.php | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 app/models/types/WidgetTypes.php diff --git a/app/models/types/WidgetTypes.php b/app/models/types/WidgetTypes.php new file mode 100644 index 0000000..7e0dd7d --- /dev/null +++ b/app/models/types/WidgetTypes.php @@ -0,0 +1,45 @@ + [ + 'name' => 'value', + 'active' => false + ], + self::ICON => [ + 'name' => 'icon', + 'active' => false + ], + self::BUTTON => [ + 'name' => 'button', + 'active' => true + ], + self::SWITH => [ + 'name' => 'switch', + 'active' => true + ], + self::RANGE => [ + 'name' => 'range', + 'active' => true + ], + self::CUSTOM => [ + 'name' => 'custom', + 'active' => true + ], + ]; + + public static function getName($type){ + return self::$types[$type]; + } + + public static function isActive($type){ + return isset(self::$types[$type]) && self::$types[$type]['active']; + } +}