install.sql 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. SET @sName = 'bx_quoteofday';
  2. -- TABLE: data
  3. CREATE TABLE `bx_quoteofday_internal` (
  4. `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  5. `text` text NOT NULL,
  6. `added` int(11) DEFAULT NULL,
  7. `status` enum ('active', 'hidden') DEFAULT 'active',
  8. PRIMARY KEY (`id`),
  9. FULLTEXT INDEX `search_fields` (`text`)
  10. );
  11. -- FORMS
  12. 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, '', '');
  13. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  14. ('bx_quoteofday_entry_add', @sName, @sName, '_bx_quoteofday_form_entry_display_add', 0),
  15. ('bx_quoteofday_entry_edit', @sName, @sName, '_bx_quoteofday_form_entry_display_edit', 0);
  16. 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
  17. (@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),
  18. (@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),
  19. (@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),
  20. (@sName, @sName, 'controls', '', 'do_submit,cancel', 0, 'input_set', '', '', '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0);
  21. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  22. ('bx_quoteofday_entry_add', 'text', 2147483647, 1, 1),
  23. ('bx_quoteofday_entry_add', 'controls', 2147483647, 1, 2),
  24. ('bx_quoteofday_entry_add', 'do_submit', 2147483647, 1, 3),
  25. ('bx_quoteofday_entry_add', 'cancel', 2147483647, 1, 4),
  26. ('bx_quoteofday_entry_edit', 'text', 2147483647, 1, 1),
  27. ('bx_quoteofday_entry_edit', 'controls', 2147483647, 1, 2),
  28. ('bx_quoteofday_entry_edit', 'do_submit', 2147483647, 1, 3),
  29. ('bx_quoteofday_entry_edit', 'cancel', 2147483647, 1, 4);
  30. -- STUDIO: page & widget
  31. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  32. (3, @sName, '_bx_quoteofday', '_bx_quoteofday', 'bx_quoteofday@modules/boonex/quoteofday/|std-icon.svg');
  33. SET @iPageId = LAST_INSERT_ID();
  34. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`, `featured`)
  35. VALUES(@iPageId, @sName, 'content', '{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);
  36. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  37. SET @iParentPageOrder = (SELECT IFNULL(MAX(`order`), 0) + 1 FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  38. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  39. (@iParentPageId, LAST_INSERT_ID(), @iParentPageOrder);