]> git.mxchange.org Git - friendica-addons.git/commitdiff
#8374: Using sub-templates for input field
authorChristian Wiwie <jonsnow@posteo.de>
Sun, 15 Mar 2020 20:19:42 +0000 (21:19 +0100)
committerChristian Wiwie <jonsnow@posteo.de>
Sun, 15 Mar 2020 20:19:42 +0000 (21:19 +0100)
showmore_dyn/showmore_dyn.php
showmore_dyn/templates/settings.tpl

index 41de11a3f8f30671abd23a37b6196a20b2b5cd71..73eb7b17a2d839e757f86068ed1b29c4469c7ad6 100644 (file)
@@ -41,7 +41,7 @@ function showmore_dyn_settings_post()
        }
 
        if (isset($_POST['showmore_dyn-submit'])) {
-               $limitHeight = $_POST['showmore_dyn_height'];
+               $limitHeight = $_POST['limitHeight'];
                if ($limitHeight && is_numeric($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'),
                '$title' => 'Showmore Dynamic',
                '$label' => DI::l10n()->t('Limit Height'),
-               '$limitHeight' => $limitHeight,
+               '$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, 'The maximal height of posts when collapsed', '', '', 'number'],
        ]);
 
 }
index 782d1fdf7ab7134a7366776e993b0d229e49c362..5e8bc3f1e8428f5107baf4379e5c70ce66b6f939 100644 (file)
@@ -1,9 +1,6 @@
 <div class="settings-block">
        <h3 class="settings-heading">{{$title}}</h3>
-       <div class='field noedit'>
-               <label>{{$label}}</label>
-               <input id="showmore_dyn_height" name="showmore_dyn_height" value="{{$limitHeight}}" />
-       </div>
+       {{include file="field_input.tpl" field=$limitHeight}}
 
        <div class="settings-submit-wrapper">
                <input type="submit" value="{{$submit}}" class="settings-submit" name="showmore_dyn-submit" />