From 5cd85d9bb7da3a42c303862325c8e6a4e2d1792b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 3 Dec 2023 14:30:40 +0000 Subject: [PATCH] "items per page" is now in the site settings as well --- src/Module/Admin/Site.php | 6 ++++++ view/templates/admin/site.tpl | 2 ++ view/theme/frio/templates/admin/site.tpl | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 05cb35641d..c1ba01d383 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -133,6 +133,8 @@ class Site extends BaseAdmin $suppress_tags = !empty($_POST['suppress_tags']); $max_comments = (!empty($_POST['max_comments']) ? intval($_POST['max_comments']) : 0); $max_display_comments = (!empty($_POST['max_display_comments']) ? intval($_POST['max_display_comments']) : 0); + $itemspage_network = (!empty($_POST['itemspage_network']) ? intval($_POST['itemspage_network']) : 0); + $itemspage_network_mobile = (!empty($_POST['itemspage_network_mobile']) ? intval($_POST['itemspage_network_mobile']) : 0); $temppath = (!empty($_POST['temppath']) ? trim($_POST['temppath']) : ''); $singleuser = (!empty($_POST['singleuser']) ? trim($_POST['singleuser']) : ''); $only_tag_search = !empty($_POST['only_tag_search']); @@ -297,6 +299,8 @@ class Site extends BaseAdmin $transactionConfig->set('system', 'max_comments', $max_comments); $transactionConfig->set('system', 'max_display_comments', $max_display_comments); + $transactionConfig->set('system', 'itemspage_network', $itemspage_network); + $transactionConfig->set('system', 'itemspage_network_mobile', $itemspage_network_mobile); if ($temppath != '') { $temppath = BasePath::getRealPath($temppath); @@ -550,6 +554,8 @@ class Site extends BaseAdmin '$dbclean_expire_conv' => ['dbclean_expire_conv', DI::l10n()->t('Lifespan of raw conversation data'), DI::config()->get('system', 'dbclean_expire_conversation'), DI::l10n()->t('The conversation data is used for ActivityPub and OStatus, as well as for debug purposes. It should be safe to remove it after 14 days, default is 90 days.')], '$max_comments' => ['max_comments', DI::l10n()->t('Maximum numbers of comments per post'), DI::config()->get('system', 'max_comments'), DI::l10n()->t('How much comments should be shown for each post? Default value is 100.')], '$max_display_comments' => ['max_display_comments', DI::l10n()->t('Maximum numbers of comments per post on the display page'), DI::config()->get('system', 'max_display_comments'), DI::l10n()->t('How many comments should be shown on the single view for each post? Default value is 1000.')], + '$itemspage_network' => ['itemspage_network', DI::l10n()->t('Items per page'), DI::config()->get('system', 'itemspage_network'), DI::l10n()->t('Number of items per page in stream pages (network, community, profile/contact statuses, search).')], + '$itemspage_network_mobile' => ['itemspage_network_mobile', DI::l10n()->t('Items per page for mobile devices'), DI::config()->get('system', 'itemspage_network_mobile'), DI::l10n()->t('Number of items per page in stream pages (network, community, profile/contact statuses, search) for mobile devices.')], '$temppath' => ['temppath', DI::l10n()->t('Temp path'), DI::config()->get('system', 'temppath'), DI::l10n()->t('If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.')], '$only_tag_search' => ['only_tag_search', DI::l10n()->t('Only search in tags'), DI::config()->get('system', 'only_tag_search'), DI::l10n()->t('On large systems the text search can slow down the system extremely.')], '$compute_circle_counts' => ['compute_circle_counts', DI::l10n()->t('Generate counts per contact circle when calculating network count'), DI::config()->get('system', 'compute_circle_counts'), DI::l10n()->t('On systems with users that heavily use contact circles the query can be very expensive.')], diff --git a/view/templates/admin/site.tpl b/view/templates/admin/site.tpl index e047b62aad..ce82c249a4 100644 --- a/view/templates/admin/site.tpl +++ b/view/templates/admin/site.tpl @@ -116,6 +116,8 @@ {{include file="field_checkbox.tpl" field=$only_tag_search}} {{include file="field_input.tpl" field=$max_comments}} {{include file="field_input.tpl" field=$max_display_comments}} + {{include file="field_input.tpl" field=$itemspage_network}} + {{include file="field_input.tpl" field=$itemspage_network_mobile}} {{include file="field_checkbox.tpl" field=$dbclean}} {{include file="field_input.tpl" field=$dbclean_expire_days}} {{include file="field_input.tpl" field=$dbclean_unclaimed}} diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index a3be0a4315..aef0f1f4b0 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -250,6 +250,8 @@ {{include file="field_checkbox.tpl" field=$only_tag_search}} {{include file="field_input.tpl" field=$max_comments}} {{include file="field_input.tpl" field=$max_display_comments}} + {{include file="field_input.tpl" field=$itemspage_network}} + {{include file="field_input.tpl" field=$itemspage_network_mobile}} {{include file="field_checkbox.tpl" field=$dbclean}} {{include file="field_input.tpl" field=$dbclean_expire_days}} {{include file="field_input.tpl" field=$dbclean_unclaimed}}