$('#api-params').append($(fieldTpl({name: name || ''})));
var $row = $('tr:last-child', '#api-params');
$('input.api-param-name', $row).crmSelect2({
- data: fields.concat({id: '-', text: ts('Other') + '...'})
+ data: fields.concat({id: '-', text: ts('Other') + '...', description: ts('Choose a field not in this list')}),
+ formatResult: function(field) {
+ return field.text + '<div class="api-field-desc">' + field.description + '</div>';
+ }
}).change();
}
id: field.name,
text: field.title || field.name,
multi: !!field['api.multiple'],
+ description: field.description || '',
required: !(!field['api.required'] || field['api.required'] === '0')
});
if (field['api.required'] && field['api.required'] !== '0') {
background-image: url("{/literal}{$config->resourceBase}{literal}/i/icons/jquery-ui-52534D.png");
opacity: .8;
}
+ .api-field-desc {
+ font-size: .8em;
+ color: #828282;
+ line-height: 1.3em;
+ }
+ .select2-highlighted .api-field-desc {
+ color: #fcfcfc;
+ }
+ .api-param-op[readonly] {
+ width: 4em;
+ }
pre ol.linenums li {
list-style-type: decimal;
color: #CFCFCF;
{if $field.title}
'title' => ts('{$field.title}'),
{/if}
+{if $field.comment}
+ 'description' => '{$field.comment|replace:"'":"\'"}',
+{/if}
{if $field.required}
'required' => {$field.required},
{/if} {* field.required *}