diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-01-23 01:18:33 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-01-23 01:18:33 +0100 |
commit | a66df8c97f4aa70977b25478fc3b6413ebd9b9db (patch) | |
tree | 564670e31f82083411dd6749ccfb27f5038907fe /app/fn | |
parent | 11c729472634682fbcaa40caa5c510d490acfa4a (diff) | |
download | wcms-a66df8c97f4aa70977b25478fc3b6413ebd9b9db.tar.gz wcms-a66df8c97f4aa70977b25478fc3b6413ebd9b9db.zip |
new media types
Diffstat (limited to 'app/fn')
-rw-r--r-- | app/fn/fn.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/fn/fn.php b/app/fn/fn.php index 583227a..61c2312 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -230,6 +230,20 @@ function treecount(array $dir, string $dirname, int $deepness, string $path, str } } +function checkboxes(string $name, array $optionlist = [], array $checkedlist = []) +{ + $checkboxes = ''; + foreach ($optionlist as $option) { + $checkboxes .= '<li><input type="checkbox" name="' . $name . '[]" id="' . $option . '" value="' . $option . '"'; + if(in_array($option, $checkedlist)) { + $checkboxes .= ' checked'; + } + $checkboxes .= '><label for="' . $option . '">' . $option . '</label></li>'; + $checkboxes .= PHP_EOL; + } + return '<ul>' . PHP_EOL . $checkboxes . PHP_EOL . '</ul>'; +} + |