number.tpl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. var element = Ext.getCmp('modx-tv-elements');
  12. if (element) {
  13. element.hide();
  14. }
  15. MODx.load({
  16. xtype: 'panel'
  17. ,layout: 'form'
  18. ,autoHeight: true
  19. ,cls: 'form-with-labels'
  20. ,labelAlign: 'top'
  21. ,border: false
  22. ,items: [{
  23. xtype: 'combo-boolean'
  24. ,fieldLabel: _('required')
  25. ,description: MODx.expandHelp ? '' : _('required_desc')
  26. ,name: 'inopt_allowBlank'
  27. ,hiddenName: 'inopt_allowBlank'
  28. ,id: 'inopt_allowBlank{/literal}{$tv|default}{literal}'
  29. ,width: 200
  30. ,value: (params['allowBlank']) ? !(params['allowBlank'] === 0 || params['allowBlank'] === 'false') : true
  31. ,listeners: oc
  32. },{
  33. xtype: MODx.expandHelp ? 'label' : 'hidden'
  34. ,forId: 'inopt_allowBlank{/literal}{$tv|default}{literal}'
  35. ,html: _('required_desc')
  36. ,cls: 'desc-under'
  37. },{
  38. xtype: 'combo-boolean'
  39. ,fieldLabel: _('number_allowdecimals')
  40. ,name: 'inopt_allowDecimals'
  41. ,hiddenName: 'inopt_allowDecimals'
  42. ,id: 'inopt_allowDecimals{/literal}{$tv|default}{literal}'
  43. ,width: 200
  44. ,value: (params['allowDecimals']) ? !(params['allowDecimals'] === 0 || params['allowDecimals'] === 'false') : true
  45. ,listeners: oc
  46. },{
  47. xtype: MODx.expandHelp ? 'label' : 'hidden'
  48. ,forId: 'inopt_allowDecimals{/literal}{$tv|default}{literal}'
  49. ,html: _('allowdecimals_desc')
  50. ,cls: 'desc-under'
  51. },{
  52. xtype: 'combo-boolean'
  53. ,fieldLabel: _('number_allownegative')
  54. ,name: 'inopt_allowNegative'
  55. ,hiddenName: 'inopt_allowNegative'
  56. ,id: 'inopt_allowNegative{/literal}{$tv|default}{literal}'
  57. ,width: 200
  58. ,value: (params['allowNegative']) ? !(params['allowNegative'] === 0 || params['allowNegative'] === 'false') : true
  59. ,listeners: oc
  60. },{
  61. xtype: MODx.expandHelp ? 'label' : 'hidden'
  62. ,forId: 'inopt_allowNegative{/literal}{$tv|default}{literal}'
  63. ,html: _('allownegative_desc')
  64. ,cls: 'desc-under'
  65. },{
  66. xtype: 'numberfield'
  67. ,fieldLabel: _('number_decimalprecision')
  68. ,name: 'inopt_decimalPrecision'
  69. ,id: 'inopt_decimalPrecision{/literal}{$tv|default}{literal}'
  70. ,value: params['decimalPrecision'] || 2
  71. ,width: 100
  72. ,listeners: oc
  73. },{
  74. xtype: MODx.expandHelp ? 'label' : 'hidden'
  75. ,forId: 'inopt_decimalPrecision{/literal}{$tv|default}{literal}'
  76. ,html: _('decimalprecision_desc')
  77. ,cls: 'desc-under'
  78. },{
  79. xtype: 'textfield'
  80. ,fieldLabel: _('number_decimalseparator')
  81. ,name: 'inopt_decimalSeparator'
  82. ,id: 'inopt_decimalSeparator{/literal}{$tv|default}{literal}'
  83. ,value: params['decimalSeparator'] || '.'
  84. ,width: 100
  85. ,listeners: oc
  86. },{
  87. xtype: MODx.expandHelp ? 'label' : 'hidden'
  88. ,forId: 'inopt_decimalSeparator{/literal}{$tv|default}{literal}'
  89. ,html: _('decimalseparator_desc')
  90. ,cls: 'desc-under'
  91. },{
  92. xtype: 'textfield'
  93. ,fieldLabel: _('number_maxvalue')
  94. ,name: 'inopt_maxValue'
  95. ,id: 'inopt_maxValue{/literal}{$tv|default}{literal}'
  96. ,value: params['maxValue'] || ''
  97. ,width: 300
  98. ,listeners: oc
  99. },{
  100. xtype: MODx.expandHelp ? 'label' : 'hidden'
  101. ,forId: 'inopt_maxValue{/literal}{$tv|default}{literal}'
  102. ,html: _('maxvalue_desc')
  103. ,cls: 'desc-under'
  104. },{
  105. xtype: 'textfield'
  106. ,fieldLabel: _('number_minvalue')
  107. ,name: 'inopt_minValue'
  108. ,id: 'inopt_minValue{/literal}{$tv|default}{literal}'
  109. ,value: params['minValue'] || ''
  110. ,width: 300
  111. ,listeners: oc
  112. },{
  113. xtype: MODx.expandHelp ? 'label' : 'hidden'
  114. ,forId: 'inopt_minValue{/literal}{$tv|default}{literal}'
  115. ,html: _('minvalue_desc')
  116. ,cls: 'desc-under'
  117. }]
  118. ,renderTo: 'tv-input-properties-form{/literal}{$tv|default}{literal}'
  119. });
  120. // ]]>
  121. </script>
  122. {/literal}