Răsfoiți Sursa

Ticket #1035 - Module itself.

AntonLV 8 ani în urmă
părinte
comite
49bd8850af
53 a modificat fișierele cu 2475 adăugiri și 0 ștergeri
  1. 21 0
      modules/boonex/photos/classes/BxPhotosAlertsResponse.php
  2. 24 0
      modules/boonex/photos/classes/BxPhotosCmtsSearchResult.php
  3. 145 0
      modules/boonex/photos/classes/BxPhotosConfig.php
  4. 34 0
      modules/boonex/photos/classes/BxPhotosDb.php
  5. 31 0
      modules/boonex/photos/classes/BxPhotosFormEntry.php
  6. 23 0
      modules/boonex/photos/classes/BxPhotosFormsEntryHelper.php
  7. 21 0
      modules/boonex/photos/classes/BxPhotosGridAdministration.php
  8. 21 0
      modules/boonex/photos/classes/BxPhotosGridCommon.php
  9. 24 0
      modules/boonex/photos/classes/BxPhotosMenu.php
  10. 25 0
      modules/boonex/photos/classes/BxPhotosMenuManageTools.php
  11. 22 0
      modules/boonex/photos/classes/BxPhotosMenuSnippetMeta.php
  12. 24 0
      modules/boonex/photos/classes/BxPhotosMenuView.php
  13. 75 0
      modules/boonex/photos/classes/BxPhotosModule.php
  14. 24 0
      modules/boonex/photos/classes/BxPhotosPageAuthor.php
  15. 24 0
      modules/boonex/photos/classes/BxPhotosPageBrowse.php
  16. 41 0
      modules/boonex/photos/classes/BxPhotosPageEntry.php
  17. 140 0
      modules/boonex/photos/classes/BxPhotosSearchResult.php
  18. 76 0
      modules/boonex/photos/classes/BxPhotosTemplate.php
  19. 28 0
      modules/boonex/photos/classes/BxPhotosUploaderHTML5.php
  20. 28 0
      modules/boonex/photos/classes/BxPhotosUploaderSimple.php
  21. 135 0
      modules/boonex/photos/install/config.php
  22. 20 0
      modules/boonex/photos/install/installer.php
  23. 202 0
      modules/boonex/photos/install/langs/en.xml
  24. 63 0
      modules/boonex/photos/install/sql/disable.sql
  25. 390 0
      modules/boonex/photos/install/sql/enable.sql
  26. 316 0
      modules/boonex/photos/install/sql/install.sql
  27. 65 0
      modules/boonex/photos/install/sql/uninstall.sql
  28. 56 0
      modules/boonex/photos/js/manage_tools.js
  29. 18 0
      modules/boonex/photos/request.php
  30. 1 0
      modules/boonex/photos/template/attachments.html
  31. 1 0
      modules/boonex/photos/template/author.html
  32. 1 0
      modules/boonex/photos/template/author_link.html
  33. 1 0
      modules/boonex/photos/template/css/forms.css
  34. 28 0
      modules/boonex/photos/template/css/main.css
  35. 1 0
      modules/boonex/photos/template/css/manage_tools.css
  36. 1 0
      modules/boonex/photos/template/entry-all-actions.html
  37. 1 0
      modules/boonex/photos/template/entry-location.html
  38. 1 0
      modules/boonex/photos/template/entry-photo.html
  39. 1 0
      modules/boonex/photos/template/entry-rating.html
  40. 1 0
      modules/boonex/photos/template/entry-share.html
  41. 1 0
      modules/boonex/photos/template/entry-text.html
  42. 30 0
      modules/boonex/photos/template/form_ghost_template.html
  43. 42 0
      modules/boonex/photos/template/images/icons/std-icon.svg
  44. 1 0
      modules/boonex/photos/template/title_link.html
  45. 1 0
      modules/boonex/photos/template/unit.html
  46. 14 0
      modules/boonex/photos/template/unit_full.html
  47. 1 0
      modules/boonex/photos/template/unit_full_private.html
  48. 25 0
      modules/boonex/photos/template/unit_gallery.html
  49. 1 0
      modules/boonex/photos/template/unit_gallery_private.html
  50. 1 0
      modules/boonex/photos/template/unit_live_search.html
  51. 1 0
      modules/boonex/photos/template/unit_meta_item.html
  52. 1 0
      modules/boonex/photos/template/unit_private.html
  53. 202 0
      modules/boonex/russian/data/langs/bx_photos/ru.xml

+ 21 - 0
modules/boonex/photos/classes/BxPhotosAlertsResponse.php

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

+ 24 - 0
modules/boonex/photos/classes/BxPhotosCmtsSearchResult.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPhotosCmtsSearchResult extends BxBaseModGeneralCmtsSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+    	$this->sModule = 'bx_photos';
+
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent['title'] = _t('_bx_photos_page_block_title_browse_cmts');
+    }
+}
+
+/** @} */

+ 145 - 0
modules/boonex/photos/classes/BxPhotosConfig.php

@@ -0,0 +1,145 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPhotosConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'edit-photo' => 'checkAllowedEdit',
+            'delete-photo' => 'checkAllowedDelete',
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'camera-retro col-blue1',
+
+            // 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_TITLE' => 'title',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'photo-text',
+            'FIELD_CATEGORY' => 'cat',
+            'FIELD_DURATION' => 'duration',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_PHOTO' => 'pictures',
+            'FIELD_THUMB' => 'thumb',
+			'FIELD_VIEWS' => 'views',
+            'FIELD_COMMENTS' => 'comments',
+	        'FIELD_STATUS' => 'status',
+        	'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-photo',
+            'URI_AUTHOR_ENTRIES' => 'photos-author',
+            'URI_ADD_ENTRY' => 'create-photo',
+        	'URI_EDIT_ENTRY' => 'edit-photo',
+        	'URI_MANAGE_COMMON' => 'photos-manage',
+
+            'URL_HOME' => 'page.php?i=photos-home',
+            'URL_POPULAR' => 'page.php?i=photos-popular',
+            'URL_UPDATED' => 'page.php?i=photos-updated',
+        	'URL_MANAGE_COMMON' => 'page.php?i=photos-manage',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=photos-administration',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_photos_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_photos_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_photos_rss_num',
+        	'PARAM_SEARCHABLE_FIELDS' => 'bx_photos_searchable_fields',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_photos_photos',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_photos_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_photos_gallery',
+        	'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_photos_cover',
+        	'OBJECT_REPORTS' => 'bx_photos',
+            'OBJECT_VIEWS' => 'bx_photos',
+            'OBJECT_VOTES' => 'bx_photos',
+            'OBJECT_VOTES_STARS' => 'bx_photos_stars',
+        	'OBJECT_FAVORITES' => 'bx_photos',
+            'OBJECT_FEATURED' => 'bx_photos',
+            'OBJECT_METATAGS' => 'bx_photos',
+            'OBJECT_COMMENTS' => 'bx_photos',
+            'OBJECT_CATEGORY' => 'bx_photos_cats',
+            'OBJECT_PRIVACY_VIEW' => 'bx_photos_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_photos',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_photos_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_photos_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_photos_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_photos_entry_delete',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_photos_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_photos_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_photos_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_photos_view_submenu', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'photos-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_SNIPPET_META' => 'bx_photos_snippet_meta', // menu for snippet meta info
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_photos_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_photos_administration',
+        	'OBJECT_GRID_COMMON' => 'bx_photos_common',
+            'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_photos_my' => array (
+                    'create-photo' => 'checkAllowedAdd',
+                ),
+                'bx_photos_view' => $aMenuItems2Methods,
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_photos_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_photos_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_photos_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_photos_txt_sample_vote_single',
+                'form_field_author' => '_bx_photos_form_entry_input_author',
+            	'grid_action_err_delete' => '_bx_photos_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_photos_grid_txt_account_manager',
+				'filter_item_active' => '_bx_photos_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_photos_grid_filter_item_title_adm_hidden',
+            	'filter_item_select_one_filter1' => '_bx_photos_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_photos_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_photos_menu_item_title_manage_all',
+                'txt_all_entries_by' => '_bx_photos_txt_all_entries_by',
+                'txt_all_entries_by_author' => '_bx_photos_page_title_browse_by_author',
+            	'txt_pict_use_as_thumb' => '_bx_photos_form_entry_input_picture_use_as_thumb'
+            ),
+        );
+
+        $this->_aJsClasses = array(
+        	'manage_tools' => 'BxPhotosManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'manage_tools' => 'oBxPhotosManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION']
+        );
+    }
+}
+
+/** @} */

+ 34 - 0
modules/boonex/photos/classes/BxPhotosDb.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxPhotosDb extends BxBaseModTextDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    public function updateEntries($aParamsSet, $aParamsWhere)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(empty($aParamsSet) || empty($aParamsWhere))
+            return false;
+
+        $sSql = "UPDATE `" . $CNF['TABLE_ENTRIES'] . "` SET " . $this->arrayToSQL($aParamsSet) . " WHERE " . $this->arrayToSQL($aParamsWhere, " AND ");
+        return $this->query($sSql);
+    }
+}
+
+/** @} */

+ 31 - 0
modules/boonex/photos/classes/BxPhotosFormEntry.php

@@ -0,0 +1,31 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit entry form
+ */
+class BxPhotosFormEntry extends BxBaseModTextFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($aInfo, $oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if (isset($CNF['FIELD_PHOTO']) && isset($this->aInputs[$CNF['FIELD_PHOTO']])) {
+            $this->aInputs[$CNF['FIELD_PHOTO']]['upload_buttons_titles'] = _t('_bx_photos_form_entry_input_pictures_upload');
+            $this->aInputs[$CNF['FIELD_PHOTO']]['multiple'] = false;
+        }
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/photos/classes/BxPhotosFormsEntryHelper.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry forms helper functions
+ */
+class BxPhotosFormsEntryHelper extends BxBaseModTextFormsEntryHelper
+{
+    public function __construct($oModule)
+    {
+        parent::__construct($oModule);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/photos/classes/BxPhotosGridAdministration.php

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

+ 21 - 0
modules/boonex/photos/classes/BxPhotosGridCommon.php

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

+ 24 - 0
modules/boonex/photos/classes/BxPhotosMenu.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * General class for module menu.
+ */
+class BxPhotosMenu extends BxBaseModTextMenu
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/photos/classes/BxPhotosMenuManageTools.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'Photos manage tools' menu.
+ */
+class BxPhotosMenuManageTools extends BxBaseModTextMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/photos/classes/BxPhotosMenuSnippetMeta.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPhotosMenuSnippetMeta extends BxBaseModTextMenuSnippetMeta
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_photos';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/photos/classes/BxPhotosMenuView.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxPhotosMenuView extends BxBaseModTextMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 75 - 0
modules/boonex/photos/classes/BxPhotosModule.php

@@ -0,0 +1,75 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Photos module
+ */
+class BxPhotosModule extends BxBaseModTextModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    /**
+     * @page service Service Calls
+     * @section bx_photos Photos
+     * @subsection bx_photos-page_blocks Page Blocks
+     * @subsubsection bx_photos-entity_photo_block entity_photo_block
+     * 
+     * @code bx_srv('bx_photos', 'entity_photo_block', [...]); @endcode
+     * 
+     * Get page block with photo player.
+     *
+     * @param $iContentId (optional) photo ID. If empty value is provided, an attempt to get it from GET/POST arrays will be performed.
+     * @return HTML string with block content to display on the site or false if there is no enough input data. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
+     * 
+     * @see BxPhotosModule::serviceEntityPhotoBlock
+     */
+    /** 
+     * @ref bx_photos-entity_photo_block "entity_photo_block"
+     */
+    public function serviceEntityPhotoBlock ($iContentId = 0)
+    {
+        $mixedContent = $this->_getContent($iContentId);
+        if($mixedContent === false)
+            return false;
+
+        list($iContentId, $aContentInfo) = $mixedContent;
+
+        return $this->_oTemplate->entryPhoto($aContentInfo);
+    }
+
+	/**
+     * @page service Service Calls
+     * @section bx_photos Photos
+     * @subsection bx_photos-page_blocks Page Blocks
+     * @subsubsection bx_photos-entity_rating entity_rating
+     * 
+     * @code bx_srv('bx_photos', 'entity_rating', [...]); @endcode
+     * 
+     * Get page block with Stars based photo's rating.
+     *
+     * @param $iContentId (optional) photo ID. If empty value is provided, an attempt to get it from GET/POST arrays will be performed.
+     * @return HTML string with block content to display on the site or false if there is no enough input data. All necessary CSS and JS files are automatically added to the HEAD section of the site HTML.
+     * 
+     * @see BxPhotosModule::serviceEntityRating
+     */
+    /** 
+     * @ref bx_photos-entity_rating "entity_rating"
+     */
+    public function serviceEntityRating($iContentId = 0)
+    {
+    	return $this->_serviceTemplateFunc ('entryRating', $iContentId);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/photos/classes/BxPhotosPageAuthor.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Profile's entries page.
+ */
+class BxPhotosPageAuthor extends BxBaseModTextPageAuthor
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 24 - 0
modules/boonex/photos/classes/BxPhotosPageBrowse.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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Browse entries pages.
+ */
+class BxPhotosPageBrowse extends BxBaseModTextPageBrowse
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 41 - 0
modules/boonex/photos/classes/BxPhotosPageEntry.php

@@ -0,0 +1,41 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry create/edit pages
+ */
+class BxPhotosPageEntry extends BxBaseModTextPageEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _setSubmenu($aParams)
+    {
+    	parent::_setSubmenu(array_merge($aParams, array(
+    		'icon' => ''
+    	)));
+    }
+
+    protected function _getThumbForMetaObject ()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(!empty($CNF['FIELD_THUMB']) && !empty($this->_aContentInfo[$CNF['FIELD_THUMB']]))
+            return array('id' => $this->_aContentInfo[$CNF['FIELD_THUMB']], 'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_COVER']);
+
+        return false;
+    }
+}
+
+/** @} */

+ 140 - 0
modules/boonex/photos/classes/BxPhotosSearchResult.php

@@ -0,0 +1,140 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPhotosSearchResult extends BxBaseModTextSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent = array(
+            'name' => 'bx_photos',
+            'module_name' => 'bx_photos',
+            'object_metatags' => 'bx_photos',
+            'title' => _t('_bx_photos_page_title_browse'),
+            'table' => 'bx_photos_entries',
+            'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added', 'views'),
+            '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_photos_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',
+                ),
+            ),
+            'ident' => 'id',
+        );
+
+        $this->sFilterName = 'bx_photos_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;
+                }
+                break;
+
+            case 'favorite':
+                if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'public':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_photos_page_title_browse_recent');
+                $this->aCurrent['rss']['link'] = 'modules/?r=photos/rss/' . $sMode;
+                break;
+
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_photos_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=photos/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
+            case 'popular':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
+                $this->aCurrent['title'] = _t('_bx_photos_page_title_browse_popular');
+                $this->aCurrent['rss']['link'] = 'modules/?r=photos/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'popular';
+                break;
+
+            case 'updated':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
+                $this->aCurrent['title'] = _t('_bx_photos_page_title_browse_updated');
+                $this->aCurrent['rss']['link'] = 'modules/?r=photos/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'updated';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_photos');
+                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_photos_entries`.`added` DESC';
+                break;
+            case 'featured':
+                $aSql['order'] = ' ORDER BY `bx_photos_entries`.`featured` DESC';
+                break;
+            case 'updated':
+                $aSql['order'] = ' ORDER BY `bx_photos_entries`.`changed` DESC';
+                break;
+            case 'popular':
+                $aSql['order'] = ' ORDER BY `bx_photos_entries`.`views` DESC';
+                break;
+        }
+        return $aSql;
+    }
+}
+
+/** @} */

+ 76 - 0
modules/boonex/photos/classes/BxPhotosTemplate.php

@@ -0,0 +1,76 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module representation.
+ */
+class BxPhotosTemplate extends BxBaseModTextTemplate
+{
+    /**
+     * Constructor
+     */
+    public function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_photos';
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function entryPhoto ($aContentInfo, $mixedContext = false)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        if(empty($aContentInfo[$CNF['FIELD_THUMB']]))
+            return '';
+
+        $iImage = (int)$aContentInfo[$CNF['FIELD_THUMB']];
+
+        $oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_COVER']);
+        if($oImagesTranscoder)
+            $sImage = $oImagesTranscoder->getFileUrl($iImage);
+        
+        if(empty($sImage)) {
+            $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE_PHOTOS']);
+            if($oStorage)
+                $sImage = $oStorage->getFileUrl($iImage);
+        }
+
+        if(empty($sImage))
+            return '';
+
+        $sTitle = bx_process_output($aContentInfo['title']);
+        $sTitleAttr = bx_html_attribute($aContentInfo['title']);
+
+        return $this->parseHtmlByName('entry-photo.html', array(
+            'title' => $sTitle,
+            'title_attr' => $sTitleAttr,
+            'src' => $sImage
+        ));
+    }
+
+    public function entryRating($aData)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+    	$sVotes = '';
+        $oVotes = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES_STARS'], $aData['id']);
+        if($oVotes) {
+			$sVotes = $oVotes->getElementBlock(array('show_counter' => true, 'show_legend' => true));
+			if(!empty($sVotes))
+				$sVotes = $this->parseHtmlByName('entry-rating.html', array(
+		    		'content' => $sVotes,
+		    	));
+        }
+
+    	return $sVotes; 
+    }
+}
+
+/** @} */

+ 28 - 0
modules/boonex/photos/classes/BxPhotosUploaderHTML5.php

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

+ 28 - 0
modules/boonex/photos/classes/BxPhotosUploaderSimple.php

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

+ 135 - 0
modules/boonex/photos/install/config.php

@@ -0,0 +1,135 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_photos',
+    'title' => 'Photos',
+    'note' => 'Basic photo posting 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/photos/',
+    'home_uri' => 'photos',
+
+    'db_prefix' => 'bx_photos_',
+    'class_prefix' => 'BxPhotos',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Photos',
+
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    ),
+    
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+    	'trigger_profile_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_photos_files'
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+		'bx_photos_preview',
+        'bx_photos_gallery',
+        'bx_photos_cover'
+    ),
+
+    /**
+     * Extended Search Forms.
+     */
+    'esearches' => array(
+        'bx_photos',
+    	'bx_photos_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/photos/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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPhotosInstaller extends BxBaseModTextInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 202 - 0
modules/boonex/photos/install/langs/en.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_photos"><![CDATA[Photos]]></string>
+	<string name="_bx_photos_cmts"><![CDATA[Photos' Comments]]></string>
+
+	<string name="_bx_photos_option_summary_chars"><![CDATA[Number of characters in auto-cropped photo summary]]></string>
+	<string name="_bx_photos_option_plain_summary_chars"><![CDATA[Number of characters in plain photo description when photo hasn't thumb]]></string>
+	<string name="_bx_photos_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_photos_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
+	<string name="_bx_photos_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+	<string name="_bx_photos_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+
+	<string name="_bx_photos_form_entry"><![CDATA[Photos]]></string>
+	<string name="_bx_photos_form_entry_display_add"><![CDATA[Add Photo]]></string>
+	<string name="_bx_photos_form_entry_display_edit"><![CDATA[Edit Photo]]></string>
+	<string name="_bx_photos_form_entry_display_delete"><![CDATA[Delete Photo]]></string>
+	<string name="_bx_photos_form_entry_display_view"><![CDATA[View Photo]]></string>
+	<string name="_bx_photos_form_entry_input_author"><![CDATA[Author]]></string>
+	<string name="_bx_photos_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_photos_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_photos_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_photos_form_entry_input_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_photos_form_entry_input_sys_title"><![CDATA[Title]]></string>
+	<string name="_bx_photos_form_entry_input_title"><![CDATA[Title]]></string>
+	<string name="_bx_photos_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+	<string name="_bx_photos_form_entry_input_sys_cat"><![CDATA[Category]]></string>
+	<string name="_bx_photos_form_entry_input_cat"><![CDATA[Category]]></string>
+    <string name="_bx_photos_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+	<string name="_bx_photos_form_entry_input_sys_text"><![CDATA[Text]]></string>
+	<string name="_bx_photos_form_entry_input_text"><![CDATA[Text]]></string>
+	<string name="_bx_photos_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_photos_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this photo]]></string>
+	<string name="_bx_photos_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+	<string name="_bx_photos_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the photo]]></string>
+	<string name="_bx_photos_form_entry_input_sys_pictures"><![CDATA[Photo]]></string>
+	<string name="_bx_photos_form_entry_input_pictures"><![CDATA[Photo]]></string>
+	<string name="_bx_photos_form_entry_input_pictures_upload"><![CDATA[Upload]]></string>
+    <string name="_bx_photos_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_photos_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_photos_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
+    <string name="_bx_photos_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_photos_form_entry_input_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_photos_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_photos_form_entry_input_date_changed"><![CDATA[Updated]]></string>
+
+	<string name="_bx_photos_acl_action_create_entry"><![CDATA[Create Photo]]></string>
+	<string name="_bx_photos_acl_action_delete_entry"><![CDATA[Delete Photo]]></string>
+	<string name="_bx_photos_acl_action_view_entry"><![CDATA[View Photo]]></string>
+	<string name="_bx_photos_acl_action_set_thumb"><![CDATA[Set Photo Thumbnail]]></string>
+	<string name="_bx_photos_acl_action_edit_any_entry"><![CDATA[Edit Any Photo]]></string>
+
+	<string name="_bx_photos_page_title_sys_create_entry"><![CDATA[New Photo]]></string>
+	<string name="_bx_photos_page_title_create_entry"><![CDATA[New Photo]]></string>
+	<string name="_bx_photos_page_block_title_create_entry"><![CDATA[New Photo]]></string>
+	<string name="_bx_photos_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_photos_page_title_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_photos_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_photos_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_photos_page_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_photos_page_block_title_delete_entry"><![CDATA[Delete]]></string>
+	<string name="_bx_photos_page_title_sys_view_entry"><![CDATA[View Photo]]></string>
+	<string name="_bx_photos_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_photos_page_block_title_entry_text"><![CDATA[Text]]></string>
+	<string name="_bx_photos_page_block_title_entry_photo"><![CDATA[Photo]]></string>
+	<string name="_bx_photos_page_title_browse"><![CDATA[Photos]]></string>
+	<string name="_bx_photos_page_title_search_results"><![CDATA[Photos matching "{0}"]]></string>
+	<string name="_bx_photos_page_title_browse_by_author"><![CDATA[Photos of {display_name}]]></string>
+	<string name="_bx_photos_page_title_browse_featured"><![CDATA[Featured Photos]]></string>
+    <string name="_bx_photos_page_title_browse_recent"><![CDATA[Latest Photos]]></string>
+    <string name="_bx_photos_page_title_browse_popular"><![CDATA[Popular Photos]]></string>
+    <string name="_bx_photos_page_title_browse_updated"><![CDATA[Updated Photos]]></string>
+    <string name="_bx_photos_page_title_sys_home"><![CDATA[Photos Home]]></string>
+    <string name="_bx_photos_page_title_home"><![CDATA[Photos]]></string>
+    <string name="_bx_photos_page_block_title_featured_entries"><![CDATA[Featured Photos (Gallery View)]]></string>
+    <string name="_bx_photos_page_block_title_featured_entries_view_extended"><![CDATA[Featured Photos]]></string>
+    <string name="_bx_photos_page_block_title_featured_entries_view_full"><![CDATA[Featured Photos (Full View)]]></string>
+    <string name="_bx_photos_page_block_title_recent_entries"><![CDATA[Latest Photos (Gallery View)]]></string>
+    <string name="_bx_photos_page_block_title_recent_entries_view_extended"><![CDATA[Latest Photos]]></string>
+    <string name="_bx_photos_page_block_title_recent_entries_view_full"><![CDATA[Latest Photos (Full View)]]></string>
+    <string name="_bx_photos_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_photos_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_photos_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_photos_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_photos_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_photos_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_photos_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_photos_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
+    <string name="_bx_photos_page_block_title_entry_rating"><![CDATA[Rating]]></string>
+    <string name="_bx_photos_page_title_sys_entries_popular"><![CDATA[Popular Photos]]></string>
+    <string name="_bx_photos_page_title_entries_popular"><![CDATA[Popular Photos]]></string>
+    <string name="_bx_photos_page_title_sys_entries_updated"><![CDATA[Updated Photos]]></string>
+    <string name="_bx_photos_page_title_entries_updated"><![CDATA[Updated Photos]]></string>
+    <string name="_bx_photos_page_title_sys_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_photos_page_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_photos_page_block_title_search_form"><![CDATA[Search Form]]></string>
+    <string name="_bx_photos_page_block_title_search_results"><![CDATA[Search Results]]></string>
+    <string name="_bx_photos_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
+    <string name="_bx_photos_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
+    <string name="_bx_photos_page_block_title_popular_entries"><![CDATA[Popular Photos]]></string>
+    <string name="_bx_photos_page_block_title_popular_entries_view_extended"><![CDATA[Popular Photos (Extended View)]]></string>
+    <string name="_bx_photos_page_block_title_popular_entries_view_full"><![CDATA[Popular Photos (Full View)]]></string>
+    <string name="_bx_photos_page_block_title_updated_entries"><![CDATA[Updated Photos]]></string>
+    <string name="_bx_photos_page_title_sys_view_entry_comments"><![CDATA[Photo Comments]]></string>
+    <string name="_bx_photos_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
+    <string name="_bx_photos_page_title_sys_entries_of_author"><![CDATA[Photos of author]]></string>
+    <string name="_bx_photos_page_title_entries_of_author"><![CDATA[Photos by {display_name}]]></string>
+    <string name="_bx_photos_page_block_title_favorites_of_author"><![CDATA[Favorites by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_photos_page_block_title_sys_favorites_of_author"><![CDATA[Favorites of author]]></string>
+    <string name="_bx_photos_page_block_title_entries_of_author"><![CDATA[Photos by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_photos_page_block_title_sys_entries_of_author"><![CDATA[Photos of author]]></string>   
+    <string name="_bx_photos_page_block_title_entries_actions"><![CDATA[Photos actions]]></string>
+    <string name="_bx_photos_page_block_title_browse_cmts"><![CDATA[Photos' Comments]]></string>
+	<string name="_bx_photos_page_title_sys_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_photos_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_photos_page_title_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_photos_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_photos_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_photos_page_block_title_manage"><![CDATA[Manage]]></string>    
+	<string name="_bx_photos_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
+	<string name="_bx_photos_page_block_title_cats"><![CDATA[Photos Categories]]></string>
+	<string name="_bx_photos_page_block_title_entry_info"><![CDATA[Info]]></string>
+	<string name="_bx_photos_page_block_title_my_entries"><![CDATA[My Photos]]></string>
+
+    <string name="_bx_photos_menu_set_title_view_entry"><![CDATA[Photo Actions]]></string>
+    <string name="_bx_photos_menu_title_view_entry"><![CDATA[Photo Actions]]></string>
+    <string name="_bx_photos_menu_title_submenu"><![CDATA[Photos Submenu]]></string>
+    <string name="_bx_photos_menu_set_title_submenu"><![CDATA[Photos Submenu]]></string>
+    <string name="_bx_photos_menu_item_title_system_create_entry"><![CDATA[New Photo]]></string>
+    <string name="_bx_photos_menu_item_title_create_entry"><![CDATA[New Photo]]></string>
+    <string name="_bx_photos_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_photos_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_photos_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_photos_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_photos_menu_item_title_system_view_entry"><![CDATA[View Photo]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_home"><![CDATA[Photos]]></string>
+    <string name="_bx_photos_menu_item_title_entries_home"><![CDATA[Photos]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_photos_menu_item_title_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_photos_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_photos_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_photos_menu_item_title_entries_search"><![CDATA[Search]]></string>
+    <string name="_bx_photos_menu_title_view_entry_submenu"><![CDATA[View Photo Submenu]]></string>
+    <string name="_bx_photos_menu_set_title_view_entry_submenu"><![CDATA[View Photo Submenu]]></string>
+    <string name="_bx_photos_menu_item_title_view_entry_submenu_entry"><![CDATA[Photo]]></string>
+    <string name="_bx_photos_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_photos_menu_item_title_system_view_entry_comments"><![CDATA[Photo Comments]]></string>
+    <string name="_bx_photos_menu_item_title_system_view_entries_author"><![CDATA[Photos]]></string>
+    <string name="_bx_photos_menu_item_title_view_entries_author"><![CDATA[Photos]]></string>
+    <string name="_bx_photos_menu_title_entries_my"><![CDATA[My Photos Action Menu]]></string>
+    <string name="_bx_photos_menu_set_title_entries_my"><![CDATA[My Photos Menu]]></string>
+	<string name="_bx_photos_menu_item_title_system_manage_my_photos"><![CDATA[My photos]]></string>
+    <string name="_bx_photos_menu_item_title_manage_my_photos"><![CDATA[{addon} photos]]></string>
+    <string name="_bx_photos_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_photos_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_photos_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_photos_menu_item_title_manage_account"><![CDATA[Manage account]]></string>
+	<string name="_bx_photos_menu_item_title_system_admt_photos"><![CDATA[Photos]]></string>
+	<string name="_bx_photos_menu_item_title_admt_photos"><![CDATA[Photos - {addon} hidden]]></string>
+	<string name="_bx_photos_menu_item_title_manage_my"><![CDATA[My Photos]]></string>
+	<string name="_bx_photos_menu_item_title_manage_all"><![CDATA[All Photos]]></string>
+
+	<string name="_bx_photos_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_photos_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_photos_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+	<string name="_bx_photos_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_photos_grid_column_title_adm_title"><![CDATA[Title]]></string>
+    <string name="_bx_photos_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_photos_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_photos_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_photos_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_photos_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_photos_grid_action_err_delete"><![CDATA[Cannot delete the selected photo(s).]]></string>
+    <string name="_bx_photos_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_photos_chart_growth"><![CDATA[Photos: Growth]]></string>
+    <string name="_bx_photos_chart_growth_speed"><![CDATA[Photos: Growth Speed]]></string>
+
+    <string name="_bx_photos_search_extended"><![CDATA[Photos Search]]></string>
+    <string name="_bx_photos_search_extended_cmts"><![CDATA[Photos Comments Search]]></string>
+
+    <string name="_bx_photos_pre_lists_cats"><![CDATA[Photo categories]]></string>
+    <string name="_bx_photos_cat_animals_and_pets"><![CDATA[Animals & Pets]]></string>
+    <string name="_bx_photos_cat_education"><![CDATA[Education]]></string>
+    <string name="_bx_photos_cat_entertainment"><![CDATA[Entertainment]]></string>
+    <string name="_bx_photos_cat_film_and_animation"><![CDATA[Film & Animation]]></string>
+    <string name="_bx_photos_cat_music"><![CDATA[Music]]></string>
+    <string name="_bx_photos_cat_news"><![CDATA[News]]></string>
+    <string name="_bx_photos_cat_people_and_blogs"><![CDATA[People & Blogs]]></string>
+    <string name="_bx_photos_cat_sports"><![CDATA[Sports]]></string>
+    <string name="_bx_photos_cat_travel"><![CDATA[Travel]]></string>
+
+    <string name="_bx_photos_txt_all_entries_by"><![CDATA[<a href="{0}">All Photos by {1} ({2})</a>]]></string>
+    <string name="_bx_photos_txt_sample_single"><![CDATA[photo]]></string>
+    <string name="_bx_photos_txt_sample_single_with_article"><![CDATA[a photo]]></string>
+    <string name="_bx_photos_txt_sample_comment_single"><![CDATA[comment to photo]]></string>
+    <string name="_bx_photos_txt_sample_vote_single"><![CDATA[vote to photo]]></string>
+    <string name="_bx_photos_txt_n_views"><![CDATA[{0} views]]></string>
+</resources>

+ 63 - 0
modules/boonex/photos/install/sql/disable.sql

@@ -0,0 +1,63 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_photos' 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_photos';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_photos' OR `object` IN('bx_photos_create_entry', 'bx_photos_edit_entry', 'bx_photos_delete_entry', 'bx_photos_view_entry', 'bx_photos_view_entry_comments', 'bx_photos_home', 'bx_photos_popular', 'bx_photos_updated', 'bx_photos_author', 'bx_photos_search', 'bx_photos_manage');
+
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_photos';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_photos';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_photos' OR `set_name` IN('bx_photos_view', 'bx_photos_submenu', 'bx_photos_view_submenu', 'bx_photos_snippet_meta', 'bx_photos_my', 'bx_photos_menu_manage_tools');
+
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_photos_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_photos';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_photos';
+
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_photos', 'bx_photos_cmts');
+
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_photos';
+
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_photos_cats';
+
+
+-- STATS
+DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_photos%';
+
+
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_photos%';
+
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_photos_administration', 'bx_photos_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_photos_administration', 'bx_photos_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_photos_administration', 'bx_photos_common');
+
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_photos_simple', 'bx_photos_html5');
+
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_photos' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;

+ 390 - 0
modules/boonex/photos/install/sql/enable.sql

@@ -0,0 +1,390 @@
+
+-- 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_photos', '_bx_photos', 'bx_photos@modules/boonex/photos/|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_photos', '_bx_photos', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_photos_summary_chars', '700', @iCategId, '_bx_photos_option_summary_chars', 'digit', '', '', '', 1),
+('bx_photos_plain_summary_chars', '240', @iCategId, '_bx_photos_option_plain_summary_chars', 'digit', '', '', '', 2),
+('bx_photos_per_page_browse', '12', @iCategId, '_bx_photos_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_photos_per_page_profile', '3', @iCategId, '_bx_photos_option_per_page_profile', 'digit', '', '', '', 12),
+('bx_photos_rss_num', '10', @iCategId, '_bx_photos_option_rss_num', 'digit', '', '', '', 20),
+('bx_photos_searchable_fields', 'title,text', @iCategId, '_bx_photos_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:21:"get_searchable_fields";}', 30);
+
+
+-- 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_photos_create_entry', '_bx_photos_page_title_sys_create_entry', '_bx_photos_page_title_create_entry', 'bx_photos', 5, 2147483647, 1, 'create-photo', 'page.php?i=create-photo', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_photos_create_entry', 1, 'bx_photos', '_bx_photos_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";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_photos_edit_entry', '_bx_photos_page_title_sys_edit_entry', '_bx_photos_page_title_edit_entry', 'bx_photos', 5, 2147483647, 1, 'edit-photo', '', '', '', '', 0, 1, 0, 'BxPhotosPageEntry', 'modules/boonex/photos/classes/BxPhotosPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_photos_edit_entry', 1, 'bx_photos', '_bx_photos_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";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_photos_delete_entry', '_bx_photos_page_title_sys_delete_entry', '_bx_photos_page_title_delete_entry', 'bx_photos', 5, 2147483647, 1, 'delete-photo', '', '', '', '', 0, 1, 0, 'BxPhotosPageEntry', 'modules/boonex/photos/classes/BxPhotosPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_photos_delete_entry', 1, 'bx_photos', '_bx_photos_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";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_photos_view_entry', '_bx_photos_page_title_sys_view_entry', '_bx_photos_page_title_view_entry', 'bx_photos', 10, 2147483647, 1, 'view-photo', '', '', '', '', 0, 1, 0, 'BxPhotosPageEntry', 'modules/boonex/photos/classes/BxPhotosPageEntry.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_photos_view_entry', 1, 'bx_photos', '', '_bx_photos_page_block_title_entry_photo', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:18:"entity_photo_block";}', 0, 0, 1, 0),
+('bx_photos_view_entry', 1, 'bx_photos', '', '_bx_photos_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:17:"entity_text_block";}', 0, 0, 1, 1),
+('bx_photos_view_entry', 2, 'bx_photos', '', '_bx_photos_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"entity_author";}', 0, 0, 1, 0),
+('bx_photos_view_entry', 2, 'bx_market', '', '_bx_photos_page_block_title_entry_rating', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"entity_rating";}', 0, 0, 1, 1),
+('bx_photos_view_entry', 3, 'bx_photos', '', '_bx_photos_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:11:"entity_info";}', 0, 0, 1, 1),
+('bx_photos_view_entry', 3, 'bx_photos', '', '_bx_photos_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"entity_location";}', 0, 0, 0, 2),
+('bx_photos_view_entry', 4, 'bx_photos', '', '_bx_photos_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 1, 0),
+('bx_photos_view_entry', 4, 'bx_photos', '', '_bx_photos_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:14:"entity_actions";}', 0, 0, 0, 1),
+('bx_photos_view_entry', 4, 'bx_photos', '', '_bx_photos_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:21:"entity_social_sharing";}', 0, 0, 0, 2),
+('bx_photos_view_entry', 4, 'bx_photos', '', '_bx_photos_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:18:"entity_attachments";}', 0, 0, 0, 3),
+('bx_photos_view_entry', 4, 'bx_photos', '', '_bx_photos_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"entity_comments";}', 0, 0, 1, 4),
+('bx_photos_view_entry', 4, 'bx_photos', '', '_bx_photos_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:9:"bx_photos";i:1;s:4:"{id}";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 0, 1, 5);
+
+-- 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_photos_view_entry_comments', '_bx_photos_page_title_sys_view_entry_comments', '_bx_photos_page_title_view_entry_comments', 'bx_photos', 5, 2147483647, 1, 'view-photo-comments', '', '', '', '', 0, 1, 0, 'BxPhotosPageEntry', 'modules/boonex/photos/classes/BxPhotosPageEntry.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_photos_view_entry_comments', 1, 'bx_photos', '_bx_photos_page_block_title_entry_comments', '_bx_photos_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";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_photos_popular', '_bx_photos_page_title_sys_entries_popular', '_bx_photos_page_title_entries_popular', 'bx_photos', 5, 2147483647, 1, 'photos-popular', 'page.php?i=photos-popular', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_photos_popular', 1, 'bx_photos', '_bx_photos_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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_photos_updated', '_bx_photos_page_title_sys_entries_updated', '_bx_photos_page_title_entries_updated', 'bx_photos', 5, 2147483647, 1, 'photos-updated', 'page.php?i=photos-updated', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_photos_updated', 1, 'bx_photos', '_bx_photos_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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_photos_author', 'photos-author', '_bx_photos_page_title_sys_entries_of_author', '_bx_photos_page_title_entries_of_author', 'bx_photos', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxPhotosPageAuthor', 'modules/boonex/photos/classes/BxPhotosPageAuthor.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_photos_author', 1, 'bx_photos', '', '_bx_photos_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 1),
+('bx_photos_author', 1, 'bx_photos', '_bx_photos_page_block_title_sys_favorites_of_author', '_bx_photos_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"browse_favorite";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_photos_author', 1, 'bx_photos', '_bx_photos_page_block_title_sys_entries_of_author', '_bx_photos_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"browse_author";}', 0, 0, 1, 3);
+
+-- 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_photos_home', 'photos-home', '_bx_photos_page_title_sys_home', '_bx_photos_page_title_home', 'bx_photos', 2, 2147483647, 1, 'page.php?i=photos-home', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.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_photos_home', 1, 'bx_photos', '', '_bx_photos_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_photos_home', 1, 'bx_photos', '', '_bx_photos_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 1),
+('bx_photos_home', 2, 'bx_photos', '', '_bx_photos_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:9:"bx_photos";i:1;s:9:"bx_photos";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, 0),
+('bx_photos_home', 2, 'bx_photos', '', '_bx_photos_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:14:"bx_photos_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_photos_search', '_bx_photos_page_title_sys_entries_search', '_bx_photos_page_title_entries_search', 'bx_photos', 5, 2147483647, 1, 'photos-search', 'page.php?i=photos-search', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_photos_search', 1, 'bx_photos', '_bx_photos_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:9:"bx_photos";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
+('bx_photos_search', 1, 'bx_photos', '_bx_photos_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:9:"bx_photos";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 2),
+('bx_photos_search', 1, 'bx_photos', '_bx_photos_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:14:"bx_photos_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 3),
+('bx_photos_search', 1, 'bx_photos', '_bx_photos_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:14:"bx_photos_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_photos_manage', '_bx_photos_page_title_sys_manage', '_bx_photos_page_title_manage', 'bx_photos', 5, 2147483647, 1, 'photos-manage', 'page.php?i=photos-manage', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.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_photos_manage', 1, 'bx_photos', '_bx_photos_page_block_title_system_manage', '_bx_photos_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_photos";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_photos_administration', '_bx_photos_page_title_sys_manage_administration', '_bx_photos_page_title_manage', 'bx_photos', 5, 192, 1, 'photos-administration', 'page.php?i=photos-administration', '', '', '', 0, 1, 0, 'BxPhotosPageBrowse', 'modules/boonex/photos/classes/BxPhotosPageBrowse.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_photos_administration', 1, 'bx_photos', '_bx_photos_page_block_title_system_manage_administration', '_bx_photos_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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_photos', '_bx_photos_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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_photos', '_bx_photos_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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:26:"bx_photos_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`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('', 0, 'bx_photos', '_bx_photos_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:4:"gallery";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 1),
+('', 0, 'bx_photos', '_bx_photos_page_block_title_recent_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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_photos', '_bx_photos_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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_photos', '_bx_photos_page_block_title_popular_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";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_photos', '_bx_photos_page_block_title_featured_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:7:"gallery";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 5),
+('', 0, 'bx_photos', '_bx_photos_page_block_title_featured_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_photos";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 6);
+
+
+-- 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_photos', 'photos-home', '_bx_photos_menu_item_title_system_entries_home', '_bx_photos_menu_item_title_entries_home', 'page.php?i=photos-home', '', '', 'camera-retro col-blue1', 'bx_photos_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_photos', 'photos-home', '_bx_photos_menu_item_title_system_entries_home', '_bx_photos_menu_item_title_entries_home', 'page.php?i=photos-home', '', '', 'camera-retro col-blue1', 'bx_photos_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_photos', 'create-photo', '_bx_photos_menu_item_title_system_create_entry', '_bx_photos_menu_item_title_create_entry', 'page.php?i=create-photo', '', '', 'camera-retro col-blue1', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+-- MENU: actions menu for view entry 
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_photos_view', '_bx_photos_menu_title_view_entry', 'bx_photos_view', 'bx_photos', 9, 0, 1, 'BxPhotosMenuView', 'modules/boonex/photos/classes/BxPhotosMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_photos_view', 'bx_photos', '_bx_photos_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_photos_view', 'bx_photos', 'edit-photo', '_bx_photos_menu_item_title_system_edit_entry', '_bx_photos_menu_item_title_edit_entry', 'page.php?i=edit-photo&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
+('bx_photos_view', 'bx_photos', 'delete-photo', '_bx_photos_menu_item_title_system_delete_entry', '_bx_photos_menu_item_title_delete_entry', 'page.php?i=delete-photo&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2);
+
+-- MENU: actions menu for my entries
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_photos_my', '_bx_photos_menu_title_entries_my', 'bx_photos_my', 'bx_photos', 9, 0, 1, 'BxPhotosMenu', 'modules/boonex/photos/classes/BxPhotosMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_photos_my', 'bx_photos', '_bx_photos_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_photos_my', 'bx_photos', 'create-photo', '_bx_photos_menu_item_title_system_create_entry', '_bx_photos_menu_item_title_create_entry', 'page.php?i=create-photo', '', '', '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_photos_submenu', '_bx_photos_menu_title_submenu', 'bx_photos_submenu', 'bx_photos', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_photos_submenu', 'bx_photos', '_bx_photos_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_photos_submenu', 'bx_photos', 'photos-home', '_bx_photos_menu_item_title_system_entries_public', '_bx_photos_menu_item_title_entries_public', 'page.php?i=photos-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_photos_submenu', 'bx_photos', 'photos-popular', '_bx_photos_menu_item_title_system_entries_popular', '_bx_photos_menu_item_title_entries_popular', 'page.php?i=photos-popular', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_photos_submenu', 'bx_photos', 'photos-search', '_bx_photos_menu_item_title_system_entries_search', '_bx_photos_menu_item_title_entries_search', 'page.php?i=photos-search', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_photos_submenu', 'bx_photos', 'photos-manage', '_bx_photos_menu_item_title_system_entries_manage', '_bx_photos_menu_item_title_entries_manage', 'page.php?i=photos-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_photos_view_submenu', '_bx_photos_menu_title_view_entry_submenu', 'bx_photos_view_submenu', 'bx_photos', 8, 0, 1, 'BxPhotosMenuView', 'modules/boonex/photos/classes/BxPhotosMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_photos_view_submenu', 'bx_photos', '_bx_photos_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_photos_view_submenu', 'bx_photos', 'view-photo', '_bx_photos_menu_item_title_system_view_entry', '_bx_photos_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-photo&id={content_id}', '', '', '', '', 2147483647, 0, 0, 1),
+('bx_photos_view_submenu', 'bx_photos', 'view-photo-comments', '_bx_photos_menu_item_title_system_view_entry_comments', '_bx_photos_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-photo-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_photos_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_photos_snippet_meta', 'bx_photos', 15, 0, 1, 'BxPhotosMenuSnippetMeta', 'modules/boonex/photos/classes/BxPhotosMenuSnippetMeta.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_photos_snippet_meta', 'bx_photos', '_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_photos_snippet_meta', 'bx_photos', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
+('bx_photos_snippet_meta', 'bx_photos', 'rating', '_sys_menu_item_title_system_sm_rating', '_sys_menu_item_title_sm_rating', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
+('bx_photos_snippet_meta', 'bx_photos', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 3),
+('bx_photos_snippet_meta', 'bx_photos', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
+('bx_photos_snippet_meta', 'bx_photos', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
+('bx_photos_snippet_meta', 'bx_photos', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 6),
+('bx_photos_snippet_meta', 'bx_photos', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 7);
+
+-- 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_photos', 'profile-stats-manage-photos', '_bx_photos_menu_item_title_system_manage_my_photos', '_bx_photos_menu_item_title_manage_my_photos', 'page.php?i=photos-manage', '', '_self', 'camera-retro col-blue1', 'a:2:{s:6:"module";s:9:"bx_photos";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_photos_menu_manage_tools', '_bx_photos_menu_title_manage_tools', 'bx_photos_menu_manage_tools', 'bx_photos', 6, 0, 1, 'BxPhotosMenuManageTools', 'modules/boonex/photos/classes/BxPhotosMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_photos_menu_manage_tools', 'bx_photos', '_bx_photos_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_photos_menu_manage_tools', 'bx_photos', 'delete-with-content', '_bx_photos_menu_item_title_system_delete_with_content', '_bx_photos_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 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_photos', 'photos-administration', '_bx_photos_menu_item_title_system_admt_photos', '_bx_photos_menu_item_title_admt_photos', 'page.php?i=photos-administration', '', '_self', '', 'a:2:{s:6:"module";s:9:"bx_photos";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_photos', 'photos-author', '_bx_photos_menu_item_title_system_view_entries_author', '_bx_photos_menu_item_title_view_entries_author', 'page.php?i=photos-author&profile_id={profile_id}', '', '', 'camera-retro col-blue1', '', 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_photos_allow_view_to', 'bx_photos', 'view', '_bx_photos_form_entry_input_allow_view_to', '3', 'bx_photos_entries', 'id', 'author', '', '');
+
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_photos', 'create entry', NULL, '_bx_photos_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_photos', 'delete entry', NULL, '_bx_photos_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_photos', 'view entry', NULL, '_bx_photos_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_photos', 'set thumb', NULL, '_bx_photos_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_photos', 'edit any entry', NULL, '_bx_photos_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_photos', '_bx_photos', @iSearchOrder + 1, 'BxPhotosSearchResult', 'modules/boonex/photos/classes/BxPhotosSearchResult.php'),
+('bx_photos_cmts', '_bx_photos_cmts', @iSearchOrder + 2, 'BxPhotosCmtsSearchResult', 'modules/boonex/photos/classes/BxPhotosCmtsSearchResult.php');
+
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_photos', 'bx_photos_meta_keywords', 'bx_photos_meta_locations', '', '', '');
+
+
+-- 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_photos_cats', 'bx_photos', 'bx_photos', 'bx_photos_cats', 'bx_photos_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_photos_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_photos', 'bx_photos', '_bx_photos', 'page.php?i=photos-home', 'camera-retro col-blue1', 'SELECT COUNT(*) FROM `bx_photos_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_photos_growth', '_bx_photos_chart_growth', 'bx_photos_entries', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
+('bx_photos_growth_speed', '_bx_photos_chart_growth_speed', 'bx_photos_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_photos_administration', 'Sql', 'SELECT * FROM `bx_photos_entries` WHERE 1 ', 'bx_photos_entries', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 192, 'BxPhotosGridAdministration', 'modules/boonex/photos/classes/BxPhotosGridAdministration.php'),
+('bx_photos_common', 'Sql', 'SELECT * FROM `bx_photos_entries` WHERE 1 ', 'bx_photos_entries', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 2147483647, 'BxPhotosGridCommon', 'modules/boonex/photos/classes/BxPhotosGridCommon.php');
+
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_photos_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_photos_administration', 'switcher', '_bx_photos_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_photos_administration', 'title', '_bx_photos_grid_column_title_adm_title', '25%', 0, '25', '', 3),
+('bx_photos_administration', 'added', '_bx_photos_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_photos_administration', 'author', '_bx_photos_grid_column_title_adm_author', '25%', 0, '25', '', 5),
+('bx_photos_administration', 'actions', '', '20%', 0, '', '', 6),
+('bx_photos_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_photos_common', 'switcher', '_bx_photos_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_photos_common', 'title', '_bx_photos_grid_column_title_adm_title', '40%', 0, '35', '', 3),
+('bx_photos_common', 'added', '_bx_photos_grid_column_title_adm_added', '30%', 1, '25', '', 4),
+('bx_photos_common', 'actions', '', '20%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_photos_administration', 'bulk', 'delete', '_bx_photos_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_photos_administration', 'single', 'edit', '_bx_photos_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_photos_administration', 'single', 'delete', '_bx_photos_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_photos_administration', 'single', 'settings', '_bx_photos_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
+('bx_photos_common', 'bulk', 'delete', '_bx_photos_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_photos_common', 'single', 'edit', '_bx_photos_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_photos_common', 'single', 'delete', '_bx_photos_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_photos_common', 'single', 'settings', '_bx_photos_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_photos_simple', 1, 'BxPhotosUploaderSimple', 'modules/boonex/photos/classes/BxPhotosUploaderSimple.php'),
+('bx_photos_html5', 1, 'BxPhotosUploaderHTML5', 'modules/boonex/photos/classes/BxPhotosUploaderHTML5.php');
+
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_photos', 'BxPhotosAlertsResponse', 'modules/boonex/photos/classes/BxPhotosAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('profile', 'delete', @iHandler);

+ 316 - 0
modules/boonex/photos/install/sql/install.sql

@@ -0,0 +1,316 @@
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+
+-- TABLE: entries
+CREATE TABLE IF NOT EXISTS `bx_photos_entries` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL default '0',
+  `added` int(11) NOT NULL default '0',
+  `changed` int(11) NOT NULL default '0',
+  `thumb` int(11) NOT NULL default '0',
+  `title` varchar(255) NOT NULL,
+  `cat` int(11) NOT NULL,
+  `text` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `srate` float NOT NULL default '0',
+  `svotes` 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',
+  `status` enum('active','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_photos_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_photos_media_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_photos_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: votes
+CREATE TABLE IF NOT EXISTS `bx_photos_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_photos_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`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_photos_svotes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_photos_svotes_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`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: views
+CREATE TABLE `bx_photos_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: metas
+CREATE TABLE `bx_photos_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `bx_photos_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))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: reports
+CREATE TABLE IF NOT EXISTS `bx_photos_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_photos_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`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: favorites
+CREATE TABLE `bx_photos_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`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+-- STORAGES & TRANSCODERS
+INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
+('bx_photos_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_photos_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+('bx_photos_media_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_photos_media_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);
+
+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_photos_preview', 'bx_photos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_photos_photos";}', 'no', 1, 2592000, 0, '', ''),
+('bx_photos_gallery', 'bx_photos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_photos_photos";}', 'no', 1, 2592000, 0, '', ''),
+('bx_photos_cover', 'bx_photos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_photos_photos";}', 'no', 1, 2592000, 0, '', '');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_photos_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_photos_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
+('bx_photos_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0');
+
+
+-- FORMS
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_photos', 'bx_photos', '_bx_photos_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_photos_entries', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxPhotosFormEntry', 'modules/boonex/photos/classes/BxPhotosFormEntry.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_photos', 'bx_photos_entry_add', 'bx_photos', 0, '_bx_photos_form_entry_display_add'),
+('bx_photos', 'bx_photos_entry_delete', 'bx_photos', 0, '_bx_photos_form_entry_display_delete'),
+('bx_photos', 'bx_photos_entry_edit', 'bx_photos', 0, '_bx_photos_form_entry_display_edit'),
+('bx_photos', 'bx_photos_entry_view', 'bx_photos', 1, '_bx_photos_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_photos', 'bx_photos', 'allow_view_to', '', '', 0, 'custom', '_bx_photos_form_entry_input_sys_allow_view_to', '_bx_photos_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_photos', 'bx_photos', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_photos_form_entry_input_sys_delete_confirm', '_bx_photos_form_entry_input_delete_confirm', '_bx_photos_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_photos_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_photos', 'bx_photos', 'do_publish', '_bx_photos_form_entry_input_do_publish', '', 0, 'submit', '_bx_photos_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_photos', 'bx_photos', 'do_submit', '_bx_photos_form_entry_input_do_submit', '', 0, 'submit', '_bx_photos_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_photos', 'bx_photos', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_photos', 'bx_photos', 'pictures', 'a:1:{i:0;s:15:"bx_photos_html5";}', 'a:2:{s:16:"bx_photos_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_photos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_photos_form_entry_input_sys_pictures', '_bx_photos_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_photos', 'bx_photos', 'text', '', '', 0, 'textarea', '_bx_photos_form_entry_input_sys_text', '_bx_photos_form_entry_input_text', '', 0, 0, 3, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
+('bx_photos', 'bx_photos', 'title', '', '', 0, 'text', '_bx_photos_form_entry_input_sys_title', '_bx_photos_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_photos_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_photos', 'bx_photos', 'cat', '', '#!bx_photos_cats', 0, 'select', '_bx_photos_form_entry_input_sys_cat', '_bx_photos_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_photos_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_photos', 'bx_photos', 'added', '', '', 0, 'datetime', '_bx_photos_form_entry_input_sys_date_added', '_bx_photos_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_photos', 'bx_photos', 'changed', '', '', 0, 'datetime', '_bx_photos_form_entry_input_sys_date_changed', '_bx_photos_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_photos_entry_add', 'title', 2147483647, 1, 1),
+('bx_photos_entry_add', 'cat', 2147483647, 1, 2),
+('bx_photos_entry_add', 'text', 2147483647, 1, 3),
+('bx_photos_entry_add', 'pictures', 2147483647, 1, 4),
+('bx_photos_entry_add', 'allow_view_to', 2147483647, 1, 5),
+('bx_photos_entry_add', 'location', 2147483647, 1, 6),
+('bx_photos_entry_add', 'do_publish', 2147483647, 1, 7),
+
+('bx_photos_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_photos_entry_delete', 'do_submit', 2147483647, 1, 2),
+
+('bx_photos_entry_edit', 'title', 2147483647, 1, 1),
+('bx_photos_entry_edit', 'cat', 2147483647, 1, 2),
+('bx_photos_entry_edit', 'text', 2147483647, 1, 3),
+('bx_photos_entry_edit', 'pictures', 2147483647, 1, 4),
+('bx_photos_entry_edit', 'allow_view_to', 2147483647, 1, 5),
+('bx_photos_entry_edit', 'location', 2147483647, 1, 6),
+('bx_photos_entry_edit', 'do_submit', 2147483647, 1, 7),
+
+('bx_photos_entry_view', 'cat', 2147483647, 1, 2),
+('bx_photos_entry_view', 'added', 2147483647, 1, 3),
+('bx_photos_entry_view', 'changed', 2147483647, 1, 4);
+
+
+-- PRE-VALUES
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_photos_cats', '_bx_photos_pre_lists_cats', 'bx_photos', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_photos_cats', '', 0, '_sys_please_select', ''),
+('bx_photos_cats', '1', 1, '_bx_photos_cat_animals_and_pets', ''),
+('bx_photos_cats', '2', 2, '_bx_photos_cat_education', ''),
+('bx_photos_cats', '3', 3, '_bx_photos_cat_entertainment', ''),
+('bx_photos_cats', '4', 4, '_bx_photos_cat_film_and_animation', ''),
+('bx_photos_cats', '5', 5, '_bx_photos_cat_music', ''),
+('bx_photos_cats', '6', 6, '_bx_photos_cat_news', ''),
+('bx_photos_cats', '7', 7, '_bx_photos_cat_people_and_blogs', ''),
+('bx_photos_cats', '8', 8, '_bx_photos_cat_sports', ''),
+('bx_photos_cats', '9', 9, '_bx_photos_cat_travel', '');
+
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_photos', 'bx_photos', 'bx_photos_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-photo&id={object_id}', '', 'bx_photos_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_photos', 'bx_photos_votes', 'bx_photos_votes_track', '604800', '1', '1', '0', '1', 'bx_photos_entries', 'id', 'author', 'rate', 'votes', '', ''),
+('bx_photos_stars', 'bx_photos_svotes', 'bx_photos_svotes_track', '604800', '1', '5', '0', '1', 'bx_photos_entries', 'id', 'author', 'srate', 'svotes', '', '');
+
+
+-- 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_photos', 'bx_photos_reports', 'bx_photos_reports_track', '1', 'page.php?i=view-photo&id={object_id}', 'bx_photos_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_photos', 'bx_photos_views_track', '86400', '1', 'bx_photos_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_photos', 'bx_photos_favorites_track', '1', '1', '1', 'page.php?i=view-photo&id={object_id}', 'bx_photos_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_photos', '1', '1', 'page.php?i=view-photo&id={object_id}', 'bx_photos_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_photos', '_bx_photos', 'bx_photos', 'added', 'edited', 'deleted', '', ''),
+('bx_photos_cmts', '_bx_photos_cmts', 'bx_photos', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
+
+INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
+('bx_photos', 'bx_photos_administration', 'id', '', ''),
+('bx_photos', 'bx_photos_common', 'id', '', '');
+
+
+-- SEARCH EXTENDED
+INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
+('bx_photos', 'bx_photos', 'bx_photos', '_bx_photos_search_extended', 1, '', ''),
+('bx_photos_cmts', 'bx_photos_cmts', 'bx_photos', '_bx_photos_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
+
+
+-- STUDIO: page & widget
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_photos', '_bx_photos', '_bx_photos', 'bx_photos@modules/boonex/photos/|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_photos', '{url_studio}module.php?name=bx_photos', '', 'bx_photos@modules/boonex/photos/|std-icon.svg', '_bx_photos', '', '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));

+ 65 - 0
modules/boonex/photos/install/sql/uninstall.sql

@@ -0,0 +1,65 @@
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_photos_entries`, `bx_photos_photos`, `bx_photos_media_resized`, `bx_photos_cmts`, `bx_photos_votes`, `bx_photos_votes_track`, `bx_photos_svotes`, `bx_photos_svotes_track`, `bx_photos_views_track`, `bx_photos_meta_keywords`, `bx_photos_meta_locations`, `bx_photos_reports`, `bx_photos_reports_track`, `bx_photos_favorites_track`;
+
+
+-- STORAGES & TRANSCODERS
+DELETE FROM `sys_objects_storage` WHERE `object` IN ('bx_photos_photos', 'bx_photos_media_resized');
+DELETE FROM `sys_storage_tokens` WHERE `object` IN ('bx_photos_photos', 'bx_photos_media_resized');
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_photos_preview', 'bx_photos_gallery', 'bx_photos_cover');
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_photos_preview', 'bx_photos_gallery', 'bx_photos_cover');
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_photos_preview', 'bx_photos_gallery', 'bx_photos_cover');
+
+
+-- FORMS
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_photos';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_photos';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_photos';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN ('bx_photos_entry_add', 'bx_photos_entry_edit', 'bx_photos_entry_view', 'bx_photos_entry_delete');
+
+
+-- PRE-VALUES
+DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_photos';
+
+DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_photos_cats');
+
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_photos';
+
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_photos', 'bx_photos_stars');
+
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_photos';
+
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_photos';
+
+
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_photos';
+
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_photos';
+
+
+-- CONTENT INFO
+DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_photos', 'bx_photos_cmts');
+
+DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_photos');
+
+
+-- SEARCH EXTENDED
+DELETE FROM `sys_objects_search_extended` WHERE `module` = 'bx_photos';
+
+
+-- 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_photos';

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

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxPhotosManageTools(oOptions) {
+	this._iSearchTimeoutId = false;
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxPhotosManageTools' : 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;
+}
+
+BxPhotosManageTools.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);
+};
+
+BxPhotosManageTools.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')
+	});
+};
+
+BxPhotosManageTools.prototype.onClickDelete = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+/** @} */

+ 18 - 0
modules/boonex/photos/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    Photos Photos
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 1 - 0
modules/boonex/photos/template/attachments.html

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

+ 1 - 0
modules/boonex/photos/template/author.html

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

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

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

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

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

+ 28 - 0
modules/boonex/photos/template/css/main.css

@@ -0,0 +1,28 @@
+@import url(../../../../base/text/template/css/main.css);
+
+
+/*--- Cover Section ---*/
+.bx_photos_cover .bx-cover-title {
+    margin-top:9rem;
+}
+
+
+/*--- Photo Block  ---*/
+.bx-photos-entity-photo img {
+    max-width:100%;
+}
+
+
+/*--- Snippet ---*/
+.bx-base-text-unit-gallery .bx-base-text-unit-no-thumb,
+.bx-base-text-unit-gallery .bx-base-text-unit-thumb {
+	position: relative;
+}
+
+.bx-photo-unit-duration {
+	position: absolute;
+	right: 10px;
+    bottom: 10px;
+
+	background-color: rgba(255, 255, 255, 0.9);
+}

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

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

+ 1 - 0
modules/boonex/photos/template/entry-all-actions.html

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

+ 1 - 0
modules/boonex/photos/template/entry-location.html

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

+ 1 - 0
modules/boonex/photos/template/entry-photo.html

@@ -0,0 +1 @@
+<div class="bx-photos-entity-photo  bx-def-font-align-center"><img src="__src__" title="__title_attr__" /></div>

+ 1 - 0
modules/boonex/photos/template/entry-rating.html

@@ -0,0 +1 @@
+<div class="bx-photos-entity-rating">__content__</div>

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

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

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

@@ -0,0 +1 @@
+<div class="bx-base-text-entity-content bx-def-constraint-list bx-def-constraint-pre bx-def-constraint-object bx-def-constraint-iframe bx-def-constraint-img">__entry_text__</div>

+ 30 - 0
modules/boonex/photos/template/form_ghost_template.html

@@ -0,0 +1,30 @@
+<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>
+
+        <bx_if:set_thumb>
+            <input type="hidden" name="__name_thumb__[]" value="{file_id}" />
+        </bx_if:set_thumb>
+    </span>
+</div>
+<script>
+    if ('object' == typeof(tinymce))
+        $('#bx-base-general-intert-to-post-link-{file_id}').show();
+
+    $('#bx-uploader-file-{storage_object}-{file_id} .bx-base-general-use-as-thumb input[value="__thumb_id__"]').attr('checked', true);
+
+    // 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>

+ 42 - 0
modules/boonex/photos/template/images/icons/std-icon.svg

@@ -0,0 +1,42 @@
+<?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>
+<g id="Слой_1_1_">
+	<title>Group 2 Copy 4</title>
+	<desc>Created with Sketch.</desc>
+	<g id="Page-1">
+		<g id="Group-2-Copy-4">
+			<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="707.32" y1="365.18" x2="707.32" y2="364.18" gradientTransform="matrix(600 0 0 -600 -424092 219108)">
+				<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>
+	<g>
+		<path class="st2" d="M486.9,139.2c-5.4-5.5-12-8.3-19.7-8.3H132.8c-7.7,0-14.3,2.8-19.7,8.3c-5.4,5.5-8.2,12.1-8.2,19.9v281.7
+			c0,7.8,2.7,14.4,8.2,19.9c5.4,5.5,12,8.3,19.7,8.3h334.4c7.7,0,14.3-2.8,19.7-8.3c5.4-5.5,8.2-12.1,8.2-19.9V159.1
+			C495.1,151.3,492.4,144.7,486.9,139.2z M160.6,145h83.6v28.2h-83.6V145z M467.2,440.8H132.8v-28.2h334.5L467.2,440.8L467.2,440.8z
+			 M216.4,314.5c0-23.3,8.2-43.3,24.5-59.8c16.3-16.5,36-24.8,59.1-24.8c23.1,0,42.8,8.3,59.1,24.8c16.3,16.5,24.5,36.4,24.5,59.8
+			c0,23.3-8.2,43.3-24.5,59.8c-16.3,16.5-36,24.8-59.1,24.8c-23.1,0-42.8-8.3-59.1-24.8C224.6,357.7,216.4,337.8,216.4,314.5z
+			 M467.2,189.5v26H132.8v-28.2H273l13.9-28.2h180.3V189.5L467.2,189.5z"/>
+		<path class="st2" d="M339.4,354.3c10.9-11,16.3-24.3,16.3-39.8c0-15.6-5.4-28.8-16.3-39.8c-10.9-11-24-16.5-39.4-16.5
+			c-15.4,0-28.5,5.5-39.4,16.5c-10.9,11-16.3,24.3-16.3,39.8c0,15.6,5.4,28.8,16.3,39.8c10.9,11,24,16.5,39.4,16.5
+			C315.4,370.8,328.5,365.3,339.4,354.3z M285.2,299.1c-4.1,4.1-6.1,9.1-6.1,15c0,2.1-0.7,3.7-2,5.1c-1.3,1.3-3,2-5,2
+			c-2,0-3.7-0.7-5-2c-1.3-1.3-2-3-2-5.1c0-9.7,3.4-18,10.2-24.9c6.8-6.9,15-10.3,24.6-10.3c2,0,3.7,0.7,5,2c1.3,1.3,2,3,2,5.1
+			c0,2.1-0.7,3.7-2,5.1c-1.3,1.3-3,2-5,2C294.2,292.9,289.3,295,285.2,299.1z"/>
+	</g>
+</g>
+</svg>

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

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

+ 1 - 0
modules/boonex/photos/template/unit.html

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

+ 14 - 0
modules/boonex/photos/template/unit_full.html

@@ -0,0 +1,14 @@
+<div class="bx-base-text-unit bx-base-text-unit-ext bx-def-margin-bottom">
+    <bx_if:thumb>
+        <div class="bx-base-text-unit-cover">
+            <img class="bx-base-text-unit-cover bx-def-round-corners" alt="__title__" src="__thumb_url__" />
+        </div>
+    </bx_if:thumb>
+    <h1 class="bx-base-text-unit-title bx-def-padding-sec-top"><a href="__content_url__">__title__</a></h1>
+    <div class="bx-base-text-unit-info">
+	    <bx_if:meta><div class="bx-base-general-unit-meta">__meta__</div></bx_if:meta>
+	</div>
+    <div class="bx-base-text-unit-summary bx-def-margin-sec-top bx-clearfix">
+        __text__
+    </div> 
+</div>

+ 1 - 0
modules/boonex/photos/template/unit_full_private.html

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

+ 25 - 0
modules/boonex/photos/template/unit_gallery.html

@@ -0,0 +1,25 @@
+<div class="bx-base-text-unit bx-base-text-unit-gallery bx-def-gal-unit-size bx-def-padding-sec bx-def-margin-sec-bottom">
+    <div class="bx-base-text-unit-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-box-sizing">
+        <bx_if:thumb>
+            <a href="__content_url__" title="__summary_attr__">
+                <div class="bx-base-text-unit-thumb bx-def-gal-div-size bx-def-round-corners bx-def-font-middle" style="background-image:url(__gallery_url__)">
+                    <div class="bx-base-text-unit-strecher">__strecher__</div>
+                </div>
+            </a>
+        </bx_if:thumb>
+        <bx_if:no_thumb>
+            <div class="bx-def-gal-img-column">
+                <div class="bx-base-text-unit-no-thumb bx-def-gal-div-size bx-def-font-middle bx-def-font-grayed bx-def-padding bx-def-box-sizing">
+                    __summary_plain__
+                    <div class="bx-base-text-unit-strecher">__strecher__</div>
+                </div>
+            </div>
+        </bx_if:no_thumb>
+        <div class="bx-base-text-unit-text bx-def-padding-leftright bx-def-padding-sec-topbottom bx-def-font-align-center bx-def-box-sizing">
+            <h2><a href="__content_url__">__title__</a></h2>
+            <div class="bx-base-text-unit-info bx-def-font-small">
+                <bx_if:meta><div class="bx-base-general-unit-meta">__meta__</div></bx_if:meta>
+            </div>
+        </div>
+    </div>
+</div>

+ 1 - 0
modules/boonex/photos/template/unit_gallery_private.html

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

+ 1 - 0
modules/boonex/photos/template/unit_live_search.html

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

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

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

+ 1 - 0
modules/boonex/photos/template/unit_private.html

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

+ 202 - 0
modules/boonex/russian/data/langs/bx_photos/ru.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+
+	<string name="_bx_photos"><![CDATA[Фото]]></string>
+	<string name="_bx_photos_cmts"><![CDATA[Фото - Комментарии]]></string>
+
+	<string name="_bx_photos_option_summary_chars"><![CDATA[Количество символов в автогенерируемой сводке к фото]]></string>
+	<string name="_bx_photos_option_plain_summary_chars"><![CDATA[Количество символов в описании фото при отсутствующей картинке]]></string>
+    <string name="_bx_photos_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
+    <string name="_bx_photos_option_per_page_profile"><![CDATA[Количество элементов на странице профайла]]></string>
+	<string name="_bx_photos_option_rss_num"><![CDATA[Количество элементов в ленте RSS]]></string>
+	<string name="_bx_photos_option_searchable_fields"><![CDATA[Поля для поиска по ключевому слову]]></string>
+
+	<string name="_bx_photos_form_entry"><![CDATA[Фото]]></string>
+	<string name="_bx_photos_form_entry_display_add"><![CDATA[Добавить фото]]></string>
+	<string name="_bx_photos_form_entry_display_edit"><![CDATA[Редактировать фото]]></string>
+	<string name="_bx_photos_form_entry_display_delete"><![CDATA[Удалить фото]]></string>
+	<string name="_bx_photos_form_entry_display_view"><![CDATA[Просмотреть фото]]></string>
+	<string name="_bx_photos_form_entry_input_author"><![CDATA[Автор]]></string>
+	<string name="_bx_photos_form_entry_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+	<string name="_bx_photos_form_entry_input_do_submit"><![CDATA[Выполнить]]></string>
+	<string name="_bx_photos_form_entry_input_sys_do_publish"><![CDATA[Опубликовать]]></string>
+	<string name="_bx_photos_form_entry_input_do_publish"><![CDATA[Опубликовать]]></string>
+	<string name="_bx_photos_form_entry_input_sys_title"><![CDATA[Заголовок]]></string>
+	<string name="_bx_photos_form_entry_input_title"><![CDATA[Заголовок]]></string>
+	<string name="_bx_photos_form_entry_input_title_err"><![CDATA[Заголовок обязателен. Пожалуйста, заполните это поле]]></string>
+	<string name="_bx_photos_form_entry_input_sys_cat"><![CDATA[Категория]]></string>
+	<string name="_bx_photos_form_entry_input_cat"><![CDATA[Категория]]></string>
+	<string name="_bx_photos_form_entry_input_cat_err"><![CDATA[Нужно обязательно выбрать категорию]]></string>
+    <string name="_bx_photos_form_entry_input_sys_text"><![CDATA[Текст]]></string>
+	<string name="_bx_photos_form_entry_input_text"><![CDATA[Текст]]></string>
+	<string name="_bx_photos_form_entry_input_sys_delete_confirm"><![CDATA[Удалить подтверждение]]></string>
+	<string name="_bx_photos_form_entry_input_delete_confirm"><![CDATA[Я уверен(а), что хочу удалить это фото]]></string>
+	<string name="_bx_photos_form_entry_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено]]></string>
+	<string name="_bx_photos_form_entry_input_delete_confirm_error"><![CDATA[Пожалуйста, отметьте этот флажок, если действительно хотите удалить фото]]></string>
+	<string name="_bx_photos_form_entry_input_sys_pictures"><![CDATA[Картинки]]></string>
+	<string name="_bx_photos_form_entry_input_pictures"><![CDATA[Картинки]]></string>
+    <string name="_bx_photos_form_entry_input_pictures_upload"><![CDATA[Загрузить]]></string>
+    <string name="_bx_photos_form_entry_input_sys_allow_view_to"><![CDATA[Видимость]]></string>
+    <string name="_bx_photos_form_entry_input_allow_view_to"><![CDATA[Видимость]]></string>
+    <string name="_bx_photos_form_entry_input_picture_use_as_thumb"><![CDATA[Изображение обложки]]></string>
+    <string name="_bx_photos_form_entry_input_sys_date_added"><![CDATA[Создано]]></string>
+    <string name="_bx_photos_form_entry_input_date_added"><![CDATA[Создано]]></string>
+    <string name="_bx_photos_form_entry_input_sys_date_changed"><![CDATA[Обновлено]]></string>
+    <string name="_bx_photos_form_entry_input_date_changed"><![CDATA[Обновлено]]></string>
+
+	<string name="_bx_photos_acl_action_create_entry"><![CDATA[Создать фото]]></string>
+	<string name="_bx_photos_acl_action_delete_entry"><![CDATA[Удалить фото]]></string>
+	<string name="_bx_photos_acl_action_view_entry"><![CDATA[Просмотреть фото]]></string>
+	<string name="_bx_photos_acl_action_set_thumb"><![CDATA[Назначить значок фото]]></string>
+	<string name="_bx_photos_acl_action_edit_any_entry"><![CDATA[Редактировать любое фото]]></string>
+
+	<string name="_bx_photos_page_title_sys_create_entry"><![CDATA[Новое фото]]></string>
+	<string name="_bx_photos_page_title_create_entry"><![CDATA[Новое фото]]></string>
+	<string name="_bx_photos_page_block_title_create_entry"><![CDATA[Новое фото]]></string>
+	<string name="_bx_photos_page_title_sys_edit_entry"><![CDATA[Редактировать фото]]></string>
+	<string name="_bx_photos_page_title_edit_entry"><![CDATA[Редактировать фото]]></string>
+	<string name="_bx_photos_page_block_title_edit_entry"><![CDATA[Редактировать фото]]></string>
+    <string name="_bx_photos_page_title_sys_delete_entry"><![CDATA[Удалить фото]]></string>
+    <string name="_bx_photos_page_title_delete_entry"><![CDATA[Удалить фото]]></string>
+    <string name="_bx_photos_page_block_title_delete_entry"><![CDATA[Удалить фото]]></string>
+	<string name="_bx_photos_page_title_sys_view_entry"><![CDATA[Просмотреть фото]]></string>
+	<string name="_bx_photos_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_photos_page_block_title_entry_text"><![CDATA[Текст]]></string>
+	<string name="_bx_photos_page_block_title_entry_photo"><![CDATA[Фото]]></string>
+	<string name="_bx_photos_page_title_browse"><![CDATA[Фото]]></string>
+	<string name="_bx_photos_page_title_search_results"><![CDATA[Фото, соответствующие "{0}"]]></string>
+	<string name="_bx_photos_page_title_browse_by_author"><![CDATA[Фото {display_name}]]></string>
+	<string name="_bx_photos_page_title_browse_featured"><![CDATA[Продвинутые фото]]></string>
+    <string name="_bx_photos_page_title_browse_recent"><![CDATA[Недавние фото]]></string>
+    <string name="_bx_photos_page_title_browse_popular"><![CDATA[Популярные фото]]></string>
+    <string name="_bx_photos_page_title_browse_updated"><![CDATA[Обновлённые фото]]></string>
+    <string name="_bx_photos_page_title_sys_home"><![CDATA[Фото - Домой]]></string>
+    <string name="_bx_photos_page_title_home"><![CDATA[Фото]]></string>
+    <string name="_bx_photos_page_block_title_featured_entries"><![CDATA[Продвинутые фото (Галерея)]]></string>
+    <string name="_bx_photos_page_block_title_featured_entries_view_extended"><![CDATA[Продвинутые фото]]></string>
+    <string name="_bx_photos_page_block_title_featured_entries_view_full"><![CDATA[Продвинутые фото (Полный просмотр)]]></string>
+    <string name="_bx_photos_page_block_title_recent_entries"><![CDATA[Новые фото (Галерея)]]></string>
+    <string name="_bx_photos_page_block_title_recent_entries_view_extended"><![CDATA[Новые фото]]></string>
+    <string name="_bx_photos_page_block_title_recent_entries_view_full"><![CDATA[Новые фото (Полный просмотр)]]></string>
+    <string name="_bx_photos_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
+    <string name="_bx_photos_page_block_title_entry_author"><![CDATA[Автор]]></string>
+    <string name="_bx_photos_page_block_title_entry_actions"><![CDATA[Действия]]></string>
+    <string name="_bx_photos_page_block_title_entry_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_photos_page_block_title_entry_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_photos_page_block_title_entry_location"><![CDATA[Расположение]]></string>
+    <string name="_bx_photos_page_block_title_entry_attachments"><![CDATA[Прикрепления]]></string>
+    <string name="_bx_photos_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
+    <string name="_bx_photos_page_block_title_entry_rating"><![CDATA[Рейтинг]]></string>
+    <string name="_bx_photos_page_title_sys_entries_popular"><![CDATA[Популярные фото]]></string>
+    <string name="_bx_photos_page_title_entries_popular"><![CDATA[Популярные фото]]></string>
+    <string name="_bx_photos_page_title_sys_entries_updated"><![CDATA[Обновленные фото]]></string>
+    <string name="_bx_photos_page_title_entries_updated"><![CDATA[Обновленные фото]]></string>
+    <string name="_bx_photos_page_title_sys_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_photos_page_title_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_photos_page_block_title_search_form"><![CDATA[Форма поиска]]></string>
+    <string name="_bx_photos_page_block_title_search_results"><![CDATA[Результаты поиска]]></string>
+    <string name="_bx_photos_page_block_title_search_form_cmts"><![CDATA[Форма поиска комментариев]]></string>
+    <string name="_bx_photos_page_block_title_search_results_cmts"><![CDATA[Результаты поиска комментариев]]></string>
+    <string name="_bx_photos_page_block_title_popular_entries"><![CDATA[Популярные фото]]></string>
+    <string name="_bx_photos_page_block_title_popular_entries_view_extended"><![CDATA[Популярные фото (Расширенный просмотр)]]></string>
+    <string name="_bx_photos_page_block_title_popular_entries_view_full"><![CDATA[Популярные фото (Полный просмотр)]]></string>
+    <string name="_bx_photos_page_block_title_updated_entries"><![CDATA[Обновленные фото]]></string>
+    <string name="_bx_photos_page_title_sys_view_entry_comments"><![CDATA[Комментарии к фото]]></string>
+    <string name="_bx_photos_page_title_view_entry_comments"><![CDATA[Комментарии к {title}]]></string>
+    <string name="_bx_photos_page_title_sys_entries_of_author"><![CDATA[Фото автора]]></string>
+    <string name="_bx_photos_page_title_entries_of_author"><![CDATA[{display_name} - Фото]]></string>
+    <string name="_bx_photos_page_block_title_favorites_of_author"><![CDATA[<a href="{profile_link}">{display_name}</a> - Избранное]]></string>   
+    <string name="_bx_photos_page_block_title_sys_favorites_of_author"><![CDATA[Избранное автора]]></string>
+    <string name="_bx_photos_page_block_title_entries_of_author"><![CDATA[<a href="{profile_link}">{display_name}</a> - Фото]]></string>   
+    <string name="_bx_photos_page_block_title_sys_entries_of_author"><![CDATA[Фото автора]]></string>   
+    <string name="_bx_photos_page_block_title_entries_actions"><![CDATA[Фото - Действия]]></string>
+    <string name="_bx_photos_page_block_title_browse_cmts"><![CDATA[Фото - Комментарии]]></string>
+	<string name="_bx_photos_page_title_sys_manage"><![CDATA[Управление собственными фото]]></string>
+	<string name="_bx_photos_page_title_sys_manage_administration"><![CDATA[Управление всеми фото]]></string>
+	<string name="_bx_photos_page_title_manage"><![CDATA[Управление]]></string>
+	<string name="_bx_photos_page_block_title_system_manage"><![CDATA[Управление собственными фото]]></string>
+	<string name="_bx_photos_page_block_title_system_manage_administration"><![CDATA[Управление всеми фото]]></string>
+	<string name="_bx_photos_page_block_title_manage"><![CDATA[Управление]]></string>    
+	<string name="_bx_photos_page_block_title_popular_keywords"><![CDATA[Популярные хэштеги]]></string>
+    <string name="_bx_photos_page_block_title_cats"><![CDATA[Фото категории]]></string>
+    <string name="_bx_photos_page_block_title_entry_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_photos_page_block_title_my_entries"><![CDATA[Мои фото]]></string>
+
+    <string name="_bx_photos_menu_set_title_view_entry"><![CDATA[Фото - Действия]]></string>
+    <string name="_bx_photos_menu_title_view_entry"><![CDATA[Фото - Действия]]></string>
+    <string name="_bx_photos_menu_title_submenu"><![CDATA[Фото - Подменю]]></string>
+    <string name="_bx_photos_menu_set_title_submenu"><![CDATA[Фото - Подменю]]></string>
+    <string name="_bx_photos_menu_item_title_system_create_entry"><![CDATA[Новое фото]]></string>
+    <string name="_bx_photos_menu_item_title_create_entry"><![CDATA[Новое фото]]></string>
+    <string name="_bx_photos_menu_item_title_system_edit_entry"><![CDATA[Редактировать фото]]></string>
+    <string name="_bx_photos_menu_item_title_edit_entry"><![CDATA[Редактировать фото]]></string>
+    <string name="_bx_photos_menu_item_title_system_delete_entry"><![CDATA[Удалить фото]]></string>
+    <string name="_bx_photos_menu_item_title_delete_entry"><![CDATA[Удалить фото]]></string>
+    <string name="_bx_photos_menu_item_title_system_view_entry"><![CDATA[Просмотреть фото]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_home"><![CDATA[Фото]]></string>
+    <string name="_bx_photos_menu_item_title_entries_home"><![CDATA[Фото]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_public"><![CDATA[Новые]]></string>
+    <string name="_bx_photos_menu_item_title_entries_public"><![CDATA[Новые]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_photos_menu_item_title_entries_manage"><![CDATA[Управление]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_popular"><![CDATA[Популярные]]></string>
+    <string name="_bx_photos_menu_item_title_entries_popular"><![CDATA[Популярные]]></string>
+    <string name="_bx_photos_menu_item_title_system_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_photos_menu_item_title_entries_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_photos_menu_title_view_entry_submenu"><![CDATA[Просмотреть фото - Подменю]]></string>
+    <string name="_bx_photos_menu_set_title_view_entry_submenu"><![CDATA[Просмотреть фото - Подменю]]></string>
+    <string name="_bx_photos_menu_item_title_view_entry_submenu_entry"><![CDATA[Фото]]></string>
+    <string name="_bx_photos_menu_item_title_view_entry_submenu_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_photos_menu_item_title_system_view_entry_comments"><![CDATA[Комментарии к фото]]></string>
+    <string name="_bx_photos_menu_item_title_system_view_entries_author"><![CDATA[Фото]]></string>
+    <string name="_bx_photos_menu_item_title_view_entries_author"><![CDATA[Фото]]></string>
+    <string name="_bx_photos_menu_title_entries_my"><![CDATA[Мои фото - Меню действий]]></string>
+    <string name="_bx_photos_menu_set_title_entries_my"><![CDATA[Мои фото - Меню]]></string>
+	<string name="_bx_photos_menu_item_title_system_manage_my_photos"><![CDATA[Мои фото]]></string>
+    <string name="_bx_photos_menu_item_title_manage_my_photos"><![CDATA[{addon} фото]]></string>
+    <string name="_bx_photos_menu_set_title_manage_tools"><![CDATA[Инструменты управления - Подменю]]></string>
+    <string name="_bx_photos_menu_title_manage_tools"><![CDATA[Инструменты управления - Подменю]]></string>
+    <string name="_bx_photos_menu_item_title_system_manage_account"><![CDATA[Управление аккаунтом]]></string>
+    <string name="_bx_photos_menu_item_title_manage_account"><![CDATA[Управление аккаунтом]]></string>
+	<string name="_bx_photos_menu_item_title_system_admt_photos"><![CDATA[Фото]]></string>
+	<string name="_bx_photos_menu_item_title_admt_photos"><![CDATA[Фото - {addon} спрятано]]></string>
+	<string name="_bx_photos_menu_item_title_manage_my"><![CDATA[Мои фото]]></string>
+	<string name="_bx_photos_menu_item_title_manage_all"><![CDATA[Все фото]]></string>
+
+	<string name="_bx_photos_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>
+	<string name="_bx_photos_grid_filter_item_title_adm_active"><![CDATA[Активные]]></string>
+	<string name="_bx_photos_grid_filter_item_title_adm_hidden"><![CDATA[Спрятанные]]></string>
+	<string name="_bx_photos_grid_column_title_adm_active"><![CDATA[Активные]]></string>
+    <string name="_bx_photos_grid_column_title_adm_title"><![CDATA[Заголовок]]></string>
+    <string name="_bx_photos_grid_column_title_adm_added"><![CDATA[Добавленные]]></string>
+    <string name="_bx_photos_grid_column_title_adm_author"><![CDATA[Автор]]></string>
+    <string name="_bx_photos_grid_action_title_adm_edit"><![CDATA[Редактировать]]></string>
+    <string name="_bx_photos_grid_action_title_adm_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_photos_grid_action_title_adm_more_actions"><![CDATA[Дополнительные действия]]></string>
+    <string name="_bx_photos_grid_action_err_delete"><![CDATA[Невозможно удалить выбранное(ные) фото.]]></string>
+    <string name="_bx_photos_grid_txt_account_manager"><![CDATA[Перенаправить в Управление аккаунтом.]]></string>
+
+    <string name="_bx_photos_chart_growth"><![CDATA[Фото: Развитие]]></string>
+    <string name="_bx_photos_chart_growth_speed"><![CDATA[Фото: Скорость развития]]></string>
+
+    <string name="_bx_photos_search_extended"><![CDATA[Поиск фото]]></string>
+    <string name="_bx_photos_search_extended_cmts"><![CDATA[Поиск комментариев к фото]]></string>
+
+    <string name="_bx_photos_pre_lists_cats"><![CDATA[Фото категории]]></string>
+    <string name="_bx_photos_cat_animals_and_pets"><![CDATA[Животные]]></string>
+    <string name="_bx_photos_cat_education"><![CDATA[Образование]]></string>
+    <string name="_bx_photos_cat_entertainment"><![CDATA[Развлечения]]></string>
+    <string name="_bx_photos_cat_film_and_animation"><![CDATA[Фильм и анимация]]></string>
+    <string name="_bx_photos_cat_music"><![CDATA[Музыка]]></string>
+    <string name="_bx_photos_cat_news"><![CDATA[Новости]]></string>
+    <string name="_bx_photos_cat_people_and_blogs"><![CDATA[Люди и Блоги]]></string>
+    <string name="_bx_photos_cat_sports"><![CDATA[Спорт]]></string>
+    <string name="_bx_photos_cat_travel"><![CDATA[Путешествия]]></string>
+
+    <string name="_bx_photos_txt_all_entries_by"><![CDATA[<a href="{0}">Все фото от {1} ({2})</a>]]></string>
+    <string name="_bx_photos_txt_sample_single"><![CDATA[фото]]></string>
+    <string name="_bx_photos_txt_sample_single_with_article"><![CDATA[фото]]></string>
+    <string name="_bx_photos_txt_sample_comment_single"><![CDATA[комментарий к фото]]></string>
+    <string name="_bx_photos_txt_sample_vote_single"><![CDATA[голос за фото]]></string>
+    <string name="_bx_photos_txt_n_views"><![CDATA[{0} просмотров]]></string>
+</resources>