[various] Convert addon_settings hook functions to the new data array format

- Add separate template files to several addons
- Remove superfluous addon settings CSS files
This commit is contained in:
Hypolite Petovan 2021-11-20 04:56:55 -05:00
parent f0522a998b
commit 779b38ec09
68 changed files with 444 additions and 953 deletions

View file

@ -45,7 +45,7 @@ function showmore_dyn_settings_post()
}
}
function showmore_dyn_settings(App &$a, &$o)
function showmore_dyn_settings(App &$a, array &$data)
{
if(!local_user()) {
return;
@ -55,12 +55,15 @@ function showmore_dyn_settings(App &$a, &$o)
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'),
$html = Renderer::replaceMacros($t, [
'$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'],
]);
$data = [
'addon' => 'showmore_dyn',
'title' => DI::l10n()->t('Show More Dynamic'),
'html' => $html,
];
}
function showmore_dyn_script()