36 lines
1.7 KiB
PHP
36 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin;
|
|
|
|
use App\Controllers\CommonController;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
abstract class AdminController extends CommonController
|
|
{
|
|
private $_layout = 'admin';
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->addActionPaths($this->_layout);
|
|
}
|
|
protected function action_init_process(string $action, ?object $entity = null): void
|
|
{
|
|
$this->service->action_init_process($action, $entity);
|
|
parent::action_init_process($action, $entity);
|
|
$layouts = LAYOUTS[$this->_layout];
|
|
array_push($layouts['javascripts'], '<script src="/js/admin/clipboard.js"></script>');
|
|
$this->addViewDatas('layout', $layouts);
|
|
$this->addViewDatas('title', $this->getTitle());
|
|
$this->addViewDatas('helper', $this->service->getHelper());
|
|
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
|
|
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
|
|
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
|
|
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions());
|
|
$this->addViewDatas('index_actionButtons', $this->service->getFormService()->getactionButtons());
|
|
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFilters());
|
|
$this->addViewDatas('index_batchjobButtons', $this->service->getFormService()->getBatchjobButtons());
|
|
}
|
|
}
|