[WIP] #8374: Limit post content by rendered height instead of number of characters #968
|
@ -41,7 +41,7 @@ function showmore_dyn_settings_post()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['showmore_dyn-submit'])) {
|
if (isset($_POST['showmore_dyn-submit'])) {
|
||||||
$limitHeight = $_POST['showmore_dyn_height'];
|
$limitHeight = $_POST['limitHeight'];
|
||||||
if ($limitHeight && is_numeric($limitHeight)) {
|
if ($limitHeight && is_numeric($limitHeight)) {
|
||||||
DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight);
|
DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ function showmore_dyn_settings(App &$a, &$o)
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
'$submit' => DI::l10n()->t('Save Settings'),
|
||||||
'$title' => 'Showmore Dynamic',
|
'$title' => 'Showmore Dynamic',
|
||||||
'$label' => DI::l10n()->t('Limit Height'),
|
'$label' => DI::l10n()->t('Limit Height'),
|
||||||
'$limitHeight' => $limitHeight,
|
'$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, 'The maximal height of posts when collapsed', '', '', 'number'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
<div class="settings-block">
|
<div class="settings-block">
|
||||||
<h3 class="settings-heading">{{$title}}</h3>
|
<h3 class="settings-heading">{{$title}}</h3>
|
||||||
<div class='field noedit'>
|
{{include file="field_input.tpl" field=$limitHeight}}
|
||||||
<label>{{$label}}</label>
|
|
||||||
<input id="showmore_dyn_height" name="showmore_dyn_height" value="{{$limitHeight}}" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper">
|
<div class="settings-submit-wrapper">
|
||||||
<input type="submit" value="{{$submit}}" class="settings-submit" name="showmore_dyn-submit" />
|
<input type="submit" value="{{$submit}}" class="settings-submit" name="showmore_dyn-submit" />
|
||||||
|
|
Loading…
Reference in a new issue