瀏覽代碼

#86 - Rename "Notes" to "Posts".

AntonLV 12 年之前
父節點
當前提交
688198e82a
共有 39 個文件被更改,包括 763 次插入 和 763 次删除
  1. 0 89
      modules/boonex/notes/classes/BxNotesConfig.php
  2. 0 100
      modules/boonex/notes/install/langs/en.xml
  3. 0 30
      modules/boonex/notes/install/sql/disable.sql
  4. 0 39
      modules/boonex/notes/install/sql/uninstall.sql
  5. 89 0
      modules/boonex/posts/classes/BxPostsConfig.php
  6. 2 2
      modules/boonex/posts/classes/BxPostsDb.php
  7. 3 3
      modules/boonex/posts/classes/BxPostsFormEntry.php
  8. 2 2
      modules/boonex/posts/classes/BxPostsFormsEntryHelper.php
  9. 3 3
      modules/boonex/posts/classes/BxPostsMenu.php
  10. 3 3
      modules/boonex/posts/classes/BxPostsMenuView.php
  11. 3 3
      modules/boonex/posts/classes/BxPostsModule.php
  12. 2 2
      modules/boonex/posts/classes/BxPostsPageAuthor.php
  13. 3 3
      modules/boonex/posts/classes/BxPostsPageBrowse.php
  14. 3 3
      modules/boonex/posts/classes/BxPostsPageEntry.php
  15. 14 14
      modules/boonex/posts/classes/BxPostsSearchResult.php
  16. 3 3
      modules/boonex/posts/classes/BxPostsTemplate.php
  17. 9 9
      modules/boonex/posts/install/config.php
  18. 4 4
      modules/boonex/posts/install/installer.php
  19. 100 0
      modules/boonex/posts/install/langs/en.xml
  20. 30 0
      modules/boonex/posts/install/sql/disable.sql
  21. 251 251
      modules/boonex/posts/install/sql/enable.sql
  22. 199 199
      modules/boonex/posts/install/sql/install.sql
  23. 39 0
      modules/boonex/posts/install/sql/uninstall.sql
  24. 1 1
      modules/boonex/posts/request.php
  25. 0 0
      modules/boonex/posts/template/attachments.html
  26. 0 0
      modules/boonex/posts/template/author.html
  27. 0 0
      modules/boonex/posts/template/css/forms.css
  28. 0 0
      modules/boonex/posts/template/css/main.css
  29. 0 0
      modules/boonex/posts/template/entry-share.html
  30. 0 0
      modules/boonex/posts/template/entry-text.html
  31. 0 0
      modules/boonex/posts/template/form_ghost_template.html
  32. 0 0
      modules/boonex/posts/template/images/icons/std-mi.png
  33. 0 0
      modules/boonex/posts/template/images/icons/std-pi.png
  34. 0 0
      modules/boonex/posts/template/images/icons/std-si.png
  35. 0 0
      modules/boonex/posts/template/images/icons/std-wi.png
  36. 0 0
      modules/boonex/posts/template/unit.html
  37. 0 0
      modules/boonex/posts/template/unit_gallery.html
  38. 0 0
      modules/boonex/posts/template/unit_live_search.html
  39. 0 0
      modules/boonex/posts/template/unit_private.html

+ 0 - 89
modules/boonex/notes/classes/BxNotesConfig.php

@@ -1,89 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    Notes Notes
- * @ingroup     DolphinModules
- *
- * @{
- */
-
-bx_import('BxBaseModTextConfig');
-
-class BxNotesConfig extends BxBaseModTextConfig
-{
-    function __construct($aModule)
-    {
-        parent::__construct($aModule);
-
-        $this->CNF = array (
-
-            // database tables
-            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'posts',
-
-            // database fields
-            'FIELD_ID' => 'id',
-            'FIELD_AUTHOR' => 'author',
-            'FIELD_ADDED' => 'added',
-            'FIELD_CHANGED' => 'changed',
-            'FIELD_TITLE' => 'title',
-            'FIELD_TEXT' => 'text',
-            'FIELD_TEXT_ID' => 'note-text',
-            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
-            'FIELD_PHOTO' => 'pictures',
-            'FIELD_THUMB' => 'thumb',
-            'FIELD_COMMENTS' => 'comments',
-
-            // page URIs
-            'URI_VIEW_ENTRY' => 'view-note',
-            'URI_AUTHOR_ENTRIES' => 'notes-author',
-            'URI_ADD_ENTRY' => 'create-note',
-
-            'URL_HOME' => 'page.php?i=notes-home',
-
-            // some params
-            'PARAM_CHARS_SUMMARY' => 'bx_notes_summary_chars',
-            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_notes_plain_summary_chars',
-            'PARAM_NUM_RSS' => 'bx_notes_rss_num',
-
-            // objects
-            'OBJECT_STORAGE' => 'bx_notes_files',
-            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_notes_preview',
-            'OBJECT_VIEWS' => 'bx_notes',
-            'OBJECT_VOTES' => 'bx_notes',
-            'OBJECT_METATAGS' => 'bx_notes',
-            'OBJECT_COMMENTS' => 'bx_notes',
-            'OBJECT_PRIVACY_VIEW' => 'bx_notes_allow_view_to',
-            'OBJECT_FORM_ENTRY' => 'bx_notes',
-            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_notes_entry_view',
-            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_notes_entry_add',
-            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_notes_entry_edit',
-            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_notes_entry_delete',
-            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_notes_view', // actions menu on view entry page
-            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_notes_my', // actions menu on my entries page
-            'OBJECT_MENU_SUBMENU' => 'bx_notes_submenu', // main module submenu
-            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_notes_view_submenu', // view entry submenu
-            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'notes-home', // first item in view entry submenu from main module submenu
-
-            // menu items which visibility depends on custom visibility checking
-            'MENU_ITEM_TO_METHOD' => array (
-                'bx_notes_my' => array (
-                    'create-note' => 'checkAllowedAdd',
-                ),
-                'bx_notes_view' => array (
-                    'edit-note' => 'checkAllowedEdit',
-                    'delete-note' => 'checkAllowedDelete',
-                ),
-            ),
-
-            // some language keys
-            'T' => array (
-                'txt_sample_single' => '_bx_notes_txt_sample_single',
-            ),
-        );
-
-    }
-}
-
-/** @} */

+ 0 - 100
modules/boonex/notes/install/langs/en.xml

@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources name="en" flag="gb" title="English">
-
-	<string name="_bx_notes"><![CDATA[Notes]]></string>
-
-	<string name="_bx_notes_option_summary_chars"><![CDATA[Number of characters in auto-cropped note summary]]></string>
-	<string name="_bx_notes_option_plain_summary_chars"><![CDATA[Number of characters in plain note description when note hasn't thumb]]></string>
-	<string name="_bx_notes_option_per_page_browse"><![CDATA[Number of items per page]]></string>
-	<string name="_bx_notes_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
-
-	<string name="_bx_notes_form_entry"><![CDATA[Notes]]></string>
-	<string name="_bx_notes_form_entry_display_add"><![CDATA[Add Note]]></string>
-	<string name="_bx_notes_form_entry_display_edit"><![CDATA[Edit Note]]></string>
-	<string name="_bx_notes_form_entry_display_delete"><![CDATA[Delete Note]]></string>
-	<string name="_bx_notes_form_entry_display_view"><![CDATA[View Note]]></string>
-	<string name="_bx_notes_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
-	<string name="_bx_notes_form_entry_input_do_submit"><![CDATA[Submit]]></string>
-	<string name="_bx_notes_form_entry_input_sys_title"><![CDATA[Title]]></string>
-	<string name="_bx_notes_form_entry_input_title"><![CDATA[Title]]></string>
-	<string name="_bx_notes_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
-	<string name="_bx_notes_form_entry_input_sys_text"><![CDATA[Text]]></string>
-	<string name="_bx_notes_form_entry_input_text"><![CDATA[Text]]></string>
-	<string name="_bx_notes_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
-	<string name="_bx_notes_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
-	<string name="_bx_notes_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this note]]></string>
-	<string name="_bx_notes_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
-	<string name="_bx_notes_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the note]]></string>
-	<string name="_bx_notes_form_entry_input_sys_pictures"><![CDATA[Pictures]]></string>
-	<string name="_bx_notes_form_entry_input_pictures"><![CDATA[Pictures]]></string>
-    <string name="_bx_notes_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
-    <string name="_bx_notes_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
-
-	<string name="_bx_notes_acl_action_create_entry"><![CDATA[Create Note]]></string>
-	<string name="_bx_notes_acl_action_delete_entry"><![CDATA[Delete Note]]></string>
-	<string name="_bx_notes_acl_action_view_entry"><![CDATA[View Note]]></string>
-	<string name="_bx_notes_acl_action_set_thumb"><![CDATA[Set Note Thumbnail]]></string>
-	<string name="_bx_notes_acl_action_edit_any_entry"><![CDATA[Edit Any Note]]></string>
-
-	<string name="_bx_notes_page_title_sys_create_entry"><![CDATA[Create Note]]></string>
-	<string name="_bx_notes_page_title_create_entry"><![CDATA[Create Note]]></string>
-	<string name="_bx_notes_page_block_title_create_entry"><![CDATA[Create Note]]></string>
-	<string name="_bx_notes_page_title_sys_edit_entry"><![CDATA[Edit Note]]></string>
-	<string name="_bx_notes_page_title_edit_entry"><![CDATA[Edit Note]]></string>
-	<string name="_bx_notes_page_block_title_edit_entry"><![CDATA[Edit Note]]></string>
-    <string name="_bx_notes_page_title_sys_delete_entry"><![CDATA[Delete Note]]></string>
-    <string name="_bx_notes_page_title_delete_entry"><![CDATA[Delete Note]]></string>
-    <string name="_bx_notes_page_block_title_delete_entry"><![CDATA[Delete Note]]></string>
-	<string name="_bx_notes_page_title_sys_view_entry"><![CDATA[View Note]]></string>
-	<string name="_bx_notes_page_title_view_entry"><![CDATA[{title}]]></string>
-	<string name="_bx_notes_page_block_title_entry_text"><![CDATA[Note Text]]></string>
-	<string name="_bx_notes_page_title_browse"><![CDATA[Notes]]></string>
-	<string name="_bx_notes_page_title_search_results"><![CDATA[Notes matching "{0}"]]></string>
-	<string name="_bx_notes_page_title_browse_by_author"><![CDATA[Notes of {display_name}]]></string>
-    <string name="_bx_notes_page_title_browse_recent"><![CDATA[Recent Notes]]></string>
-    <string name="_bx_notes_page_title_sys_home"><![CDATA[Notes Home]]></string>
-    <string name="_bx_notes_page_title_home"><![CDATA[Notes]]></string>
-    <string name="_bx_notes_page_block_title_recent_entries"><![CDATA[Recent Notes]]></string>
-    <string name="_bx_notes_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
-    <string name="_bx_notes_page_block_title_entry_author"><![CDATA[Author]]></string>
-    <string name="_bx_notes_page_block_title_entry_actions"><![CDATA[Actions]]></string>
-    <string name="_bx_notes_page_block_title_entry_comments"><![CDATA[Comments]]></string>
-    <string name="_bx_notes_page_title_sys_entries_featured"><![CDATA[Featured Notes]]></string>
-    <string name="_bx_notes_page_title_entries_featured"><![CDATA[Featured Notes]]></string>
-    <string name="_bx_notes_page_block_title_featured_entries"><![CDATA[Featured Notes]]></string>
-    <string name="_bx_notes_page_title_sys_view_entry_comments"><![CDATA[Note Comments]]></string>
-    <string name="_bx_notes_page_title_view_entry_comments"><![CDATA[Note Comments]]></string>
-    <string name="_bx_notes_page_title_sys_entries_of_author"><![CDATA[Notes of author]]></string>
-    <string name="_bx_notes_page_title_entries_of_author"><![CDATA[Notes of {display_name}]]></string>
-    <string name="_bx_notes_page_block_title_entries_of_author"><![CDATA[Notes of author]]></string>   
-    <string name="_bx_notes_page_block_title_entries_actions"><![CDATA[Notes actions]]></string>
-
-    <string name="_bx_notes_menu_set_title_view_entry"><![CDATA[View Note]]></string>
-    <string name="_bx_notes_menu_title_view_entry"><![CDATA[View Note]]></string>
-    <string name="_bx_notes_menu_title_submenu"><![CDATA[Notes Submenu]]></string>
-    <string name="_bx_notes_menu_set_title_submenu"><![CDATA[Notes Submenu]]></string>
-    <string name="_bx_notes_menu_item_title_system_create_entry"><![CDATA[Create Note]]></string>
-    <string name="_bx_notes_menu_item_title_create_entry"><![CDATA[Create Note]]></string>
-    <string name="_bx_notes_menu_item_title_system_edit_entry"><![CDATA[Edit Note]]></string>
-    <string name="_bx_notes_menu_item_title_edit_entry"><![CDATA[Edit Note]]></string>
-    <string name="_bx_notes_menu_item_title_system_delete_entry"><![CDATA[Delete Note]]></string>
-    <string name="_bx_notes_menu_item_title_delete_entry"><![CDATA[Delete Note]]></string>
-    <string name="_bx_notes_menu_item_title_system_view_entry"><![CDATA[View Note]]></string>
-    <string name="_bx_notes_menu_item_title_system_entries_home"><![CDATA[Notes]]></string>
-    <string name="_bx_notes_menu_item_title_entries_home"><![CDATA[Notes]]></string>
-    <string name="_bx_notes_menu_item_title_system_entries_public"><![CDATA[Public]]></string>
-    <string name="_bx_notes_menu_item_title_entries_public"><![CDATA[Public]]></string>
-    <string name="_bx_notes_menu_item_title_system_entries_featured"><![CDATA[Featured]]></string>
-    <string name="_bx_notes_menu_item_title_entries_featured"><![CDATA[Featured]]></string>
-    <string name="_bx_notes_menu_title_view_entry_submenu"><![CDATA[View Note Submenu]]></string>
-    <string name="_bx_notes_menu_set_title_view_entry_submenu"><![CDATA[View Note Submenu]]></string>
-    <string name="_bx_notes_menu_item_title_view_entry_submenu_entry"><![CDATA[Note]]></string>
-    <string name="_bx_notes_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
-    <string name="_bx_notes_menu_item_title_system_view_entry_comments"><![CDATA[Note Comments]]></string>
-    <string name="_bx_notes_menu_item_title_system_view_entries_author"><![CDATA[Notes]]></string>
-    <string name="_bx_notes_menu_item_title_view_entries_author"><![CDATA[Notes]]></string>
-    <string name="_bx_notes_menu_title_entries_my"><![CDATA[My Notes Action Menu]]></string>
-    <string name="_bx_notes_menu_set_title_entries_my"><![CDATA[My Notes Menu]]></string>
-
-    <string name="_bx_notes_txt_sample_single"><![CDATA[note]]></string>
-</resources>

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

@@ -1,30 +0,0 @@
-
--- SETTINGS
-SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_notes' LIMIT 1);
-SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
-DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
-DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
-DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
-
--- PAGES
-DELETE FROM `sys_objects_page` WHERE `module` = 'bx_notes';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_notes' OR `object` IN('bx_notes_create_entry', 'bx_notes_edit_entry', 'bx_notes_delete_entry', 'bx_notes_view_entry', 'bx_notes_view_entry_comments', 'bx_notes_home', 'bx_notes_featured', 'bx_notes_author');
-
--- MENU
-DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_notes';
-DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_notes';
-DELETE FROM `sys_menu_items` WHERE `module` = 'bx_notes' OR `set_name` IN('bx_notes_view', 'bx_notes_submenu', 'bx_notes_view_submenu', 'bx_notes_my');
-
--- PRIVACY 
-DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_notes_allow_view_to';
-
--- ACL
-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';
-
--- SEARCH
-DELETE FROM `sys_objects_search` WHERE `ObjectName` = 'bx_notes';
-
--- METATAGS
-DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_notes';
-

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

@@ -1,39 +0,0 @@
-
--- TABLES
-
-DROP TABLE IF EXISTS `bx_notes_posts`, `bx_notes_files`, `bx_notes_photos_resized`, `bx_notes_cmts`, `bx_notes_votes`, `bx_notes_votes_track`, `bx_notes_views_track`, `bx_notes_meta_keywords`;
-
--- STORAGES & TRANSCODERS
-
-DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_notes_files' OR `object` = 'bx_notes_photos_resized';
-DELETE FROM `sys_storage_tokens` WHERE `object` = 'bx_notes_files' OR `object` = 'bx_notes_photos_resized';
-
-DELETE FROM `sys_objects_transcoder_images` WHERE `object` = 'bx_notes_preview';
-DELETE FROM `sys_transcoder_images_filters` WHERE `transcoder_object` = 'bx_notes_preview';
-DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` = 'bx_notes_preview';
-
--- FORMS
-
-DELETE FROM `sys_objects_form` WHERE `module` = 'bx_notes';
-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`
-USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
-WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_notes';
-

+ 89 - 0
modules/boonex/posts/classes/BxPostsConfig.php

@@ -0,0 +1,89 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Posts Posts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+bx_import('BxBaseModTextConfig');
+
+class BxPostsConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this->CNF = array (
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'posts',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_TITLE' => 'title',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'post-text',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_PHOTO' => 'pictures',
+            'FIELD_THUMB' => 'thumb',
+            'FIELD_COMMENTS' => 'comments',
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-post',
+            'URI_AUTHOR_ENTRIES' => 'posts-author',
+            'URI_ADD_ENTRY' => 'create-post',
+
+            'URL_HOME' => 'page.php?i=posts-home',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_posts_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_posts_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_posts_rss_num',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_posts_files',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_posts_preview',
+            'OBJECT_VIEWS' => 'bx_posts',
+            'OBJECT_VOTES' => 'bx_posts',
+            'OBJECT_METATAGS' => 'bx_posts',
+            'OBJECT_COMMENTS' => 'bx_posts',
+            'OBJECT_PRIVACY_VIEW' => 'bx_posts_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_posts',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_posts_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_posts_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_posts_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_posts_entry_delete',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_posts_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_posts_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_posts_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_posts_view_submenu', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'posts-home', // first item in view entry submenu from main module submenu
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_posts_my' => array (
+                    'create-post' => 'checkAllowedAdd',
+                ),
+                'bx_posts_view' => array (
+                    'edit-post' => 'checkAllowedEdit',
+                    'delete-post' => 'checkAllowedDelete',
+                ),
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_posts_txt_sample_single',
+            ),
+        );
+
+    }
+}
+
+/** @} */

+ 2 - 2
modules/boonex/notes/classes/BxNotesDb.php → modules/boonex/posts/classes/BxPostsDb.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,7 +14,7 @@ bx_import('BxBaseModTextDb');
 /*
  * Module database queries
  */
-class BxNotesDb extends BxBaseModTextDb
+class BxPostsDb extends BxBaseModTextDb
 {
     function __construct(&$oConfig)
     {

+ 3 - 3
modules/boonex/notes/classes/BxNotesFormEntry.php → modules/boonex/posts/classes/BxPostsFormEntry.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,11 +14,11 @@ bx_import('BxBaseModTextFormEntry');
 /**
  * Create/Edit entry form
  */
-class BxNotesFormEntry extends BxBaseModTextFormEntry
+class BxPostsFormEntry extends BxBaseModTextFormEntry
 {
     public function __construct($aInfo, $oTemplate = false)
     {
-        $this->MODULE = 'bx_notes';
+        $this->MODULE = 'bx_posts';
         parent::__construct($aInfo, $oTemplate);
     }
 }

+ 2 - 2
modules/boonex/notes/classes/BxNotesFormsEntryHelper.php → modules/boonex/posts/classes/BxPostsFormsEntryHelper.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,7 +14,7 @@ bx_import('BxBaseModTextFormsEntryHelper');
 /**
  * Entry forms helper functions
  */
-class BxNotesFormsEntryHelper extends BxBaseModTextFormsEntryHelper
+class BxPostsFormsEntryHelper extends BxBaseModTextFormsEntryHelper
 {
     public function __construct($oModule)
     {

+ 3 - 3
modules/boonex/notes/classes/BxNotesMenu.php → modules/boonex/posts/classes/BxPostsMenu.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,11 +14,11 @@ bx_import('BxBaseModTextMenu');
 /**
  * General class for module menu.
  */
-class BxNotesMenu extends BxBaseModTextMenu
+class BxPostsMenu extends BxBaseModTextMenu
 {
     public function __construct($aObject, $oTemplate = false)
     {
-        $this->MODULE = 'bx_notes';
+        $this->MODULE = 'bx_posts';
         parent::__construct($aObject, $oTemplate);
     }
 }

+ 3 - 3
modules/boonex/notes/classes/BxNotesMenuView.php → modules/boonex/posts/classes/BxPostsMenuView.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,11 +14,11 @@ bx_import('BxBaseModTextMenuView');
 /**
  * View entry menu
  */
-class BxNotesMenuView extends BxBaseModTextMenuView
+class BxPostsMenuView extends BxBaseModTextMenuView
 {
     public function __construct($aObject, $oTemplate = false)
     {
-        $this->MODULE = 'bx_notes';
+        $this->MODULE = 'bx_posts';
         parent::__construct($aObject, $oTemplate);
     }
 }

+ 3 - 3
modules/boonex/notes/classes/BxNotesModule.php → modules/boonex/posts/classes/BxPostsModule.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -12,9 +12,9 @@
 bx_import ('BxBaseModTextModule');
 
 /**
- * Notes module
+ * Posts module
  */
-class BxNotesModule extends BxBaseModTextModule
+class BxPostsModule extends BxBaseModTextModule
 {
     function __construct(&$aModule)
     {

+ 2 - 2
modules/boonex/notes/classes/BxNotesPageAuthor.php → modules/boonex/posts/classes/BxPostsPageAuthor.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,7 +14,7 @@ bx_import('BxBaseModTextPageAuthor');
 /**
  * Profile's entries page.
  */
-class BxNotesPageAuthor extends BxBaseModTextPageAuthor
+class BxPostsPageAuthor extends BxBaseModTextPageAuthor
 {
     public function __construct($aObject, $oTemplate = false)
     {

+ 3 - 3
modules/boonex/notes/classes/BxNotesPageBrowse.php → modules/boonex/posts/classes/BxPostsPageBrowse.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,11 +14,11 @@ bx_import('BxBaseModTextPageBrowse');
 /**
  * Browse entries pages.
  */
-class BxNotesPageBrowse extends BxBaseModTextPageBrowse
+class BxPostsPageBrowse extends BxBaseModTextPageBrowse
 {
     public function __construct($aObject, $oTemplate = false)
     {
-        $this->MODULE = 'bx_notes';
+        $this->MODULE = 'bx_posts';
         parent::__construct($aObject, $oTemplate);
     }
 }

+ 3 - 3
modules/boonex/notes/classes/BxNotesPageEntry.php → modules/boonex/posts/classes/BxPostsPageEntry.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,11 +14,11 @@ bx_import('BxBaseModTextPageEntry');
 /**
  * Entry create/edit pages
  */
-class BxNotesPageEntry extends BxBaseModTextPageEntry
+class BxPostsPageEntry extends BxBaseModTextPageEntry
 {
     public function __construct($aObject, $oTemplate = false)
     {
-        $this->MODULE = 'bx_notes';
+        $this->MODULE = 'bx_posts';
         parent::__construct($aObject, $oTemplate);
     }
 }

+ 14 - 14
modules/boonex/notes/classes/BxNotesSearchResult.php → modules/boonex/posts/classes/BxPostsSearchResult.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -11,22 +11,22 @@
 
 bx_import('BxBaseModTextSearchResult');
 
-class BxNotesSearchResult extends BxBaseModTextSearchResult
+class BxPostsSearchResult extends BxBaseModTextSearchResult
 {
     function __construct($sMode = '', $aParams = array())
     {
         parent::__construct($sMode, $aParams);
 
         $this->aCurrent = array(
-            'name' => 'bx_notes',
-            'title' => _t('_bx_notes_page_title_browse'),
-            'table' => 'bx_notes_posts',
+            'name' => 'bx_posts',
+            'title' => _t('_bx_posts_page_title_browse'),
+            'table' => 'bx_posts_posts',
             'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added'),
             'searchFields' => array('title', 'text'),
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
             ),
-            'paginate' => array('perPage' => getParam('bx_notes_per_page_browse'), 'start' => 0),
+            'paginate' => array('perPage' => getParam('bx_posts_per_page_browse'), 'start' => 0),
             'sorting' => 'last',
             'rss' => array(
                 'title' => '',
@@ -44,7 +44,7 @@ class BxNotesSearchResult extends BxBaseModTextSearchResult
             'ident' => 'id',
         );
 
-        $this->sFilterName = 'bx_notes_filter';
+        $this->sFilterName = 'bx_posts_filter';
         $this->oModule = $this->getMain();
 
         $oProfileAuthor = null;
@@ -64,20 +64,20 @@ class BxNotesSearchResult extends BxBaseModTextSearchResult
                 $this->aCurrent['restriction']['author']['value'] = $oProfileAuthor->id();
 
                 $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_AUTHOR_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_notes_page_title_browse_by_author');
-                $this->aCurrent['rss']['link'] = 'modules/?r=notes/rss/' . $sMode . '/' . $oProfileAuthor->id();
+                $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_by_author');
+                $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode . '/' . $oProfileAuthor->id();
                 break;
 
             case 'public':
                 bx_import('BxDolPermalinks');
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
-                $this->aCurrent['title'] = _t('_bx_notes_page_title_browse_recent');
-                $this->aCurrent['rss']['link'] = 'modules/?r=notes/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_recent');
+                $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode;
                 break;
 
             case '': // search results
                 $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
-                $this->aCurrent['title'] = _t('_bx_notes');
+                $this->aCurrent['title'] = _t('_bx_posts');
                 $this->aCurrent['paginate']['perPage'] = 3;
                 unset($this->aCurrent['rss']);
                 break;
@@ -112,7 +112,7 @@ class BxNotesSearchResult extends BxBaseModTextSearchResult
     function displayResultBlock ()
     {
         $s = parent::displayResultBlock ();
-        $s = '<div class="bx-notes-wrapper ' . ('unit_gallery.html' == $this->sUnitTemplate ? 'bx-def-margin-neg bx-clearfix' : '') . '">' . $s . '</div>';
+        $s = '<div class="bx-posts-wrapper ' . ('unit_gallery.html' == $this->sUnitTemplate ? 'bx-def-margin-neg bx-clearfix' : '') . '">' . $s . '</div>';
         return $s;
     }
 
@@ -120,7 +120,7 @@ class BxNotesSearchResult extends BxBaseModTextSearchResult
     {
         if ($this->aCurrent['sorting'] == 'last') {
             $aSql = array();
-            $aSql['order'] = " ORDER BY `bx_notes_posts`.`added` DESC";
+            $aSql['order'] = " ORDER BY `bx_posts_posts`.`added` DESC";
             return $aSql;
         }
         return array();

+ 3 - 3
modules/boonex/notes/classes/BxNotesTemplate.php → modules/boonex/posts/classes/BxPostsTemplate.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -14,14 +14,14 @@ bx_import('BxBaseModTextTemplate');
 /*
  * Module representation.
  */
-class BxNotesTemplate extends BxBaseModTextTemplate
+class BxPostsTemplate extends BxBaseModTextTemplate
 {
     /**
      * Constructor
      */
     function __construct(&$oConfig, &$oDb)
     {
-        $this->MODULE = 'bx_notes';
+        $this->MODULE = 'bx_posts';
         parent::__construct($oConfig, $oDb);
     }
 }

+ 9 - 9
modules/boonex/notes/install/config.php → modules/boonex/posts/install/config.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -15,10 +15,10 @@ $aConfig = array(
      * Main Section.
      */
     'type' => BX_DOL_MODULE_TYPE_MODULE,
-    'name' => 'bx_notes',
-    'title' => 'Notes',
+    'name' => 'bx_posts',
+    'title' => 'Posts',
     'note' => 'Basic blogging module.',
-    'version' => '8.0.1.DEV',
+    'version' => '8.0.0.DEV',
     'vendor' => 'BoonEx',
 	'help_url' => 'http://feed.boonex.com/?section={module_name}',
 
@@ -29,16 +29,16 @@ $aConfig = array(
     /**
      * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
      */
-    'home_dir' => 'boonex/notes/',
-    'home_uri' => 'notes',
+    'home_dir' => 'boonex/posts/',
+    'home_uri' => 'posts',
 
-    'db_prefix' => 'bx_notes_',
-    'class_prefix' => 'BxNotes',
+    'db_prefix' => 'bx_posts_',
+    'class_prefix' => 'BxPosts',
 
     /**
      * Category for language keys.
      */
-    'language_category' => 'Notes',
+    'language_category' => 'Posts',
 
     /**
      * Installation/Uninstallation Section.

+ 4 - 4
modules/boonex/notes/install/installer.php → modules/boonex/posts/install/installer.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{
@@ -11,13 +11,13 @@
 
 bx_import('BxBaseModTextInstaller');
 
-class BxNotesInstaller extends BxBaseModTextInstaller
+class BxPostsInstaller extends BxBaseModTextInstaller
 {
     function __construct($aConfig)
     {
         parent::__construct($aConfig);
-        $this->_aTranscoders = array ('bx_notes_preview');
-        $this->_aStorages = array ('bx_notes_files');
+        $this->_aTranscoders = array ('bx_posts_preview');
+        $this->_aStorages = array ('bx_posts_files');
         $this->_aMenuTriggers = array ('trigger_profile_view_submenu');
     }
 }

+ 100 - 0
modules/boonex/posts/install/langs/en.xml

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_posts"><![CDATA[Posts]]></string>
+
+	<string name="_bx_posts_option_summary_chars"><![CDATA[Number of characters in auto-cropped post summary]]></string>
+	<string name="_bx_posts_option_plain_summary_chars"><![CDATA[Number of characters in plain post description when post hasn't thumb]]></string>
+	<string name="_bx_posts_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_posts_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+
+	<string name="_bx_posts_form_entry"><![CDATA[Posts]]></string>
+	<string name="_bx_posts_form_entry_display_add"><![CDATA[Add Post]]></string>
+	<string name="_bx_posts_form_entry_display_edit"><![CDATA[Edit Post]]></string>
+	<string name="_bx_posts_form_entry_display_delete"><![CDATA[Delete Post]]></string>
+	<string name="_bx_posts_form_entry_display_view"><![CDATA[View Post]]></string>
+	<string name="_bx_posts_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_posts_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_posts_form_entry_input_sys_title"><![CDATA[Title]]></string>
+	<string name="_bx_posts_form_entry_input_title"><![CDATA[Title]]></string>
+	<string name="_bx_posts_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+	<string name="_bx_posts_form_entry_input_sys_text"><![CDATA[Text]]></string>
+	<string name="_bx_posts_form_entry_input_text"><![CDATA[Text]]></string>
+	<string name="_bx_posts_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
+	<string name="_bx_posts_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_posts_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this post]]></string>
+	<string name="_bx_posts_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+	<string name="_bx_posts_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the post]]></string>
+	<string name="_bx_posts_form_entry_input_sys_pictures"><![CDATA[Pictures]]></string>
+	<string name="_bx_posts_form_entry_input_pictures"><![CDATA[Pictures]]></string>
+    <string name="_bx_posts_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_posts_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+
+	<string name="_bx_posts_acl_action_create_entry"><![CDATA[Create Post]]></string>
+	<string name="_bx_posts_acl_action_delete_entry"><![CDATA[Delete Post]]></string>
+	<string name="_bx_posts_acl_action_view_entry"><![CDATA[View Post]]></string>
+	<string name="_bx_posts_acl_action_set_thumb"><![CDATA[Set Post Thumbnail]]></string>
+	<string name="_bx_posts_acl_action_edit_any_entry"><![CDATA[Edit Any Post]]></string>
+
+	<string name="_bx_posts_page_title_sys_create_entry"><![CDATA[Create Post]]></string>
+	<string name="_bx_posts_page_title_create_entry"><![CDATA[Create Post]]></string>
+	<string name="_bx_posts_page_block_title_create_entry"><![CDATA[Create Post]]></string>
+	<string name="_bx_posts_page_title_sys_edit_entry"><![CDATA[Edit Post]]></string>
+	<string name="_bx_posts_page_title_edit_entry"><![CDATA[Edit Post]]></string>
+	<string name="_bx_posts_page_block_title_edit_entry"><![CDATA[Edit Post]]></string>
+    <string name="_bx_posts_page_title_sys_delete_entry"><![CDATA[Delete Post]]></string>
+    <string name="_bx_posts_page_title_delete_entry"><![CDATA[Delete Post]]></string>
+    <string name="_bx_posts_page_block_title_delete_entry"><![CDATA[Delete Post]]></string>
+	<string name="_bx_posts_page_title_sys_view_entry"><![CDATA[View Post]]></string>
+	<string name="_bx_posts_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_posts_page_block_title_entry_text"><![CDATA[Post Text]]></string>
+	<string name="_bx_posts_page_title_browse"><![CDATA[Posts]]></string>
+	<string name="_bx_posts_page_title_search_results"><![CDATA[Posts matching "{0}"]]></string>
+	<string name="_bx_posts_page_title_browse_by_author"><![CDATA[Posts of {display_name}]]></string>
+    <string name="_bx_posts_page_title_browse_recent"><![CDATA[Recent Posts]]></string>
+    <string name="_bx_posts_page_title_sys_home"><![CDATA[Posts Home]]></string>
+    <string name="_bx_posts_page_title_home"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_page_block_title_recent_entries"><![CDATA[Recent Posts]]></string>
+    <string name="_bx_posts_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_posts_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_posts_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_posts_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_posts_page_title_sys_entries_featured"><![CDATA[Featured Posts]]></string>
+    <string name="_bx_posts_page_title_entries_featured"><![CDATA[Featured Posts]]></string>
+    <string name="_bx_posts_page_block_title_featured_entries"><![CDATA[Featured Posts]]></string>
+    <string name="_bx_posts_page_title_sys_view_entry_comments"><![CDATA[Post Comments]]></string>
+    <string name="_bx_posts_page_title_view_entry_comments"><![CDATA[Post Comments]]></string>
+    <string name="_bx_posts_page_title_sys_entries_of_author"><![CDATA[Posts of author]]></string>
+    <string name="_bx_posts_page_title_entries_of_author"><![CDATA[Posts of {display_name}]]></string>
+    <string name="_bx_posts_page_block_title_entries_of_author"><![CDATA[Posts of author]]></string>   
+    <string name="_bx_posts_page_block_title_entries_actions"><![CDATA[Posts actions]]></string>
+
+    <string name="_bx_posts_menu_set_title_view_entry"><![CDATA[View Post]]></string>
+    <string name="_bx_posts_menu_title_view_entry"><![CDATA[View Post]]></string>
+    <string name="_bx_posts_menu_title_submenu"><![CDATA[Posts Submenu]]></string>
+    <string name="_bx_posts_menu_set_title_submenu"><![CDATA[Posts Submenu]]></string>
+    <string name="_bx_posts_menu_item_title_system_create_entry"><![CDATA[Create Post]]></string>
+    <string name="_bx_posts_menu_item_title_create_entry"><![CDATA[Create Post]]></string>
+    <string name="_bx_posts_menu_item_title_system_edit_entry"><![CDATA[Edit Post]]></string>
+    <string name="_bx_posts_menu_item_title_edit_entry"><![CDATA[Edit Post]]></string>
+    <string name="_bx_posts_menu_item_title_system_delete_entry"><![CDATA[Delete Post]]></string>
+    <string name="_bx_posts_menu_item_title_delete_entry"><![CDATA[Delete Post]]></string>
+    <string name="_bx_posts_menu_item_title_system_view_entry"><![CDATA[View Post]]></string>
+    <string name="_bx_posts_menu_item_title_system_entries_home"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_menu_item_title_entries_home"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_menu_item_title_system_entries_public"><![CDATA[Public]]></string>
+    <string name="_bx_posts_menu_item_title_entries_public"><![CDATA[Public]]></string>
+    <string name="_bx_posts_menu_item_title_system_entries_featured"><![CDATA[Featured]]></string>
+    <string name="_bx_posts_menu_item_title_entries_featured"><![CDATA[Featured]]></string>
+    <string name="_bx_posts_menu_title_view_entry_submenu"><![CDATA[View Post Submenu]]></string>
+    <string name="_bx_posts_menu_set_title_view_entry_submenu"><![CDATA[View Post Submenu]]></string>
+    <string name="_bx_posts_menu_item_title_view_entry_submenu_entry"><![CDATA[Post]]></string>
+    <string name="_bx_posts_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_posts_menu_item_title_system_view_entry_comments"><![CDATA[Post Comments]]></string>
+    <string name="_bx_posts_menu_item_title_system_view_entries_author"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_menu_item_title_view_entries_author"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_menu_title_entries_my"><![CDATA[My Posts Action Menu]]></string>
+    <string name="_bx_posts_menu_set_title_entries_my"><![CDATA[My Posts Menu]]></string>
+
+    <string name="_bx_posts_txt_sample_single"><![CDATA[post]]></string>
+</resources>

+ 30 - 0
modules/boonex/posts/install/sql/disable.sql

@@ -0,0 +1,30 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_posts' LIMIT 1);
+SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
+DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
+DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
+DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_posts';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_posts' OR `object` IN('bx_posts_create_entry', 'bx_posts_edit_entry', 'bx_posts_delete_entry', 'bx_posts_view_entry', 'bx_posts_view_entry_comments', 'bx_posts_home', 'bx_posts_featured', 'bx_posts_author');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_posts';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_posts';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_posts' OR `set_name` IN('bx_posts_view', 'bx_posts_submenu', 'bx_posts_view_submenu', 'bx_posts_my');
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_posts_allow_view_to';
+
+-- ACL
+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_posts';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_posts';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` = 'bx_posts';
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_posts';
+

+ 251 - 251
modules/boonex/notes/install/sql/enable.sql → modules/boonex/posts/install/sql/enable.sql

@@ -1,251 +1,251 @@
-
--- SETTINGS
-
-SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
-INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES 
-('modules', 'bx_notes', '_bx_notes', 'bx_notes@modules/boonex/notes/|std-mi.png', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
-SET @iTypeId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
-VALUES (@iTypeId, 'bx_notes', '_bx_notes', 1);
-SET @iCategId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
-('bx_notes_summary_chars', '700', @iCategId, '_bx_notes_option_summary_chars', 'digit', '', '', '', 1),
-('bx_notes_plain_summary_chars', '200', @iCategId, '_bx_notes_option_plain_summary_chars', 'digit', '', '', '', 2),
-('bx_notes_per_page_browse', '12', @iCategId, '_bx_notes_option_per_page_browse', 'digit', '', '', '', 10),
-('bx_notes_rss_num', '10', @iCategId, '_bx_notes_option_rss_num', 'digit', '', '', '', 20);
-
--- PAGE: create entry
-
-INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_create_entry', '_bx_notes_page_title_sys_create_entry', '_bx_notes_page_title_create_entry', 'bx_notes', 5, 2147483647, 1, 'create-note', 'page.php?i=create-note', '', '', '', 0, 1, 0, 'BxNotesPageBrowse', 'modules/boonex/notes/classes/BxNotesPageBrowse.php');
-
-INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
-('bx_notes_create_entry', 1, 'bx_notes', '_bx_notes_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_notes";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
-
-
--- PAGE: edit entry
-
-INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_edit_entry', '_bx_notes_page_title_sys_edit_entry', '_bx_notes_page_title_edit_entry', 'bx_notes', 5, 2147483647, 1, 'edit-note', '', '', '', '', 0, 1, 0, 'BxNotesPageEntry', 'modules/boonex/notes/classes/BxNotesPageEntry.php');
-
-INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
-('bx_notes_edit_entry', 1, 'bx_notes', '_bx_notes_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_notes";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
-
-
--- PAGE: delete entry
-
-INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_delete_entry', '_bx_notes_page_title_sys_delete_entry', '_bx_notes_page_title_delete_entry', 'bx_notes', 5, 2147483647, 1, 'delete-note', '', '', '', '', 0, 1, 0, 'BxNotesPageEntry', 'modules/boonex/notes/classes/BxNotesPageEntry.php');
-
-INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
-('bx_notes_delete_entry', 1, 'bx_notes', '_bx_notes_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_notes";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
-
-
--- PAGE: view entry
-
-INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_view_entry', '_bx_notes_page_title_sys_view_entry', '_bx_notes_page_title_view_entry', 'bx_notes', 11, 2147483647, 1, 'view-note', '', '', '', '', 0, 1, 0, 'BxNotesPageEntry', 'modules/boonex/notes/classes/BxNotesPageEntry.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_notes_view_entry', 2, 'bx_notes', '_bx_notes_page_block_title_entry_author', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 0),
-('bx_notes_view_entry', 3, 'bx_notes', '_bx_notes_page_block_title_entry_actions', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0),
-('bx_notes_view_entry', 1, 'bx_notes', '_bx_notes_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 0),
-('bx_notes_view_entry', 1, 'bx_notes', '_bx_notes_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1),
-('bx_notes_view_entry', 1, 'bx_notes', '_bx_notes_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 2);
-
-
--- PAGE: view entry comments
-
-INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_view_entry_comments', '_bx_notes_page_title_sys_view_entry_comments', '_bx_notes_page_title_view_entry_comments', 'bx_notes', 5, 2147483647, 1, 'view-note-comments', '', '', '', '', 0, 1, 0, 'BxNotesPageEntry', 'modules/boonex/notes/classes/BxNotesPageEntry.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_notes_view_entry_comments', 1, 'bx_notes', '_bx_notes_page_block_title_entry_comments', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
-
-
--- PAGE: featured entries
-
-INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_featured', '_bx_notes_page_title_sys_entries_featured', '_bx_notes_page_title_entries_featured', 'bx_notes', 5, 2147483647, 1, 'notes-featured', 'page.php?i=notes-featured', '', '', '', 0, 1, 0, 'BxNotesPageBrowse', 'modules/boonex/notes/classes/BxNotesPageBrowse.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_notes_featured', 1, 'bx_notes', '_bx_notes_page_block_title_featured_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:15:\"browse_featured\";}', 0, 1, 1);
-
-
--- PAGE: entries of author
-
-INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_author', 'notes-author', '_bx_notes_page_title_sys_entries_of_author', '_bx_notes_page_title_entries_of_author', 'bx_notes', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxNotesPageAuthor', 'modules/boonex/notes/classes/BxNotesPageAuthor.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_notes_author', 1, 'bx_notes', '_bx_notes_page_block_title_entries_actions', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 0),
-('bx_notes_author', 1, 'bx_notes', '_bx_notes_page_block_title_entries_of_author', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1);
-
--- PAGE: module home
-
-INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_home', '_bx_notes_page_title_sys_home', '_bx_notes_page_title_home', 'bx_notes', 5, 2147483647, 1, 'notes-home', 'page.php?i=notes-home', '', '', '', 0, 1, 0, 'BxNotesPageBrowse', 'modules/boonex/notes/classes/BxNotesPageBrowse.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('bx_notes_home', 1, 'bx_notes', '_bx_notes_page_block_title_recent_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:13:\"browse_public\";}', 0, 1, 0);
-
--- PAGE: add block to homepage
-
-SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
-('sys_home', 1, 'bx_notes', '_bx_notes_page_block_title_recent_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:13:\"browse_public\";}', 1, 0, IFNULL(@iBlockOrder, 0) + 1);
-
-
--- MENU: add to site menu
-
-SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
-INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('sys_site', 'bx_notes', 'notes-home', '_bx_notes_menu_item_title_system_entries_home', '_bx_notes_menu_item_title_entries_home', 'page.php?i=notes-home', '', '', 'file-text col-red3', 'bx_notes_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
-
--- MENU: add to "add content" menu
-
-SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
-INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('sys_add_content_links', 'bx_notes', 'create-note', '_bx_notes_menu_item_title_system_create_entry', '_bx_notes_menu_item_title_create_entry', 'page.php?i=create-note', '', '', 'file-text col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
-
-
--- MENU: actions menu for view entry 
-
-INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_view', '_bx_notes_menu_title_view_entry', 'bx_notes_view', 'bx_notes', 9, 0, 1, 'BxNotesMenuView', 'modules/boonex/notes/classes/BxNotesMenuView.php');
-
-INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
-('bx_notes_view', 'bx_notes', '_bx_notes_menu_set_title_view_entry', 0);
-
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_notes_view', 'bx_notes', 'edit-note', '_bx_notes_menu_item_title_system_edit_entry', '_bx_notes_menu_item_title_edit_entry', 'page.php?i=edit-note&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
-('bx_notes_view', 'bx_notes', 'delete-note', '_bx_notes_menu_item_title_system_delete_entry', '_bx_notes_menu_item_title_delete_entry', 'page.php?i=delete-note&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2);
-
-
--- MENU: actions menu for my entries
-
-INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_my', '_bx_notes_menu_title_entries_my', 'bx_notes_my', 'bx_notes', 9, 0, 1, 'BxNotesMenu', 'modules/boonex/notes/classes/BxNotesMenu.php');
-
-INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
-('bx_notes_my', 'bx_notes', '_bx_notes_menu_set_title_entries_my', 0);
-
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_notes_my', 'bx_notes', 'create-note', '_bx_notes_menu_item_title_system_create_entry', '_bx_notes_menu_item_title_create_entry', 'page.php?i=create-note', '', '', 'plus', '', 2147483647, 1, 0, 0);
-
-
--- MENU: module sub-menu
-
-INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_submenu', '_bx_notes_menu_title_submenu', 'bx_notes_submenu', 'bx_notes', 8, 0, 1, '', '');
-
-INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
-('bx_notes_submenu', 'bx_notes', '_bx_notes_menu_set_title_submenu', 0);
-
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_notes_submenu', 'bx_notes', 'notes-home', '_bx_notes_menu_item_title_system_entries_public', '_bx_notes_menu_item_title_entries_public', 'page.php?i=notes-home', '', '', '', '', 2147483647, 1, 1, 1),
-('bx_notes_submenu', 'bx_notes', 'notes-featured', '_bx_notes_menu_item_title_system_entries_featured', '_bx_notes_menu_item_title_entries_featured', 'page.php?i=notes-featured', '', '', '', '', 2147483647, 1, 1, 2);
-
-
--- MENU: sub-menu for view entry
-
-INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes_view_submenu', '_bx_notes_menu_title_view_entry_submenu', 'bx_notes_view_submenu', 'bx_notes', 8, 0, 1, 'BxNotesMenuView', 'modules/boonex/notes/classes/BxNotesMenuView.php');
-
-INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
-('bx_notes_view_submenu', 'bx_notes', '_bx_notes_menu_set_title_view_entry_submenu', 0);
-
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_notes_view_submenu', 'bx_notes', 'view-note', '_bx_notes_menu_item_title_system_view_entry', '_bx_notes_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-note&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
-('bx_notes_view_submenu', 'bx_notes', 'view-note-comments', '_bx_notes_menu_item_title_system_view_entry_comments', '_bx_notes_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-note-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
-
-
--- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
-
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('trigger_profile_view_submenu', 'bx_notes', 'notes-author', '_bx_notes_menu_item_title_system_view_entries_author', '_bx_notes_menu_item_title_view_entries_author', 'page.php?i=notes-author&profile_id={profile_id}', '', '', '', '', 2147483647, 1, 0, 0);
-
-
--- PRIVACY 
-
-INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
-('bx_notes_allow_view_to', 'bx_notes', 'view', '_bx_notes_form_entry_input_allow_view_to', '3', 'bx_notes_posts', 'id', 'author', '', '');
-
-
--- ACL
-
-INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
-('bx_notes', 'create entry', NULL, '_bx_notes_acl_action_create_entry', '', 1, 3);
-SET @iIdActionEntryCreate = LAST_INSERT_ID();
-
-INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
-('bx_notes', 'delete entry', NULL, '_bx_notes_acl_action_delete_entry', '', 1, 3);
-SET @iIdActionEntryDelete = LAST_INSERT_ID();
-
-INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
-('bx_notes', 'view entry', NULL, '_bx_notes_acl_action_view_entry', '', 1, 0);
-SET @iIdActionEntryView = LAST_INSERT_ID();
-
-INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
-('bx_notes', 'set thumb', NULL, '_bx_notes_acl_action_set_thumb', '', 1, 3);
-SET @iIdActionSetThumb = LAST_INSERT_ID();
-
-INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
-('bx_notes', 'edit any entry', NULL, '_bx_notes_acl_action_edit_any_entry', '', 1, 3);
-SET @iIdActionEntryEditAny = LAST_INSERT_ID();
-
-SET @iUnauthenticated = 1;
-SET @iAccount = 2;
-SET @iStandard = 3;
-SET @iUnconfirmed = 4;
-SET @iPending = 5;
-SET @iSuspended = 6;
-SET @iModerator = 7;
-SET @iAdministrator = 8;
-SET @iPremium = 9;
-
-INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
-
--- entry create
-(@iStandard, @iIdActionEntryCreate),
-(@iModerator, @iIdActionEntryCreate),
-(@iAdministrator, @iIdActionEntryCreate),
-(@iPremium, @iIdActionEntryCreate),
-
--- entry delete
-(@iStandard, @iIdActionEntryDelete),
-(@iModerator, @iIdActionEntryDelete),
-(@iAdministrator, @iIdActionEntryDelete),
-(@iPremium, @iIdActionEntryDelete),
-
--- entry view
-(@iUnauthenticated, @iIdActionEntryView),
-(@iAccount, @iIdActionEntryView),
-(@iStandard, @iIdActionEntryView),
-(@iUnconfirmed, @iIdActionEntryView),
-(@iPending, @iIdActionEntryView),
-(@iModerator, @iIdActionEntryView),
-(@iAdministrator, @iIdActionEntryView),
-(@iPremium, @iIdActionEntryView),
-
--- set entry thumb
-(@iStandard, @iIdActionSetThumb),
-(@iModerator, @iIdActionSetThumb),
-(@iAdministrator, @iIdActionSetThumb),
-(@iPremium, @iIdActionSetThumb),
-
--- edit any entry
-(@iModerator, @iIdActionEntryEditAny),
-(@iAdministrator, @iIdActionEntryEditAny);
-
-
--- SEARCH
-INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `ClassName`, `ClassPath`) VALUES
-('bx_notes', '_bx_notes', 'BxNotesSearchResult', 'modules/boonex/notes/classes/BxNotesSearchResult.php');
-
--- METATAGS
-INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `table_pictures`, `override_class_name`, `override_class_file`) VALUES
-('bx_notes', 'bx_notes_meta_keywords', '', '', '', '', '');
-
+
+-- SETTINGS
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_posts', '_bx_posts', 'bx_posts@modules/boonex/posts/|std-mi.png', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_posts', '_bx_posts', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_posts_summary_chars', '700', @iCategId, '_bx_posts_option_summary_chars', 'digit', '', '', '', 1),
+('bx_posts_plain_summary_chars', '200', @iCategId, '_bx_posts_option_plain_summary_chars', 'digit', '', '', '', 2),
+('bx_posts_per_page_browse', '12', @iCategId, '_bx_posts_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_posts_rss_num', '10', @iCategId, '_bx_posts_option_rss_num', 'digit', '', '', '', 20);
+
+-- PAGE: create entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_create_entry', '_bx_posts_page_title_sys_create_entry', '_bx_posts_page_title_create_entry', 'bx_posts', 5, 2147483647, 1, 'create-post', 'page.php?i=create-post', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_posts_create_entry', 1, 'bx_posts', '_bx_posts_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
+
+
+-- PAGE: edit entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_edit_entry', '_bx_posts_page_title_sys_edit_entry', '_bx_posts_page_title_edit_entry', 'bx_posts', 5, 2147483647, 1, 'edit-post', '', '', '', '', 0, 1, 0, 'BxPostsPageEntry', 'modules/boonex/posts/classes/BxPostsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_posts_edit_entry', 1, 'bx_posts', '_bx_posts_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
+
+
+-- PAGE: delete entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_delete_entry', '_bx_posts_page_title_sys_delete_entry', '_bx_posts_page_title_delete_entry', 'bx_posts', 5, 2147483647, 1, 'delete-post', '', '', '', '', 0, 1, 0, 'BxPostsPageEntry', 'modules/boonex/posts/classes/BxPostsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_posts_delete_entry', 1, 'bx_posts', '_bx_posts_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
+
+
+-- PAGE: view entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_view_entry', '_bx_posts_page_title_sys_view_entry', '_bx_posts_page_title_view_entry', 'bx_posts', 11, 2147483647, 1, 'view-post', '', '', '', '', 0, 1, 0, 'BxPostsPageEntry', 'modules/boonex/posts/classes/BxPostsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_view_entry', 2, 'bx_posts', '_bx_posts_page_block_title_entry_author', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 0),
+('bx_posts_view_entry', 3, 'bx_posts', '_bx_posts_page_block_title_entry_actions', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0),
+('bx_posts_view_entry', 1, 'bx_posts', '_bx_posts_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 0),
+('bx_posts_view_entry', 1, 'bx_posts', '_bx_posts_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1),
+('bx_posts_view_entry', 1, 'bx_posts', '_bx_posts_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 2);
+
+
+-- PAGE: view entry comments
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_view_entry_comments', '_bx_posts_page_title_sys_view_entry_comments', '_bx_posts_page_title_view_entry_comments', 'bx_posts', 5, 2147483647, 1, 'view-post-comments', '', '', '', '', 0, 1, 0, 'BxPostsPageEntry', 'modules/boonex/posts/classes/BxPostsPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_view_entry_comments', 1, 'bx_posts', '_bx_posts_page_block_title_entry_comments', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
+
+
+-- PAGE: featured entries
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_featured', '_bx_posts_page_title_sys_entries_featured', '_bx_posts_page_title_entries_featured', 'bx_posts', 5, 2147483647, 1, 'posts-featured', 'page.php?i=posts-featured', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_featured', 1, 'bx_posts', '_bx_posts_page_block_title_featured_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"browse_featured\";}', 0, 1, 1);
+
+
+-- PAGE: entries of author
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_author', 'posts-author', '_bx_posts_page_title_sys_entries_of_author', '_bx_posts_page_title_entries_of_author', 'bx_posts', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxPostsPageAuthor', 'modules/boonex/posts/classes/BxPostsPageAuthor.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_author', 1, 'bx_posts', '_bx_posts_page_block_title_entries_actions', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 0),
+('bx_posts_author', 1, 'bx_posts', '_bx_posts_page_block_title_entries_of_author', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1);
+
+-- PAGE: module home
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_home', '_bx_posts_page_title_sys_home', '_bx_posts_page_title_home', 'bx_posts', 5, 2147483647, 1, 'posts-home', 'page.php?i=posts-home', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_home', 1, 'bx_posts', '_bx_posts_page_block_title_recent_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_public\";}', 0, 1, 0);
+
+-- PAGE: add block to homepage
+
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('sys_home', 1, 'bx_posts', '_bx_posts_page_block_title_recent_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_public\";}', 1, 0, IFNULL(@iBlockOrder, 0) + 1);
+
+
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_posts', 'posts-home', '_bx_posts_menu_item_title_system_entries_home', '_bx_posts_menu_item_title_entries_home', 'page.php?i=posts-home', '', '', 'file-text col-red3', 'bx_posts_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_posts', 'create-post', '_bx_posts_menu_item_title_system_create_entry', '_bx_posts_menu_item_title_create_entry', 'page.php?i=create-post', '', '', 'file-text col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+
+-- MENU: actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_view', '_bx_posts_menu_title_view_entry', 'bx_posts_view', 'bx_posts', 9, 0, 1, 'BxPostsMenuView', 'modules/boonex/posts/classes/BxPostsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_posts_view', 'bx_posts', '_bx_posts_menu_set_title_view_entry', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_posts_view', 'bx_posts', 'edit-post', '_bx_posts_menu_item_title_system_edit_entry', '_bx_posts_menu_item_title_edit_entry', 'page.php?i=edit-post&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
+('bx_posts_view', 'bx_posts', 'delete-post', '_bx_posts_menu_item_title_system_delete_entry', '_bx_posts_menu_item_title_delete_entry', 'page.php?i=delete-post&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2);
+
+
+-- MENU: actions menu for my entries
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_my', '_bx_posts_menu_title_entries_my', 'bx_posts_my', 'bx_posts', 9, 0, 1, 'BxPostsMenu', 'modules/boonex/posts/classes/BxPostsMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_posts_my', 'bx_posts', '_bx_posts_menu_set_title_entries_my', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_posts_my', 'bx_posts', 'create-post', '_bx_posts_menu_item_title_system_create_entry', '_bx_posts_menu_item_title_create_entry', 'page.php?i=create-post', '', '', 'plus', '', 2147483647, 1, 0, 0);
+
+
+-- MENU: module sub-menu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_submenu', '_bx_posts_menu_title_submenu', 'bx_posts_submenu', 'bx_posts', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_posts_submenu', 'bx_posts', '_bx_posts_menu_set_title_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_posts_submenu', 'bx_posts', 'posts-home', '_bx_posts_menu_item_title_system_entries_public', '_bx_posts_menu_item_title_entries_public', 'page.php?i=posts-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_posts_submenu', 'bx_posts', 'posts-featured', '_bx_posts_menu_item_title_system_entries_featured', '_bx_posts_menu_item_title_entries_featured', 'page.php?i=posts-featured', '', '', '', '', 2147483647, 1, 1, 2);
+
+
+-- MENU: sub-menu for view entry
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_view_submenu', '_bx_posts_menu_title_view_entry_submenu', 'bx_posts_view_submenu', 'bx_posts', 8, 0, 1, 'BxPostsMenuView', 'modules/boonex/posts/classes/BxPostsMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_posts_view_submenu', 'bx_posts', '_bx_posts_menu_set_title_view_entry_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_posts_view_submenu', 'bx_posts', 'view-post', '_bx_posts_menu_item_title_system_view_entry', '_bx_posts_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-post&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
+('bx_posts_view_submenu', 'bx_posts', 'view-post-comments', '_bx_posts_menu_item_title_system_view_entry_comments', '_bx_posts_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-post-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
+
+
+-- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_submenu', 'bx_posts', 'posts-author', '_bx_posts_menu_item_title_system_view_entries_author', '_bx_posts_menu_item_title_view_entries_author', 'page.php?i=posts-author&profile_id={profile_id}', '', '', '', '', 2147483647, 1, 0, 0);
+
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_posts_allow_view_to', 'bx_posts', 'view', '_bx_posts_form_entry_input_allow_view_to', '3', 'bx_posts_posts', 'id', 'author', '', '');
+
+
+-- ACL
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_posts', 'create entry', NULL, '_bx_posts_acl_action_create_entry', '', 1, 3);
+SET @iIdActionEntryCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_posts', 'delete entry', NULL, '_bx_posts_acl_action_delete_entry', '', 1, 3);
+SET @iIdActionEntryDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_posts', 'view entry', NULL, '_bx_posts_acl_action_view_entry', '', 1, 0);
+SET @iIdActionEntryView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_posts', 'set thumb', NULL, '_bx_posts_acl_action_set_thumb', '', 1, 3);
+SET @iIdActionSetThumb = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_posts', 'edit any entry', NULL, '_bx_posts_acl_action_edit_any_entry', '', 1, 3);
+SET @iIdActionEntryEditAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- entry create
+(@iStandard, @iIdActionEntryCreate),
+(@iModerator, @iIdActionEntryCreate),
+(@iAdministrator, @iIdActionEntryCreate),
+(@iPremium, @iIdActionEntryCreate),
+
+-- entry delete
+(@iStandard, @iIdActionEntryDelete),
+(@iModerator, @iIdActionEntryDelete),
+(@iAdministrator, @iIdActionEntryDelete),
+(@iPremium, @iIdActionEntryDelete),
+
+-- entry view
+(@iUnauthenticated, @iIdActionEntryView),
+(@iAccount, @iIdActionEntryView),
+(@iStandard, @iIdActionEntryView),
+(@iUnconfirmed, @iIdActionEntryView),
+(@iPending, @iIdActionEntryView),
+(@iModerator, @iIdActionEntryView),
+(@iAdministrator, @iIdActionEntryView),
+(@iPremium, @iIdActionEntryView),
+
+-- set entry thumb
+(@iStandard, @iIdActionSetThumb),
+(@iModerator, @iIdActionSetThumb),
+(@iAdministrator, @iIdActionSetThumb),
+(@iPremium, @iIdActionSetThumb),
+
+-- edit any entry
+(@iModerator, @iIdActionEntryEditAny),
+(@iAdministrator, @iIdActionEntryEditAny);
+
+
+-- SEARCH
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `ClassName`, `ClassPath`) VALUES
+('bx_posts', '_bx_posts', 'BxPostsSearchResult', 'modules/boonex/posts/classes/BxPostsSearchResult.php');
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `table_pictures`, `override_class_name`, `override_class_file`) VALUES
+('bx_posts', 'bx_posts_meta_keywords', '', '', '', '', '');
+

+ 199 - 199
modules/boonex/notes/install/sql/install.sql → modules/boonex/posts/install/sql/install.sql

@@ -1,199 +1,199 @@
-
--- TABLE: entries
-
-CREATE TABLE IF NOT EXISTS `bx_notes_posts` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `author` int(10) unsigned NOT NULL,
-  `added` int(11) NOT NULL,
-  `changed` int(11) NOT NULL,
-  `thumb` int(11) NOT NULL,
-  `title` varchar(255) NOT NULL,
-  `text` text NOT NULL,
-  `views` int(11) NOT NULL default '0',
-  `rate` float NOT NULL default '0',
-  `votes` int(11) NOT NULL default '0',
-  `comments` int(11) NOT NULL default '0',
-  `allow_view_to` int(11) NOT NULL DEFAULT '3',
-  PRIMARY KEY (`id`),
-  FULLTEXT KEY `title_text` (`title`,`text`)
-);
-
--- TABLE: storages & transcoders
-
-CREATE TABLE IF NOT EXISTS `bx_notes_files` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `profile_id` int(10) unsigned NOT NULL,
-  `remote_id` varchar(255) NOT NULL,
-  `path` varchar(255) NOT NULL,
-  `file_name` varchar(255) NOT NULL,
-  `mime_type` varchar(128) NOT NULL,
-  `ext` varchar(32) NOT NULL,
-  `size` int(11) NOT NULL,
-  `added` int(11) NOT NULL,
-  `modified` int(11) NOT NULL,
-  `private` int(11) NOT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `remote_id` (`remote_id`)
-);
-
-CREATE TABLE IF NOT EXISTS `bx_notes_photos_resized` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `profile_id` int(10) unsigned NOT NULL,
-  `remote_id` varchar(255) NOT NULL,
-  `path` varchar(255) NOT NULL,
-  `file_name` varchar(255) NOT NULL,
-  `mime_type` varchar(128) NOT NULL,
-  `ext` varchar(32) NOT NULL,
-  `size` int(11) NOT NULL,
-  `added` int(11) NOT NULL,
-  `modified` int(11) NOT NULL,
-  `private` int(11) NOT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `remote_id` (`remote_id`)
-);
-
--- TABLE: comments
-
-CREATE TABLE IF NOT EXISTS `bx_notes_cmts` (
-  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
-  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
-  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
-  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
-  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `cmt_level` int(11) NOT NULL DEFAULT '0',
-  `cmt_text` text NOT NULL,
-  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
-  `cmt_rate` int(11) NOT NULL DEFAULT '0',
-  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
-  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
-  `cmt_replies` int(11) NOT NULL DEFAULT '0',
-  PRIMARY KEY (`cmt_id`),
-  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`)
-);
-
--- TABLE: votes
-
-CREATE TABLE IF NOT EXISTS `bx_notes_votes` (
-  `object_id` int(11) NOT NULL default '0',
-  `count` int(11) NOT NULL default '0',
-  `sum` int(11) NOT NULL default '0',
-  UNIQUE KEY `object_id` (`object_id`)
-) ENGINE=MYISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE IF NOT EXISTS `bx_notes_votes_track` (
-  `object_id` int(11) NOT NULL default '0',
-  `author_id` int(11) NOT NULL default '0',
-  `author_nip` int(11) unsigned NOT NULL default '0',
-  `value` tinyint(4) NOT NULL default '0',
-  `date` int(11) NOT NULL default '0',
-  KEY `vote` (`object_id`, `author_nip`)
-) ENGINE=MYISAM DEFAULT CHARSET=utf8;
-
--- TABLE: views
-
-CREATE TABLE `bx_notes_views_track` (
-  `object_id` int(11) NOT NULL default '0',
-  `viewer_id` int(11) NOT NULL default '0',
-  `viewer_nip` int(11) unsigned NOT NULL default '0',
-  `date` int(11) NOT NULL default '0',
-  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- TABLE: metas
-
-CREATE TABLE `bx_notes_meta_keywords` (
-  `object_id` int(10) unsigned NOT NULL,
-  `keyword` varchar(255) NOT NULL,
-  KEY `object_id` (`object_id`),
-  KEY `keyword` (`keyword`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-
--- STORAGES & TRANSCODERS
-
-INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
-('bx_notes_files', 'Local', '', 360, 2592000, 3, 'bx_notes_files', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
-('bx_notes_photos_resized', 'Local', '', 360, 2592000, 3, 'bx_notes_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
-
-INSERT INTO `sys_objects_transcoder_images` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
-('bx_notes_preview', 'bx_notes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_notes_files";}', 'no', '1', '2592000', '0');
-
-INSERT INTO `sys_transcoder_images_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
-('bx_notes_preview', 'Resize', 'a:4:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";s:10:"force_type";s:3:"jpg";}', '0');
-
--- FORMS
-
-INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notes', 'bx_notes', '_bx_notes_form_entry', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_notes_posts', 'id', '', '', 'do_submit', '', 0, 1, 'BxNotesFormEntry', 'modules/boonex/notes/classes/BxNotesFormEntry.php');
-
-INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
-('bx_notes', 'bx_notes_entry_add', 'bx_notes', 0, '_bx_notes_form_entry_display_add'),
-('bx_notes', 'bx_notes_entry_edit', 'bx_notes', 0, '_bx_notes_form_entry_display_edit'),
-('bx_notes', 'bx_notes_entry_delete', 'bx_notes', 0, '_bx_notes_form_entry_display_delete'),
-('bx_notes', 'bx_notes_entry_view', 'bx_notes', 1, '_bx_notes_form_entry_display_view');
-
-INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
-('bx_notes', 'bx_notes', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_notes_form_entry_input_sys_delete_confirm', '_bx_notes_form_entry_input_delete_confirm', '_bx_notes_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_notes_form_entry_input_delete_confirm_error', '', '', 1, 0),
-('bx_notes', 'bx_notes', 'do_submit', '_bx_notes_form_entry_input_do_submit', '', 0, 'submit', '_bx_notes_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_notes', 'bx_notes', 'title', '', '', 0, 'text', '_bx_notes_form_entry_input_sys_title', '_bx_notes_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_notes_form_entry_input_title_err', 'Xss', '', 1, 0),
-('bx_notes', 'bx_notes', 'text', '', '', 0, 'textarea', '_bx_notes_form_entry_input_sys_text', '_bx_notes_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_notes_form_entry_input_text_err', 'XssHtml', '', 1, 0),
-('bx_notes', 'bx_notes', 'pictures', '', '', 0, 'files', '_bx_notes_form_entry_input_sys_pictures', '_bx_notes_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_notes', 'bx_notes', 'allow_view_to', '', '', 0, 'custom', '_bx_notes_form_entry_input_sys_allow_view_to', '_bx_notes_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 0, 0);
-
-INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
-('bx_notes_entry_add', 'delete_confirm', 2147483647, 0, 1),
-('bx_notes_entry_add', 'title', 2147483647, 1, 2),
-('bx_notes_entry_add', 'text', 2147483647, 1, 3),
-('bx_notes_entry_add', 'pictures', 2147483647, 1, 4),
-('bx_notes_entry_add', 'allow_view_to', 2147483647, 1, 6),
-('bx_notes_entry_add', 'do_submit', 2147483647, 1, 7),
-
-('bx_notes_entry_edit', 'delete_confirm', 2147483647, 0, 1),
-('bx_notes_entry_edit', 'title', 2147483647, 1, 2),
-('bx_notes_entry_edit', 'text', 2147483647, 1, 3),
-('bx_notes_entry_edit', 'pictures', 2147483647, 1, 4),
-('bx_notes_entry_edit', 'allow_view_to', 2147483647, 1, 6),
-('bx_notes_entry_edit', 'do_submit', 2147483647, 1, 7),
-
-('bx_notes_entry_view', 'delete_confirm', 2147483647, 0, 0),
-('bx_notes_entry_view', 'allow_view_to', 2147483647, 0, 0),
-('bx_notes_entry_view', 'do_submit', 2147483647, 0, 0),
-('bx_notes_entry_view', 'text', 2147483647, 0, 0),
-('bx_notes_entry_view', 'title', 2147483647, 0, 0),
-('bx_notes_entry_view', 'pictures', 2147483647, 0, 0),
-
-('bx_notes_entry_delete', 'delete_confirm', 2147483647, 1, 1),
-('bx_notes_entry_delete', 'do_submit', 2147483647, 1, 2),
-('bx_notes_entry_delete', 'allow_view_to', 2147483647, 0, 0),
-('bx_notes_entry_delete', 'pictures', 2147483647, 0, 0),
-('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
-(3, 'bx_notes', '_bx_notes', '_bx_notes', 'bx_notes@modules/boonex/notes/|std-pi.png');
-SET @iPageId = LAST_INSERT_ID();
-
-SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
-SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
-INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
-(@iPageId, 'bx_notes', '{url_studio}module.php?name=bx_notes', '', 'bx_notes@modules/boonex/notes/|std-wi.png', '_bx_notes', '', '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";}');
-INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
-(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
-
+
+-- TABLE: entries
+
+CREATE TABLE IF NOT EXISTS `bx_posts_posts` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `thumb` int(11) NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `text` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `allow_view_to` int(11) NOT NULL DEFAULT '3',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title_text` (`title`,`text`)
+);
+
+-- TABLE: storages & transcoders
+
+CREATE TABLE IF NOT EXISTS `bx_posts_files` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(255) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_posts_photos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(255) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+-- TABLE: comments
+
+CREATE TABLE IF NOT EXISTS `bx_posts_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`)
+);
+
+-- TABLE: votes
+
+CREATE TABLE IF NOT EXISTS `bx_posts_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_posts_votes_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `vote` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: views
+
+CREATE TABLE `bx_posts_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: metas
+
+CREATE TABLE `bx_posts_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+-- STORAGES & TRANSCODERS
+
+INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
+('bx_posts_files', 'Local', '', 360, 2592000, 3, 'bx_posts_files', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+('bx_posts_photos_resized', 'Local', '', 360, 2592000, 3, 'bx_posts_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder_images` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
+('bx_posts_preview', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_posts_files";}', 'no', '1', '2592000', '0');
+
+INSERT INTO `sys_transcoder_images_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_posts_preview', 'Resize', 'a:4:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";s:10:"force_type";s:3:"jpg";}', '0');
+
+-- FORMS
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts', 'bx_posts', '_bx_posts_form_entry', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_posts_posts', 'id', '', '', 'do_submit', '', 0, 1, 'BxPostsFormEntry', 'modules/boonex/posts/classes/BxPostsFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_posts', 'bx_posts_entry_add', 'bx_posts', 0, '_bx_posts_form_entry_display_add'),
+('bx_posts', 'bx_posts_entry_edit', 'bx_posts', 0, '_bx_posts_form_entry_display_edit'),
+('bx_posts', 'bx_posts_entry_delete', 'bx_posts', 0, '_bx_posts_form_entry_display_delete'),
+('bx_posts', 'bx_posts_entry_view', 'bx_posts', 1, '_bx_posts_form_entry_display_view');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_posts', 'bx_posts', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_posts_form_entry_input_sys_delete_confirm', '_bx_posts_form_entry_input_delete_confirm', '_bx_posts_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_posts_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_posts', 'bx_posts', 'do_submit', '_bx_posts_form_entry_input_do_submit', '', 0, 'submit', '_bx_posts_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_posts', 'bx_posts', 'title', '', '', 0, 'text', '_bx_posts_form_entry_input_sys_title', '_bx_posts_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_posts_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_posts', 'bx_posts', 'text', '', '', 0, 'textarea', '_bx_posts_form_entry_input_sys_text', '_bx_posts_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_posts_form_entry_input_text_err', 'XssHtml', '', 1, 0),
+('bx_posts', 'bx_posts', 'pictures', '', '', 0, 'files', '_bx_posts_form_entry_input_sys_pictures', '_bx_posts_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_posts', 'bx_posts', 'allow_view_to', '', '', 0, 'custom', '_bx_posts_form_entry_input_sys_allow_view_to', '_bx_posts_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_posts_entry_add', 'delete_confirm', 2147483647, 0, 1),
+('bx_posts_entry_add', 'title', 2147483647, 1, 2),
+('bx_posts_entry_add', 'text', 2147483647, 1, 3),
+('bx_posts_entry_add', 'pictures', 2147483647, 1, 4),
+('bx_posts_entry_add', 'allow_view_to', 2147483647, 1, 6),
+('bx_posts_entry_add', 'do_submit', 2147483647, 1, 7),
+
+('bx_posts_entry_edit', 'delete_confirm', 2147483647, 0, 1),
+('bx_posts_entry_edit', 'title', 2147483647, 1, 2),
+('bx_posts_entry_edit', 'text', 2147483647, 1, 3),
+('bx_posts_entry_edit', 'pictures', 2147483647, 1, 4),
+('bx_posts_entry_edit', 'allow_view_to', 2147483647, 1, 6),
+('bx_posts_entry_edit', 'do_submit', 2147483647, 1, 7),
+
+('bx_posts_entry_view', 'delete_confirm', 2147483647, 0, 0),
+('bx_posts_entry_view', 'allow_view_to', 2147483647, 0, 0),
+('bx_posts_entry_view', 'do_submit', 2147483647, 0, 0),
+('bx_posts_entry_view', 'text', 2147483647, 0, 0),
+('bx_posts_entry_view', 'title', 2147483647, 0, 0),
+('bx_posts_entry_view', 'pictures', 2147483647, 0, 0),
+
+('bx_posts_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_posts_entry_delete', 'do_submit', 2147483647, 1, 2),
+('bx_posts_entry_delete', 'allow_view_to', 2147483647, 0, 0),
+('bx_posts_entry_delete', 'pictures', 2147483647, 0, 0),
+('bx_posts_entry_delete', 'text', 2147483647, 0, 0),
+('bx_posts_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_posts', 'bx_posts_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 0, -3, 1, 'cmt', 'page/view-post&id={object_id}', '', 'bx_posts_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_posts', 'bx_posts_votes', 'bx_posts_votes_track', '604800', '1', '1', '1', '1', 'bx_posts_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_posts', 'bx_posts_views_track', '86400', '1', 'bx_posts_posts', 'id', 'views', '', '');
+
+-- STUDIO: page & widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_posts', '_bx_posts', '_bx_posts', 'bx_posts@modules/boonex/posts/|std-pi.png');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_posts', '{url_studio}module.php?name=bx_posts', '', 'bx_posts@modules/boonex/posts/|std-wi.png', '_bx_posts', '', '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";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 39 - 0
modules/boonex/posts/install/sql/uninstall.sql

@@ -0,0 +1,39 @@
+
+-- TABLES
+
+DROP TABLE IF EXISTS `bx_posts_posts`, `bx_posts_files`, `bx_posts_photos_resized`, `bx_posts_cmts`, `bx_posts_votes`, `bx_posts_votes_track`, `bx_posts_views_track`, `bx_posts_meta_keywords`;
+
+-- STORAGES & TRANSCODERS
+
+DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_posts_files' OR `object` = 'bx_posts_photos_resized';
+DELETE FROM `sys_storage_tokens` WHERE `object` = 'bx_posts_files' OR `object` = 'bx_posts_photos_resized';
+
+DELETE FROM `sys_objects_transcoder_images` WHERE `object` = 'bx_posts_preview';
+DELETE FROM `sys_transcoder_images_filters` WHERE `transcoder_object` = 'bx_posts_preview';
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` = 'bx_posts_preview';
+
+-- FORMS
+
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_posts';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_posts';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_posts';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN ('bx_posts_entry_add', 'bx_posts_entry_edit', 'bx_posts_entry_view', 'bx_posts_entry_delete');
+
+-- COMMENTS
+
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_posts';
+
+-- VOTES
+
+DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_posts';
+
+-- VIEWS
+
+DELETE FROM `sys_objects_view` WHERE `Name` = 'bx_posts';
+
+-- STUDIO: page & widget
+
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_posts';
+

+ 1 - 1
modules/boonex/notes/request.php → modules/boonex/posts/request.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Notes Notes
+ * @defgroup    Posts Posts
  * @ingroup     DolphinModules
  *
  * @{

+ 0 - 0
modules/boonex/notes/template/attachments.html → modules/boonex/posts/template/attachments.html


+ 0 - 0
modules/boonex/notes/template/author.html → modules/boonex/posts/template/author.html


+ 0 - 0
modules/boonex/notes/template/css/forms.css → modules/boonex/posts/template/css/forms.css


+ 0 - 0
modules/boonex/notes/template/css/main.css → modules/boonex/posts/template/css/main.css


+ 0 - 0
modules/boonex/notes/template/entry-share.html → modules/boonex/posts/template/entry-share.html


+ 0 - 0
modules/boonex/notes/template/entry-text.html → modules/boonex/posts/template/entry-text.html


+ 0 - 0
modules/boonex/notes/template/form_ghost_template.html → modules/boonex/posts/template/form_ghost_template.html


+ 0 - 0
modules/boonex/notes/template/images/icons/std-mi.png → modules/boonex/posts/template/images/icons/std-mi.png


+ 0 - 0
modules/boonex/notes/template/images/icons/std-pi.png → modules/boonex/posts/template/images/icons/std-pi.png


+ 0 - 0
modules/boonex/notes/template/images/icons/std-si.png → modules/boonex/posts/template/images/icons/std-si.png


+ 0 - 0
modules/boonex/notes/template/images/icons/std-wi.png → modules/boonex/posts/template/images/icons/std-wi.png


+ 0 - 0
modules/boonex/notes/template/unit.html → modules/boonex/posts/template/unit.html


+ 0 - 0
modules/boonex/notes/template/unit_gallery.html → modules/boonex/posts/template/unit_gallery.html


+ 0 - 0
modules/boonex/notes/template/unit_live_search.html → modules/boonex/posts/template/unit_live_search.html


+ 0 - 0
modules/boonex/notes/template/unit_private.html → modules/boonex/posts/template/unit_private.html