recusive activate dependencies
This commit is contained in:
@ -3,18 +3,31 @@
|
||||
namespace kernel\modules\themes\controllers;
|
||||
|
||||
use DirectoryIterator;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use JetBrains\PhpStorm\NoReturn;
|
||||
use Josantonius\Session\Exceptions\HeadersSentException;
|
||||
use Josantonius\Session\Exceptions\SessionNotStartedException;
|
||||
use Josantonius\Session\Exceptions\SessionStartedException;
|
||||
use Josantonius\Session\Exceptions\WrongSessionOptionException;
|
||||
use Josantonius\Session\Facades\Session;
|
||||
use kernel\AdminController;
|
||||
use kernel\helpers\Debug;
|
||||
use kernel\models\Option;
|
||||
use kernel\Request;
|
||||
use kernel\services\ModuleService;
|
||||
use kernel\services\ThemeService;
|
||||
|
||||
class ThemeController extends AdminController
|
||||
{
|
||||
public ThemeService $themeService;
|
||||
|
||||
public ModuleService $moduleService;
|
||||
protected function init(): void
|
||||
{
|
||||
parent::init();
|
||||
$this->cgView->viewPath = KERNEL_MODULES_DIR . "/themes/views/";
|
||||
$this->themeService = new ThemeService();
|
||||
$this->moduleService = new ModuleService();
|
||||
}
|
||||
|
||||
public function actionIndex(): void
|
||||
@ -62,10 +75,19 @@ class ThemeController extends AdminController
|
||||
$this->cgView->render("index.php", ['json' => json_encode($infoToTable, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws HeadersSentException
|
||||
* @throws WrongSessionOptionException
|
||||
* @throws SessionStartedException
|
||||
* @throws GuzzleException
|
||||
* @throws SessionNotStartedException
|
||||
*/
|
||||
#[NoReturn] public function actionActivate(): void
|
||||
{
|
||||
$request = new Request();
|
||||
$this->themeService->setActiveTheme($request->get("p"));
|
||||
if(!$this->themeService->setActiveTheme($request->get("p"))){
|
||||
$this->redirect("/admin/settings/themes/", 302);
|
||||
}
|
||||
|
||||
$this->cgView->render("view.php", ['data' => $this->themeService->getThemeInfo($request->get("p"))]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user