diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-03-29 13:19:35 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-03-29 13:19:35 +0000 |
| commit | 25872272e8a7433b257300fe09fec94fe0fd6d81 (patch) | |
| tree | fcc129234d42f7d0fe20fb162326a368421c65ae /views/admin/form/select.phtml | |
| parent | cfc854a91c6683870cdbec8c7dd67082e07e03f1 (diff) | |
- Produktverwaltung
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5450 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/admin/form/select.phtml')
| -rw-r--r-- | views/admin/form/select.phtml | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/views/admin/form/select.phtml b/views/admin/form/select.phtml index ab46b8a..f0466c8 100644 --- a/views/admin/form/select.phtml +++ b/views/admin/form/select.phtml @@ -7,9 +7,55 @@ <div class="wpsg_field_wrap">
<select id="<?php echo $this->view['field_id']; ?>" name="<?php echo $this->view['field_name']; ?>" class="form-control input-sm" <?php echo $this->view['atts_select']; ?>>
- <?php foreach ($this->view['field_values'] as $k => $v) { ?>
- <option <?php echo (($k == $this->view['field_value'])?'selected="selected"':''); ?> value="<?php echo wpsg_hspc($k); ?>"><?php echo wpsg_hspc($v); ?></option>
+
+ <?php
+
+ if (wpsg_isTrue($this->view['field_config']['optgroup']))
+ {
+
+ $arGroup = array();
+
+ foreach ($this->view['field_values'] as $k_group => $v_group)
+ {
+
+ $arGroup[$k_group] = $v_group[0];
+ $arValues[$k_group] = $v_group[1];
+
+ }
+
+ }
+ else
+ {
+
+ $arValues = array($this->view['field_values']);
+ $arGroup = null;
+
+ }
+
+ ?>
+
+ <?php foreach ($arValues as $k_group => $v_group) { ?>
+
+ <?php if (!is_null($arGroup)) { ?><optgroup label="<?php echo $arGroup[$k_group]; ?>"><?php } ?>
+
+ <?php foreach ($v_group as $k => $v) { ?>
+ <option <?php
+
+ if (wpsg_isTrue($this->view['field_config']['noKeys']) && wpsg_isSizedString($v, $this->view['field_value'])) echo ' selected="selected" ';
+ else echo (($k == $this->view['field_value'])?'selected="selected"':'');
+
+ ?> value="<?php
+
+ if (wpsg_isTrue($this->view['field_config']['noKeys'])) echo wpsg_hspc($v);
+ else echo wpsg_hspc($k);
+
+ ?>"><?php echo wpsg_hspc($v); ?></option>
+ <?php } ?>
+
+ <?php if (!is_null($arGroup)) { ?></optgroup><?php } ?>
+
<?php } ?>
+
</select>
<?php if (wpsg_isSizedString($this->view['field_config']['help'])) { ?>
|
