Skip to content

Commit

Permalink
Support showSetup in list views of the RelationController
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Nov 4, 2023
1 parent 9486aca commit 539ad66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/backend/behaviors/RelationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ protected function makeViewWidget()
$config = $this->makeConfigForMode('view', 'list');
$config->model = $this->relationModel;
$config->alias = $this->alias . 'ViewList';
$config->showSetup = $this->getConfig('view[showSetup]', true);
$config->showSorting = $this->getConfig('view[showSorting]', true);
$config->defaultSort = $this->getConfig('view[defaultSort]');
$config->recordsPerPage = $this->getConfig('view[recordsPerPage]');
Expand Down Expand Up @@ -814,7 +815,7 @@ protected function makeManageWidget()
$config = $this->makeConfigForMode('manage', 'list');
$config->model = $this->relationModel;
$config->alias = $this->alias . 'ManageList';
$config->showSetup = false;
$config->showSetup = $this->getConfig('manage[showSetup]', !$isPivot);
$config->showCheckboxes = $this->getConfig('manage[showCheckboxes]', !$isPivot);
$config->showSorting = $this->getConfig('manage[showSorting]', !$isPivot);
$config->defaultSort = $this->getConfig('manage[defaultSort]');
Expand Down
1 change: 1 addition & 0 deletions modules/backend/widgets/lists/partials/_list_head_row.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class="list-cell-name-<?= $column->getName() ?> list-cell-type-<?= $column->type
<?php if ($showSetup): ?>
<th class="list-setup">
<a href="javascript:;"
id="<?= $this->getId('setupButton') ?>"
title="<?= e(trans('backend::lang.list.setup_title')) ?>"
data-control="popup"
data-handler="<?= $this->getEventHandler('onLoadSetup') ?>"></a>
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/widgets/lists/partials/_setup_form.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?= Form::open() ?>
<?= Form::open(['data-request-parent' => '#' . $this->getId('setupButton')]) ?>
<div class="modal-header">
<button type="button" class="close" data-dismiss="popup">&times;</button>
<h4 class="modal-title"><?= e(trans('backend::lang.list.setup_title')) ?></h4>
Expand Down

0 comments on commit 539ad66

Please sign in to comment.