Skip to content

Commit

Permalink
#3 use the PageDefinitions class to hold the parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
1stthomas committed Nov 5, 2021
1 parent 347221a commit 2c20e33
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
28 changes: 13 additions & 15 deletions controllers/single_page/dashboard/ht7/tools/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ public function __construct(Page $c)
$pkgFileConfig = $pkgH->getPackageFileConfig($this);
$pkgHandle = $pkgH->getPackageHandle($this);

$this->definitions = new PageDefinitions(
[
'definitions' => ['forms.settings', $pkgFileConfig],
'elements' => [
'label' => ['tools/settings/label', $pkgHandle],
'setting' => ['tools/settings/attributes', $pkgHandle]
],
'tabs' => ['ht7_tabs.settings', $pkgFileConfig],
'urls' => [
'form_abort' => $this->action(),
'form_save' => $this->action('save'),
],
'values' => ['settings', $pkgFileConfig],
],
PageDefinitionTypes::SIMPLE
$this->setDefinitions(new PageDefinitions([
'definitions' => ['forms.settings', $pkgFileConfig],
'elements' => [
'label' => ['tools/settings/label', $pkgHandle],
'setting' => ['tools/settings/attributes', $pkgHandle]
],
'tabs' => ['ht7_tabs.settings', $pkgFileConfig],
'urls' => [
'form_abort' => $this->action(),
'form_save' => $this->action('save'),
],
'values' => ['settings', $pkgFileConfig],
], PageDefinitionTypes::SIMPLE)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public function save()
}
}

public function setDefinitions(PageDefinitions $definitions)
{
$this->definitions = $definitions;
}

public function view()
{
$this->requireAsset('javascript', 'ht7-widgets/concrete5');
Expand Down

0 comments on commit 2c20e33

Please sign in to comment.