kernel update
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace kernel\controllers;
|
||||
|
||||
use DirectoryIterator;
|
||||
use JetBrains\PhpStorm\NoReturn;
|
||||
use Josantonius\Session\Facades\Session;
|
||||
use kernel\AdminController;
|
||||
use kernel\helpers\Debug;
|
||||
@ -53,10 +54,6 @@ class ModuleController extends AdminController
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
// foreach (ModuleShopClientService::getModuleShopClientInfo() as $module) {
|
||||
// $module->id = $i++;
|
||||
// $modules_info[] = $module;
|
||||
// }
|
||||
|
||||
$module_count = count($modules_info);
|
||||
$modules_info = array_slice($modules_info, $per_page*($page_number-1), $per_page);
|
||||
@ -106,25 +103,11 @@ class ModuleController extends AdminController
|
||||
$this->cgView->render("view.php", ['data' => $mod_info]);
|
||||
}
|
||||
|
||||
public function actionUpdate(): void
|
||||
#[NoReturn] public function actionUpdate(): void
|
||||
{
|
||||
$request = new Request();
|
||||
$slug = $request->get('slug');
|
||||
if ($this->moduleService->isKernelModule($slug)) {
|
||||
$active_res = $this->moduleService->updateModule($request->get("slug"));
|
||||
if (!$active_res){
|
||||
Session::start();
|
||||
Session::set("error", implode(";", $this->moduleService->getErrors()));
|
||||
$this->redirect("/admin", 302);
|
||||
}
|
||||
$mod_info = $this->moduleService->getModuleInfoBySlug($request->get('slug'));
|
||||
} else {
|
||||
$this->redirect("/admin/module_shop_client/update/?slug=" . $slug, 302);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->cgView->render("view.php", ['data' => $mod_info]);
|
||||
$this->redirect("/admin/module_shop_client/update/?slug=" . $slug, 302);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user