-
Notifications
You must be signed in to change notification settings - Fork 315
select generation is bad #3043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
the good syntax perhaps must be <?php
foreach ((widgets::listTemplate()) as $type => $values) {
foreach ($values as $subtype => $namelist) {
$first = true; // Indicateur pour la première option
foreach ($namelist as $name) {
$selected = $first ? ' selected' : ''; // Ajoute selected uniquement pour le premier élément
echo '<option data-type="' . $type . '" data-subtype="' . $subtype . '" value="' . $name . '"' . $selected . '>' . ucfirst(str_replace('tmpl', '', $name)) . '</option>';
$first = false; // Désactive l'indicateur après la première itération
}
}
}
?> |
I think is dreadful when you try to create a widget directly 👍 <div class="form-group">
<label class="col-lg-4 col-xs-4 control-label">Sous-Type</label>
<div class="col-lg-4 col-xs-5">
<select class="form-control selectWidgetSubType"
data-l1key="subtype" data-type="info">
<option data-type="info" value="numeric"><a>Numérique</option>
<option data-type="info" value="binary"><a>Binaire</option>
<option data-type="info" value="string"><a>Autre</option>
</select><select class="form-control selectWidgetSubType"
data-l1key="subtype" data-type="action">
<option data-type="action" value="other"><a>Défaut</option>
<option data-type="action" value="slider"><a>Curseur</option>
<option data-type="action" value="message"><a>Message</option>
<option data-type="action" value="color"><a>Couleur</option>
<option data-type="action" value="select"><a>Liste</option>
</select>
</div> |
Hello, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
core/desktop/php/widgets.php
Line 173 in 90a95f1
is not supported.
modify by 'selected' on the first option
the code generate is :
and must be :
The text was updated successfully, but these errors were encountered: