Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase treeview items per page max, refs #13320 #1126

Merged
merged 1 commit into from Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/qubit/modules/settings/actions/treeviewAction.class.php
Expand Up @@ -129,7 +129,12 @@ protected function addField($name)
}
$this->form->setDefault($name, $default);

$this->form->setValidator($name, new sfValidatorInteger(array('min' => 10, 'max' => 1000)));
$this->form->setValidator($name, new sfValidatorInteger(
array(
'min' => 10,
'max' => sfConfig::get('app_treeview_items_per_page_max', 10000)
)
));
$this->form->setWidget($name, new sfWidgetFormInput);

break;
Expand Down
13 changes: 12 additions & 1 deletion apps/qubit/modules/settings/templates/treeviewSuccess.php
@@ -1,3 +1,5 @@
<?php use_helper('Number') ?>

<?php decorate_with('layout_2col.php') ?>

<?php slot('sidebar') ?>
Expand Down Expand Up @@ -87,7 +89,16 @@
<p>
<?php echo $form->fullItemsPerPage
->label(__('Items per page'))
->help(__('Items per page can be a minimum of 10 and a maximum of 1000'))
->help(
__('Items per page can be a minimum of %1% and a maximum of %2%',
array(
'%1%' => format_number(10),
'%2%' => format_number(
sfConfig::get('app_treeview_items_per_page_max', 10000)
)
)
)
)
->renderRow() ?>
</p>

Expand Down
3 changes: 3 additions & 0 deletions config/app.yml
Expand Up @@ -56,3 +56,6 @@ all:
# Specify password_hash algorithm options (as JSON)
# See: https://www.php.net/manual/en/function.password-hash.php
password_hash_algorithm_options: {"memory_cost": "2048", "time_cost": "4", "threads": "3"}

# Maximum allowed value for full-width treeview "items per page" setting
treeview_items_per_page_max: 10000