home.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Ext.onReady(function() {
  2. MODx.load({
  3. xtype : 'formit-page-home'
  4. });
  5. });
  6. FormIt.page.Home = function(config) {
  7. config = config || {};
  8. config.buttons = [];
  9. if (FormIt.config.branding_url) {
  10. config.buttons.push({
  11. text : 'FormIt ' + FormIt.config.version,
  12. cls : 'x-btn-branding',
  13. handler : this.loadBranding
  14. });
  15. }
  16. if (FormIt.config.branding_url_help) {
  17. config.buttons.push({
  18. text : _('help_ex'),
  19. handler : MODx.loadHelpPane,
  20. scope : this
  21. });
  22. }
  23. Ext.applyIf(config, {
  24. components : [{
  25. xtype : 'formit-panel-home',
  26. renderTo : 'formit-panel-home-div'
  27. }]
  28. });
  29. FormIt.page.Home.superclass.constructor.call(this, config);
  30. };
  31. Ext.extend(FormIt.page.Home, MODx.Component, {
  32. loadBranding: function(btn) {
  33. window.open(FormIt.config.branding_url);
  34. }
  35. });
  36. Ext.reg('formit-page-home', FormIt.page.Home);