Guest User

Untitled

a guest
Feb 16th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. ,getMainRightBottomFields: function(config) {
  2. config = config || {};
  3.  
  4. var menuindex = [{
  5. xtype: 'numberfield'
  6. ,fieldLabel: _('resource_menuindex')
  7. ,description: '<b>[[*menuindex]]</b><br />'+_('resource_menuindex_help')
  8. ,name: 'menuindex'
  9. ,id: 'modx-resource-menuindex'
  10. ,width: 75
  11. ,value: parseInt(config.record.menuindex) || 0
  12. }];
  13.  
  14. var items = [{
  15. xtype: 'xcheckbox'
  16. ,boxLabel: _('resource_hide_from_menus')
  17. ,hideLabel: true
  18. ,cls: 'warning'
  19. ,description: '<b>[[*hidemenu]]</b><br />'+_('resource_hide_from_menus_help')
  20. ,name: 'hidemenu'
  21. ,id: 'modx-resource-hidemenu'
  22. ,inputValue: 1
  23. ,checked: parseInt(config.record.hidemenu) || false
  24. },{
  25. xtype: 'textfield'
  26. ,fieldLabel: _('resource_menutitle')
  27. ,description: '<b>[[*menutitle]]</b><br />'+_('resource_menutitle_help')
  28. ,name: 'menutitle'
  29. ,id: 'modx-resource-menutitle'
  30. ,maxLength: 255
  31. ,anchor: '100%'
  32. ,value: config.record.menutitle || ''
  33. },{
  34. xtype: 'textfield'
  35. ,fieldLabel: _('resource_link_attributes')
  36. ,description: '<b>[[*link_attributes]]</b><br />'+_('resource_link_attributes_help')
  37. ,name: 'link_attributes'
  38. ,id: 'modx-resource-link-attributes'
  39. ,maxLength: 255
  40. ,anchor: '100%'
  41. ,value: config.record.link_attributes || ''
  42. }];
  43.  
  44. if (MODx.perm.resourcegroup_resource_list) {
  45. items.push(menuindex);
  46. }
  47.  
  48. var it = [{
  49. layout: 'form'
  50. ,id: 'modx-resource-main-right-bottom'
  51. ,cls: 'modx-resource-panel'
  52. ,title: _('resource_right_bottom_title')
  53. ,collapsible: true
  54. ,stateful: true
  55. ,stateEvents: ['collapse', 'expand']
  56. ,getState: function() {
  57. return { collapsed: this.collapsed };
  58. }
  59. ,items: items
  60. }]
  61.  
  62. return it;
  63. }
  64.  
  65. ,getMainRightFields: function(config) {
  66. config = config || {};
  67.  
  68. var it = [{
  69. layout: 'form'
  70. ,id: 'modx-resource-main-right-top'
  71. ,cls: 'modx-resource-panel'
  72. ,title: _('resource_right_top_title')
  73. ,collapsible: true
  74. ,stateful: true
  75. ,stateEvents: ['collapse', 'expand']
  76. ,getState: function() {
  77. return { collapsed: this.collapsed };
  78. }
  79. ,items: [{
  80. xtype: 'xcheckbox'
  81. ,boxLabel: _('resource_published')
  82. ,hideLabel: true
  83. ,description: '<b>[[*published]]</b><br />'+_('resource_published_help')
  84. ,name: 'published'
  85. ,id: 'modx-resource-published'
  86. ,inputValue: 1
  87. ,checked: parseInt(config.record.published)
  88. },{
  89. xtype: 'xdatetime'
  90. ,fieldLabel: _('resource_publishedon')
  91. ,description: '<b>[[*publishedon]]</b><br />'+_('resource_publishedon_help')
  92. ,name: 'publishedon'
  93. ,id: 'modx-resource-publishedon'
  94. ,allowBlank: true
  95. ,dateFormat: MODx.config.manager_date_format
  96. ,timeFormat: MODx.config.manager_time_format
  97. ,startDay: parseInt(MODx.config.manager_week_start)
  98. ,dateWidth: '100%'
  99. ,timeWidth: '100%'
  100. ,offset_time: MODx.config.server_offset_time
  101. ,value: config.record.publishedon
  102. },{
  103. xtype: MODx.config.publish_document ? 'xdatetime' : 'hidden'
  104. ,fieldLabel: _('resource_publishdate')
  105. ,description: '<b>[[*pub_date]]</b><br />'+_('resource_publishdate_help')
  106. ,name: 'pub_date'
  107. ,id: 'modx-resource-pub-date'
  108. ,allowBlank: true
  109. ,dateFormat: MODx.config.manager_date_format
  110. ,timeFormat: MODx.config.manager_time_format
  111. ,startDay: parseInt(MODx.config.manager_week_start)
  112. ,dateWidth: '100%'
  113. ,timeWidth: '100%'
  114. ,offset_time: MODx.config.server_offset_time
  115. ,value: config.record.pub_date
  116. },{
  117. xtype: MODx.config.publish_document ? 'xdatetime' : 'hidden'
  118. ,fieldLabel: _('resource_unpublishdate')
  119. ,description: '<b>[[*unpub_date]]</b><br />'+_('resource_unpublishdate_help')
  120. ,name: 'unpub_date'
  121. ,id: 'modx-resource-unpub-date'
  122. ,allowBlank: true
  123. ,dateFormat: MODx.config.manager_date_format
  124. ,timeFormat: MODx.config.manager_time_format
  125. ,startDay: parseInt(MODx.config.manager_week_start)
  126. ,dateWidth: '100%'
  127. ,timeWidth: '100%'
  128. ,offset_time: MODx.config.server_offset_time
  129. ,value: config.record.unpub_date
  130. }]
  131. },{
  132. layout: 'form'
  133. ,id: 'modx-resource-main-right-middle'
  134. ,cls: 'modx-resource-panel'
  135. ,title: _('resource_right_middle_title')
  136. ,collapsible: true
  137. ,stateful: true
  138. ,stateEvents: ['collapse', 'expand']
  139. ,getState: function() {
  140. return { collapsed: this.collapsed };
  141. }
  142. ,items: [{
  143. xtype: 'modx-combo-template'
  144. ,fieldLabel: _('resource_template')
  145. ,hideLabel: true
  146. ,description: '<b>[[*template]]</b><br />'+_('resource_template_help')
  147. ,name: 'template'
  148. ,id: 'modx-resource-template'
  149. ,anchor: '100%'
  150. ,editable: true
  151. ,typeAhead: true
  152. ,typeAheadDelay: 300
  153. ,forceSelection: true
  154. ,baseParams: {
  155. action: 'element/template/getList'
  156. ,combo: '1'
  157. ,limit: 0
  158. }
  159. ,listeners: {
  160. 'select': {fn: this.templateWarning,scope: this}
  161. }
  162. }]
  163. }]
  164.  
  165. it.push(this.getMainRightBottomFields(config));
  166.  
  167. return it;
  168. }
Add Comment
Please, Sign In to add comment