2
2
3
3
namespace CoreCMF \Omnipay \Http \Listeners ;
4
4
5
- use CoreCMF \Omnipay \Http \Models \Config ;
6
5
/**
7
- * [SocialiteEventSubscriber 社会登录事件订阅者 ]
6
+ * [OmnipayEventSubscriber 支付扩展包订阅器 ]
8
7
*/
9
8
class OmnipayEventSubscriber
10
9
{
11
- private $ configModel ;
12
10
13
- public function __construct (Config $ configPro ){
14
- $ this ->configModel = $ configPro ;
15
- }
16
11
/**
17
12
* [onBuilderTablePackage 后台模型table渲染处理]
18
13
* @param [type] $event [description]
19
14
* @return [type] [description]
20
15
*/
21
- public function onBuilderTablePackage ($ event )
16
+ public function onAdminMain ($ event )
22
17
{
23
- $ table = $ event ->table ;
24
- if ($ table ->event == 'package ' ) {
25
- $ table ->data ->transform (function ($ item , $ key ) {
26
- if ($ item ->name == 'Omnipay ' ) {
27
- // $item->rightButton = [
28
- // ['title'=>'云存储管理','apiUrl'=> route('api.omnipay.config.index'),'type'=>'info', 'icon'=>'fa fa-edit']
29
- // ];
30
- }
31
- return $ item ;
32
- });
33
- }
18
+ // $main = $event->main;
19
+ // if ($main->event == 'AdminMain') {
20
+ // // dd($main);
21
+ // }
34
22
}
35
23
/**
36
24
* 为订阅者注册监听器.
@@ -40,8 +28,8 @@ public function onBuilderTablePackage($event)
40
28
public function subscribe ($ events )
41
29
{
42
30
$ events ->listen (
43
- 'CoreCMF\Core\Events\BuilderTable ' ,
44
- 'CoreCMF\Omnipay\Http\Listeners\OmnipayEventSubscriber@onBuilderTablePackage '
31
+ 'CoreCMF\Core\Support\ Events\BuilderMain ' ,
32
+ 'CoreCMF\Omnipay\Http\Listeners\OmnipayEventSubscriber@onAdminMain '
45
33
);
46
34
}
47
35
0 commit comments