checkbox.tpl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <div id="tv-input-properties-form{$tv|default}"></div>
  2. {literal}
  3. <script type="text/javascript">
  4. // <![CDATA[
  5. var params = {
  6. {/literal}{foreach from=$params key=k item=v name='p'}
  7. '{$k}': '{$v|escape:"javascript"}'{if NOT $smarty.foreach.p.last},{/if}
  8. {/foreach}{literal}
  9. };
  10. var oc = {'change':{fn:function(){Ext.getCmp('modx-panel-tv').markDirty();},scope:this}};
  11. MODx.load({
  12. xtype: 'panel'
  13. ,layout: 'form'
  14. ,autoHeight: true
  15. ,labelAlign: 'top'
  16. ,cls: 'form-with-labels'
  17. ,border: false
  18. ,items: [{
  19. xtype: 'combo-boolean'
  20. ,fieldLabel: _('required')
  21. ,description: MODx.expandHelp ? '' : _('required_desc')
  22. ,name: 'inopt_allowBlank'
  23. ,hiddenName: 'inopt_allowBlank'
  24. ,id: 'inopt_allowBlank{/literal}{$tv|default}{literal}'
  25. ,width: 200
  26. ,value: (params['allowBlank']) ? !(params['allowBlank'] === 0 || params['allowBlank'] === 'false') : true
  27. ,listeners: oc
  28. },{
  29. xtype: MODx.expandHelp ? 'label' : 'hidden'
  30. ,forId: 'inopt_allowBlank{/literal}{$tv|default}{literal}'
  31. ,html: _('required_desc')
  32. ,cls: 'desc-under'
  33. },{
  34. xtype: 'numberfield'
  35. ,allowNegative: false
  36. ,allowDecimals: false
  37. ,fieldLabel: _('checkbox_columns')
  38. ,description: MODx.expandHelp ? '' : _('checkbox_columns_desc')
  39. ,name: 'inopt_columns'
  40. ,id: 'inopt_columns{/literal}{$tv|default}{literal}'
  41. ,value: params['columns'] || 1
  42. ,width: 300
  43. ,listeners: oc
  44. },{
  45. xtype: MODx.expandHelp ? 'label' : 'hidden'
  46. ,forId: 'inopt_columns{/literal}{$tv|default}{literal}'
  47. ,html: _('checkbox_columns_desc')
  48. ,cls: 'desc-under'
  49. }]
  50. ,renderTo: 'tv-input-properties-form{/literal}{$tv|default}{literal}'
  51. });
  52. // ]]>
  53. </script>
  54. {/literal}