Overview
Comment:Template: ajout d'un type select avec optgroups au widget input
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 62abb2d90193000cf11e624c2f3d48baaa950a01
User & Date: bohwaz on 2020-04-21 02:55:40
Other Links: branch diff | manifest | tags
Context
2020-04-21
14:10
Empêcher les requêtes à favicon.ico de déclencher une requête cachée vers upgrade.php check-in: 978ee98591 user: bohwaz tags: dev
02:55
Template: ajout d'un type select avec optgroups au widget input check-in: 62abb2d901 user: bohwaz tags: dev
02:49
Suppression des catégories comptables, intégration dans le plan comptable check-in: 34c1d2732d user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Template.php from [f41e267c94] to [1bd195df26].

192
193
194
195
196
197
198















199
200
201
202
203
204
205

		if ($type == 'select') {
			$out .= sprintf('<select %s>', $attributes);

			foreach ($options as $_key => $_value) {
				$out .= sprintf('<option value="%s"%s>%s</option>', $_key, $current_value == $_key ? ' selected="selected"' : '', $this->escape($_value));
			}
















			$out .= '</select>';
		}
		elseif ($type == 'textarea') {
			$out .= sprintf('<textarea %s>%s</textarea>', $attributes, $this->escape($current_value));
		}
		else {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220

		if ($type == 'select') {
			$out .= sprintf('<select %s>', $attributes);

			foreach ($options as $_key => $_value) {
				$out .= sprintf('<option value="%s"%s>%s</option>', $_key, $current_value == $_key ? ' selected="selected"' : '', $this->escape($_value));
			}

			$out .= '</select>';
		}
		elseif ($type == 'select_groups') {
			$out .= sprintf('<select %s>', $attributes);

			foreach ($options as $optgroup => $suboptions) {
				$out .= sprintf('<optgroup label="%s">', $this->escape($optgroup));

				foreach ($suboptions as $_key => $value) {
					$out .= sprintf('<option value="%s"%s>%s</option>', $_key, $current_value == $_key ? ' selected="selected"' : '', $this->escape($_value));
				}

				$out .= '</optgroup>';
			}

			$out .= '</select>';
		}
		elseif ($type == 'textarea') {
			$out .= sprintf('<textarea %s>%s</textarea>', $attributes, $this->escape($current_value));
		}
		else {