OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
61
app/Domain/Help/Controllers/FirstLogin.php
Normal file
61
app/Domain/Help/Controllers/FirstLogin.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Help\Controllers;
|
||||
|
||||
use Leantime\Core\Controller\Controller;
|
||||
use Leantime\Core\Controller\Frontcontroller;
|
||||
use Leantime\Domain\Help\Services\Helper;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class FirstLogin extends Controller
|
||||
{
|
||||
private Helper $helperService;
|
||||
|
||||
/**
|
||||
* Injects the Helper service.
|
||||
*/
|
||||
public function init(Helper $helperService): void
|
||||
{
|
||||
$this->helperService = $helperService;
|
||||
}
|
||||
|
||||
/**
|
||||
* get - handle get requests
|
||||
*
|
||||
* Renders the appropriate first-login onboarding step partial.
|
||||
*
|
||||
* @param array $params Request parameters.
|
||||
*/
|
||||
public function get($params): Response
|
||||
{
|
||||
$step = $this->helperService->resolveFirstLoginStep($_GET['step'] ?? null);
|
||||
|
||||
if ($step['isEnd']) {
|
||||
return $this->tpl->displayPartial($step['template']);
|
||||
}
|
||||
|
||||
$this->tpl->assign('currentStep', $step['key']);
|
||||
$this->tpl->assign('nextStep', $step['next']);
|
||||
|
||||
return $this->tpl->displayPartial($step['template']);
|
||||
}
|
||||
|
||||
/**
|
||||
* post - handle post requests
|
||||
*
|
||||
* Delegates onboarding step handling to the Helper service and redirects
|
||||
* to the resolved next step.
|
||||
*
|
||||
* @param array $params Request parameters.
|
||||
*/
|
||||
public function post($params): Response
|
||||
{
|
||||
$result = $this->helperService->handleFirstLoginStep($params);
|
||||
|
||||
if (! $result['valid']) {
|
||||
return Frontcontroller::redirect(BASE_URL.'/help/firstLogin');
|
||||
}
|
||||
|
||||
return Frontcontroller::redirect(BASE_URL.'/help/firstLogin?step='.$result['next']);
|
||||
}
|
||||
}
|
||||
42
app/Domain/Help/Controllers/ShowOnboardingDialog.php
Normal file
42
app/Domain/Help/Controllers/ShowOnboardingDialog.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Help\Controllers;
|
||||
|
||||
use Leantime\Core\Controller\Controller;
|
||||
use Leantime\Domain\Help\Services\Helper;
|
||||
|
||||
class ShowOnboardingDialog extends Controller
|
||||
{
|
||||
protected Helper $helpService;
|
||||
|
||||
/**
|
||||
* Injects the Helper service.
|
||||
*/
|
||||
public function init(Helper $helpService): void
|
||||
{
|
||||
$this->helpService = $helpService;
|
||||
}
|
||||
|
||||
/**
|
||||
* get - handle get requests
|
||||
*
|
||||
* Renders the onboarding modal partial for the requested module or route.
|
||||
* The "show once per session" bookkeeping and sanitization live in the service.
|
||||
*
|
||||
* @param array $params Request parameters.
|
||||
*/
|
||||
public function get($params)
|
||||
{
|
||||
if (isset($params['module']) && $params['module'] != '') {
|
||||
$template = $this->helpService->markModalSeenForModule($params['module']);
|
||||
|
||||
return $this->tpl->displayPartial('help.'.$template);
|
||||
}
|
||||
|
||||
if (isset($params['route']) && $params['route'] != '') {
|
||||
$template = $this->helpService->markModalSeenForRoute($params['route']);
|
||||
|
||||
return $this->tpl->displayPartial('help.'.$template);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/Domain/Help/Controllers/Support.php
Normal file
27
app/Domain/Help/Controllers/Support.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Help\Controllers;
|
||||
|
||||
use Leantime\Core\Controller\Controller;
|
||||
use Leantime\Domain\Help\Services\Helper;
|
||||
|
||||
class Support extends Controller
|
||||
{
|
||||
protected Helper $helpService;
|
||||
|
||||
public function init(Helper $helpService)
|
||||
{
|
||||
$this->helpService = $helpService;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get - handle get requests
|
||||
*/
|
||||
public function get($params)
|
||||
{
|
||||
|
||||
return $this->tpl->display('help.support');
|
||||
|
||||
}
|
||||
}
|
||||
28
app/Domain/Help/Controllers/Updates.php
Normal file
28
app/Domain/Help/Controllers/Updates.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Help\Controllers;
|
||||
|
||||
use Leantime\Core\Controller\Controller;
|
||||
|
||||
class Updates extends Controller
|
||||
{
|
||||
/**
|
||||
* get - handle get requests
|
||||
*/
|
||||
public function get($params) {}
|
||||
|
||||
/**
|
||||
* post - handle post requests
|
||||
*/
|
||||
public function post($params) {}
|
||||
|
||||
/**
|
||||
* put - handle put requests
|
||||
*/
|
||||
public function put($params) {}
|
||||
|
||||
/**
|
||||
* delete - handle delete requests
|
||||
*/
|
||||
public function delete($params) {}
|
||||
}
|
||||
Reference in New Issue
Block a user