Hook::register('addon_settings_post', __FILE__, 'showmore_dyn_settings_post');
}
-function showmore_dyn_head(App $a, &$b)
+function showmore_dyn_head(App $a, string &$body)
{
DI::page()->registerStylesheet(__DIR__ . '/showmore_dyn.css');
}
-function showmore_dyn_footer(App $a, &$b)
+function showmore_dyn_footer(App $a, string &$body)
{
DI::page()->registerFooterScript(__DIR__ . '/showmore_dyn.js');
}
}
}
-function showmore_dyn_settings(App &$a, &$o)
+function showmore_dyn_settings(App &$a, array &$data)
{
if(!local_user()) {
return;
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' => 'Show More Dynamic',
- '$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, 'The maximal pixel height of posts, 0 to disable', '', '', 'number'],
+ $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()
{
$limitHeight = intval(DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight', 250));
- $showmore_dyn_showmore_linktext = DI::l10n()->t('Show more ...');
+ $showmore_dyn_showmore_linktext = DI::l10n()->t('Show more...');
DI::page()['htmlhead'] .= <<<EOT
<script>
var postLimitHeight = $limitHeight;