PUM_Admin_Templates::general_fields()


Description Description


Source Source

File: classes/Admin/Templates.php

	public static function general_fields() {
		?>
		<script type="text/html" id="tmpl-pum-field-text">
			<input type="text" placeholder="{{data.placeholder}}" class="{{data.size}}-text" id="{{data.id}}" name="{{data.name}}" value="{{data.value}}" {{{data.meta}}}/>
		</script>

		<script type="text/html" id="tmpl-pum-field-password">
			<input type="password" placeholder="{{data.placeholder}}" class="{{data.size}}-text" id="{{data.id}}" name="{{data.name}}" value="{{data.value}}" {{{data.meta}}}/>
		</script>

		<script type="text/html" id="tmpl-pum-field-select">
			<select id="{{data.id}}" name="{{data.name}}" data-allow-clear="true" {{{data.meta}}}>
				<# _.each(data.options, function(option, key) {

				if (option.options !== undefined && option.options.length) { #>

				<optgroup label="{{{option.label}}}">

					<# _.each(option.options, function(option, key) { #>
					<option value="{{option.value}}" {{{option.meta}}}>{{option.label}}</option>
					<# }); #>

				</optgroup>

				<# } else { #>
				<option value="{{option.value}}" {{{option.meta}}}>{{{option.label}}}</option>
				<# }

				}); #>
			</select>
		</script>

		<script type="text/html" id="tmpl-pum-field-radio">
			<ul class="pum-field-radio-list">
				<# _.each(data.options, function(option, key) { #>
				<li
				<# print(option.value === data.value ? 'class="pum-selected"' : ''); #>>
				<input type="radio" id="{{data.id}}_{{key}}" name="{{data.name}}" value="{{option.value}}" {{{option.meta}}}/>
				<label for="{{data.id}}_{{key}}">{{{option.label}}}</label>
				</li>
				<# }); #>
			</ul>
		</script>

		<script type="text/html" id="tmpl-pum-field-checkbox">
			<input type="checkbox" id="{{data.id}}" name="{{data.name}}" value="1" {{{data.meta}}}/>
		</script>

		<script type="text/html" id="tmpl-pum-field-multicheck">
			<ul class="pum-field-mulitcheck-list">
				<# _.each(data.options, function(option, key) { #>
				<li>
					<input type="checkbox" id="{{data.id}}_{{key}}" name="{{data.name}}[{{option.value}}]" value="{{option.value}}" {{{option.meta}}}/>
					<label for="{{data.id}}_{{key}}">{{{option.label}}}</label>
				</li>
				<# }); #>
			</ul>
		</script>

		<script type="text/html" id="tmpl-pum-field-textarea">
			<textarea name="{{data.name}}" id="{{data.id}}" class="{{data.size}}-text" {{{data.meta}}}>{{data.value}}</textarea>
		</script>

		<script type="text/html" id="tmpl-pum-field-hidden">
			<input type="hidden" class="{{data.classes}}" id="{{data.id}}" name="{{data.name}}" value="{{data.value}}" {{{data.meta}}}/>
		</script>
		<?php
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.