Pārlūkot izejas kodu

#51 - delayed files deletions: on module un-install

Alex Trofimov 12 gadi atpakaļ
vecāks
revīzija
e3e33b9914

+ 0 - 9
modules/boonex/notes/install/sql/disable.sql

@@ -22,15 +22,6 @@ DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_notes_allow_view_to';
 DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_notes';
 DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_notes';
 
--- COMMENTS
-DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_notes';
-
--- VOTES
-DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_notes';
-
--- VIEWS
-DELETE FROM `sys_objects_view` WHERE `Name` = 'bx_notes';
-
 -- SEARCH
 DELETE FROM `sys_objects_search` WHERE `ObjectName` = 'bx_notes';
 

+ 0 - 14
modules/boonex/notes/install/sql/enable.sql

@@ -236,20 +236,6 @@ INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
 (@iAdministrator, @iIdActionEntryEditAny);
 
 
--- COMMENTS
-INSERT INTO `sys_objects_cmts` (`Name`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
-('bx_notes', 'bx_notes_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 0, -3, 1, 'cmt', 'page/view-note&id={object_id}', '', 'bx_notes_posts', 'id', 'title', 'comments', '', '');
-
-
--- VOTES
-INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
-('bx_notes', 'bx_notes_votes', 'bx_notes_votes_track', '604800', '1', '1', '1', '1', 'bx_notes_posts', 'id', 'rate', 'votes', '', '');
-
-
--- VIEWS
-INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
-('bx_notes', 'bx_notes_views_track', '86400', '1', 'bx_notes_posts', 'id', 'views', '', '');
-
 -- SEARCH
 INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `ClassName`, `ClassPath`) VALUES
 ('bx_notes', '_bx_notes', 'BxNotesSearchResult', 'modules/boonex/notes/classes/BxNotesSearchResult.php');

+ 15 - 0
modules/boonex/notes/install/sql/install.sql

@@ -158,6 +158,21 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 ('bx_notes_entry_delete', 'text', 2147483647, 0, 0),
 ('bx_notes_entry_delete', 'title', 2147483647, 0, 0);
 
+-- COMMENTS
+
+INSERT INTO `sys_objects_cmts` (`Name`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_notes', 'bx_notes_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 0, -3, 1, 'cmt', 'page/view-note&id={object_id}', '', 'bx_notes_posts', 'id', 'title', 'comments', '', '');
+
+-- VOTES
+
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_notes', 'bx_notes_votes', 'bx_notes_votes_track', '604800', '1', '1', '1', '1', 'bx_notes_posts', 'id', 'rate', 'votes', '', '');
+
+-- VIEWS
+
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_notes', 'bx_notes_views_track', '86400', '1', 'bx_notes_posts', 'id', 'views', '', '');
+
 -- STUDIO: page & widget
 
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES

+ 12 - 0
modules/boonex/notes/install/sql/uninstall.sql

@@ -19,6 +19,18 @@ DELETE FROM `sys_form_displays` WHERE `module` = 'bx_notes';
 DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_notes';
 DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN ('bx_notes_entry_add', 'bx_notes_entry_edit', 'bx_notes_entry_view', 'bx_notes_entry_delete');
 
+-- COMMENTS
+
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_notes';
+
+-- VOTES
+
+DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_notes';
+
+-- VIEWS
+
+DELETE FROM `sys_objects_view` WHERE `Name` = 'bx_notes';
+
 -- STUDIO: page & widget
 
 DELETE FROM `tp`, `tw`, `tpw`