Overview
Comment:Don't forget the name attribute
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: cbf952e28cdfbab783424d7a6d03271245ce265e
User & Date: bohwaz on 2020-09-10 00:19:33
Other Links: branch diff | manifest | tags
Context
2020-09-10
00:20
Changing the words, again check-in: 6ea0091635 user: bohwaz tags: dev
00:19
Don't forget the name attribute check-in: cbf952e28c user: bohwaz tags: dev
00:19
Fix queries check-in: d5683e8d06 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Template.php from [a5a8d51011] to [b87b02ae79].

200
201
202
203
204
205
206

207
208
209
210
211
212
213
...
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
			$current_value = $_POST[$name];
		}
		elseif (isset($default)) {
			$current_value = $default;
		}

		$attributes['id'] = 'f_' . $name;


		if ($type == 'radio' || $type == 'checkbox') {
			$attributes['id'] .= '_' . $value;
		}

		// Create attributes string
		if (array_key_exists('required', $attributes)) {
................................................................................

			$input .= '</select>';
		}
		elseif ($type == 'textarea') {
			$input = sprintf('<textarea %s>%s</textarea>', $attributes_string, $this->escape($current_value));
		}
		elseif ($type == 'list') {
			$input = sprintf('<span id="%s_container" class="input-list"><input type="hidden" name="%s" value="%s" /><span class="value">%3$s</span><button id="%1$s" data-icon="%s" name="list_selector[%2$s]" class="icn-btn" value="%s">%s</button></span>', $this->escape($attributes['id']), $this->escape($name), $this->escape($current_value), Utils::iconUnicode('menu'), $this->escape($attributes['target']), 'Sélectionner');
		}
		else {
			$input = sprintf('<input type="%s" %s value="%s" />', $type, $attributes_string, $this->escape($current_value));
		}

		// No label? then we only want the input without the widget
		if (empty($label)) {







>







 







|







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
...
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
			$current_value = $_POST[$name];
		}
		elseif (isset($default)) {
			$current_value = $default;
		}

		$attributes['id'] = 'f_' . $name;
		$attributes['name'] = $name;

		if ($type == 'radio' || $type == 'checkbox') {
			$attributes['id'] .= '_' . $value;
		}

		// Create attributes string
		if (array_key_exists('required', $attributes)) {
................................................................................

			$input .= '</select>';
		}
		elseif ($type == 'textarea') {
			$input = sprintf('<textarea %s>%s</textarea>', $attributes_string, $this->escape($current_value));
		}
		elseif ($type == 'list') {
			$input = sprintf('<span id="%s_container" class="input-list"><input type="hidden" name="%s" value="%s" /><span class="value">%3$s</span><button type="button" id="%1$s" data-icon="%s" name="list_selector[%2$s]" class="icn-btn" value="%s">%s</button></span>', $this->escape($attributes['id']), $this->escape($name), $this->escape($current_value), Utils::iconUnicode('menu'), $this->escape($attributes['target']), 'Sélectionner');
		}
		else {
			$input = sprintf('<input type="%s" %s value="%s" />', $type, $attributes_string, $this->escape($current_value));
		}

		// No label? then we only want the input without the widget
		if (empty($label)) {