vincent-peugnet / wcms

⧉ light-weight experimental wiki
http://w.club1.fr
GNU Affero General Public License v3.0
20 stars 5 forks source link

remove obscure function checkboxes() from fn.php #466

Open jbidoret opened 2 weeks ago

jbidoret commented 2 weeks ago

In app/view/template/media.php, a checkboxes() function is used (and nowhere else, it seems) that returns a html string with a list, list-items, inputs and labels. Do you think we should keep with this function and returns a modified HTML? (So that it matches the future layout and structure of fields). Or should we do the templating in the view? That would bring up something like this:

<?php 
    $optionlist = Wcms\Media::mediatypes(); 
    $checkedlist = $mediaopt->type();
    foreach ($optionlist as $option) :
?>
<p class="field">
    <label for="<?= $option ?>"><?= $option ?></label>
    <input type="checkbox" name="type[]" id="<?= $option ?>" value="<?= $option ?>" <?= in_array($option, $checkedlist) ? "checked" : "" ?>>
</p>
<?php endforeach ?>
vincent-peugnet commented 2 weeks ago

I agree that this obscure function should be removed. 👍️

Let's keep this for after your big UI update.