registerStylesheet(__DIR__ . '/showmore_dyn.css'); } function showmore_dyn_footer(App $a, &$b) { DI::page()->registerFooterScript(__DIR__ . '/showmore_dyn.js'); } function showmore_dyn_settings_post(){ if(! local_user()) return; if (isset($_POST['showmore_dyn-submit'])){ $limitHeight = $_POST['showmore_dyn_height']; DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight); } } function showmore_dyn_settings(&$a,&$o) { if(! local_user()) return; $limitHeight = DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight' ); if ($limitHeight=='') { $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'), '$title' => "Showmore Dynamic", '$label' => DI::l10n()->t('Limit Height'), '$limitHeight' => $limitHeight, ]); } function showmore_dyn_script() { $limitHeight = DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight' ); $showmore_dyn_showmore_linktext = DI::l10n()->t('Show more ...'); DI::page()['htmlhead'] .= ''; }