AntonLV 7 лет назад
Родитель
Сommit
f5c675600e
74 измененных файлов с 3264 добавлено и 0 удалено
  1. 22 0
      modules/boonex/directory/classes/BxDirAlertsResponse.php
  2. 24 0
      modules/boonex/directory/classes/BxDirCmtsSearchResult.php
  3. 183 0
      modules/boonex/directory/classes/BxDirConfig.php
  4. 38 0
      modules/boonex/directory/classes/BxDirCronPublishing.php
  5. 40 0
      modules/boonex/directory/classes/BxDirDb.php
  6. 181 0
      modules/boonex/directory/classes/BxDirFormEntry.php
  7. 34 0
      modules/boonex/directory/classes/BxDirFormsEntryHelper.php
  8. 22 0
      modules/boonex/directory/classes/BxDirGridAdministration.php
  9. 22 0
      modules/boonex/directory/classes/BxDirGridCommon.php
  10. 25 0
      modules/boonex/directory/classes/BxDirMenu.php
  11. 25 0
      modules/boonex/directory/classes/BxDirMenuAttachments.php
  12. 26 0
      modules/boonex/directory/classes/BxDirMenuManageTools.php
  13. 22 0
      modules/boonex/directory/classes/BxDirMenuSnippetMeta.php
  14. 25 0
      modules/boonex/directory/classes/BxDirMenuView.php
  15. 35 0
      modules/boonex/directory/classes/BxDirMenuViewActions.php
  16. 83 0
      modules/boonex/directory/classes/BxDirModule.php
  17. 24 0
      modules/boonex/directory/classes/BxDirPageAuthor.php
  18. 25 0
      modules/boonex/directory/classes/BxDirPageBrowse.php
  19. 33 0
      modules/boonex/directory/classes/BxDirPageEntry.php
  20. 142 0
      modules/boonex/directory/classes/BxDirSearchResult.php
  21. 35 0
      modules/boonex/directory/classes/BxDirTemplate.php
  22. 27 0
      modules/boonex/directory/classes/BxDirUploaderHTML5.php
  23. 27 0
      modules/boonex/directory/classes/BxDirUploaderHTML5Attach.php
  24. 27 0
      modules/boonex/directory/classes/BxDirUploaderSimple.php
  25. 27 0
      modules/boonex/directory/classes/BxDirUploaderSimpleAttach.php
  26. 150 0
      modules/boonex/directory/install/config.php
  27. 20 0
      modules/boonex/directory/install/installer.php
  28. 288 0
      modules/boonex/directory/install/langs/en.xml
  29. 54 0
      modules/boonex/directory/install/sql/disable.sql
  30. 484 0
      modules/boonex/directory/install/sql/enable.sql
  31. 550 0
      modules/boonex/directory/install/sql/install.sql
  32. 56 0
      modules/boonex/directory/install/sql/uninstall.sql
  33. 56 0
      modules/boonex/directory/js/manage_tools.js
  34. 242 0
      modules/boonex/directory/js/polls.js
  35. 18 0
      modules/boonex/directory/request.php
  36. 3 0
      modules/boonex/directory/template/attachments.html
  37. 3 0
      modules/boonex/directory/template/author.html
  38. 1 0
      modules/boonex/directory/template/author_link.html
  39. 1 0
      modules/boonex/directory/template/context.html
  40. 1 0
      modules/boonex/directory/template/css/forms.css
  41. 1 0
      modules/boonex/directory/template/css/main.css
  42. 1 0
      modules/boonex/directory/template/css/manage_tools.css
  43. 1 0
      modules/boonex/directory/template/css/polls.css
  44. 3 0
      modules/boonex/directory/template/entry-all-actions.html
  45. 3 0
      modules/boonex/directory/template/entry-location.html
  46. 1 0
      modules/boonex/directory/template/entry-share.html
  47. 1 0
      modules/boonex/directory/template/entry-text.html
  48. 22 0
      modules/boonex/directory/template/form_ghost_template.html
  49. 16 0
      modules/boonex/directory/template/form_ghost_template_cover.html
  50. 22 0
      modules/boonex/directory/template/form_ghost_template_file.html
  51. 22 0
      modules/boonex/directory/template/form_ghost_template_video.html
  52. 38 0
      modules/boonex/directory/template/images/icons/std-icon.svg
  53. 1 0
      modules/boonex/directory/template/poll_answer_vc_text.html
  54. 1 0
      modules/boonex/directory/template/poll_answer_ve_block.html
  55. 1 0
      modules/boonex/directory/template/poll_form.html
  56. 1 0
      modules/boonex/directory/template/poll_form_answers.html
  57. 1 0
      modules/boonex/directory/template/poll_form_field.html
  58. 1 0
      modules/boonex/directory/template/poll_item.html
  59. 1 0
      modules/boonex/directory/template/poll_item_answers.html
  60. 1 0
      modules/boonex/directory/template/poll_item_results.html
  61. 1 0
      modules/boonex/directory/template/poll_items.html
  62. 1 0
      modules/boonex/directory/template/poll_items_showcase.html
  63. 1 0
      modules/boonex/directory/template/title_link.html
  64. 3 0
      modules/boonex/directory/template/unit.html
  65. 1 0
      modules/boonex/directory/template/unit_full.html
  66. 3 0
      modules/boonex/directory/template/unit_full_private.html
  67. 1 0
      modules/boonex/directory/template/unit_gallery.html
  68. 3 0
      modules/boonex/directory/template/unit_gallery_private.html
  69. 3 0
      modules/boonex/directory/template/unit_live_search.html
  70. 1 0
      modules/boonex/directory/template/unit_meta_item.html
  71. 3 0
      modules/boonex/directory/template/unit_private.html
  72. 1 0
      modules/boonex/directory/template/unit_showcase.html
  73. 1 0
      modules/boonex/directory/template/uploader_button_html5_attach.html
  74. 1 0
      modules/boonex/directory/template/uploader_button_simple_attach.html

+ 22 - 0
modules/boonex/directory/classes/BxDirAlertsResponse.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirAlertsResponse extends BxBaseModTextAlertsResponse
+{
+    public function __construct()
+    {
+        $this->MODULE = 'bx_directory';
+
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/directory/classes/BxDirCmtsSearchResult.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirCmtsSearchResult extends BxBaseModGeneralCmtsSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+    	$this->sModule = 'bx_directory';
+
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent['title'] = _t('_bx_directory_page_block_title_browse_cmts');
+    }
+}
+
+/** @} */

+ 183 - 0
modules/boonex/directory/classes/BxDirConfig.php

@@ -0,0 +1,183 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'edit-ad' => 'checkAllowedEdit',
+            'delete-ad' => 'checkAllowedDelete',
+        );
+
+        $this->CNF = array_merge($this->CNF, array (
+
+            // module icon
+            'ICON' => 'folder-open col-green3',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'entries',
+            'TABLE_ENTRIES_FULLTEXT' => 'title_text',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_PUBLISHED' => 'published',
+            'FIELD_TITLE' => 'title',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'ad-text',
+            'FIELD_CATEGORY' => 'cat',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_COVER' => 'covers',
+            'FIELD_PHOTO' => 'pictures',
+            'FIELD_VIDEO' => 'videos',
+            'FIELD_FILE' => 'files',
+            'FIELD_POLL' => '',
+            'FIELD_THUMB' => 'thumb',
+            'FIELD_ATTACHMENTS' => 'attachments',
+            'FIELD_VIEWS' => 'views',
+            'FIELD_COMMENTS' => 'comments',
+            'FIELD_STATUS' => 'status',
+            'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELD_LABELS' => 'labels',
+            'FIELD_ANONYMOUS' => 'anonymous',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+            'FIELD_DISABLE_COMMENTS' => 'disable_comments',
+            
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-ad',
+            'URI_AUTHOR_ENTRIES' => 'ads-author',
+            'URI_ENTRIES_BY_CONTEXT' => 'ads-context',
+            'URI_ADD_ENTRY' => 'create-ad',
+            'URI_EDIT_ENTRY' => 'edit-ad',
+            'URI_MANAGE_COMMON' => 'ads-manage',
+
+            'URL_HOME' => 'page.php?i=directory-home',
+            'URL_POPULAR' => 'page.php?i=ads-popular',
+            'URL_UPDATED' => 'page.php?i=ads-updated',
+            'URL_MANAGE_COMMON' => 'page.php?i=ads-manage',
+            'URL_MANAGE_ADMINISTRATION' => 'page.php?i=ads-administration',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_directory_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_directory_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_directory_rss_num',
+            'PARAM_SEARCHABLE_FIELDS' => 'bx_directory_searchable_fields',
+            'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_directory_per_page_browse_showcase',
+            'PARAM_LABELS' => 'bx_directory_labels',
+            
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_directory_covers',
+            'OBJECT_STORAGE_FILES' => 'bx_directory_files',
+            'OBJECT_STORAGE_PHOTOS' => 'bx_directory_photos',
+            'OBJECT_STORAGE_VIDEOS' => 'bx_directory_videos',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_directory_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_directory_gallery',
+            'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_directory_cover',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES' => 'bx_directory_preview_files',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY_FILES' => 'bx_directory_gallery_files',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => 'bx_directory_preview_photos',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => 'bx_directory_gallery_photos',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(
+                'poster' => 'bx_directory_videos_poster', 
+            	'poster_preview' => 'bx_directory_videos_poster_preview',
+            	'mp4' => 'bx_directory_videos_mp4', 
+            	'webm' => 'bx_directory_videos_webm'
+            ),
+            'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
+            'OBJECT_REPORTS' => 'bx_directory',
+            'OBJECT_VIEWS' => 'bx_directory',
+            'OBJECT_VOTES' => 'bx_directory',
+            'OBJECT_REACTIONS' => 'bx_directory_reactions',
+            'OBJECT_SCORES' => 'bx_directory',
+            'OBJECT_FAVORITES' => 'bx_directory',
+            'OBJECT_FEATURED' => 'bx_directory',
+            'OBJECT_METATAGS' => 'bx_directory',
+            'OBJECT_COMMENTS' => 'bx_directory',
+            'OBJECT_CATEGORY' => 'bx_directory_cats',
+            'OBJECT_PRIVACY_VIEW' => 'bx_directory_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_directory',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_directory_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_directory_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_directory_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_directory_entry_delete',
+            'OBJECT_FORM_POLL' => 'bx_directory_poll',
+            'OBJECT_FORM_POLL_DISPLAY_ADD' => 'bx_directory_poll_add',
+            'OBJECT_MENU_ENTRY_ATTACHMENTS' => 'bx_directory_entry_attachments', // attachments menu in create/edit forms
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_directory_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_directory_view_actions', // all actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_directory_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_directory_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_directory_view_submenu', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'directory-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_SNIPPET_META' => 'bx_directory_snippet_meta', // menu for snippet meta info
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_directory_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_directory_administration',
+            'OBJECT_GRID_COMMON' => 'bx_directory_common',
+            'OBJECT_UPLOADERS' => array('bx_directory_simple', 'bx_directory_html5'),
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_directory_my' => array (
+                    'create-ad' => 'checkAllowedAdd',
+                ),
+                'bx_directory_view' => $aMenuItems2Methods,
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_directory_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_directory_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_directory_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_directory_txt_sample_vote_single',
+                'form_field_author' => '_bx_directory_form_entry_input_author',
+            	'grid_action_err_delete' => '_bx_directory_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_directory_grid_txt_account_manager',
+                'filter_item_active' => '_bx_directory_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_directory_grid_filter_item_title_adm_hidden',
+            	'filter_item_select_one_filter1' => '_bx_directory_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_directory_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_directory_menu_item_title_manage_all',
+                'txt_all_entries_by' => '_bx_directory_txt_all_entries_by',
+                'txt_all_entries_in' => '_bx_directory_txt_all_entries_in',
+                'txt_all_entries_by_author' => '_bx_directory_page_title_browse_by_author',
+                'txt_all_entries_by_context' => '_bx_directory_page_title_browse_by_context',
+                'txt_err_cannot_perform_action' => '_bx_directory_txt_err_cannot_perform_action',
+                'txt_poll_answer_vote_do_by' => '_bx_directory_txt_poll_answer_vote_do_by',
+                'txt_poll_answer_vote_counter' => '_bx_directory_txt_poll_answer_vote_counter',
+                'txt_poll_answer_vote_percent' => '_bx_directory_txt_poll_answer_vote_percent'
+            ),
+        ));
+        
+        $this->_aJsClasses = array_merge($this->_aJsClasses, array(
+            'manage_tools' => 'BxDirManageTools'
+        ));
+
+        $this->_aJsObjects = array_merge($this->_aJsObjects, array(
+            'manage_tools' => 'oBxDirManageTools'
+        ));
+
+        $this->_aGridObjects = array(
+            'common' => $this->CNF['OBJECT_GRID_COMMON'],
+            'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        );
+
+        $this->_bAttachmentsInTimeline = true;
+    }
+}
+
+/** @} */

+ 38 - 0
modules/boonex/directory/classes/BxDirCronPublishing.php

@@ -0,0 +1,38 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxDirCronPublishing extends BxDolCron
+{
+	protected $_sModule;
+	protected $_oModule;
+
+	public function __construct()
+    {
+        parent::__construct();
+
+    	$this->_sModule = 'bx_directory';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+    }
+
+    function processing()
+    {
+        $mixedIds = $this->_oModule->_oDb->publish();
+        if($mixedIds === false)
+            return;
+
+        foreach($mixedIds as $iId)
+            $this->_oModule->onPublished($iId);
+    }
+}
+
+/** @} */

+ 40 - 0
modules/boonex/directory/classes/BxDirDb.php

@@ -0,0 +1,40 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxDirDb extends BxBaseModTextDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    public function publish()
+    {
+        $CNF = $this->_oConfig->CNF;
+
+        $aEntries = $this->getAll("SELECT `id`, `" . $CNF['FIELD_PUBLISHED'] . "`, from_unixtime(`" . $CNF['FIELD_PUBLISHED'] . "`)  FROM `" . $CNF['TABLE_ENTRIES'] . "` WHERE `" . $CNF['FIELD_STATUS'] . "` = 'awaiting'");
+        if(empty($aEntries) || !is_array($aEntries))
+            return false;
+
+        $iNow = time();
+        $aResult = array();
+        foreach($aEntries as $aEntry)
+            if($aEntry[$CNF['FIELD_PUBLISHED']] <= $iNow) 
+                $aResult[] = $aEntry[$CNF['FIELD_ID']];
+
+        return count($aResult) == (int)$this->query("UPDATE `" . $CNF['TABLE_ENTRIES'] . "` SET `" . $CNF['FIELD_ADDED'] . "`=`" . $CNF['FIELD_PUBLISHED'] . "`, `" . $CNF['FIELD_CHANGED'] . "`=`" . $CNF['FIELD_PUBLISHED'] . "`, `" . $CNF['FIELD_STATUS'] . "` = 'active' WHERE `id` IN (" . $this->implode_escape($aResult) . ")") ? $aResult : false;
+    }
+}
+
+/** @} */

+ 181 - 0
modules/boonex/directory/classes/BxDirFormEntry.php

@@ -0,0 +1,181 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit entry form
+ */
+class BxDirFormEntry extends BxBaseModTextFormEntry
+{
+    protected $_sGhostTemplateCover = 'form_ghost_template_cover.html';
+	
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_directory';
+        parent::__construct($aInfo, $oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+    	if(isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
+            if($this->_oModule->checkAllowedSetThumb() === CHECK_ACTION_RESULT_ALLOWED) {
+                $this->aInputs[$CNF['FIELD_COVER']]['storage_object'] = $CNF['OBJECT_STORAGE'];
+                $this->aInputs[$CNF['FIELD_COVER']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_COVER']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_COVER']]['value']) : $CNF['OBJECT_UPLOADERS'];
+                $this->aInputs[$CNF['FIELD_COVER']]['upload_buttons_titles'] = array(
+                    'Simple' => _t('_bx_directory_form_entry_input_covers_uploader_simple_title'), 
+                    'HTML5' => _t('_bx_directory_form_entry_input_covers_uploader_html5_title')
+                );
+                $this->aInputs[$CNF['FIELD_COVER']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW'];
+                $this->aInputs[$CNF['FIELD_COVER']]['storage_private'] = 0;
+                $this->aInputs[$CNF['FIELD_COVER']]['multiple'] = false;
+                $this->aInputs[$CNF['FIELD_COVER']]['content_id'] = 0;
+                $this->aInputs[$CNF['FIELD_COVER']]['ghost_template'] = '';
+            }
+            else
+                unset($this->aInputs[$CNF['FIELD_COVER']]);
+        }
+
+        if(isset($CNF['FIELD_PHOTO']) && isset($this->aInputs[$CNF['FIELD_PHOTO']])) {
+            $this->aInputs[$CNF['FIELD_PHOTO']]['storage_object'] = $CNF['OBJECT_STORAGE_PHOTOS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_PHOTO']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_PHOTO']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_PHOTO']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+
+        if(isset($this->aInputs[$CNF['FIELD_VIDEO']])) {
+            $this->aInputs[$CNF['FIELD_VIDEO']]['storage_object'] = $CNF['OBJECT_STORAGE_VIDEOS'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_VIDEO']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_VIDEO']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['images_transcoder'] = $CNF['OBJECT_VIDEOS_TRANSCODERS']['poster_preview'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_VIDEO']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+
+        if (isset($CNF['FIELD_FILE']) && isset($this->aInputs[$CNF['FIELD_FILE']])) {
+            $this->aInputs[$CNF['FIELD_FILE']]['storage_object'] = $CNF['OBJECT_STORAGE_FILES'];
+            $this->aInputs[$CNF['FIELD_FILE']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_FILE']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_FILE']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_FILE']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_FILES'];
+            $this->aInputs[$CNF['FIELD_FILE']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_FILE']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_FILE']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_FILE']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_FILE']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+
+        if(isset($this->aInputs[$CNF['FIELD_POLL']])) {
+            $this->aInputs[$CNF['FIELD_POLL']]['tr_attrs'] = array('class'=> 'bx-base-text-attachment-item');
+        }
+    }
+
+    function initChecker ($aValues = array (), $aSpecificValues = array())
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $bValues = $aValues && !empty($aValues['id']);
+        $aContentInfo = $bValues ? $this->_oModule->_oDb->getContentInfoById($aValues['id']) : false;
+
+        if (isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
+            if($bValues)
+                $this->aInputs[$CNF['FIELD_COVER']]['content_id'] = $aValues['id'];
+
+            $this->aInputs[$CNF['FIELD_COVER']]['ghost_template'] = $this->_oModule->_oTemplate->parseHtmlByName($this->_sGhostTemplateCover, $this->_getCoverGhostTmplVars($aContentInfo));
+        }
+
+        parent::initChecker ($aValues, $aSpecificValues);
+    }
+
+    public function insert ($aValsToAdd = array(), $isIgnore = false)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(isset($CNF['FIELD_ADDED']) && empty($aValsToAdd[$CNF['FIELD_ADDED']])) {
+            $iAdded = 0;
+            if(isset($this->aInputs[$CNF['FIELD_ADDED']]))
+                $iAdded = $this->getCleanValue($CNF['FIELD_ADDED']);
+            
+            if(empty($iAdded))
+                 $iAdded = time();
+
+            $aValsToAdd[$CNF['FIELD_ADDED']] = $iAdded;
+        }
+
+        if(empty($aValsToAdd[$CNF['FIELD_PUBLISHED']])) {
+            $iPublished = 0;
+            if(isset($this->aInputs[$CNF['FIELD_PUBLISHED']]))
+                $iPublished = $this->getCleanValue($CNF['FIELD_PUBLISHED']);
+                
+             if(empty($iPublished))
+                 $iPublished = time();
+
+             $aValsToAdd[$CNF['FIELD_PUBLISHED']] = $iPublished;
+        }
+
+        $aValsToAdd[$CNF['FIELD_STATUS']] = $aValsToAdd[$CNF['FIELD_PUBLISHED']] > $aValsToAdd[$CNF['FIELD_ADDED']] ? 'awaiting' : 'active';
+
+        $iContentId = parent::insert ($aValsToAdd, $isIgnore);
+        if(!empty($iContentId))
+            $this->processFiles($CNF['FIELD_COVER'], $iContentId, true);
+
+        return $iContentId;
+    }
+
+    function update ($iContentId, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(empty($aValsToAdd[$CNF['FIELD_PUBLISHED']]) && isset($this->aInputs[$CNF['FIELD_PUBLISHED']])) {
+            $iPublished = $this->getCleanValue($CNF['FIELD_PUBLISHED']);
+            if(empty($iPublished))
+                $iPublished = time();
+
+            $aValsToAdd[$CNF['FIELD_PUBLISHED']] = $iPublished;
+        }
+
+        if(isset($aValsToAdd[$CNF['FIELD_PUBLISHED']]))
+            $aValsToAdd[$CNF['FIELD_STATUS']] = $aValsToAdd[$CNF['FIELD_PUBLISHED']] > time() ? 'awaiting' : 'active';
+
+        $iResult = parent::update ($iContentId, $aValsToAdd, $aTrackTextFieldsChanges);
+
+        $this->processFiles($CNF['FIELD_COVER'], $iContentId, false);
+
+        return $iResult;
+    }
+
+    protected function _getCoverGhostTmplVars($aContentInfo = array())
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	return array (
+            'name' => $this->aInputs[$CNF['FIELD_COVER']]['name'],
+            'content_id' => $this->aInputs[$CNF['FIELD_COVER']]['content_id'],
+            'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : '',
+            'thumb_id' => isset($CNF['FIELD_THUMB']) && isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
+            'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : ''
+        );
+    }
+
+    protected function _getPhotoGhostTmplVars($aContentInfo = array())
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+    	return array (
+            'name' => $this->aInputs[$CNF['FIELD_PHOTO']]['name'],
+            'content_id' => (int)$this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
+            'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : ''
+    	);
+    }
+}
+
+/** @} */

+ 34 - 0
modules/boonex/directory/classes/BxDirFormsEntryHelper.php

@@ -0,0 +1,34 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry forms helper functions
+ */
+class BxDirFormsEntryHelper extends BxBaseModTextFormsEntryHelper
+{
+    public function __construct($oModule)
+    {
+        parent::__construct($oModule);
+    }
+
+    protected function _alertAfterAdd($aContentInfo)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $aParams = array('object_author_id' => $aContentInfo[$CNF['FIELD_AUTHOR']]);
+        if(isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
+        	$aParams['privacy_view'] = $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']];
+
+        bx_alert($this->_oModule->getName(), ($aContentInfo[$CNF['FIELD_STATUS']] == 'awaiting' ? 'scheduled' : 'added'), $aContentInfo[$CNF['FIELD_ID']], $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/directory/classes/BxDirGridAdministration.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxDirGridAdministration extends BxBaseModTextGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_directory';
+
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/directory/classes/BxDirGridCommon.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxDirGridCommon extends BxBaseModTextGridCommon
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_directory';
+
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/directory/classes/BxDirMenu.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * General class for module menu.
+ */
+class BxDirMenu extends BxBaseModTextMenu
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/directory/classes/BxDirMenuAttachments.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxDirMenuAttachments extends BxBaseModTextMenuAttachments
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 26 - 0
modules/boonex/directory/classes/BxDirMenuManageTools.php

@@ -0,0 +1,26 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'Directory manage tools' menu.
+ */
+class BxDirMenuManageTools extends BxBaseModTextMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/directory/classes/BxDirMenuSnippetMeta.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirMenuSnippetMeta extends BxBaseModTextMenuSnippetMeta
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/directory/classes/BxDirMenuView.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxDirMenuView extends BxBaseModTextMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 35 - 0
modules/boonex/directory/classes/BxDirMenuViewActions.php

@@ -0,0 +1,35 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry social actions menu
+ */
+class BxDirMenuViewActions extends BxBaseModTextMenuViewActions
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _getMenuItemEditAd($aItem)
+    {
+        return $this->_getMenuItemByNameActions($aItem);
+    }
+
+    protected function _getMenuItemDeleteAd($aItem)
+    {
+        return $this->_getMenuItemByNameActions($aItem);
+    }
+}
+
+/** @} */

+ 83 - 0
modules/boonex/directory/classes/BxDirModule.php

@@ -0,0 +1,83 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Directory module
+ */
+class BxDirModule extends BxBaseModTextModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+
+        $CNF = &$this->_oConfig->CNF;
+        $this->_aSearchableNamesExcept = array_merge($this->_aSearchableNamesExcept, array(
+             $CNF['FIELD_PUBLISHED']
+        ));
+    }
+
+    /**
+     * Entry post for Timeline module
+     */
+    public function serviceGetTimelinePost($aEvent, $aBrowseParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $aResult = parent::serviceGetTimelinePost($aEvent, $aBrowseParams);
+        if(empty($aResult) || !is_array($aResult) || empty($aResult['date']))
+            return $aResult;
+
+        $aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id']);
+        if($aContentInfo[$CNF['FIELD_PUBLISHED']] > $aResult['date'])
+            $aResult['date'] = $aContentInfo[$CNF['FIELD_PUBLISHED']];
+
+        return $aResult;
+    }
+
+    public function onPublished($iContentId)
+    {
+		$CNF = &$this->_oConfig->CNF;
+
+		$aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if(!$aContentInfo)
+            return MsgBox(_t('_sys_txt_error_occured'));
+
+		$aParams = array('object_author_id' => $aContentInfo[$CNF['FIELD_AUTHOR']]);
+		if(isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
+			$aParams['privacy_view'] = $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']];
+
+        bx_alert($this->getName(), 'added', $iContentId, false, $aParams);
+
+        return '';
+    }
+    
+    public function serviceCheckAllowedCommentsPost($iContentId, $sObjectComments) 
+    {
+		$CNF = &$this->_oConfig->CNF;
+		$aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+		if ($aContentInfo[$CNF['FIELD_DISABLE_COMMENTS']] == 1)
+			return false;
+
+        return parent::serviceCheckAllowedCommentsPost($iContentId, $sObjectComments);
+    }
+	
+	public function serviceCheckAllowedCommentsView($iContentId, $sObjectComments) 
+    {
+        $CNF = &$this->_oConfig->CNF;
+		$aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+		if ($aContentInfo[$CNF['FIELD_DISABLE_COMMENTS']] == 1)
+			return false;
+
+        return parent::serviceCheckAllowedCommentsView($iContentId, $sObjectComments);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/directory/classes/BxDirPageAuthor.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Profile's entries page.
+ */
+class BxDirPageAuthor extends BxBaseModTextPageAuthor
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 25 - 0
modules/boonex/directory/classes/BxDirPageBrowse.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Browse entries pages.
+ */
+class BxDirPageBrowse extends BxBaseModTextPageBrowse
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 33 - 0
modules/boonex/directory/classes/BxDirPageEntry.php

@@ -0,0 +1,33 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry create/edit pages
+ */
+class BxDirPageEntry extends BxBaseModTextPageEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_directory';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _setSubmenu($aParams)
+    {
+        parent::_setSubmenu(array_merge($aParams, array(
+            'title' => '',
+            'icon' => ''
+        )));
+    }
+}
+
+/** @} */

+ 142 - 0
modules/boonex/directory/classes/BxDirSearchResult.php

@@ -0,0 +1,142 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirSearchResult extends BxBaseModTextSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent = array(
+            'name' => 'bx_directory',
+            'module_name' => 'bx_directory',
+            'object_metatags' => 'bx_directory',
+            'title' => _t('_bx_directory_page_title_browse'),
+            'table' => 'bx_directory_entries',
+            'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added'),
+            'searchFields' => array(),
+            'restriction' => array(
+                'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
+                'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+                'statusAdmin' => array('value' => 'active', 'field' => 'status_admin', 'operator' => '='),
+            ),
+            'paginate' => array('perPage' => getParam('bx_directory_per_page_browse'), 'start' => 0),
+            'sorting' => 'last',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'title',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'text',
+                    'Image' => 'thumb'
+                ),
+            ),
+            'ident' => 'id',
+        );
+
+        $this->sFilterName = 'bx_directory_filter';
+        $this->oModule = $this->getMain();
+
+        $CNF = &$this->oModule->_oConfig->CNF;
+
+        $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
+        $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
+
+        $oProfileAuthor = null;
+
+        switch ($sMode) {
+            case 'author':
+                if(!$this->_updateCurrentForAuthor($sMode, $aParams, $oProfileAuthor))
+                    $this->isError = true;
+                break;
+
+            case 'context':
+                if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileAuthor))
+                    $this->isError = true;
+                break;
+                
+            case 'favorite':
+                if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor))
+                    $this->isError = true;
+                break;
+
+            case 'public':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_directory_page_title_browse_recent');
+                $this->aCurrent['rss']['link'] = 'modules/?r=ads/rss/' . $sMode;
+                break;
+
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_directory_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=ads/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
+            case 'popular':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
+                $this->aCurrent['title'] = _t('_bx_directory_page_title_browse_popular');
+                $this->aCurrent['rss']['link'] = 'modules/?r=ads/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'popular';
+                break;
+
+            case 'updated':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
+                $this->aCurrent['title'] = _t('_bx_directory_page_title_browse_updated');
+                $this->aCurrent['rss']['link'] = 'modules/?r=ads/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'updated';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_directory');
+                unset($this->aCurrent['paginate']['perPage'], $this->aCurrent['rss']);
+                break;
+
+            default:
+                $sMode = '';
+                $this->isError = true;
+        }
+
+        $this->processReplaceableMarkers($oProfileAuthor);
+
+        $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
+    }
+
+    function getAlterOrder()
+    {
+        $aSql = array();
+        switch ($this->aCurrent['sorting']) {
+            case 'last':
+                $aSql['order'] = ' ORDER BY `bx_directory_entries`.`added` DESC';
+                break;
+            case 'featured':
+                $aSql['order'] = ' ORDER BY `bx_directory_entries`.`featured` DESC';
+                break;
+            case 'updated':
+                $aSql['order'] = ' ORDER BY `bx_directory_entries`.`changed` DESC';
+                break;
+            case 'popular':
+                $aSql['order'] = ' ORDER BY `bx_directory_entries`.`views` DESC';
+                break;
+        }
+        return $aSql;
+    }
+}
+
+/** @} */

+ 35 - 0
modules/boonex/directory/classes/BxDirTemplate.php

@@ -0,0 +1,35 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module representation.
+ */
+class BxDirTemplate extends BxBaseModTextTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_directory';
+
+        parent::__construct($oConfig, $oDb);
+    }
+
+    /**
+     * Use Gallery image for both because currently there is no Unit types with small thumbnails.
+     */
+    protected function getUnitThumbAndGallery ($aData)
+    {
+        list($sPhotoThumb, $sPhotoGallery) = parent::getUnitThumbAndGallery($aData);
+
+        return array($sPhotoGallery, $sPhotoGallery);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/directory/classes/BxDirUploaderHTML5.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirUploaderHTML5 extends BxBaseModTextUploaderHTML5
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_directory';
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/directory/classes/BxDirUploaderHTML5Attach.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirUploaderHTML5Attach extends BxBaseModTextUploaderHTML5Attach
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_directory';
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/directory/classes/BxDirUploaderSimple.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirUploaderSimple extends BxBaseModTextUploaderSimple
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_directory';
+        
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/directory/classes/BxDirUploaderSimpleAttach.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirUploaderSimpleAttach extends BxBaseModTextUploaderSimpleAttach
+{
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_sModule = 'bx_directory';
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+    }
+
+    protected function isAdmin ($iContentId = 0)
+    {
+        return $this->_oModule->_isModerator (false);
+    }
+}
+
+/** @} */

+ 150 - 0
modules/boonex/directory/install/config.php

@@ -0,0 +1,150 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_directory',
+    'title' => 'Directory',
+    'note' => 'Directory module.',
+    'version' => '9.0.0.DEV',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/directory/',
+    'home_uri' => 'directory',
+
+    'db_prefix' => 'bx_directory_',
+    'class_prefix' => 'BxDir',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Directory',
+
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    ),
+    
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+        'trigger_profile_view_submenu',
+        'trigger_group_view_submenu',
+    ),
+
+    /**
+     * Storage objects to automatically delete files from upon module uninstallation.
+     * Note. Don't add storage objects used in transcoder objects.
+     */
+    'storages' => array(
+        'bx_directory_covers',
+    	'bx_directory_photos',
+        'bx_directory_videos',
+        'bx_directory_files'
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+        'bx_directory_preview',
+        'bx_directory_gallery',
+        'bx_directory_cover',
+
+        'bx_directory_preview_photos',
+        'bx_directory_gallery_photos', 
+
+        'bx_directory_videos_poster',
+        'bx_directory_videos_poster_preview',
+        'bx_directory_videos_mp4',
+        'bx_directory_videos_webm',
+
+        'bx_directory_preview_files',
+        'bx_directory_gallery_files'
+    ),
+
+    /**
+     * Extended Search Forms.
+     */
+    'esearches' => array(
+        'bx_directory',
+    	'bx_directory_cmts'
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_esearches' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable_success' => array(
+        'process_menu_triggers' => 1,
+        'process_page_triggers' => 1,
+    	'process_esearches' => 1,
+        'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'update_relations' => 1,
+        'unregister_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+        'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Relations Section
+     */
+    'relations' => array(
+    	'bx_timeline',
+    	'bx_notifications'
+    ),
+
+);
+
+/** @} */

+ 20 - 0
modules/boonex/directory/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxDirInstaller extends BxBaseModTextInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 288 - 0
modules/boonex/directory/install/langs/en.xml

@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+    <string name="_bx_directory"><![CDATA[Directory]]></string>
+    <string name="_bx_directory_cmts"><![CDATA[Directory's Comments]]></string>
+
+    <string name="_bx_directory_option_summary_chars"><![CDATA[Number of characters in auto-cropped ad summary]]></string>
+    <string name="_bx_directory_option_plain_summary_chars"><![CDATA[Number of characters in plain ad description when ad hasn't thumb]]></string>
+    <string name="_bx_directory_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+    <string name="_bx_directory_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
+    <string name="_bx_directory_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+    <string name="_bx_directory_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+
+    <string name="_bx_directory_form_entry"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_form_entry_display_add"><![CDATA[Add Ad]]></string>
+    <string name="_bx_directory_form_entry_display_edit"><![CDATA[Edit Ad]]></string>
+    <string name="_bx_directory_form_entry_display_delete"><![CDATA[Delete Ad]]></string>
+    <string name="_bx_directory_form_entry_display_view"><![CDATA[View Ad]]></string>
+    <string name="_bx_directory_form_entry_input_author"><![CDATA[Author]]></string>
+    <string name="_bx_directory_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_directory_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_directory_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
+    <string name="_bx_directory_form_entry_input_do_publish"><![CDATA[Publish]]></string>
+    <string name="_bx_directory_form_entry_input_sys_title"><![CDATA[Title]]></string>
+    <string name="_bx_directory_form_entry_input_title"><![CDATA[Title]]></string>
+    <string name="_bx_directory_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+    <string name="_bx_directory_form_entry_input_sys_cat"><![CDATA[Category]]></string>
+    <string name="_bx_directory_form_entry_input_cat"><![CDATA[Category]]></string>
+    <string name="_bx_directory_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+    <string name="_bx_directory_form_entry_input_sys_text"><![CDATA[Text]]></string>
+    <string name="_bx_directory_form_entry_input_text"><![CDATA[Text]]></string>
+    <string name="_bx_directory_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
+    <string name="_bx_directory_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+    <string name="_bx_directory_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this ad]]></string>
+    <string name="_bx_directory_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+    <string name="_bx_directory_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the ad]]></string>
+    <string name="_bx_directory_form_entry_input_sys_covers"><![CDATA[Header Image]]></string>
+    <string name="_bx_directory_form_entry_input_covers"><![CDATA[Header Image]]></string>
+    <string name="_bx_directory_form_entry_input_covers_uploader_simple_title"><![CDATA[Upload]]></string>
+    <string name="_bx_directory_form_entry_input_covers_uploader_html5_title"><![CDATA[Upload]]></string>
+    <string name="_bx_directory_form_entry_input_sys_pictures"><![CDATA[Images]]></string>
+    <string name="_bx_directory_form_entry_input_pictures"><![CDATA[]]></string>
+    <string name="_bx_directory_form_entry_input_sys_videos"><![CDATA[Videos]]></string>
+    <string name="_bx_directory_form_entry_input_videos"><![CDATA[]]></string>
+    <string name="_bx_directory_form_entry_input_sys_files"><![CDATA[Files]]></string>
+    <string name="_bx_directory_form_entry_input_files"><![CDATA[]]></string>
+    <string name="_bx_directory_form_entry_input_sys_polls"><![CDATA[Polls]]></string>
+    <string name="_bx_directory_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_directory_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_directory_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_directory_form_entry_input_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_directory_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_directory_form_entry_input_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_directory_form_entry_input_sys_date_published"><![CDATA[Publish at]]></string>
+    <string name="_bx_directory_form_entry_input_date_published"><![CDATA[Publish at]]></string>
+    <string name="_bx_directory_form_entry_input_date_published_info"><![CDATA[Leave empty to publish immediately.]]></string>
+    <string name="_bx_directory_form_entry_input_sys_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_directory_form_entry_input_sys_disable_comments"><![CDATA[Disable comments]]></string>
+    <string name="_bx_directory_form_entry_input_disable_comments"><![CDATA[Disable comments]]></string>
+
+    <string name="_bx_directory_form_poll"><![CDATA[Polls]]></string>
+    <string name="_bx_directory_form_poll_display_add"><![CDATA[Add Poll]]></string>
+    <string name="_bx_directory_form_poll_input_sys_text"><![CDATA[Question]]></string>
+    <string name="_bx_directory_form_poll_input_text"><![CDATA[Question]]></string>
+    <string name="_bx_directory_form_poll_input_text_err"><![CDATA[Question is essential. Please, fill in this field]]></string>
+    <string name="_bx_directory_form_poll_input_sys_answers"><![CDATA[Answers]]></string>
+    <string name="_bx_directory_form_poll_input_answers"><![CDATA[Answers]]></string>
+    <string name="_bx_directory_form_poll_input_answers_err"><![CDATA[Poll should have at least 2 non-empty answers.]]></string>
+    <string name="_bx_directory_form_poll_input_answers_add"><![CDATA[Add More]]></string>
+    <string name="_bx_directory_form_poll_input_sys_do_submit"><![CDATA[Add]]></string>
+    <string name="_bx_directory_form_poll_input_do_submit"><![CDATA[Add]]></string>
+    <string name="_bx_directory_form_poll_input_do_cancel"><![CDATA[Close]]></string>
+
+    <string name="_bx_directory_acl_action_create_entry"><![CDATA[Create Ad]]></string>
+    <string name="_bx_directory_acl_action_delete_entry"><![CDATA[Delete Ad]]></string>
+    <string name="_bx_directory_acl_action_view_entry"><![CDATA[View Ad]]></string>
+    <string name="_bx_directory_acl_action_set_thumb"><![CDATA[Set Ad Header Image]]></string>
+    <string name="_bx_directory_acl_action_edit_any_entry"><![CDATA[Edit Any Ad]]></string>
+
+    <string name="_bx_directory_page_title_sys_create_entry"><![CDATA[New Ad]]></string>
+    <string name="_bx_directory_page_title_create_entry"><![CDATA[New Ad]]></string>
+    <string name="_bx_directory_page_block_title_create_entry"><![CDATA[New Ad]]></string>
+    <string name="_bx_directory_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_directory_page_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_directory_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_directory_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_directory_page_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_directory_page_block_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_directory_page_title_sys_view_entry"><![CDATA[View Ad]]></string>
+    <string name="_bx_directory_page_title_view_entry"><![CDATA[{title}]]></string>
+    <string name="_bx_directory_page_block_title_entry_text"><![CDATA[Ad Text]]></string>
+    <string name="_bx_directory_page_title_browse"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_page_title_search_results"><![CDATA[Ads matching "{0}"]]></string>
+    <string name="_bx_directory_page_title_browse_by_author"><![CDATA[Ads of {display_name}]]></string>
+    <string name="_bx_directory_page_title_browse_by_context"><![CDATA[Ads in {display_name}]]></string>
+    <string name="_bx_directory_page_title_browse_featured"><![CDATA[Featured Ads]]></string>
+    <string name="_bx_directory_page_title_browse_recent"><![CDATA[Latest Ads]]></string>
+    <string name="_bx_directory_page_title_browse_popular"><![CDATA[Popular Ads]]></string>
+    <string name="_bx_directory_page_title_browse_updated"><![CDATA[Updated Ads]]></string>
+    <string name="_bx_directory_page_title_sys_home"><![CDATA[Directory Home]]></string>
+    <string name="_bx_directory_page_title_home"><![CDATA[Directory]]></string>
+    <string name="_bx_directory_page_block_title_featured_entries_view_extended"><![CDATA[Featured Ads]]></string>
+    <string name="_bx_directory_page_block_title_recent_entries"><![CDATA[Latest Ads (Gallery View)]]></string>
+    <string name="_bx_directory_page_block_title_recent_entries_view_extended"><![CDATA[Latest Ads]]></string>
+    <string name="_bx_directory_page_block_title_recent_entries_view_full"><![CDATA[Latest Ads (Full View)]]></string>
+    <string name="_bx_directory_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_directory_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_directory_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_directory_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_directory_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_directory_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_directory_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_directory_page_block_title_entry_polls"><![CDATA[Polls]]></string>
+    <string name="_bx_directory_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
+    <string name="_bx_directory_page_title_sys_entries_popular"><![CDATA[Popular Ads]]></string>
+    <string name="_bx_directory_page_title_entries_popular"><![CDATA[Popular Ads]]></string>
+    <string name="_bx_directory_page_title_sys_entries_updated"><![CDATA[Updated Ads]]></string>
+    <string name="_bx_directory_page_title_entries_updated"><![CDATA[Updated Ads]]></string>
+    <string name="_bx_directory_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_directory_page_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_directory_page_block_title_search_form"><![CDATA[Search Form]]></string>
+    <string name="_bx_directory_page_block_title_search_results"><![CDATA[Search Results]]></string>
+    <string name="_bx_directory_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+    <string name="_bx_directory_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+    <string name="_bx_directory_page_block_title_popular_entries"><![CDATA[Popular Ads]]></string>
+    <string name="_bx_directory_page_block_title_popular_entries_view_extended"><![CDATA[Popular Ads (Extended View)]]></string>
+    <string name="_bx_directory_page_block_title_popular_entries_view_full"><![CDATA[Popular Ads (Full View)]]></string>
+    <string name="_bx_directory_page_block_title_updated_entries"><![CDATA[Updated Ads]]></string>
+    <string name="_bx_directory_page_title_sys_view_entry_comments"><![CDATA[Ad Comments]]></string>
+    <string name="_bx_directory_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
+    <string name="_bx_directory_page_title_sys_entries_of_author"><![CDATA[Ads of author]]></string>
+    <string name="_bx_directory_page_title_entries_of_author"><![CDATA[Ads by {display_name}]]></string>
+    <string name="_bx_directory_page_title_sys_entries_in_context"><![CDATA[Ads in context]]></string>
+    <string name="_bx_directory_page_title_entries_in_context"><![CDATA[Ads in {display_name}]]></string>
+    <string name="_bx_directory_page_block_title_favorites_of_author"><![CDATA[Favorites by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_directory_page_block_title_sys_favorites_of_author"><![CDATA[Favorites of author]]></string>
+    <string name="_bx_directory_page_block_title_entries_of_author"><![CDATA[Ads by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_directory_page_block_title_sys_entries_of_author"><![CDATA[Ads of author]]></string>
+    <string name="_bx_directory_page_block_title_entries_in_context"><![CDATA[Ads in <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_directory_page_block_title_sys_entries_in_context"><![CDATA[Ads in context]]></string>
+    <string name="_bx_directory_page_block_title_entries_actions"><![CDATA[Ads actions]]></string>
+    <string name="_bx_directory_page_block_title_browse_cmts"><![CDATA[Ads' Comments]]></string>
+    <string name="_bx_directory_page_title_sys_manage"><![CDATA[Manage Own]]></string>
+    <string name="_bx_directory_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
+    <string name="_bx_directory_page_title_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_directory_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
+    <string name="_bx_directory_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
+    <string name="_bx_directory_page_block_title_manage"><![CDATA[Manage]]></string>    
+    <string name="_bx_directory_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
+    <string name="_bx_directory_page_block_title_cats"><![CDATA[Ads Categories]]></string>
+    <string name="_bx_directory_page_block_title_entry_info"><![CDATA[Info]]></string>
+    <string name="_bx_directory_page_block_title_my_entries"><![CDATA[My Ads]]></string>
+    <string name="_bx_directory_page_block_title_sys_recent_entries_view_showcase"><![CDATA[Latest Ads (Showcase View)]]></string>
+    <string name="_bx_directory_page_block_title_recent_entries_view_showcase"><![CDATA[Latest Ads]]></string>
+    <string name="_bx_directory_page_block_title_sys_popular_entries_view_showcase"><![CDATA[Popular Ads (Showcase View)]]></string>
+    <string name="_bx_directory_page_block_title_popular_entries_view_showcase"><![CDATA[Popular Ads]]></string>
+    <string name="_bx_directory_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured Ads (Showcase View)]]></string>
+    <string name="_bx_directory_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Ads]]></string>
+    <string name="_bx_directory_page_block_title_sys_entry_context"><![CDATA[Posted in]]></string>
+    <string name="_bx_directory_page_block_title_entry_context"><![CDATA[Posted in]]></string>
+
+    <string name="_bx_directory_menu_title_entry_attachments"><![CDATA[Form Attachments]]></string>
+    <string name="_bx_directory_menu_set_title_entry_attachments"><![CDATA[Form Attachments]]></string>
+    <string name="_bx_directory_menu_item_title_system_cpa_photo_simple"><![CDATA[Add Photo (simple)]]></string>
+    <string name="_bx_directory_menu_item_title_cpa_photo_simple"><![CDATA[Add Photo]]></string>
+    <string name="_bx_directory_menu_item_title_system_cpa_photo_html5"><![CDATA[Add Photo (html5)]]></string>
+    <string name="_bx_directory_menu_item_title_cpa_photo_html5"><![CDATA[Add Photos]]></string>
+    <string name="_bx_directory_menu_item_title_system_cpa_video_simple"><![CDATA[Add Video (simple)]]></string>
+    <string name="_bx_directory_menu_item_title_cpa_video_simple"><![CDATA[Add Video]]></string>
+    <string name="_bx_directory_menu_item_title_system_cpa_video_html5"><![CDATA[Add Video (html5)]]></string>
+    <string name="_bx_directory_menu_item_title_cpa_video_html5"><![CDATA[Add Videos]]></string>
+    <string name="_bx_directory_menu_item_title_system_cpa_file_simple"><![CDATA[Add File (simple)]]></string>
+    <string name="_bx_directory_menu_item_title_cpa_file_simple"><![CDATA[Add File]]></string>
+    <string name="_bx_directory_menu_item_title_system_cpa_file_html5"><![CDATA[Add File (html5)]]></string>
+    <string name="_bx_directory_menu_item_title_cpa_file_html5"><![CDATA[Add Files]]></string>
+    <string name="_bx_directory_menu_item_title_system_cpa_poll"><![CDATA[Add Poll]]></string>
+    <string name="_bx_directory_menu_item_title_cpa_poll"><![CDATA[Add Poll]]></string>
+
+    <string name="_bx_directory_menu_set_title_view_entry"><![CDATA[Ad Actions]]></string>
+    <string name="_bx_directory_menu_title_view_entry"><![CDATA[Ad Actions]]></string>
+    <string name="_bx_directory_menu_title_submenu"><![CDATA[Directory Submenu]]></string>
+    <string name="_bx_directory_menu_set_title_submenu"><![CDATA[Directory Submenu]]></string>
+    <string name="_bx_directory_menu_item_title_system_create_entry"><![CDATA[Ad]]></string>
+    <string name="_bx_directory_menu_item_title_create_entry"><![CDATA[Ad]]></string>
+    <string name="_bx_directory_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_directory_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_directory_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_directory_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_directory_menu_item_title_system_view_entry"><![CDATA[View Ad]]></string>
+    <string name="_bx_directory_menu_item_title_system_entries_home"><![CDATA[Directory]]></string>
+    <string name="_bx_directory_menu_item_title_entries_home"><![CDATA[Directory]]></string>
+    <string name="_bx_directory_menu_item_title_system_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_directory_menu_item_title_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_directory_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_directory_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_directory_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_directory_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_directory_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_directory_menu_item_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_directory_menu_title_view_entry_submenu"><![CDATA[View Ad Submenu]]></string>
+    <string name="_bx_directory_menu_set_title_view_entry_submenu"><![CDATA[View Ad Submenu]]></string>
+    <string name="_bx_directory_menu_item_title_view_entry_submenu_entry"><![CDATA[Ad]]></string>
+    <string name="_bx_directory_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_directory_menu_item_title_system_view_entry_comments"><![CDATA[Ad Comments]]></string>
+    <string name="_bx_directory_menu_item_title_system_view_entries_author"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_menu_item_title_view_entries_author"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_menu_item_title_system_view_entries_in_context"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_menu_item_title_view_entries_in_context"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_menu_title_entries_my"><![CDATA[My Ads Action Menu]]></string>
+    <string name="_bx_directory_menu_set_title_entries_my"><![CDATA[My Ads Menu]]></string>
+    <string name="_bx_directory_menu_item_title_system_manage_my_posts"><![CDATA[My ads]]></string>
+    <string name="_bx_directory_menu_item_title_manage_my_posts"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_directory_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_directory_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_directory_menu_item_title_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_directory_menu_item_title_system_admt_posts"><![CDATA[Ads]]></string>
+    <string name="_bx_directory_menu_item_title_admt_posts"><![CDATA[Ads - {addon} hidden]]></string>
+    <string name="_bx_directory_menu_item_title_manage_my"><![CDATA[My Ads]]></string>
+    <string name="_bx_directory_menu_item_title_manage_all"><![CDATA[All Ads]]></string>
+
+    <string name="_bx_directory_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+    <string name="_bx_directory_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_directory_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+    <string name="_bx_directory_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_directory_grid_column_title_adm_title"><![CDATA[Title]]></string>
+    <string name="_bx_directory_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_directory_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_directory_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_directory_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_directory_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_directory_grid_action_err_delete"><![CDATA[Cannot delete the selected ad(s).]]></string>
+    <string name="_bx_directory_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_directory_chart_growth"><![CDATA[Directory: Growth]]></string>
+    <string name="_bx_directory_chart_growth_speed"><![CDATA[Directory: Growth Speed]]></string>
+
+    <string name="_bx_directory_search_extended"><![CDATA[Directory Search]]></string>
+    <string name="_bx_directory_search_extended_cmts"><![CDATA[Directory Comments Search]]></string>
+
+    <string name="_bx_directory_pre_lists_cats"><![CDATA[Ad categories]]></string>
+    <string name="_bx_directory_cat_Animals_Pets"><![CDATA[Animals & Pets]]></string>
+    <string name="_bx_directory_cat_Architecture"><![CDATA[Architecture]]></string>
+    <string name="_bx_directory_cat_Art"><![CDATA[Art]]></string>
+    <string name="_bx_directory_cat_Cars_Motorcycles"><![CDATA[Cars & Motorcycles]]></string>
+    <string name="_bx_directory_cat_Celebrities"><![CDATA[Celebrities]]></string>
+    <string name="_bx_directory_cat_Design"><![CDATA[Design]]></string>
+    <string name="_bx_directory_cat_DIY_Crafts"><![CDATA[DIY & Crafts]]></string>
+    <string name="_bx_directory_cat_Education"><![CDATA[Education]]></string>
+    <string name="_bx_directory_cat_Film_Music_Books"><![CDATA[Film, Music & Books]]></string>
+    <string name="_bx_directory_cat_Food_Drink"><![CDATA[Food & Drink]]></string>
+    <string name="_bx_directory_cat_Gardening"><![CDATA[Gardening]]></string>
+    <string name="_bx_directory_cat_Geek"><![CDATA[Geek]]></string>
+    <string name="_bx_directory_cat_Hair_Beauty"><![CDATA[Hair & Beauty]]></string>
+    <string name="_bx_directory_cat_Health_Fitness"><![CDATA[Health & Fitness]]></string>
+    <string name="_bx_directory_cat_History"><![CDATA[History]]></string>
+    <string name="_bx_directory_cat_Holidays_Events"><![CDATA[Holidays & Events]]></string>
+    <string name="_bx_directory_cat_Home_Decor"><![CDATA[Home Decor]]></string>
+    <string name="_bx_directory_cat_Humor"><![CDATA[Humor]]></string>
+    <string name="_bx_directory_cat_Illustrations_Posters"><![CDATA[Illustrations & Posters]]></string>
+    <string name="_bx_directory_cat_Kids_Parenting"><![CDATA[Kids & Parenting]]></string>
+    <string name="_bx_directory_cat_Mens_Fashion"><![CDATA[Men's Fashion]]></string>
+    <string name="_bx_directory_cat_Outdoors"><![CDATA[Outdoors]]></string>
+    <string name="_bx_directory_cat_Photography"><![CDATA[Photography]]></string>
+    <string name="_bx_directory_cat_Products"><![CDATA[Products]]></string>
+    <string name="_bx_directory_cat_Quotes"><![CDATA[Quotes]]></string>
+    <string name="_bx_directory_cat_Science_Nature"><![CDATA[Science & Nature]]></string>
+    <string name="_bx_directory_cat_Sports"><![CDATA[Sports]]></string>
+    <string name="_bx_directory_cat_Tattoos"><![CDATA[Tattoos]]></string>
+    <string name="_bx_directory_cat_Technology"><![CDATA[Technology]]></string>
+    <string name="_bx_directory_cat_Travel"><![CDATA[Travel]]></string>
+    <string name="_bx_directory_cat_Weddings"><![CDATA[Weddings]]></string>
+    <string name="_bx_directory_cat_Womens_Fashion"><![CDATA[Women's Fashion]]></string>
+
+    <string name="_bx_directory_txt_all_entries_in"><![CDATA[<a href="{0}">All Ads in {1} ({2})</a>]]></string>
+    <string name="_bx_directory_txt_all_entries_by"><![CDATA[<a href="{0}">All Ads by {1} ({2})</a>]]></string>
+    <string name="_bx_directory_txt_sample_single"><![CDATA[ad]]></string>
+    <string name="_bx_directory_txt_sample_single_with_article"><![CDATA[an ad]]></string>
+    <string name="_bx_directory_txt_sample_comment_single"><![CDATA[comment to ad]]></string>
+    <string name="_bx_directory_txt_sample_vote_single"><![CDATA[vote to ad]]></string>
+
+    <string name="_bx_directory_txt_err_cannot_perform_action"><![CDATA[Cannot perform action. Please report.]]></string>
+
+    <string name="_bx_directory_txt_poll_view_answers"><![CDATA[poll]]></string>
+    <string name="_bx_directory_txt_poll_view_results"><![CDATA[results]]></string>
+    <string name="_bx_directory_txt_poll_answer_vote_do_by"><![CDATA[Voted for]]></string>
+    <string name="_bx_directory_txt_poll_answer_vote_counter"><![CDATA[{0} votes]]></string>
+    <string name="_bx_directory_txt_poll_answer_vote_percent"><![CDATA[({0}%)]]></string>
+</resources>

+ 54 - 0
modules/boonex/directory/install/sql/disable.sql

@@ -0,0 +1,54 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_directory' 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_directory';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_directory' OR `object` IN ('bx_directory_create_entry', 'bx_directory_edit_entry', 'bx_directory_delete_entry', 'bx_directory_view_entry', 'bx_directory_view_entry_comments', 'bx_directory_home', 'bx_directory_popular', 'bx_directory_updated', 'bx_directory_author', 'bx_directory_context', 'bx_directory_search', 'bx_directory_manage');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_directory';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_directory';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_directory' OR `set_name` IN ('bx_directory_create_post_attachments', 'bx_directory_view', 'bx_directory_view_actions', 'bx_directory_submenu', 'bx_directory_view_submenu', 'bx_directory_snippet_meta', 'bx_directory_my', 'bx_directory_menu_manage_tools');
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_directory_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_directory';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_directory';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_directory', 'bx_directory_cmts');
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_directory';
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_directory_cats';
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_directory%';
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_directory%';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_directory_administration', 'bx_directory_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_directory_administration', 'bx_directory_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_directory_administration', 'bx_directory_common');
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` LIKE 'bx_directory_%';
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_directory' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+-- CRON
+DELETE FROM `sys_cron_jobs` WHERE `name` LIKE 'bx_directory%';

+ 484 - 0
modules/boonex/directory/install/sql/enable.sql

@@ -0,0 +1,484 @@
+
+-- 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_directory', '_bx_directory', 'bx_directory@modules/boonex/directory/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_directory', '_bx_directory', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_directory_summary_chars', '700', @iCategId, '_bx_directory_option_summary_chars', 'digit', '', '', '', 1),
+('bx_directory_plain_summary_chars', '240', @iCategId, '_bx_directory_option_plain_summary_chars', 'digit', '', '', '', 2),
+('bx_directory_per_page_browse', '12', @iCategId, '_bx_directory_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_directory_per_page_profile', '6', @iCategId, '_bx_directory_option_per_page_profile', 'digit', '', '', '', 12),
+('bx_directory_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
+('bx_directory_rss_num', '10', @iCategId, '_bx_directory_option_rss_num', 'digit', '', '', '', 20),
+('bx_directory_searchable_fields', 'title,text', @iCategId, '_bx_directory_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:21:"get_searchable_fields";}', 30),
+('bx_directory_labels', '', @iCategId, '_sys_option_labels', 'text', '', '', '', 40);
+
+-- 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_directory_create_entry', '_bx_directory_page_title_sys_create_entry', '_bx_directory_page_title_create_entry', 'bx_directory', 5, 2147483647, 1, 'create-ad', 'page.php?i=create-ad', '', '', '', 0, 1, 0, 'BxDirPageBrowse', 'modules/boonex/directory/classes/BxDirPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_directory_create_entry', 1, 'bx_directory', '_bx_directory_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";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_directory_edit_entry', '_bx_directory_page_title_sys_edit_entry', '_bx_directory_page_title_edit_entry', 'bx_directory', 5, 2147483647, 1, 'edit-ad', '', '', '', '', 0, 1, 0, 'BxDirPageEntry', 'modules/boonex/directory/classes/BxDirPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_directory_edit_entry', 1, 'bx_directory', '_bx_directory_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";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_directory_delete_entry', '_bx_directory_page_title_sys_delete_entry', '_bx_directory_page_title_delete_entry', 'bx_directory', 5, 2147483647, 1, 'delete-ad', '', '', '', '', 0, 1, 0, 'BxDirPageEntry', 'modules/boonex/directory/classes/BxDirPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_directory_delete_entry', 1, 'bx_directory', '_bx_directory_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";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_directory_view_entry', '_bx_directory_page_title_sys_view_entry', '_bx_directory_page_title_view_entry', 'bx_directory', 12, 2147483647, 1, 'view-ad', '', '', '', '', 0, 1, 0, 'BxDirPageEntry', 'modules/boonex/directory/classes/BxDirPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_directory_view_entry', 2, 'bx_directory', '', '_bx_directory_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:17:"entity_text_block";}', 0, 0, 1, 2),
+('bx_directory_view_entry', 2, 'bx_directory', '', '_bx_directory_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"entity_author";}', 0, 0, 1, 1),
+('bx_directory_view_entry', 3, 'bx_directory', '_bx_directory_page_block_title_sys_entry_context', '_bx_directory_page_block_title_entry_context', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"entity_context";}', 0, 0, 1, 1),
+('bx_directory_view_entry', 3, 'bx_directory', '', '_bx_directory_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:11:"entity_info";}', 0, 0, 1, 2),
+('bx_directory_view_entry', 3, 'bx_directory', '', '_bx_directory_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:15:"entity_location";}', 0, 0, 0, 0),
+('bx_directory_view_entry', 2, 'bx_directory', '', '_bx_directory_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 1, 3),
+('bx_directory_view_entry', 4, 'bx_directory', '', '_bx_directory_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"entity_actions";}', 0, 0, 0, 0),
+('bx_directory_view_entry', 4, 'bx_directory', '', '_bx_directory_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:21:"entity_social_sharing";}', 0, 0, 0, 0),
+('bx_directory_view_entry', 4, 'bx_directory', '', '_bx_directory_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:18:"entity_attachments";}', 0, 0, 0, 0),
+('bx_directory_view_entry', 4, 'bx_directory', '', '_bx_directory_page_block_title_entry_polls', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:12:"entity_polls";}', 0, 0, 0, 0),
+('bx_directory_view_entry', 2, 'bx_directory', '', '_bx_directory_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:15:"entity_comments";}', 0, 0, 1, 4),
+('bx_directory_view_entry', 3, 'bx_directory', '', '_bx_directory_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:13:"locations_map";s:6:"params";a:2:{i:0;s:12:"bx_directory";i:1;s:4:"{id}";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 0, 1, 3),
+('bx_directory_view_entry', 3, 'bx_directory', '', '_bx_directory_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 0, 1, 4);
+
+
+-- 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_directory_view_entry_comments', '_bx_directory_page_title_sys_view_entry_comments', '_bx_directory_page_title_view_entry_comments', 'bx_directory', 5, 2147483647, 1, 'view-ad-comments', '', '', '', '', 0, 1, 0, 'BxDirPageEntry', 'modules/boonex/directory/classes/BxDirPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_directory_view_entry_comments', 1, 'bx_directory', '_bx_directory_page_block_title_entry_comments', '_bx_directory_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:15:"entity_comments";}', 0, 0, 1);
+
+
+-- PAGE: popular 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_directory_popular', '_bx_directory_page_title_sys_entries_popular', '_bx_directory_page_title_entries_popular', 'bx_directory', 5, 2147483647, 1, 'ads-popular', 'page.php?i=ads-popular', '', '', '', 0, 1, 0, 'BxDirPageBrowse', 'modules/boonex/directory/classes/BxDirPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_directory_popular', 1, 'bx_directory', '_bx_directory_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+
+-- PAGE: recently updated 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_directory_updated', '_bx_directory_page_title_sys_entries_updated', '_bx_directory_page_title_entries_updated', 'bx_directory', 5, 2147483647, 1, 'ads-updated', 'page.php?i=ads-updated', '', '', '', 0, 1, 0, 'BxDirPageBrowse', 'modules/boonex/directory/classes/BxDirPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_directory_updated', 1, 'bx_directory', '_bx_directory_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"browse_updated";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 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_directory_author', 'ads-author', '_bx_directory_page_title_sys_entries_of_author', '_bx_directory_page_title_entries_of_author', 'bx_directory', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxDirPageAuthor', 'modules/boonex/directory/classes/BxDirPageAuthor.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_directory_author', 1, 'bx_directory', '', '_bx_directory_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 1),
+('bx_directory_author', 1, 'bx_directory', '_bx_directory_page_block_title_sys_favorites_of_author', '_bx_directory_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:15:"browse_favorite";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_directory_author', 1, 'bx_directory', '_bx_directory_page_block_title_sys_entries_of_author', '_bx_directory_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"browse_author";}', 0, 0, 1, 3);
+
+-- PAGE: entries in context
+
+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_directory_context', 'ads-context', '_bx_directory_page_title_sys_entries_in_context', '_bx_directory_page_title_entries_in_context', 'bx_directory', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxDirPageAuthor', 'modules/boonex/directory/classes/BxDirPageAuthor.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_directory_context', 1, 'bx_directory', '_bx_directory_page_block_title_sys_entries_in_context', '_bx_directory_page_block_title_entries_in_context', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"browse_context";}', 0, 0, 1, 1);
+
+-- PAGE: module home
+
+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_directory_home', 'directory-home', '_bx_directory_page_title_sys_home', '_bx_directory_page_title_home', 'bx_directory', 2, 2147483647, 1, 'page.php?i=directory-home', '', '', '', 0, 1, 0, 'BxDirPageBrowse', 'modules/boonex/directory/classes/BxDirPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_directory_home', 1, 'bx_directory', '', '_bx_directory_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_directory_home', 1, 'bx_directory', '', '_bx_directory_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 1),
+('bx_directory_home', 2, 'bx_directory', '', '_bx_directory_page_block_title_popular_keywords', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:2:{i:0;s:12:"bx_directory";i:1;s:12:"bx_directory";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, 0),
+('bx_directory_home', 2, 'bx_directory', '', '_bx_directory_page_block_title_cats', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"categories_list";s:6:"params";a:2:{i:0;s:17:"bx_directory_cats";i:1;a:1:{s:10:"show_empty";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 0, 1, 1, 1);
+
+
+-- PAGE: search for 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_directory_search', '_bx_directory_page_title_sys_entries_search', '_bx_directory_page_title_entries_search', 'bx_directory', 5, 2147483647, 1, 'ads-search', 'page.php?i=ads-search', '', '', '', 0, 1, 0, 'BxDirPageBrowse', 'modules/boonex/directory/classes/BxDirPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_directory_search', 1, 'bx_directory', '_bx_directory_page_block_title_search_form', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:12:"bx_directory";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_directory_search', 1, 'bx_directory', '_bx_directory_page_block_title_search_results', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:12:"bx_directory";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_directory_search', 1, 'bx_directory', '_bx_directory_page_block_title_search_form_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:17:"bx_directory_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_directory_search', 1, 'bx_directory', '_bx_directory_page_block_title_search_results_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:17:"bx_directory_cmts";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 4);
+
+
+-- PAGE: module manage own
+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_directory_manage', '_bx_directory_page_title_sys_manage', '_bx_directory_page_title_manage', 'bx_directory', 5, 2147483647, 1, 'ads-manage', 'page.php?i=ads-manage', '', '', '', 0, 1, 0, 'BxDirPageBrowse', 'modules/boonex/directory/classes/BxDirPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_directory_manage', 1, 'bx_directory', '_bx_directory_page_block_title_system_manage', '_bx_directory_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:12:"manage_tools";}}', 0, 1, 0);
+
+-- PAGE: module manage all
+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_directory_administration', '_bx_directory_page_title_sys_manage_administration', '_bx_directory_page_title_manage', 'bx_directory', 5, 192, 1, 'ads-administration', 'page.php?i=ads-administration', '', '', '', 0, 1, 0, 'BxDirPageBrowse', 'modules/boonex/directory/classes/BxDirPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_directory_administration', 1, 'bx_directory', '_bx_directory_page_block_title_system_manage_administration', '_bx_directory_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:12:"manage_tools";s:6:"params";a:1:{i:0;s:14:"administration";}}', 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`, `active`, `order`) VALUES 
+('sys_home', 1, 'bx_directory', '_bx_directory_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"browse_public";s:6:"params";a:2:{i:0;b:0;i:1;b:0;}}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1);
+
+-- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
+SET @iPBCellProfile = 3;
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_directory', '_bx_directory_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"browse_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:2:{s:8:"per_page";s:29:"bx_directory_per_page_profile";s:13:"empty_message";b:0;}}}', 0, 0, 0);
+
+-- PAGE: service blocks
+
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system` , `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('', 0, 'bx_directory', '', '_bx_directory_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 1),
+
+('', 0, 'bx_directory', '', '_bx_directory_page_block_title_recent_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 2),
+('', 0, 'bx_directory', '', '_bx_directory_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 3),
+('', 0, 'bx_directory', '', '_bx_directory_page_block_title_popular_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 4),
+('', 0, 'bx_directory', '_bx_directory_page_block_title_sys_recent_entries_view_showcase', '_bx_directory_page_block_title_recent_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:8:"showcase";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 5),
+('', 0, 'bx_directory', '_bx_directory_page_block_title_sys_popular_entries_view_showcase', '_bx_directory_page_block_title_popular_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:8:"showcase";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 6),
+('', 0, 'bx_directory', '_bx_directory_page_block_title_sys_featured_entries_view_showcase', '_bx_directory_page_block_title_featured_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:12:"bx_directory";s:6:"method";s:15:"browse_featured";s:6:"params";a:3:{s:9:"unit_view";s:8:"showcase";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 7);
+
+
+-- 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_directory', 'directory-home', '_bx_directory_menu_item_title_system_entries_home', '_bx_directory_menu_item_title_entries_home', 'page.php?i=directory-home', '', '', 'folder-open col-green3', 'bx_directory_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
+
+-- MENU: add to homepage menu
+
+SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' 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_homepage', 'bx_directory', 'directory-home', '_bx_directory_menu_item_title_system_entries_home', '_bx_directory_menu_item_title_entries_home', 'page.php?i=directory-home', '', '', 'folder-open col-green3', 'bx_directory_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 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_directory', 'create-ad', '_bx_directory_menu_item_title_system_create_entry', '_bx_directory_menu_item_title_create_entry', 'page.php?i=create-ad', '', '', 'folder-open col-green3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+-- MENU: create ad form attachments (link, photo, video, etc)
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_directory_entry_attachments', '_bx_directory_menu_title_entry_attachments', 'bx_directory_entry_attachments', 'bx_directory', 23, 0, 1, 'BxDirMenuAttachments', 'modules/boonex/directory/classes/BxDirMenuAttachments.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_entry_attachments', 'bx_directory', '_bx_directory_menu_set_title_entry_attachments', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_directory_entry_attachments', 'bx_directory', 'photo_simple', '_bx_directory_menu_item_title_system_cpa_photo_simple', '_bx_directory_menu_item_title_cpa_photo_simple', 'javascript:void(0)', 'javascript:{js_object_uploader_photos_simple}.showUploaderForm();', '_self', 'camera', '', '', 2147483647, '', 0, 0, 1, 1),
+('bx_directory_entry_attachments', 'bx_directory', 'photo_html5', '_bx_directory_menu_item_title_system_cpa_photo_html5', '_bx_directory_menu_item_title_cpa_photo_html5', 'javascript:void(0)', 'javascript:{js_object_uploader_photos_html5}.showUploaderForm();', '_self', 'camera', '', '', 2147483647, '', 1, 0, 1, 2),
+('bx_directory_entry_attachments', 'bx_directory', 'video_simple', '_bx_directory_menu_item_title_system_cpa_video_simple', '_bx_directory_menu_item_title_cpa_video_simple', 'javascript:void(0)', 'javascript:{js_object_uploader_videos_simple}.showUploaderForm();', '_self', 'video', '', '', 2147483647, '', 0, 0, 1, 3),
+('bx_directory_entry_attachments', 'bx_directory', 'video_html5', '_bx_directory_menu_item_title_system_cpa_video_html5', '_bx_directory_menu_item_title_cpa_video_html5', 'javascript:void(0)', 'javascript:{js_object_uploader_videos_html5}.showUploaderForm();', '_self', 'video', '', '', 2147483647, '', 1, 0, 1, 4),
+('bx_directory_entry_attachments', 'bx_directory', 'file_simple', '_bx_directory_menu_item_title_system_cpa_file_simple', '_bx_directory_menu_item_title_cpa_file_simple', 'javascript:void(0)', 'javascript:{js_object_uploader_files_simple}.showUploaderForm();', '_self', 'file', '', '', 2147483647, '', 0, 0, 1, 5),
+('bx_directory_entry_attachments', 'bx_directory', 'file_html5', '_bx_directory_menu_item_title_system_cpa_file_html5', '_bx_directory_menu_item_title_cpa_file_html5', 'javascript:void(0)', 'javascript:{js_object_uploader_files_html5}.showUploaderForm();', '_self', 'file', '', '', 2147483647, '', 1, 0, 1, 6),
+('bx_directory_entry_attachments', 'bx_directory', 'poll', '_bx_directory_menu_item_title_system_cpa_poll', '_bx_directory_menu_item_title_cpa_poll', 'javascript:void(0)', 'javascript:{js_object}.showPollForm(this);', '_self', 'tasks', '', '', 2147483647, '', 1, 0, 1, 7);
+
+-- 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_directory_view', '_bx_directory_menu_title_view_entry', 'bx_directory_view', 'bx_directory', 9, 0, 1, 'BxDirMenuView', 'modules/boonex/directory/classes/BxDirMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_view', 'bx_directory', '_bx_directory_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_directory_view', 'bx_directory', 'edit-ad', '_bx_directory_menu_item_title_system_edit_entry', '_bx_directory_menu_item_title_edit_entry', 'page.php?i=edit-ad&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 1),
+('bx_directory_view', 'bx_directory', 'delete-ad', '_bx_directory_menu_item_title_system_delete_entry', '_bx_directory_menu_item_title_delete_entry', 'page.php?i=delete-ad&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2);
+
+
+-- MENU: all 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_directory_view_actions', '_sys_menu_title_view_actions', 'bx_directory_view_actions', 'bx_directory', 15, 0, 1, 'BxDirMenuViewActions', 'modules/boonex/directory/classes/BxDirMenuViewActions.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_view_actions', 'bx_directory', '_sys_menu_set_title_view_actions', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_directory_view_actions', 'bx_directory', 'edit-ad', '_bx_directory_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 10),
+('bx_directory_view_actions', 'bx_directory', 'delete-ad', '_bx_directory_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
+('bx_directory_view_actions', 'bx_directory', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
+('bx_directory_view_actions', 'bx_directory', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 210),
+('bx_directory_view_actions', 'bx_directory', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 220),
+('bx_directory_view_actions', 'bx_directory', 'reaction', '_sys_menu_item_title_system_va_reaction', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 225),
+('bx_directory_view_actions', 'bx_directory', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 230),
+('bx_directory_view_actions', 'bx_directory', 'favorite', '_sys_menu_item_title_system_va_favorite', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 240),
+('bx_directory_view_actions', 'bx_directory', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 250),
+('bx_directory_view_actions', 'bx_directory', 'repost', '_sys_menu_item_title_system_va_repost', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 260),
+('bx_directory_view_actions', 'bx_directory', 'report', '_sys_menu_item_title_system_va_report', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 270),
+('bx_directory_view_actions', 'bx_directory', 'social-sharing-facebook', '_sys_menu_item_title_system_social_sharing_facebook', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 300),
+('bx_directory_view_actions', 'bx_directory', 'social-sharing-twitter', '_sys_menu_item_title_system_social_sharing_twitter', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 320),
+('bx_directory_view_actions', 'bx_directory', 'social-sharing-pinterest', '_sys_menu_item_title_system_social_sharing_pinterest', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 330),
+('bx_directory_view_actions', 'bx_directory', 'more-auto', '_sys_menu_item_title_system_va_more_auto', '_sys_menu_item_title_va_more_auto', 'javascript:void(0)', '', '', 'ellipsis-v', '', '', 0, 2147483647, 1, 0, 9999);
+
+
+-- 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_directory_my', '_bx_directory_menu_title_entries_my', 'bx_directory_my', 'bx_directory', 9, 0, 1, 'BxDirMenu', 'modules/boonex/directory/classes/BxDirMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_my', 'bx_directory', '_bx_directory_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_directory_my', 'bx_directory', 'create-ad', '_bx_directory_menu_item_title_system_create_entry', '_bx_directory_menu_item_title_create_entry', 'page.php?i=create-ad', '', '', '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_directory_submenu', '_bx_directory_menu_title_submenu', 'bx_directory_submenu', 'bx_directory', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_submenu', 'bx_directory', '_bx_directory_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_directory_submenu', 'bx_directory', 'directory-home', '_bx_directory_menu_item_title_system_entries_public', '_bx_directory_menu_item_title_entries_public', 'page.php?i=directory-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_directory_submenu', 'bx_directory', 'ads-popular', '_bx_directory_menu_item_title_system_entries_popular', '_bx_directory_menu_item_title_entries_popular', 'page.php?i=ads-popular', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_directory_submenu', 'bx_directory', 'ads-search', '_bx_directory_menu_item_title_system_entries_search', '_bx_directory_menu_item_title_entries_search', 'page.php?i=ads-search', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_directory_submenu', 'bx_directory', 'ads-manage', '_bx_directory_menu_item_title_system_entries_manage', '_bx_directory_menu_item_title_entries_manage', 'page.php?i=ads-manage', '', '', '', '', 2147483646, 1, 1, 4);
+
+-- 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_directory_view_submenu', '_bx_directory_menu_title_view_entry_submenu', 'bx_directory_view_submenu', 'bx_directory', 8, 0, 1, 'BxDirMenuView', 'modules/boonex/directory/classes/BxDirMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_view_submenu', 'bx_directory', '_bx_directory_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_directory_view_submenu', 'bx_directory', 'view-ad', '_bx_directory_menu_item_title_system_view_entry', '_bx_directory_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-ad&id={content_id}', '', '', '', '', 2147483647, 0, 0, 1),
+('bx_directory_view_submenu', 'bx_directory', 'view-ad-comments', '_bx_directory_menu_item_title_system_view_entry_comments', '_bx_directory_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-ad-comments&id={content_id}', '', '', '', '', 2147483647, 0, 0, 2);
+
+-- MENU: custom menu for snippet meta info
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_directory_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_directory_snippet_meta', 'bx_directory', 15, 0, 1, 'BxDirMenuSnippetMeta', 'modules/boonex/directory/classes/BxDirMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_snippet_meta', 'bx_directory', '_sys_menu_set_title_snippet_meta', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_directory_snippet_meta', 'bx_directory', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
+('bx_directory_snippet_meta', 'bx_directory', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
+('bx_directory_snippet_meta', 'bx_directory', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 0, 0, 1, 3),
+('bx_directory_snippet_meta', 'bx_directory', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
+('bx_directory_snippet_meta', 'bx_directory', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
+('bx_directory_snippet_meta', 'bx_directory', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 6);
+
+-- MENU: profile stats
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_directory', 'profile-stats-manage-ads', '_bx_directory_menu_item_title_system_manage_my_posts', '_bx_directory_menu_item_title_manage_my_posts', 'page.php?i=ads-manage', '', '_self', 'folder-open col-green3', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
+
+-- MENU: manage tools submenu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_directory_menu_manage_tools', '_bx_directory_menu_title_manage_tools', 'bx_directory_menu_manage_tools', 'bx_directory', 6, 0, 1, 'BxDirMenuManageTools', 'modules/boonex/directory/classes/BxDirMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_directory_menu_manage_tools', 'bx_directory', '_bx_directory_menu_set_title_manage_tools', 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_directory_menu_manage_tools', 'bx_directory', 'delete-with-content', '_bx_directory_menu_item_title_system_delete_with_content', '_bx_directory_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'far trash-alt', '', 128, 1, 0, 0);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', 'bx_directory', 'ads-administration', '_bx_directory_menu_item_title_system_admt_ads', '_bx_directory_menu_item_title_admt_ads', 'page.php?i=ads-administration', '', '_self', '', 'a:2:{s:6:"module";s:12:"bx_directory";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- 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_directory', 'ads-author', '_bx_directory_menu_item_title_system_view_entries_author', '_bx_directory_menu_item_title_view_entries_author', 'page.php?i=ads-author&profile_id={profile_id}', '', '', 'folder-open col-green3', '', 2147483647, 1, 0, 0),
+('trigger_group_view_submenu', 'bx_directory', 'ads-context', '_bx_directory_menu_item_title_system_view_entries_in_context', '_bx_directory_menu_item_title_view_entries_in_context', 'page.php?i=ads-context&profile_id={profile_id}', '', '', 'folder-open col-green3', '', 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_directory_allow_view_to', 'bx_directory', 'view', '_bx_directory_form_entry_input_allow_view_to', '3', 'bx_directory_entries', 'id', 'author', '', '');
+
+
+-- ACL
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_directory', 'create entry', NULL, '_bx_directory_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_directory', 'delete entry', NULL, '_bx_directory_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_directory', 'view entry', NULL, '_bx_directory_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_directory', 'set thumb', NULL, '_bx_directory_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_directory', 'edit any entry', NULL, '_bx_directory_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
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_directory', '_bx_directory', @iSearchOrder + 1, 'BxDirSearchResult', 'modules/boonex/directory/classes/BxDirSearchResult.php'),
+('bx_directory_cmts', '_bx_directory_cmts', @iSearchOrder + 2, 'BxDirCmtsSearchResult', 'modules/boonex/directory/classes/BxDirCmtsSearchResult.php');
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_directory', 'bx_directory_meta_keywords', 'bx_directory_meta_locations', 'bx_directory_meta_mentions', '', '');
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_directory_cats', 'bx_directory', 'bx_directory', 'bx_directory_cats', 'bx_directory_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_directory_entries`.`author` OR `sys_profiles`.`id` = -`bx_directory_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+-- STATS
+SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
+INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES 
+('bx_directory', 'bx_directory', '_bx_directory', 'page.php?i=ads-home', 'folder-open col-green3', 'SELECT COUNT(*) FROM `bx_directory_entries` WHERE 1 AND `status` = ''active'' AND `status_admin` = ''active''', @iMaxOrderStats + 1);
+
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `field_status`, `query`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_directory_growth', '_bx_directory_chart_growth', 'bx_directory_entries', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_directory_growth_speed', '_bx_directory_chart_growth_speed', 'bx_directory_entries', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
+
+-- GRIDS: moderation tools
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_directory_administration', 'Sql', 'SELECT * FROM `bx_directory_entries` WHERE 1 ', 'bx_directory_entries', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', 'reports', '', 192, 'BxDirGridAdministration', 'modules/boonex/directory/classes/BxDirGridAdministration.php'),
+('bx_directory_common', 'Sql', 'SELECT * FROM `bx_directory_entries` WHERE 1 ', 'bx_directory_entries', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 2147483647, 'BxDirGridCommon', 'modules/boonex/directory/classes/BxDirGridCommon.php');
+
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_directory_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_directory_administration', 'switcher', '_bx_directory_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_directory_administration', 'reports', '_sys_txt_reports_title', '5%', 0, '', '', 3),
+('bx_directory_administration', 'title', '_bx_directory_grid_column_title_adm_title', '25%', 0, '25', '', 4),
+('bx_directory_administration', 'added', '_bx_directory_grid_column_title_adm_added', '20%', 1, '25', '', 5),
+('bx_directory_administration', 'author', '_bx_directory_grid_column_title_adm_author', '20%', 0, '25', '', 6),
+('bx_directory_administration', 'actions', '', '20%', 0, '', '', 7),
+('bx_directory_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_directory_common', 'switcher', '_bx_directory_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_directory_common', 'title', '_bx_directory_grid_column_title_adm_title', '40%', 0, '35', '', 3),
+('bx_directory_common', 'added', '_bx_directory_grid_column_title_adm_added', '30%', 1, '25', '', 4),
+('bx_directory_common', 'actions', '', '20%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_directory_administration', 'bulk', 'delete', '_bx_directory_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_directory_administration', 'single', 'edit', '_bx_directory_grid_action_title_adm_edit', 'pencil-alt', 1, 0, 1),
+('bx_directory_administration', 'single', 'delete', '_bx_directory_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_directory_administration', 'single', 'settings', '_bx_directory_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
+('bx_directory_common', 'bulk', 'delete', '_bx_directory_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_directory_common', 'single', 'edit', '_bx_directory_grid_action_title_adm_edit', 'pencil-alt', 1, 0, 1),
+('bx_directory_common', 'single', 'delete', '_bx_directory_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_directory_common', 'single', 'settings', '_bx_directory_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
+
+-- UPLOADERS
+
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_directory_simple', 1, 'BxDirUploaderSimple', 'modules/boonex/directory/classes/BxDirUploaderSimple.php'),
+('bx_directory_html5', 1, 'BxDirUploaderHTML5', 'modules/boonex/directory/classes/BxDirUploaderHTML5.php'),
+('bx_directory_photos_simple', 1, 'BxDirUploaderSimpleAttach', 'modules/boonex/directory/classes/BxDirUploaderSimpleAttach.php'),
+('bx_directory_photos_html5', 1, 'BxDirUploaderHTML5Attach', 'modules/boonex/directory/classes/BxDirUploaderHTML5Attach.php'),
+('bx_directory_videos_simple', 1, 'BxDirUploaderSimpleAttach', 'modules/boonex/directory/classes/BxDirUploaderSimpleAttach.php'),
+('bx_directory_videos_html5', 1, 'BxDirUploaderHTML5Attach', 'modules/boonex/directory/classes/BxDirUploaderHTML5Attach.php'),
+('bx_directory_files_simple', 1, 'BxDirUploaderSimpleAttach', 'modules/boonex/directory/classes/BxDirUploaderSimpleAttach.php'),
+('bx_directory_files_html5', 1, 'BxDirUploaderHTML5Attach', 'modules/boonex/directory/classes/BxDirUploaderHTML5Attach.php');
+
+-- ALERTS
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_directory', 'BxDirAlertsResponse', 'modules/boonex/directory/classes/BxDirAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('profile', 'delete', @iHandler);
+
+
+-- CRON
+INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_directory_publishing', '* * * * *', 'BxDirCronPublishing', 'modules/boonex/directory/classes/BxDirCronPublishing.php', '');

+ 550 - 0
modules/boonex/directory/install/sql/install.sql

@@ -0,0 +1,550 @@
+-- TABLE: entries
+CREATE TABLE IF NOT EXISTS `bx_directory_entries` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `published` int(11) NOT NULL,
+  `thumb` int(11) NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `cat` int(11) NOT NULL,
+  `text` mediumtext NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `rrate` float NOT NULL default '0',
+  `rvotes` int(11) NOT NULL default '0',
+  `score` int(11) NOT NULL default '0',
+  `sc_up` int(11) NOT NULL default '0',
+  `sc_down` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
+  `allow_view_to` int(11) NOT NULL DEFAULT '3',
+  `disable_comments` tinyint(4) NOT NULL DEFAULT '0',
+  `status` enum('active','awaiting','hidden') NOT NULL DEFAULT 'active',
+  `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title_text` (`title`,`text`)
+);
+
+-- TABLE: storages & transcoders
+CREATE TABLE IF NOT EXISTS `bx_directory_covers` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) 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_directory_files` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) 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_directory_photos` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) 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_directory_photos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) 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_directory_videos` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) 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_directory_videos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) 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_directory_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(11) 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`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: votes
+CREATE TABLE IF NOT EXISTS `bx_directory_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`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `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',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_reactions` (
+  `object_id` int(11) NOT NULL default '0',
+  `reaction` varchar(32) NOT NULL default '',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `reaction` (`object_id`, `reaction`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_reactions_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `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',
+  `reaction` varchar(32) NOT NULL default '',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- TABLE: views
+CREATE TABLE IF NOT EXISTS `bx_directory_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`)
+);
+
+-- TABLE: metas
+CREATE TABLE IF NOT EXISTS `bx_directory_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_meta_mentions` (
+  `object_id` int(10) unsigned NOT NULL,
+  `profile_id` int(10) unsigned NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `profile_id` (`profile_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_meta_locations` (
+  `object_id` int(10) unsigned NOT NULL,
+  `lat` double NOT NULL,
+  `lng` double NOT NULL,
+  `country` varchar(2) NOT NULL,
+  `state` varchar(255) NOT NULL,
+  `city` varchar(255) NOT NULL,
+  `zip` varchar(255) NOT NULL,
+  `street` varchar(255) NOT NULL,
+  `street_number` varchar(255) NOT NULL,
+  PRIMARY KEY (`object_id`),
+  KEY `country_state_city` (`country`,`state`(8),`city`(8))
+);
+
+-- TABLE: reports
+CREATE TABLE IF NOT EXISTS `bx_directory_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `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',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+);
+
+-- TABLE: favorites
+CREATE TABLE IF NOT EXISTS `bx_directory_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+);
+
+-- TABLE: scores
+CREATE TABLE IF NOT EXISTS `bx_directory_scores` (
+  `object_id` int(11) NOT NULL default '0',
+  `count_up` int(11) NOT NULL default '0',
+  `count_down` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_scores_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `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',
+  `type` varchar(8) NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- TABLE: polls
+CREATE TABLE IF NOT EXISTS `bx_directory_polls` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author_id` int(11) NOT NULL default '0',
+  `content_id` int(11) NOT NULL default '0',
+  `text` text NOT NULL,
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `search_fields` (`text`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `poll_id` int(11) unsigned NOT NULL default '0',
+  `title` varchar(255) NOT NULL,
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `order` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title` (`title`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers_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`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_directory_polls_answers_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `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',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
+
+-- STORAGES & TRANSCODERS
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+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_directory_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_covers', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+
+('bx_directory_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+('bx_directory_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+
+('bx_directory_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_videos', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
+('bx_directory_videos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_videos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png,avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
+
+('bx_directory_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_directory_files', 'deny-allow', '', 'action,apk,app,bat,bin,cmd,com,command,cpl,csh,exe,gadget,inf,ins,inx,ipa,isu,job,jse,ksh,lnk,msc,msi,msp,mst,osx,out,paf,pif,prg,ps1,reg,rgs,run,sct,shb,shs,u3p,vb,vbe,vbs,vbscript,workflow,ws,wsf', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES 
+('bx_directory_preview', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
+('bx_directory_gallery', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
+('bx_directory_cover', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_covers";}', 'no', '1', '2592000', '0', '', ''),
+
+('bx_directory_preview_photos', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_photos";}', 'no', '1', '2592000', '0', '', ''),
+('bx_directory_gallery_photos', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_photos";}', 'no', '1', '2592000', '0', '', ''),
+
+('bx_directory_videos_poster', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
+('bx_directory_videos_poster_preview', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
+('bx_directory_videos_mp4', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
+('bx_directory_videos_webm', 'bx_directory_videos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_directory_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
+
+('bx_directory_preview_files', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:18:"bx_directory_files";}', 'no', '1', '2592000', '0', '', ''),
+('bx_directory_gallery_files', 'bx_directory_photos_resized', 'Storage', 'a:1:{s:6:"object";s:18:"bx_directory_files";}', 'no', '1', '2592000', '0', '', '');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_directory_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
+('bx_directory_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
+('bx_directory_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
+
+('bx_directory_preview_photos', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
+('bx_directory_gallery_photos', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
+
+('bx_directory_videos_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:13:"square_resize";s:1:"1";}', 10),
+('bx_directory_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
+('bx_directory_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
+('bx_directory_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
+('bx_directory_videos_webm', 'Webm', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:4:"webm";}', 0),
+
+('bx_directory_preview_files', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
+('bx_directory_gallery_files', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+
+
+-- FORMS: entry (post)
+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_directory', 'bx_directory', '_bx_directory_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_directory_entries', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxDirFormEntry', 'modules/boonex/directory/classes/BxDirFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_directory', 'bx_directory_entry_add', 'bx_directory', 0, '_bx_directory_form_entry_display_add'),
+('bx_directory', 'bx_directory_entry_delete', 'bx_directory', 0, '_bx_directory_form_entry_display_delete'),
+('bx_directory', 'bx_directory_entry_edit', 'bx_directory', 0, '_bx_directory_form_entry_display_edit'),
+('bx_directory', 'bx_directory_entry_view', 'bx_directory', 1, '_bx_directory_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_directory', 'bx_directory', 'allow_view_to', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_allow_view_to', '_bx_directory_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_directory_form_entry_input_sys_delete_confirm', '_bx_directory_form_entry_input_delete_confirm', '_bx_directory_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_directory_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'do_publish', '_bx_directory_form_entry_input_do_publish', '', 0, 'submit', '_bx_directory_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'do_submit', '_bx_directory_form_entry_input_do_submit', '', 0, 'submit', '_bx_directory_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'covers', 'a:1:{i:0;s:18:"bx_directory_html5";}', 'a:2:{s:19:"bx_directory_simple";s:26:"_sys_uploader_simple_title";s:18:"bx_directory_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_covers', '_bx_directory_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'pictures', 'a:1:{i:0;s:25:"bx_directory_photos_html5";}', 'a:2:{s:26:"bx_directory_photos_simple";s:26:"_sys_uploader_simple_title";s:25:"bx_directory_photos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_pictures', '_bx_directory_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'videos', 'a:1:{i:0;s:25:"bx_directory_videos_html5";}', 'a:2:{s:26:"bx_directory_videos_simple";s:26:"_sys_uploader_simple_title";s:25:"bx_directory_videos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_videos', '_bx_directory_form_entry_input_videos', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'files', 'a:1:{i:0;s:24:"bx_directory_files_html5";}', 'a:2:{s:25:"bx_directory_files_simple";s:26:"_sys_uploader_simple_title";s:24:"bx_directory_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_directory_form_entry_input_sys_files', '_bx_directory_form_entry_input_files', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'polls', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_polls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'text', '', '', 0, 'textarea', '_bx_directory_form_entry_input_sys_text', '_bx_directory_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_directory_form_entry_input_text_err', 'XssHtml', '', 1, 0),
+('bx_directory', 'bx_directory', 'title', '', '', 0, 'text', '_bx_directory_form_entry_input_sys_title', '_bx_directory_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_directory_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_directory', 'bx_directory', 'cat', '', '#!bx_directory_cats', 0, 'select', '_bx_directory_form_entry_input_sys_cat', '_bx_directory_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_directory_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_directory', 'bx_directory', 'added', '', '', 0, 'datetime', '_bx_directory_form_entry_input_sys_date_added', '_bx_directory_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'changed', '', '', 0, 'datetime', '_bx_directory_form_entry_input_sys_date_changed', '_bx_directory_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'published', '', '', 0, 'datetime', '_bx_directory_form_entry_input_sys_date_published', '_bx_directory_form_entry_input_date_published', '_bx_directory_form_entry_input_date_published_info', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
+('bx_directory', 'bx_directory', 'attachments', '', '', 0, 'custom', '_bx_directory_form_entry_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_directory', 'bx_directory', 'disable_comments', '1', '', 0, 'switcher', '_bx_directory_form_entry_input_sys_disable_comments', '_bx_directory_form_entry_input_disable_comments', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0);
+
+
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_directory_entry_add', 'delete_confirm', 2147483647, 0, 1),
+('bx_directory_entry_add', 'title', 2147483647, 1, 2),
+('bx_directory_entry_add', 'cat', 2147483647, 1, 3),
+('bx_directory_entry_add', 'text', 2147483647, 1, 4),
+('bx_directory_entry_add', 'attachments', 2147483647, 1, 5),
+('bx_directory_entry_add', 'pictures', 2147483647, 1, 6),
+('bx_directory_entry_add', 'videos', 2147483647, 1, 7),
+('bx_directory_entry_add', 'files', 2147483647, 1, 8),
+('bx_directory_entry_add', 'polls', 2147483647, 1, 9),
+('bx_directory_entry_add', 'covers', 2147483647, 1, 10),
+('bx_directory_entry_add', 'allow_view_to', 2147483647, 1, 11),
+('bx_directory_entry_add', 'location', 2147483647, 1, 12),
+('bx_directory_entry_add', 'published', 192, 1, 13),
+('bx_directory_entry_add', 'disable_comments', 192, 1, 14),
+('bx_directory_entry_add', 'do_publish', 2147483647, 1, 15),
+
+('bx_directory_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_directory_entry_delete', 'do_submit', 2147483647, 1, 2),
+
+('bx_directory_entry_edit', 'do_publish', 2147483647, 0, 1),
+('bx_directory_entry_edit', 'delete_confirm', 2147483647, 0, 2),
+('bx_directory_entry_edit', 'title', 2147483647, 1, 3),
+('bx_directory_entry_edit', 'cat', 2147483647, 1, 4),
+('bx_directory_entry_edit', 'text', 2147483647, 1, 5),
+('bx_directory_entry_edit', 'attachments', 2147483647, 1, 6),
+('bx_directory_entry_edit', 'pictures', 2147483647, 1, 7),
+('bx_directory_entry_edit', 'videos', 2147483647, 1, 8),
+('bx_directory_entry_edit', 'files', 2147483647, 1, 9),
+('bx_directory_entry_edit', 'polls', 2147483647, 1, 10),
+('bx_directory_entry_edit', 'covers', 2147483647, 1, 11),
+('bx_directory_entry_edit', 'allow_view_to', 2147483647, 1, 12),
+('bx_directory_entry_edit', 'location', 2147483647, 1, 13),
+('bx_directory_entry_edit', 'disable_comments', 192, 1, 14),
+('bx_directory_entry_edit', 'published', 192, 1, 15),
+('bx_directory_entry_edit', 'do_submit', 2147483647, 1, 16),
+
+('bx_directory_entry_view', 'cat', 2147483647, 1, 1),
+('bx_directory_entry_view', 'added', 2147483647, 1, 2),
+('bx_directory_entry_view', 'changed', 2147483647, 1, 3),
+('bx_directory_entry_view', 'published', 192, 1, 4);
+
+-- FORMS: poll
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_directory_poll', 'bx_directory', '_bx_directory_form_poll', '', '', 'do_submit', 'bx_directory_polls', 'id', '', '', 'a:1:{s:14:"checker_helper";s:26:"BxDirFormPollCheckerHelper";}', 0, 1, 'BxDirFormPoll', 'modules/boonex/directory/classes/BxDirFormPoll.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_directory_poll_add', 'bx_directory', 'bx_directory_poll', '_bx_directory_form_poll_display_add', 0);
+
+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_directory_poll', 'bx_directory', 'text', '', '', 0, 'textarea', '_bx_directory_form_poll_input_sys_text', '_bx_directory_form_poll_input_text', '', 1, 0, 3, '', '', '', 'Avail', '', '_bx_directory_form_poll_input_text_err', 'Xss', '', 1, 0),
+('bx_directory_poll', 'bx_directory', 'answers', '', '', 0, 'custom', '_bx_directory_form_poll_input_sys_answers', '_bx_directory_form_poll_input_answers', '', 1, 0, 0, '', '', '', 'AvailAnswers', '', '_bx_directory_form_poll_input_answers_err', '', '', 1, 0),
+('bx_directory_poll', 'bx_directory', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_directory_poll', 'bx_directory', 'do_submit', '_bx_directory_form_poll_input_do_submit', '', 0, 'submit', '_bx_directory_form_poll_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_directory_poll', 'bx_directory', 'do_cancel', '_bx_directory_form_poll_input_do_cancel', '', 0, 'button', '_bx_directory_form_poll_input_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_directory_poll_add', 'text', 2147483647, 1, 1),
+('bx_directory_poll_add', 'answers', 2147483647, 1, 2),
+('bx_directory_poll_add', 'controls', 2147483647, 1, 3),
+('bx_directory_poll_add', 'do_submit', 2147483647, 1, 4),
+('bx_directory_poll_add', 'do_cancel', 2147483647, 1, 5);
+
+
+-- PRE-VALUES
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_directory_cats', '_bx_directory_pre_lists_cats', 'bx_directory', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_directory_cats', '', 0, '_sys_please_select', ''),
+('bx_directory_cats', '1', 1, '_bx_directory_cat_Animals_Pets', ''),
+('bx_directory_cats', '2', 2, '_bx_directory_cat_Architecture', ''),
+('bx_directory_cats', '3', 3, '_bx_directory_cat_Art', ''),
+('bx_directory_cats', '4', 4, '_bx_directory_cat_Cars_Motorcycles', ''),
+('bx_directory_cats', '5', 5, '_bx_directory_cat_Celebrities', ''),
+('bx_directory_cats', '6', 6, '_bx_directory_cat_Design', ''),
+('bx_directory_cats', '7', 7, '_bx_directory_cat_DIY_Crafts', ''),
+('bx_directory_cats', '8', 8, '_bx_directory_cat_Education', ''),
+('bx_directory_cats', '9', 9, '_bx_directory_cat_Film_Music_Books', ''),
+('bx_directory_cats', '10', 10, '_bx_directory_cat_Food_Drink', ''),
+('bx_directory_cats', '11', 11, '_bx_directory_cat_Gardening', ''),
+('bx_directory_cats', '12', 12, '_bx_directory_cat_Geek', ''),
+('bx_directory_cats', '13', 13, '_bx_directory_cat_Hair_Beauty', ''),
+('bx_directory_cats', '14', 14, '_bx_directory_cat_Health_Fitness', ''),
+('bx_directory_cats', '15', 15, '_bx_directory_cat_History', ''),
+('bx_directory_cats', '16', 16, '_bx_directory_cat_Holidays_Events', ''),
+('bx_directory_cats', '17', 17, '_bx_directory_cat_Home_Decor', ''),
+('bx_directory_cats', '18', 18, '_bx_directory_cat_Humor', ''),
+('bx_directory_cats', '19', 19, '_bx_directory_cat_Illustrations_Posters', ''),
+('bx_directory_cats', '20', 20, '_bx_directory_cat_Kids_Parenting', ''),
+('bx_directory_cats', '21', 21, '_bx_directory_cat_Mens_Fashion', ''),
+('bx_directory_cats', '22', 22, '_bx_directory_cat_Outdoors', ''),
+('bx_directory_cats', '23', 23, '_bx_directory_cat_Photography', ''),
+('bx_directory_cats', '24', 24, '_bx_directory_cat_Products', ''),
+('bx_directory_cats', '25', 25, '_bx_directory_cat_Quotes', ''),
+('bx_directory_cats', '26', 26, '_bx_directory_cat_Science_Nature', ''),
+('bx_directory_cats', '27', 27, '_bx_directory_cat_Sports', ''),
+('bx_directory_cats', '28', 28, '_bx_directory_cat_Tattoos', ''),
+('bx_directory_cats', '29', 29, '_bx_directory_cat_Technology', ''),
+('bx_directory_cats', '30', 30, '_bx_directory_cat_Travel', ''),
+('bx_directory_cats', '31', 31, '_bx_directory_cat_Weddings', ''),
+('bx_directory_cats', '32', 32, '_bx_directory_cat_Womens_Fashion', '');
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_directory', 'bx_directory', 'bx_directory_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-post&id={object_id}', '', 'bx_directory_entries', 'id', 'author', 'title', 'comments', '', '');
+
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_directory', 'bx_directory_votes', 'bx_directory_votes_track', '604800', '1', '1', '0', '1', 'bx_directory_entries', 'id', 'author', 'rate', 'votes', '', ''),
+('bx_directory_reactions', 'bx_directory_reactions', 'bx_directory_reactions_track', '604800', '1', '1', '1', '1', 'bx_directory_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''),
+('bx_directory_poll_answers', 'bx_directory_polls_answers_votes', 'bx_directory_polls_answers_votes_track', '604800', '1', '1', '0', '1', 'bx_directory_polls_answers', 'id', 'author_id', 'rate', 'votes', 'BxDirVotePollAnswers', 'modules/boonex/directory/classes/BxDirVotePollAnswers.php');
+
+-- SCORES
+INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 
+('bx_directory', 'bx_directory', 'bx_directory_scores', 'bx_directory_scores_track', '604800', '0', 'bx_directory_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
+
+-- REPORTS
+INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_directory', 'bx_directory_reports', 'bx_directory_reports_track', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'reports', '', '');
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_directory', 'bx_directory_views_track', '86400', '1', 'bx_directory_entries', 'id', 'author', 'views', '', '');
+
+-- FAFORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_directory', 'bx_directory_favorites_track', '1', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'favorites', '', '');
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_directory', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_directory_entries', 'id', 'author', 'featured', '', '');
+
+-- CONTENT INFO
+INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
+('bx_directory', '_bx_directory', 'bx_directory', 'added', 'edited', 'deleted', '', ''),
+('bx_directory_cmts', '_bx_directory_cmts', 'bx_directory', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_directory', 'bx_directory_administration', 'id', '', ''),
+('bx_directory', 'bx_directory_common', 'id', '', '');
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_directory', 'bx_directory', 'bx_directory', '_bx_directory_search_extended', 1, '', ''),
+('bx_directory_cmts', 'bx_directory_cmts', 'bx_directory', '_bx_directory_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+-- STUDIO: page & widget
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_directory', '_bx_directory', '_bx_directory', 'bx_directory@modules/boonex/directory/|std-icon.svg');
+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_directory', '{url_studio}module.php?name=bx_directory', '', 'bx_directory@modules/boonex/directory/|std-icon.svg', '_bx_directory', '', '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));
+

+ 56 - 0
modules/boonex/directory/install/sql/uninstall.sql

@@ -0,0 +1,56 @@
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_directory_entries`, `bx_directory_covers`, `bx_directory_files`, `bx_directory_photos`, `bx_directory_photos_resized`, `bx_directory_videos`, `bx_directory_videos_resized`, `bx_directory_cmts`, `bx_directory_votes`, `bx_directory_votes_track`, `bx_directory_reactions`, `bx_directory_reactions_track`, `bx_directory_views_track`, `bx_directory_meta_keywords`, `bx_directory_meta_locations`, `bx_directory_meta_mentions`, `bx_directory_reports`, `bx_directory_reports_track`, `bx_directory_favorites_track`, `bx_directory_scores`, `bx_directory_scores_track`, `bx_directory_polls`, `bx_directory_polls_answers`, `bx_directory_polls_answers_votes`, `bx_directory_polls_answers_votes_track`;
+
+-- STORAGES & TRANSCODERS
+DELETE FROM `sys_objects_storage` WHERE `object` LIKE 'bx_directory_%';
+DELETE FROM `sys_storage_tokens` WHERE `object` LIKE 'bx_directory_%';
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` LIKE 'bx_directory_%';
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` LIKE 'bx_directory_%';
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` LIKE 'bx_directory_%';
+
+-- FORMS
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_directory';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_directory';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_directory';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` LIKE 'bx_directory_%';
+
+-- PRE-VALUES
+DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_directory';
+
+DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_directory_cats');
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_directory';
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_directory', 'bx_directory_reactions', 'bx_directory_poll_answers');
+
+-- SCORES
+DELETE FROM `sys_objects_score` WHERE `name` = 'bx_directory';
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_directory';
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_directory';
+
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_directory';
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_directory';
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_directory', 'bx_directory_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_directory');
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_directory';
+
+-- 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_directory';

+ 56 - 0
modules/boonex/directory/js/manage_tools.js

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxDirManageTools(oOptions) {
+    this._iSearchTimeoutId = false;
+    this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxDirManageTools' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxDirManageTools.prototype.onChangeFilter = function(oFilter) {
+    var $this = this;
+    var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+    var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+    var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+    var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+    if(sValueSearch == _t('_sys_grid_search'))
+        sValueSearch = '';
+
+    clearTimeout($this._iSearchTimeoutId);
+    $this._iSearchTimeoutId = setTimeout(function () {
+        glGrids[$this._sObjNameGrid].setFilter(sValueFilter1 + $this._sParamsDivider + sValueSearch, true);
+    }, 500);
+};
+
+BxDirManageTools.prototype.onClickSettings = function(sMenuObject, oButton) {
+    if($(oButton).hasClass('bx-btn-disabled'))
+        return false;
+
+    bx_menu_popup(sMenuObject, oButton, {}, {
+        content_id: $(oButton).attr('bx_grid_action_data')
+    });
+};
+
+BxDirManageTools.prototype.onClickDelete = function(iContentId) {
+    $('.bx-popup-applied:visible').dolPopupHide();
+
+    glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+/** @} */

+ 242 - 0
modules/boonex/directory/js/polls.js

@@ -0,0 +1,242 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxDirPolls(oOptions) {
+    this._sActionsUri = oOptions.sActionUri;
+    this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxDirPolls' : oOptions.sObjName;
+    this._iOwnerId = oOptions.iOwnerId == undefined ? 0 : oOptions.iOwnerId;
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'slide' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxDirPolls.prototype.initFlickity = function(oParent) {
+    if(!oParent)
+        return;
+
+    if(typeof(oParent) == 'string')
+        oParent = $(oParent);
+
+    var sItemClass = 'bx-base-text-poll';
+    var sItemsClass = 'bx-base-text-polls-showcase';
+
+    var oItems = $(oParent).hasClass(sItemsClass) ? oParent : oParent.find('.' + sItemsClass);
+    if(oItems.find('.' + sItemClass).length <= 1)
+        return;
+
+    oItems.flickity({
+        cellSelector: 'div.' + sItemClass,
+        cellAlign: 'left',
+        imagesLoaded: true,
+        wrapAround: true,
+        pageDots: false
+    });
+};
+
+BxDirPolls.prototype.initPollForm = function(sFormId)
+{
+    var $this = this;
+    var oForm = $('#' + sFormId);
+
+    oForm.ajaxForm({
+        dataType: "json",
+        clearForm: true,
+        beforeSubmit: function (formData, jqForm, options) {
+            window[$this._sObjName].beforePollFormSubmit(oForm);
+        },
+        success: function (oData) {
+            window[$this._sObjName].afterPollFormSubmit(oForm, oData);
+        }
+    });
+};
+
+BxDirPolls.prototype.beforePollFormSubmit = function(oForm)
+{
+    this.loadingInButton($(oForm).children().find(':submit'), true);
+};
+
+BxDirPolls.prototype.afterPollFormSubmit = function (oForm, oData)
+{
+    var $this = this;
+    var fContinue = function() {
+        if(oData && oData.item != undefined) {
+            $('#' + $this._aHtmlIds['add_poll_popup']).dolPopupHide({onHide: function(oPopup) {
+                oPopup.remove();
+            }});
+
+            if(!$.trim(oData.item).length)
+                return;
+
+            var oItem = $(oData.item).hide();
+            $('#' + $this._aHtmlIds['add_poll_form_field']).append(oItem).find('#' + $this._aHtmlIds['poll'] + oData.id).bx_anim('show', $this._sAnimationEffect, $this._sAnimationSpeed);
+
+            return;
+        }
+
+        if(oData && oData.form != undefined && oData.form_id != undefined) {
+            $('#' + oData.form_id).replaceWith(oData.form);
+            $this.initPollForm(oData.form_id);
+
+            return;
+        }
+    };
+
+    this.loadingInButton($(oForm).find(':submit'), false);
+
+    if(oData && oData.message != undefined)
+        bx_alert(oData.message, fContinue);
+    else
+        fContinue();
+};
+
+BxDirPolls.prototype.deletePoll = function(oLink, iId)
+{
+    var $this = this;
+
+    bx_confirm('', function() {
+        var oData = $this._getDefaultData();
+        oData['id'] = iId;
+
+        var oPoll = $('#' + $this._aHtmlIds['poll'] + iId);
+
+        bx_loading(oPoll, true);
+
+        jQuery.post (
+            $this._sActionsUrl + 'delete_poll/',
+            oData,
+            function(oData) {
+                var fContinue = function() {
+                    if(oData && oData.code != undefined && oData.code == 0) {
+                        oPoll.bx_anim('hide', $this._sAnimationEffect, $this._sAnimationSpeed, function() {
+                            $(this).remove;
+                        });
+                    }
+                };
+
+                bx_loading(oPoll, false);
+
+                if(oData && oData.message != undefined)
+                    bx_alert(oData.message, fContinue);
+                else
+                    fContinue();
+            },
+            'json'
+        );
+    });
+
+    return false;
+};
+
+BxDirPolls.prototype.showPollForm = function(oLink)
+{
+    var oData = this._getDefaultData();    
+
+    $(window).dolPopupAjax({
+        id: {value: this._aHtmlIds['add_poll_popup'], force: true},
+        url: bx_append_url_params(this._sActionsUri + 'get_poll_form/', oData),
+        closeOnOuterClick: false
+    });
+
+    return false;
+};
+
+BxDirPolls.prototype.changePollView = function(oLink, sView, iPollId, onComplete) {
+    var $this = this;
+
+    this.loadingInBox(oLink, true);
+
+    jQuery.get (
+        this._sActionsUrl + 'get_poll',
+        {
+            poll_id: iPollId,
+            view: sView
+        },
+        function(oData) {
+            if(oLink)
+                $this.loadingInBox(oLink, false);
+
+            if(!oData.content)
+                return;
+
+            var sPollId = $this._aHtmlIds['poll'] + iPollId;
+            var sContentId = $this._aHtmlIds['poll_content'] + iPollId;
+
+            var oPoll = $(oLink).parents('.bx-db-container:first').find('#' + sPollId);
+            if(!oPoll.length)
+                oPoll = $('#' + sPollId);
+            if(!oPoll.length)
+                return;
+
+            var oContent = $(oLink).parents('.bx-db-container:first').find('#' + sContentId);
+            if(!oContent.length)
+                oContent = $('#' + sContentId);
+            if(!oContent.length)
+                return;
+
+            oContent.bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
+                $(this).replaceWith(oData.content);
+                
+                if(typeof onComplete === 'function')
+                    onComplete(oPoll, iPollId, oData);
+            });
+            
+            
+        },
+        'json'
+    );
+};
+
+BxDirPolls.prototype.addPollAnswer = function(oButton, sName) {
+    var oButton = $(oButton);
+
+    var oSubentry = oButton.parents('#bx-form-element-' + sName).find('.bx-form-input-answer:hidden:first').clone();
+    oButton.parents('.bx-form-input-answer-add:first').before(oSubentry.removeClass('bx-fi-answer-blank').find("input[type = 'text']").removeAttr('disabled').end());
+};
+
+BxDirPolls.prototype.deletePollAnswer = function(oButton) {
+    $(oButton).parents('.bx-form-input-answer:first').remove();
+};
+
+BxDirPolls.prototype.onPollAnswerVote = function(oLink, oData, iPollId) {
+    var $this = this;
+
+    this.changePollView(oLink, 'results', iPollId, function(oPoll, iPollId, oData) {
+        var sMenuLink = $this._aHtmlIds['poll_view_link_results'] + iPollId;
+        var oMenuLink = $(oPoll).find('.bx-menu-inter:first #' + sMenuLink);
+        if(oMenuLink.length > 0)
+            oMenuLink.parent().siblings('.bx-menu-inter-act:visible').hide().siblings('.bx-menu-inter-pas:hidden').show().siblings('#' + sMenuLink + '-pas:visible').hide().siblings('#' + sMenuLink + '-act:hidden').show();
+    });
+};
+
+BxDirPolls.prototype.loadingInButton = function(e, bShow) {
+    if($(e).length)
+        bx_loading_btn($(e), bShow);
+    else
+        bx_loading($('body'), bShow);	
+};
+
+BxDirPolls.prototype.loadingInBox = function(e, bShow) {
+    var oParent = $(e).length ? $(e).parents('.bx-base-text-poll:first') : $('body'); 
+    bx_loading(oParent, bShow);
+};
+
+BxDirPolls.prototype.loadingInBlock = function(e, bShow) {
+    var oParent = $(e).length ? $(e).parents('.bx-db-container:first') : $('body'); 
+    bx_loading(oParent, bShow);
+};
+
+BxDirPolls.prototype._getDefaultData = function() {
+    var oDate = new Date();
+    return jQuery.extend({}, this._oRequestParams, {_t:oDate.getTime()});
+};
+
+/** @} */

+ 18 - 0
modules/boonex/directory/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Directory Directory
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 3 - 0
modules/boonex/directory/template/attachments.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/attachments.html />
+

+ 3 - 0
modules/boonex/directory/template/author.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/author.html />
+

+ 1 - 0
modules/boonex/directory/template/author_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/author_link.html />

+ 1 - 0
modules/boonex/directory/template/context.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/context.html />

+ 1 - 0
modules/boonex/directory/template/css/forms.css

@@ -0,0 +1 @@
+@import url(../../../../base/text/template/css/forms.css);

+ 1 - 0
modules/boonex/directory/template/css/main.css

@@ -0,0 +1 @@
+@import url(../../../../base/text/template/css/main.css);

+ 1 - 0
modules/boonex/directory/template/css/manage_tools.css

@@ -0,0 +1 @@
+@import url(../../../../base/general/template/css/manage_tools.css);

+ 1 - 0
modules/boonex/directory/template/css/polls.css

@@ -0,0 +1 @@
+@import url(../../../../base/text/template/css/polls.css);

+ 3 - 0
modules/boonex/directory/template/entry-all-actions.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/entry-all-actions.html />
+

+ 3 - 0
modules/boonex/directory/template/entry-location.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/general/template/entry-location.html />
+

+ 1 - 0
modules/boonex/directory/template/entry-share.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/entry-share.html />

+ 1 - 0
modules/boonex/directory/template/entry-text.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/entry-text.html />

+ 22 - 0
modules/boonex/directory/template/form_ghost_template.html

@@ -0,0 +1,22 @@
+<div id="bx-uploader-file-{storage_object}-{file_id}" class="bx-uploader-ghost bx-def-margin-sec-top bx-clearfix">
+    <input type="hidden" name="__name__[]" value="{file_id}" />
+    <div class="bx-base-general-icon-wrapper bx-def-margin-sec-right">
+        <img src="{file_icon}" class="bx-def-round-corners bx-base-general-icon bx-base-general-icon-{file_id}" />
+    </div>
+    <span class="bx-base-general-uploader-ghost">
+        <b><bx_text:_sys_txt_form_entry_input_picture_pic_url /></b><br />
+        <input class="bx-def-font-inputs bx-form-input-text bx-def-margin-sec-bottom" type="text" value="{file_url}" readonly="1" /> <br />
+        <span id="bx-base-general-intert-to-post-link-{file_id}" style="display:none;">
+            <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_insert_to_post('{file_id}', '{file_url}', '__editor_id__');"><bx_text:_sys_txt_form_entry_input_picture_insert /></a>
+        </span>
+        <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_delete_ghost('{file_id}', '{file_url}', '{file_icon}', ['__editor_id__'], {js_instance_name});"><bx_text:_sys_txt_form_entry_input_picture_delete /></a>
+    </span>
+</div>
+<script>
+    $('#bx-base-general-intert-to-post-link-{file_id}').show();
+
+    // disable images drag&drop, because resized images address can be reset after some time
+    $(".bx-base-general-icon-{file_id}").bind('dragstart', function(){
+        return false; 
+    });
+</script>

+ 16 - 0
modules/boonex/directory/template/form_ghost_template_cover.html

@@ -0,0 +1,16 @@
+<div id="bx-uploader-file-{storage_object}-{file_id}" class="bx-uploader-ghost bx-def-margin-sec-top bx-clearfix">
+    <input type="hidden" name="__name__[]" value="{file_id}" />
+    <input type="hidden" name="__name_thumb__[]" value="{file_id}" onclick="bx_base_general_select_thumb(this)" id="__name_thumb__-{file_id}" />
+    <div class="bx-base-general-icon-wrapper bx-def-margin-sec-right">
+        <img src="{file_icon}" class="bx-def-round-corners bx-base-general-icon bx-base-general-icon-{file_id}" />
+    </div>
+    <span class="bx-base-general-uploader-ghost">
+        <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_delete_ghost('{file_id}', '{file_url}', '{file_icon}', ['__editor_id__'], {js_instance_name});"><bx_text:_sys_txt_form_entry_input_picture_delete /></a>
+    </span>
+</div>
+<script>
+    // disable images drag&drop, because resized images address can be reset after some time
+    $(".bx-base-general-icon-{file_id}").bind('dragstart', function(){
+        return false; 
+    });
+</script>

+ 22 - 0
modules/boonex/directory/template/form_ghost_template_file.html

@@ -0,0 +1,22 @@
+<div id="bx-uploader-file-{storage_object}-{file_id}" class="bx-uploader-ghost bx-def-margin-sec-top bx-clearfix">
+    <input type="hidden" name="__name__[]" value="{file_id}" />
+    <div class="bx-base-general-icon-wrapper bx-def-margin-sec-right">
+        <img src="{file_icon}" class="bx-def-round-corners bx-base-general-icon bx-base-general-icon-{file_id}" />
+    </div>
+    <span class="bx-base-general-uploader-ghost">
+        <b><bx_text:_sys_txt_form_entry_input_picture_pic_url /></b><br />
+        <input class="bx-def-font-inputs bx-form-input-text bx-def-margin-sec-bottom" type="text" value="{file_url}" readonly="1" /> <br />
+        <span id="bx-base-general-intert-to-post-link-{file_id}" style="display:none;">
+            <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_insert_to_post('{file_id}', '{file_url}', '__editor_id__');"><bx_text:_sys_txt_form_entry_input_picture_insert /></a>
+        </span>
+        <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_delete_ghost('{file_id}', '{file_url}', '{file_icon}', ['__editor_id__'], {js_instance_name});"><bx_text:_sys_txt_form_entry_input_picture_delete /></a>
+    </span>
+</div>
+<script>
+    $('#bx-base-general-intert-to-post-link-{file_id}').show();
+
+    // disable images drag&drop, because resized images address can be reset after some time
+    $(".bx-base-general-icon-{file_id}").bind('dragstart', function(){
+        return false; 
+    });
+</script>

+ 22 - 0
modules/boonex/directory/template/form_ghost_template_video.html

@@ -0,0 +1,22 @@
+<div id="bx-uploader-file-{storage_object}-{file_id}" class="bx-uploader-ghost bx-def-margin-sec-top bx-clearfix">
+    <input type="hidden" name="__name__[]" value="{file_id}" />
+    <div class="bx-base-general-icon-wrapper bx-def-margin-sec-right">
+        <img src="{file_icon}" class="bx-def-round-corners bx-base-general-icon bx-base-general-icon-{file_id}" />
+    </div>
+    <span class="bx-base-general-uploader-ghost">
+        <b><bx_text:_sys_txt_form_entry_input_picture_pic_url /></b><br />
+        <input class="bx-def-font-inputs bx-form-input-text bx-def-margin-sec-bottom" type="text" value="{file_url}" readonly="1" /> <br />
+        <span id="bx-base-general-intert-to-post-link-{file_id}" style="display:none;">
+            <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_insert_to_post('{file_id}', '{file_url}', '__editor_id__');"><bx_text:_sys_txt_form_entry_input_picture_insert /></a>
+        </span>
+        <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_delete_ghost('{file_id}', '{file_url}', '{file_icon}', ['__editor_id__'], {js_instance_name});"><bx_text:_sys_txt_form_entry_input_picture_delete /></a>
+    </span>
+</div>
+<script>
+    $('#bx-base-general-intert-to-post-link-{file_id}').show();
+
+    // disable images drag&drop, because resized images address can be reset after some time
+    $(".bx-base-general-icon-{file_id}").bind('dragstart', function(){
+        return false; 
+    });
+</script>

+ 38 - 0
modules/boonex/directory/template/images/icons/std-icon.svg

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 20.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 600 600" style="enable-background:new 0 0 600 600;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#2BAF92;}
+	.st1{fill:url(#path-copy_1_);}
+	.st2{fill:#FFFFFF;}
+</style>
+<title>Group 2 Copy 25</title>
+<desc>Created with Sketch.</desc>
+<g id="Page-1">
+	<g id="Group-2-Copy-25">
+		<path id="path" class="st0" d="M552.3,552.3C600,504.5,600,431.5,600,300s0-204.5-47.7-252.3C504.5,0,431.5,0,300,0
+			S95.5,0,47.7,47.7C0,95.5,0,168.5,0,300s0,204.5,47.7,252.3C95.5,600,168.5,600,300,600S504.5,600,552.3,552.3L552.3,552.3z"/>
+		
+			<linearGradient id="path-copy_1_" gradientUnits="userSpaceOnUse" x1="-9.4833" y1="0.3167" x2="-9.4833" y2="1.3167" gradientTransform="matrix(600 0 0 600 5990 -190)">
+			<stop  offset="0" style="stop-color:#FFFFFF;stop-opacity:0.2"/>
+			<stop  offset="1" style="stop-color:#000000;stop-opacity:0.1389"/>
+		</linearGradient>
+		<path id="path-copy" class="st1" d="M552.3,552.3C600,504.5,600,431.5,600,300s0-204.5-47.7-252.3C504.5,0,431.5,0,300,0
+			S95.5,0,47.7,47.7C0,95.5,0,168.5,0,300s0,204.5,47.7,252.3C95.5,600,168.5,600,300,600S504.5,600,552.3,552.3L552.3,552.3z"/>
+	</g>
+</g>
+<g>
+	<g>
+		<path class="st2" d="M518.8,289.8c-3.2-6.7-8.1-11.9-14.8-15.5c-6.6-3.6-13.9-5.4-21.8-5.4H440v-35.2c0-13.5-4.8-25.1-14.5-34.8
+			c-9.7-9.7-21.3-14.5-34.8-14.5H271v-7.1c0-13.5-4.8-25.1-14.5-34.8S235.2,128,221.7,128h-70.4c-13.5,0-25.1,4.8-34.8,14.5
+			c-9.7,9.8-14.5,21.3-14.5,34.9v211.3c0,13.5,4.8,25.1,14.5,34.8c9.7,9.7,21.3,14.5,34.8,14.5h239.4c9.8,0,20.1-2.5,30.8-7.6
+			c10.7-5.1,19.2-11.5,25.5-19.3l64.9-79.9c6.7-8.5,10.1-17.3,10.1-26.4C522,299.5,521,294.5,518.8,289.8z M130.1,177.4
+			c0-5.8,2.1-10.8,6.2-14.9c4.1-4.1,9.1-6.2,14.9-6.2h70.4c5.9,0,10.8,2.1,14.9,6.2c4.1,4.1,6.2,9.1,6.2,14.9v14.1
+			c0,5.9,2.1,10.8,6.2,14.9c4.1,4.1,9.1,6.2,14.9,6.2h126.8c5.8,0,10.8,2.1,14.9,6.2c4.1,4.1,6.2,9.1,6.2,14.9v35.2h-169
+			c-10,0-20.3,2.5-30.9,7.6c-10.6,5.1-19,11.5-25.5,19.3l-56.1,69.3V177.4L130.1,177.4z M489.9,313.4l-64.7,79.9
+			c-3.7,4.5-8.9,8.5-15.6,11.7c-6.7,3.2-13,4.8-19,4.8H151.2c-7.8,0-11.7-2.5-11.7-7.7c0-2.4,1.3-5.3,3.9-8.8l64.7-79.9
+			c3.8-4.5,9-8.4,15.8-11.6c6.6-3.1,13-4.8,18.8-4.8h239.4c7.8,0,11.7,2.5,11.7,7.7C493.9,307.3,492.6,310.2,489.9,313.4z"/>
+	</g>
+</g>
+</svg>

+ 1 - 0
modules/boonex/directory/template/poll_answer_vc_text.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_answer_vc_text.html />

+ 1 - 0
modules/boonex/directory/template/poll_answer_ve_block.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_answer_ve_block.html />

+ 1 - 0
modules/boonex/directory/template/poll_form.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_form.html />

+ 1 - 0
modules/boonex/directory/template/poll_form_answers.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_form_answers.html />

+ 1 - 0
modules/boonex/directory/template/poll_form_field.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_form_field.html />

+ 1 - 0
modules/boonex/directory/template/poll_item.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_item.html />

+ 1 - 0
modules/boonex/directory/template/poll_item_answers.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_item_answers.html />

+ 1 - 0
modules/boonex/directory/template/poll_item_results.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_item_results.html />

+ 1 - 0
modules/boonex/directory/template/poll_items.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_items.html />

+ 1 - 0
modules/boonex/directory/template/poll_items_showcase.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/poll_items_showcase.html />

+ 1 - 0
modules/boonex/directory/template/title_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/title_link.html />

+ 3 - 0
modules/boonex/directory/template/unit.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit.html />
+

+ 1 - 0
modules/boonex/directory/template/unit_full.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/unit_full.html />

+ 3 - 0
modules/boonex/directory/template/unit_full_private.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_full_private.html />
+

+ 1 - 0
modules/boonex/directory/template/unit_gallery.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/unit_gallery.html />

+ 3 - 0
modules/boonex/directory/template/unit_gallery_private.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_gallery_private.html />
+

+ 3 - 0
modules/boonex/directory/template/unit_live_search.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_live_search.html />
+

+ 1 - 0
modules/boonex/directory/template/unit_meta_item.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/unit_meta_item.html />

+ 3 - 0
modules/boonex/directory/template/unit_private.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_private.html />
+

+ 1 - 0
modules/boonex/directory/template/unit_showcase.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/unit_showcase.html />

+ 1 - 0
modules/boonex/directory/template/uploader_button_html5_attach.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/uploader_button_html5_attach.html />

+ 1 - 0
modules/boonex/directory/template/uploader_button_simple_attach.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/uploader_button_simple_attach.html />