<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PicUploader\Core; use Illuminate\Events\Dispatcher; use Illuminate\Support\ServiceProvider; use ModStart\Admin\Config\AdminMenu; use ModStart\Data\Event\DataDeletedEvent; use Module\Member\Config\MemberMenu; use Module\PicUploader\Model\PicUploaderItem; use Module\PicUploader\Provider\PicUploaderHomePageProvider; use Module\Vendor\Provider\HomePage\HomePageProvider; class ModuleServiceProvider extends ServiceProvider { public function boot(Dispatcher $in2oG) { goto lAB9J; yCo6n: if (!modstart_config('PicUploader_MemberMenuApiHide', false)) { MemberMenu::register(function () { return array(array('icon' => 'image', 'title' => '图床管理', 'sort' => 500, 'children' => array(array('title' => '接口设置', 'url' => modstart_web_url('member/pic_uploader/api'))))); }); } goto w8MhI; w8MhI: if (class_exists(DataDeletedEvent::class)) { DataDeletedEvent::listen(function ($dWodd) { $rpy90 = PicUploaderItem::where(array('dataId' => $dWodd->data['id']))->first(); if ($rpy90) { $rpy90->delete(); } }); } goto AVGSK; lAB9J: AdminMenu::register(function () { return array(array('title' => '功能设置', 'icon' => 'tools', 'sort' => 300, 'children' => array(array('title' => '图床模块', 'url' => '\\Module\\PicUploader\\Admin\\Controller\\ConfigController@index')))); }); goto yCo6n; AVGSK: } public function register() { HomePageProvider::register(PicUploaderHomePageProvider::class); } }