OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
53
app/Domain/Menu/Hxcontrollers/ProjectSelector.php
Normal file
53
app/Domain/Menu/Hxcontrollers/ProjectSelector.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Menu\Hxcontrollers;
|
||||
|
||||
use Illuminate\Contracts\Container\BindingResolutionException;
|
||||
use Leantime\Core\Controller\Frontcontroller as FrontcontrollerCore;
|
||||
use Leantime\Core\Controller\HtmxController;
|
||||
use Leantime\Core\Events\DispatchesEvents;
|
||||
use Leantime\Domain\Menu\Services\Menu;
|
||||
|
||||
class ProjectSelector extends HtmxController
|
||||
{
|
||||
use DispatchesEvents;
|
||||
|
||||
protected static string $view = 'menu::partials.projectSelector';
|
||||
|
||||
private Menu $menuService;
|
||||
|
||||
/**
|
||||
* Controller constructor
|
||||
*/
|
||||
public function init(Menu $menuService): void
|
||||
{
|
||||
$this->menuService = $menuService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws BindingResolutionException
|
||||
*/
|
||||
public function updateMenu(): void
|
||||
{
|
||||
$projectSelectFilter = [
|
||||
'groupBy' => $_POST['groupBy'] ?? 'none',
|
||||
'client' => (int) ($_POST['client'] ?? null),
|
||||
];
|
||||
|
||||
$userId = session()->exists('userdata') ? (int) session('userdata.id') : null;
|
||||
|
||||
$viewData = $this->menuService->getProjectSelectorViewData(
|
||||
$userId,
|
||||
$projectSelectFilter,
|
||||
FrontcontrollerCore::getCurrentRoute(),
|
||||
$this->incomingRequest->getRequestUri()
|
||||
);
|
||||
|
||||
array_map([$this->tpl, 'assign'], array_keys($viewData), array_values($viewData));
|
||||
|
||||
$this->tpl->assign('module', FrontcontrollerCore::getModuleName());
|
||||
$this->tpl->assign('action', FrontcontrollerCore::getActionName());
|
||||
}
|
||||
|
||||
public function filter(): void {}
|
||||
}
|
||||
Reference in New Issue
Block a user