forked from hasan-ozbey/flarum-password-strength
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextend.php
46 lines (37 loc) · 1.5 KB
/
extend.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Password Strength Indicator for Flarum.
*
* LICENSE: For the full copyright and license information,
* please view the LICENSE.md file that was distributed
* with this source code.
*
* @package glowingblue/password-strength
* @author Hasan Özbey <[email protected]>, Rafael Horvat <[email protected]>
* @copyright 2021
* @license The MIT License
* @version Release: 1.0.2
* @link https://github.com/glowingblue/flarum-ext-password-strength
*/
namespace GlowingBlue\PasswordStrength;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Extend;
$prefix = 'glowingblue-password-strength';
return [
(new Extend\Frontend('forum'))
->css(__DIR__ . '/less/forum.less')
->js(__DIR__ . '/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->css(__DIR__ . '/less/admin.less')
->js(__DIR__ . '/js/dist/admin.js'),
(new Extend\Locales(__DIR__ . '/locale')),
(new Extend\Settings())
->serializeToForum("$prefix.weakColor", "$prefix.weakColor")
->serializeToForum("$prefix.mediumColor", "$prefix.mediumColor")
->serializeToForum("$prefix.strongColor", "$prefix.strongColor")
->serializeToForum("$prefix.enableInputColor", "$prefix.enableInputColor", 'boolVal')
->serializeToForum("$prefix.enableInputBorderColor", "$prefix.enableInputBorderColor", 'boolVal')
->serializeToForum("$prefix.enablePasswordToggle", "$prefix.enablePasswordToggle", 'boolVal'),
(new Extend\ApiSerializer(ForumSerializer::class))
->attributes(Listeners\LoadSettings::class),
];