first commit
This commit is contained in:
51
admin/class/class.BaseAdminSectionsRelations.php
Normal file
51
admin/class/class.BaseAdminSectionsRelations.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use KupShop\AdminBundle\Util\AdminSectionTree;
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
|
||||
class BaseAdminSectionsRelations extends \Frame
|
||||
{
|
||||
protected $template = 'sectionsRelations.tpl';
|
||||
|
||||
protected AdminSectionTree $adminSectionTree;
|
||||
|
||||
protected string $label;
|
||||
protected string $tableName;
|
||||
protected string $column;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminSectionTree = ServiceContainer::getService(AdminSectionTree::class);
|
||||
}
|
||||
|
||||
public function get_vars()
|
||||
{
|
||||
$vars = parent::get_vars();
|
||||
|
||||
$pageVars['tree'] = $this->adminSectionTree->getCategories();
|
||||
$pageVars['category0'] = $this->adminSectionTree->getCategory0();
|
||||
$pageVars['selected'] = $this->adminSectionTree->getSelected($this->getID(), $this->tableName, $this->label, $this->column);
|
||||
$this->adminSectionTree->getOpened($pageVars['tree']);
|
||||
$pageVars['opened'] = $this->adminSectionTree->opened;
|
||||
|
||||
$vars['body'] = $pageVars;
|
||||
$vars['body']['data']['id'] = $this->getID();
|
||||
$vars['body']['ID'] = $this->getID();
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
parent::handle();
|
||||
|
||||
if (getVal('isSubmitted')) {
|
||||
$this->handleSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
protected function handleSubmit(): void
|
||||
{
|
||||
throw new \RuntimeException('Not implemented!');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user