install.sql 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. -- TABLE: data
  2. CREATE TABLE bx_quoteofday_internal (
  3. id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  4. text text NOT NULL,
  5. source1 tinyint(4) NOT NULL DEFAULT 0,
  6. is_active1 tinyint(4) DEFAULT 0,
  7. added int(11) DEFAULT NULL,
  8. status enum ('active', 'hidden') DEFAULT 'active',
  9. author1 varchar(255) DEFAULT NULL,
  10. status_admin enum ('active', 'hidden') DEFAULT 'active',
  11. PRIMARY KEY (id),
  12. FULLTEXT INDEX title_text (text)
  13. )
  14. ;
  15. -- FORMS
  16. SET @sName = 'bx_quoteofday';
  17. INSERT INTO sys_objects_form(object, module, title, action, form_attrs, submit_name, `table`, `key`, uri, uri_title, params, deletable, active, override_class_name, override_class_file) VALUES(@sName, @sName, '_bx_quoteofday_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'do_submit', 'bx_quoteofday_internal', 'id', '', '', '', 0, 1, '', '');
  18. INSERT INTO sys_form_displays(display_name, module, object, title, view_mode) VALUES
  19. ('bx_quoteofday_entry_add', @sName, @sName, '_bx_quoteofday_form_entry_display_add', 0),
  20. ('bx_quoteofday_entry_edit', @sName, @sName, '_bx_quoteofday_form_entry_display_edit', 0);
  21. INSERT INTO sys_form_inputs(`object`, module, name, value, `values`, checked, type, caption_system, caption, info, `required`, `unique`, collapsed, html, attrs, attrs_tr, attrs_wrapper, checker_func, checker_params, checker_error, db_pass, db_params, editable, deletable) VALUES
  22. (@sName, @sName, 'do_submit', '_bx_quoteofday_form_entry_input_do_submit', '', 0, 'submit', '_bx_quoteofday_form_entry_input_sys_do_submit', '', '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  23. (@sName, @sName, 'text', '', '', 0, 'textarea', '_bx_quoteofday_form_entry_input_sys_text', '_bx_quoteofday_form_entry_input_text', '', 1, 0, 0, 2, '', '', '', 'Avail', '', '_bx_quoteofday_form_entry_input_text_err', 'XssHtml', '', 1, 0),
  24. (@sName, @sName, 'cancel', '_bx_quoteofday_form_entry_input_cancel', '', 0, 'button', '_bx_dev_bp_btn_sys_block_cancel', '', '', 0, 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', 'Avail', '', '', '', '', 0, 0),
  25. (@sName, @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0);
  26. INSERT INTO sys_form_display_inputs(display_name, input_name, visible_for_levels, active, `order`) VALUES
  27. ('bx_quoteofday_entry_add', 'text', 2147483647, 1, 1),
  28. ('bx_quoteofday_entry_add', 'controls', 2147483647, 1, 2),
  29. ('bx_quoteofday_entry_add', 'do_submit', 2147483647, 1, 3),
  30. ('bx_quoteofday_entry_add', 'cancel', 2147483647, 1, 4),
  31. ('bx_quoteofday_entry_edit', 'text', 2147483647, 1, 1),
  32. ('bx_quoteofday_entry_edit', 'controls', 2147483647, 1, 2),
  33. ('bx_quoteofday_entry_edit', 'do_submit', 2147483647, 1, 3),
  34. ('bx_quoteofday_entry_edit', 'cancel', 2147483647, 1, 4);
  35. -- STUDIO: page & widget
  36. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  37. (3, 'bx_quoteofday', '_bx_quoteofday', '_bx_quoteofday', 'bx_quoteofday@modules/boonex/quoteofday/|std-icon.svg');
  38. SET @iPageId = LAST_INSERT_ID();
  39. INSERT INTO sys_std_widgets(page_id, module, url, click, icon, caption, cnt_notices, cnt_actions, bookmark)
  40. VALUES(@iPageId, 'bx_quoteofday', '{url_studio}module.php?name=bx_quoteofday', '', 'bx_quoteofday@modules/boonex/quoteofday/|std-icon.svg', '_bx_quoteofday', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}', 0);
  41. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  42. SET @iParentPageOrder = (SELECT IFNULL(MAX(`order`), 0) + 1 FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  43. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  44. (@iParentPageId, LAST_INSERT_ID(), @iParentPageOrder);