<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Photo\Core; use Illuminate\Events\Dispatcher; use Illuminate\Support\ServiceProvider; use ModStart\Admin\Config\AdminMenu; use ModStart\Admin\Widget\DashboardItemA; use ModStart\Core\Dao\ModelUtil; use ModStart\Layout\Row; use Module\Photo\Provider\PhotoHomePageProvider; use Module\Photo\Type\PhotoCategoryType; use Module\Vendor\Admin\Widget\AdminWidgetDashboard; use Module\Vendor\Admin\Widget\AdminWidgetLink; use Module\Vendor\Provider\HomePage\HomePageProvider; class ModuleServiceProvider extends ServiceProvider { public function boot(Dispatcher $PC25T) { goto V31WL; jTYw0: AdminWidgetDashboard::registerIcon(function (Row $L2swt) { $vXksR = ModelUtil::count('photo_category', array('type' => PhotoCategoryType::ALBUM)); $L2swt->column(3, DashboardItemA::makeIconNumberTitle('iconfont icon-images', $vXksR, '照片集', modstart_admin_url('photo/photo_category'))); $vXksR = ModelUtil::count('photo_category', array('type' => PhotoCategoryType::VIDEO)); $L2swt->column(3, DashboardItemA::makeIconNumberTitle('iconfont icon-play', $vXksR, '视频数', modstart_admin_url('photo/photo_category'))); $vXksR = ModelUtil::count('photo'); $L2swt->column(3, DashboardItemA::makeIconNumberTitle('iconfont icon-image', $vXksR, '照片数', modstart_admin_url('photo/photo'))); }); goto ZKw23; ZKw23: AdminWidgetLink::register(function () { $RIyH2 = array(); $RIyH2[] = array('相册首页', modstart_web_url('photo')); $RIyH2 = array_merge($RIyH2, array_map(function ($HuYBt) { return array('分类:' . $HuYBt['name'], modstart_web_url("photo_category/{$HuYBt['id']}")); }, ModelUtil::all('photo_category'))); return AdminWidgetLink::build('相册', $RIyH2); }); goto Uk3jU; V31WL: AdminMenu::register(function () { return array(array('title' => '相册管理', 'icon' => 'images', 'sort' => 150, 'children' => array(array('title' => '相册集', 'url' => '\\Module\\Photo\\Admin\\Controller\\PhotoCategoryController@index'), array('title' => '相册管理', 'url' => '\\Module\\Photo\\Admin\\Controller\\PhotoController@index'), array('title' => '相册上传', 'url' => '\\Module\\Photo\\Admin\\Controller\\PhotoController@upload'), array('title' => '访问设置', 'url' => '\\Module\\Photo\\Admin\\Controller\\ConfigController@setting')))); }); goto jTYw0; Uk3jU: HomePageProvider::register(PhotoHomePageProvider::class); goto sIKvB; sIKvB: } public function register() { } }