+ DI::page()->registerFooterScript(__DIR__ . '/showmore_dyn.js');
+}
+
+function showmore_dyn_settings_post()
+{
+ if(!local_user()) {
+ return;
+ }
+
+ if (isset($_POST['showmore_dyn-submit'])) {
+ DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $_POST['limitHeight'] ?? 0);
+ }
+}
+
+function showmore_dyn_settings(App &$a, &$o)
+{
+ if(!local_user()) {
+ return;
+ }
+
+ $limitHeight = DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight', 250);
+ DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight);
+
+ $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/');
+ $o .= Renderer::replaceMacros($t, [
+ '$submit' => DI::l10n()->t('Save Settings'),
+ '$header' => DI::l10n()->t('Show More Dynamic'),
+ '$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, DI::l10n()->t('The maximal pixel height of posts before the Show More link is added, 0 to disable'), '', '', 'number'],
+ ]);
+