Parcourir la source

Ticket #1630 - Changes Posts module.

AntonLV il y a 7 ans
Parent
commit
af3ac5d6e6
29 fichiers modifiés avec 788 ajouts et 261 suppressions
  1. 55 37
      modules/boonex/posts/classes/BxPostsConfig.php
  2. 36 37
      modules/boonex/posts/classes/BxPostsFormEntry.php
  3. 24 0
      modules/boonex/posts/classes/BxPostsFormPoll.php
  4. 25 0
      modules/boonex/posts/classes/BxPostsMenuAttachments.php
  5. 1 17
      modules/boonex/posts/classes/BxPostsTemplate.php
  6. 3 4
      modules/boonex/posts/classes/BxPostsUploaderHTML5.php
  7. 3 4
      modules/boonex/posts/classes/BxPostsUploaderSimple.php
  8. 22 0
      modules/boonex/posts/classes/BxPostsVotePollAnswers.php
  9. 10 4
      modules/boonex/posts/install/config.php
  10. 113 73
      modules/boonex/posts/install/langs/en.xml
  11. 2 2
      modules/boonex/posts/install/sql/disable.sql
  12. 20 1
      modules/boonex/posts/install/sql/enable.sql
  13. 135 16
      modules/boonex/posts/install/sql/install.sql
  14. 8 8
      modules/boonex/posts/install/sql/uninstall.sql
  15. 206 0
      modules/boonex/posts/js/polls.js
  16. 1 3
      modules/boonex/posts/template/css/forms.css
  17. 1 0
      modules/boonex/posts/template/css/polls.css
  18. 22 0
      modules/boonex/posts/template/form_ghost_template_video.html
  19. 1 0
      modules/boonex/posts/template/poll_answer_vc_text.html
  20. 1 0
      modules/boonex/posts/template/poll_answer_ve_block.html
  21. 1 0
      modules/boonex/posts/template/poll_form.html
  22. 1 0
      modules/boonex/posts/template/poll_form_answers.html
  23. 1 0
      modules/boonex/posts/template/poll_form_field.html
  24. 1 0
      modules/boonex/posts/template/poll_item.html
  25. 1 0
      modules/boonex/posts/template/poll_item_answers.html
  26. 1 0
      modules/boonex/posts/template/poll_item_results.html
  27. 1 0
      modules/boonex/posts/template/poll_items.html
  28. 1 0
      modules/boonex/posts/template/uploader_button_simple.html
  29. 91 55
      modules/boonex/russian/data/langs/bx_posts/ru.xml

+ 55 - 37
modules/boonex/posts/classes/BxPostsConfig.php

@@ -20,14 +20,14 @@ class BxPostsConfig extends BxBaseModTextConfig
             'delete-post' => 'checkAllowedDelete',
             'delete-post' => 'checkAllowedDelete',
         );
         );
 
 
-        $this->CNF = array (
+        $this->CNF = array_merge($this->CNF, array (
 
 
             // module icon
             // module icon
             'ICON' => 'file-alt col-red3',
             'ICON' => 'file-alt col-red3',
 
 
             // database tables
             // database tables
             'TABLE_ENTRIES' => $aModule['db_prefix'] . 'posts',
             'TABLE_ENTRIES' => $aModule['db_prefix'] . 'posts',
-        	'TABLE_ENTRIES_FULLTEXT' => 'title_text',
+            'TABLE_ENTRIES_FULLTEXT' => 'title_text',
 
 
             // database fields
             // database fields
             'FIELD_ID' => 'id',
             'FIELD_ID' => 'id',
@@ -38,15 +38,18 @@ class BxPostsConfig extends BxBaseModTextConfig
             'FIELD_TITLE' => 'title',
             'FIELD_TITLE' => 'title',
             'FIELD_TEXT' => 'text',
             'FIELD_TEXT' => 'text',
             'FIELD_TEXT_ID' => 'post-text',
             'FIELD_TEXT_ID' => 'post-text',
-        	'FIELD_CATEGORY' => 'cat',
+            'FIELD_CATEGORY' => 'cat',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
-        	'FIELD_COVER' => 'covers',
+            'FIELD_COVER' => 'covers',
             'FIELD_PHOTO' => 'pictures',
             'FIELD_PHOTO' => 'pictures',
+            'FIELD_VIDEO' => 'videos',
+            'FIELD_POLL' => 'polls',
             'FIELD_THUMB' => 'thumb',
             'FIELD_THUMB' => 'thumb',
-        	'FIELD_VIEWS' => 'views',
+            'FIELD_ATTACHMENTS' => 'attachments',
+            'FIELD_VIEWS' => 'views',
             'FIELD_COMMENTS' => 'comments',
             'FIELD_COMMENTS' => 'comments',
-	        'FIELD_STATUS' => 'status',
-        	'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_STATUS' => 'status',
+            'FIELD_STATUS_ADMIN' => 'status_admin',
             'FIELD_LOCATION_PREFIX' => 'location',
             'FIELD_LOCATION_PREFIX' => 'location',
             'FIELD_LABELS' => 'labels',
             'FIELD_LABELS' => 'labels',
             'FIELD_ANONYMOUS' => 'anonymous',
             'FIELD_ANONYMOUS' => 'anonymous',
@@ -57,38 +60,45 @@ class BxPostsConfig extends BxBaseModTextConfig
             'URI_AUTHOR_ENTRIES' => 'posts-author',
             'URI_AUTHOR_ENTRIES' => 'posts-author',
             'URI_ENTRIES_BY_CONTEXT' => 'posts-context',
             'URI_ENTRIES_BY_CONTEXT' => 'posts-context',
             'URI_ADD_ENTRY' => 'create-post',
             'URI_ADD_ENTRY' => 'create-post',
-        	'URI_EDIT_ENTRY' => 'edit-post',
-        	'URI_MANAGE_COMMON' => 'posts-manage',
+            'URI_EDIT_ENTRY' => 'edit-post',
+            'URI_MANAGE_COMMON' => 'posts-manage',
 
 
             'URL_HOME' => 'page.php?i=posts-home',
             'URL_HOME' => 'page.php?i=posts-home',
             'URL_POPULAR' => 'page.php?i=posts-popular',
             'URL_POPULAR' => 'page.php?i=posts-popular',
             'URL_UPDATED' => 'page.php?i=posts-updated',
             'URL_UPDATED' => 'page.php?i=posts-updated',
-        	'URL_MANAGE_COMMON' => 'page.php?i=posts-manage',
-        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=posts-administration',
+            'URL_MANAGE_COMMON' => 'page.php?i=posts-manage',
+            'URL_MANAGE_ADMINISTRATION' => 'page.php?i=posts-administration',
 
 
             // some params
             // some params
             'PARAM_CHARS_SUMMARY' => 'bx_posts_summary_chars',
             'PARAM_CHARS_SUMMARY' => 'bx_posts_summary_chars',
             'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_posts_plain_summary_chars',
             'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_posts_plain_summary_chars',
             'PARAM_NUM_RSS' => 'bx_posts_rss_num',
             'PARAM_NUM_RSS' => 'bx_posts_rss_num',
-        	'PARAM_SEARCHABLE_FIELDS' => 'bx_posts_searchable_fields',
+            'PARAM_SEARCHABLE_FIELDS' => 'bx_posts_searchable_fields',
             'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_posts_per_page_browse_showcase',
             'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_posts_per_page_browse_showcase',
             'PARAM_LABELS' => 'bx_posts_labels',
             'PARAM_LABELS' => 'bx_posts_labels',
             
             
 
 
             // objects
             // objects
             'OBJECT_STORAGE' => 'bx_posts_files',
             'OBJECT_STORAGE' => 'bx_posts_files',
-			'OBJECT_STORAGE_PHOTOS' => 'bx_posts_photos',
-        	'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_posts_preview',
-			'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_posts_gallery',
-			'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_posts_cover',
-			'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => 'bx_posts_preview_photos',
-			'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => 'bx_posts_gallery_photos',
-            'OBJECT_VIDEOS_TRANSCODERS' => array(),
-        	'OBJECT_REPORTS' => 'bx_posts',
+            'OBJECT_STORAGE_PHOTOS' => 'bx_posts_photos',
+            'OBJECT_STORAGE_VIDEOS' => 'bx_posts_videos',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_posts_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_posts_gallery',
+            'OBJECT_IMAGES_TRANSCODER_COVER' => 'bx_posts_cover',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS' => 'bx_posts_preview_photos',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY_PHOTOS' => 'bx_posts_gallery_photos',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(
+                'poster' => 'bx_posts_videos_poster', 
+            	'poster_preview' => 'bx_posts_videos_poster_preview',
+            	'mp4' => 'bx_posts_videos_mp4', 
+            	'webm' => 'bx_posts_videos_webm'
+            ),
+            'OBJECT_VIDEO_TRANSCODER_HEIGHT' => '480px',
+            'OBJECT_REPORTS' => 'bx_posts',
             'OBJECT_VIEWS' => 'bx_posts',
             'OBJECT_VIEWS' => 'bx_posts',
             'OBJECT_VOTES' => 'bx_posts',
             'OBJECT_VOTES' => 'bx_posts',
-        	'OBJECT_SCORES' => 'bx_posts',
-        	'OBJECT_FAVORITES' => 'bx_posts',
+            'OBJECT_SCORES' => 'bx_posts',
+            'OBJECT_FAVORITES' => 'bx_posts',
             'OBJECT_FEATURED' => 'bx_posts',
             'OBJECT_FEATURED' => 'bx_posts',
             'OBJECT_METATAGS' => 'bx_posts',
             'OBJECT_METATAGS' => 'bx_posts',
             'OBJECT_COMMENTS' => 'bx_posts',
             'OBJECT_COMMENTS' => 'bx_posts',
@@ -99,6 +109,9 @@ class BxPostsConfig extends BxBaseModTextConfig
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_posts_entry_add',
             'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_posts_entry_add',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_posts_entry_edit',
             'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_posts_entry_edit',
             'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_posts_entry_delete',
             'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_posts_entry_delete',
+            'OBJECT_FORM_POLL' => 'bx_posts_poll',
+            'OBJECT_FORM_POLL_DISPLAY_ADD' => 'bx_posts_poll_add',
+            'OBJECT_MENU_ENTRY_ATTACHMENTS' => 'bx_posts_entry_attachments', // attachments menu in create/edit forms
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_posts_view', // actions menu on view entry page
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_posts_view', // actions menu on view entry page
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_posts_view_actions', // all actions menu on view entry page
             'OBJECT_MENU_ACTIONS_VIEW_ENTRY_ALL' => 'bx_posts_view_actions', // all actions menu on view entry page
             'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_posts_my', // actions menu on my entries page
             'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_posts_my', // actions menu on my entries page
@@ -108,8 +121,8 @@ class BxPostsConfig extends BxBaseModTextConfig
             'OBJECT_MENU_SNIPPET_META' => 'bx_posts_snippet_meta', // menu for snippet meta info
             'OBJECT_MENU_SNIPPET_META' => 'bx_posts_snippet_meta', // menu for snippet meta info
             'OBJECT_MENU_MANAGE_TOOLS' => 'bx_posts_menu_manage_tools', //manage menu in content administration tools
             'OBJECT_MENU_MANAGE_TOOLS' => 'bx_posts_menu_manage_tools', //manage menu in content administration tools
             'OBJECT_GRID_ADMINISTRATION' => 'bx_posts_administration',
             'OBJECT_GRID_ADMINISTRATION' => 'bx_posts_administration',
-        	'OBJECT_GRID_COMMON' => 'bx_posts_common',
-            'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
+            'OBJECT_GRID_COMMON' => 'bx_posts_common',
+            'OBJECT_UPLOADERS' => array('bx_posts_simple', 'bx_posts_html5'),
 
 
             // menu items which visibility depends on custom visibility checking
             // menu items which visibility depends on custom visibility checking
             'MENU_ITEM_TO_METHOD' => array (
             'MENU_ITEM_TO_METHOD' => array (
@@ -128,7 +141,7 @@ class BxPostsConfig extends BxBaseModTextConfig
                 'form_field_author' => '_bx_posts_form_entry_input_author',
                 'form_field_author' => '_bx_posts_form_entry_input_author',
             	'grid_action_err_delete' => '_bx_posts_grid_action_err_delete',
             	'grid_action_err_delete' => '_bx_posts_grid_action_err_delete',
             	'grid_txt_account_manager' => '_bx_posts_grid_txt_account_manager',
             	'grid_txt_account_manager' => '_bx_posts_grid_txt_account_manager',
-				'filter_item_active' => '_bx_posts_grid_filter_item_title_adm_active',
+                'filter_item_active' => '_bx_posts_grid_filter_item_title_adm_active',
             	'filter_item_hidden' => '_bx_posts_grid_filter_item_title_adm_hidden',
             	'filter_item_hidden' => '_bx_posts_grid_filter_item_title_adm_hidden',
             	'filter_item_select_one_filter1' => '_bx_posts_grid_filter_item_title_adm_select_one_filter1',
             	'filter_item_select_one_filter1' => '_bx_posts_grid_filter_item_title_adm_select_one_filter1',
             	'menu_item_manage_my' => '_bx_posts_menu_item_title_manage_my',
             	'menu_item_manage_my' => '_bx_posts_menu_item_title_manage_my',
@@ -137,23 +150,28 @@ class BxPostsConfig extends BxBaseModTextConfig
                 'txt_all_entries_in' => '_bx_posts_txt_all_entries_in',
                 'txt_all_entries_in' => '_bx_posts_txt_all_entries_in',
                 'txt_all_entries_by_author' => '_bx_posts_page_title_browse_by_author',
                 'txt_all_entries_by_author' => '_bx_posts_page_title_browse_by_author',
                 'txt_all_entries_by_context' => '_bx_posts_page_title_browse_by_context',
                 'txt_all_entries_by_context' => '_bx_posts_page_title_browse_by_context',
-            	'txt_pict_use_as_thumb' => '_bx_posts_form_entry_input_picture_use_as_thumb'
+            	'txt_pict_use_as_thumb' => '_bx_posts_form_entry_input_picture_use_as_thumb',
+                'txt_err_cannot_perform_action' => '_bx_posts_txt_err_cannot_perform_action',
+                'txt_poll_answer_vote_do_by' => '_bx_posts_txt_poll_answer_vote_do_by',
+                'txt_poll_answer_vote_counter' => '_bx_posts_txt_poll_answer_vote_counter',
+                'txt_poll_answer_vote_percent' => '_bx_posts_txt_poll_answer_vote_percent'
             ),
             ),
-        );
-
-        $this->_aJsClasses = array(
-        	'manage_tools' => 'BxPostsManageTools'
-        );
+        ));
+        
+        $this->_aJsClasses = array_merge($this->_aJsClasses, array(
+            'manage_tools' => 'BxPostsManageTools'
+        ));
 
 
-        $this->_aJsObjects = array(
-        	'manage_tools' => 'oBxPostsManageTools'
-        );
+        $this->_aJsObjects = array_merge($this->_aJsObjects, array(
+            'manage_tools' => 'oBxPostsManageTools'
+        ));
 
 
         $this->_aGridObjects = array(
         $this->_aGridObjects = array(
-        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
-        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
-        	
+            'common' => $this->CNF['OBJECT_GRID_COMMON'],
+            'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
         );
         );
+
+        $this->_bAttachmentsInTimeline = true;
     }
     }
 }
 }
 
 

+ 36 - 37
modules/boonex/posts/classes/BxPostsFormEntry.php

@@ -14,7 +14,7 @@
  */
  */
 class BxPostsFormEntry extends BxBaseModTextFormEntry
 class BxPostsFormEntry extends BxBaseModTextFormEntry
 {
 {
-	protected $_sGhostTemplateCover = 'form_ghost_template_cover.html';
+    protected $_sGhostTemplateCover = 'form_ghost_template_cover.html';
 	
 	
     public function __construct($aInfo, $oTemplate = false)
     public function __construct($aInfo, $oTemplate = false)
     {
     {
@@ -38,26 +38,36 @@ class BxPostsFormEntry extends BxBaseModTextFormEntry
         }
         }
 
 
         if (isset($CNF['FIELD_PHOTO']) && isset($this->aInputs[$CNF['FIELD_PHOTO']])) {
         if (isset($CNF['FIELD_PHOTO']) && isset($this->aInputs[$CNF['FIELD_PHOTO']])) {
-        	$this->aInputs[$CNF['FIELD_PHOTO']]['storage_object'] = $CNF['OBJECT_STORAGE_PHOTOS'];
-        	$this->aInputs[$CNF['FIELD_PHOTO']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_PHOTO']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_PHOTO']]['value']) : $CNF['OBJECT_UPLOADERS'];
-        	$this->aInputs[$CNF['FIELD_PHOTO']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS'];
-        	$this->aInputs[$CNF['FIELD_PHOTO']]['storage_private'] = 0;
-        	$this->aInputs[$CNF['FIELD_PHOTO']]['multiple'] = true;
-        	$this->aInputs[$CNF['FIELD_PHOTO']]['content_id'] = 0;
-        	$this->aInputs[$CNF['FIELD_PHOTO']]['ghost_template'] = '';
+            $this->aInputs[$CNF['FIELD_PHOTO']]['storage_object'] = $CNF['OBJECT_STORAGE_PHOTOS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_PHOTO']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_PHOTO']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS'];
+            $this->aInputs[$CNF['FIELD_PHOTO']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_PHOTO']]['ghost_template'] = '';
+        }
+
+        if(isset($this->aInputs[$CNF['FIELD_VIDEO']])) {
+            $this->aInputs[$CNF['FIELD_VIDEO']]['storage_object'] = $CNF['OBJECT_STORAGE_VIDEOS'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['uploaders'] = !empty($this->aInputs[$CNF['FIELD_VIDEO']]['value']) ? unserialize($this->aInputs[$CNF['FIELD_VIDEO']]['value']) : $CNF['OBJECT_UPLOADERS'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['images_transcoder'] = $CNF['OBJECT_VIDEOS_TRANSCODERS']['poster_preview'];
+            $this->aInputs[$CNF['FIELD_VIDEO']]['storage_private'] = 0;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['multiple'] = true;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['content_id'] = 0;
+            $this->aInputs[$CNF['FIELD_VIDEO']]['ghost_template'] = '';
         }
         }
     }
     }
 
 
-	function initChecker ($aValues = array (), $aSpecificValues = array())
+    function initChecker ($aValues = array (), $aSpecificValues = array())
     {
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
         $CNF = &$this->_oModule->_oConfig->CNF;
 
 
+        $bValues = $aValues && !empty($aValues['id']);
+        $aContentInfo = $bValues ? $this->_oModule->_oDb->getContentInfoById($aValues['id']) : false;
+
         if (isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
         if (isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
-            $aContentInfo = false;
-            if ($aValues && !empty($aValues['id'])) {
-                $aContentInfo = $this->_oModule->_oDb->getContentInfoById ($aValues['id']);
+            if($bValues)
                 $this->aInputs[$CNF['FIELD_COVER']]['content_id'] = $aValues['id'];
                 $this->aInputs[$CNF['FIELD_COVER']]['content_id'] = $aValues['id'];
-            }
 
 
             $this->aInputs[$CNF['FIELD_COVER']]['ghost_template'] = $this->_oModule->_oTemplate->parseHtmlByName($this->_sGhostTemplateCover, $this->_getCoverGhostTmplVars($aContentInfo));
             $this->aInputs[$CNF['FIELD_COVER']]['ghost_template'] = $this->_oModule->_oTemplate->parseHtmlByName($this->_sGhostTemplateCover, $this->_getCoverGhostTmplVars($aContentInfo));
         }
         }
@@ -95,7 +105,7 @@ class BxPostsFormEntry extends BxBaseModTextFormEntry
 
 
         $iContentId = parent::insert ($aValsToAdd, $isIgnore);
         $iContentId = parent::insert ($aValsToAdd, $isIgnore);
         if(!empty($iContentId))
         if(!empty($iContentId))
-        	$this->processFiles($CNF['FIELD_COVER'], $iContentId, true);
+            $this->processFiles($CNF['FIELD_COVER'], $iContentId, true);
 
 
         return $iContentId;
         return $iContentId;
     }
     }
@@ -122,35 +132,24 @@ class BxPostsFormEntry extends BxBaseModTextFormEntry
         return $iResult;
         return $iResult;
     }
     }
 
 
-	protected function _getCoverGhostTmplVars($aContentInfo = array())
+    protected function _getCoverGhostTmplVars($aContentInfo = array())
     {
     {
     	$CNF = &$this->_oModule->_oConfig->CNF;
     	$CNF = &$this->_oModule->_oConfig->CNF;
 
 
     	return array (
     	return array (
-			'name' => $this->aInputs[$CNF['FIELD_COVER']]['name'],
-			'content_id' => $this->aInputs[$CNF['FIELD_COVER']]['content_id'],
-			'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : '',
+            'name' => $this->aInputs[$CNF['FIELD_COVER']]['name'],
+            'content_id' => $this->aInputs[$CNF['FIELD_COVER']]['content_id'],
+            'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : '',
             'thumb_id' => isset($CNF['FIELD_THUMB']) && isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
             'thumb_id' => isset($CNF['FIELD_THUMB']) && isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
             'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : '',
             'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : '',
-			'bx_if:set_thumb' => array (
-				'condition' => CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->checkAllowedSetThumb($this->aInputs[$CNF['FIELD_COVER']]['content_id']),
-				'content' => array (
-					'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : '',
-    				'txt_pict_use_as_thumb' => _t(!empty($CNF['T']['txt_pict_use_as_thumb']) ? $CNF['T']['txt_pict_use_as_thumb'] : '_sys_txt_form_entry_input_picture_use_as_thumb')
-				),
-			),
-		);
-    }
-
-    protected function _getPhotoGhostTmplVars($aContentInfo = array())
-    {
-    	$CNF = &$this->_oModule->_oConfig->CNF;
-
-    	return array (
-			'name' => $this->aInputs[$CNF['FIELD_PHOTO']]['name'],
-			'content_id' => (int)$this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
-			'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : ''
-    	);
+            'bx_if:set_thumb' => array (
+                'condition' => CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->checkAllowedSetThumb($this->aInputs[$CNF['FIELD_COVER']]['content_id']),
+                'content' => array (
+                    'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : '',
+                    'txt_pict_use_as_thumb' => _t(!empty($CNF['T']['txt_pict_use_as_thumb']) ? $CNF['T']['txt_pict_use_as_thumb'] : '_sys_txt_form_entry_input_picture_use_as_thumb')
+                ),
+            ),
+        );
     }
     }
 }
 }
 
 

+ 24 - 0
modules/boonex/posts/classes/BxPostsFormPoll.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    Polls Polls
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPostsFormPoll extends BxBaseModTextFormPoll
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_posts';
+
+        parent::__construct($aInfo, $oTemplate);
+    }
+}
+
+class BxPostsFormPollCheckerHelper extends BxBaseModTextFormPollCheckerHelper {}
+
+/** @} */

+ 25 - 0
modules/boonex/posts/classes/BxPostsMenuAttachments.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    Posts Posts
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxPostsMenuAttachments extends BxBaseModTextMenuAttachments
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_posts';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 1 - 17
modules/boonex/posts/classes/BxPostsTemplate.php

@@ -14,12 +14,10 @@
  */
  */
 class BxPostsTemplate extends BxBaseModTextTemplate
 class BxPostsTemplate extends BxBaseModTextTemplate
 {
 {
-    /**
-     * Constructor
-     */
     function __construct(&$oConfig, &$oDb)
     function __construct(&$oConfig, &$oDb)
     {
     {
         $this->MODULE = 'bx_posts';
         $this->MODULE = 'bx_posts';
+
         parent::__construct($oConfig, $oDb);
         parent::__construct($oConfig, $oDb);
     }
     }
 
 
@@ -32,20 +30,6 @@ class BxPostsTemplate extends BxBaseModTextTemplate
 
 
         return array($sPhotoGallery, $sPhotoGallery);
         return array($sPhotoGallery, $sPhotoGallery);
     }
     }
-
-    protected function getAttachmentsImagesTranscoders ()
-    {
-        $CNF = &$this->getModule()->_oConfig->CNF;
-
-        $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS']);
-
-        return array($oTranscoder, null);
-    }
-    
-    function entryAttachments ($aData, $aParams = array())
-    {
-        return $this->entryAttachmentsByStorage($this->getModule()->_oConfig->CNF['OBJECT_STORAGE_PHOTOS'], $aData, $aParams);
-    }
 }
 }
 
 
 /** @} */
 /** @} */

+ 3 - 4
modules/boonex/posts/classes/BxPostsUploaderHTML5.php

@@ -9,14 +9,13 @@
  * @{
  * @{
  */
  */
 
 
-class BxPostsUploaderHTML5 extends BxTemplUploaderHTML5
+class BxPostsUploaderHTML5 extends BxBaseModTextUploaderHTML5
 {
 {
-    protected $_oModule;
-
     public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
     public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
     {
     {
+        $this->_sModule = 'bx_posts';
+
         parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
         parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
-        $this->_oModule = BxDolModule::getInstance('bx_posts');
     }
     }
 
 
     protected function isAdmin ($iContentId = 0)
     protected function isAdmin ($iContentId = 0)

+ 3 - 4
modules/boonex/posts/classes/BxPostsUploaderSimple.php

@@ -9,14 +9,13 @@
  * @{
  * @{
  */
  */
 
 
-class BxPostsUploaderSimple extends BxTemplUploaderSimple
+class BxPostsUploaderSimple extends BxBaseModTextUploaderSimple
 {
 {
-    protected $_oModule;
-
     public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
     public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
     {
     {
+        $this->_sModule = 'bx_posts';
+        
         parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
         parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
-        $this->_oModule = BxDolModule::getInstance('bx_posts');
     }
     }
 
 
     protected function isAdmin ($iContentId = 0)
     protected function isAdmin ($iContentId = 0)

+ 22 - 0
modules/boonex/posts/classes/BxPostsVotePollAnswers.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    Posts Posts
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPostsVotePollAnswers extends BxBaseModTextVotePollAnswers
+{
+    function __construct($sSystem, $iId, $iInit = 1)
+    {
+    	$this->_sModule = 'bx_posts';
+
+        parent::__construct($sSystem, $iId, $iInit);
+    }
+}
+
+/** @} */

+ 10 - 4
modules/boonex/posts/install/config.php

@@ -20,7 +20,7 @@ $aConfig = array(
     'note' => 'Basic blogging module.',
     'note' => 'Basic blogging module.',
     'version' => '9.0.12.DEV',
     'version' => '9.0.12.DEV',
     'vendor' => 'BoonEx',
     'vendor' => 'BoonEx',
-	'help_url' => 'http://feed.una.io/?section={module_name}',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
 
 
     'compatible_with' => array(
     'compatible_with' => array(
         '9.0.x'
         '9.0.x'
@@ -61,19 +61,25 @@ $aConfig = array(
      */
      */
     'storages' => array(
     'storages' => array(
     	'bx_posts_files',
     	'bx_posts_files',
-    	'bx_posts_photos'
+    	'bx_posts_photos',
+        'bx_posts_videos'
     ),
     ),
 
 
     /**
     /**
      * Transcoders.
      * Transcoders.
      */
      */
     'transcoders' => array(
     'transcoders' => array(
-		'bx_posts_preview',
+        'bx_posts_preview',
         'bx_posts_gallery',
         'bx_posts_gallery',
         'bx_posts_cover',
         'bx_posts_cover',
 
 
         'bx_posts_preview_photos',
         'bx_posts_preview_photos',
-        'bx_posts_gallery_photos'
+        'bx_posts_gallery_photos', 
+        
+        'bx_posts_videos_poster',
+        'bx_posts_videos_poster_preview',
+        'bx_posts_videos_mp4',
+        'bx_posts_videos_webm'
     ),
     ),
 
 
     /**
     /**

+ 113 - 73
modules/boonex/posts/install/langs/en.xml

@@ -1,45 +1,48 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <resources name="en" flag="gb" title="English">
 <resources name="en" flag="gb" title="English">
 
 
-	<string name="_bx_posts"><![CDATA[Posts]]></string>
-	<string name="_bx_posts_cmts"><![CDATA[Posts' Comments]]></string>
+    <string name="_bx_posts"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_cmts"><![CDATA[Posts' Comments]]></string>
 
 
-	<string name="_bx_posts_option_summary_chars"><![CDATA[Number of characters in auto-cropped post summary]]></string>
-	<string name="_bx_posts_option_plain_summary_chars"><![CDATA[Number of characters in plain post description when post hasn't thumb]]></string>
-	<string name="_bx_posts_option_per_page_browse"><![CDATA[Number of items per page]]></string>
-	<string name="_bx_posts_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
-	<string name="_bx_posts_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
-	<string name="_bx_posts_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+    <string name="_bx_posts_option_summary_chars"><![CDATA[Number of characters in auto-cropped post summary]]></string>
+    <string name="_bx_posts_option_plain_summary_chars"><![CDATA[Number of characters in plain post description when post hasn't thumb]]></string>
+    <string name="_bx_posts_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+    <string name="_bx_posts_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
+    <string name="_bx_posts_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+    <string name="_bx_posts_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
 
 
-	<string name="_bx_posts_form_entry"><![CDATA[Posts]]></string>
-	<string name="_bx_posts_form_entry_display_add"><![CDATA[Add Post]]></string>
-	<string name="_bx_posts_form_entry_display_edit"><![CDATA[Edit Post]]></string>
-	<string name="_bx_posts_form_entry_display_delete"><![CDATA[Delete Post]]></string>
-	<string name="_bx_posts_form_entry_display_view"><![CDATA[View Post]]></string>
-	<string name="_bx_posts_form_entry_input_author"><![CDATA[Author]]></string>
-	<string name="_bx_posts_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
-	<string name="_bx_posts_form_entry_input_do_submit"><![CDATA[Submit]]></string>
-	<string name="_bx_posts_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
-	<string name="_bx_posts_form_entry_input_do_publish"><![CDATA[Publish]]></string>
-	<string name="_bx_posts_form_entry_input_sys_title"><![CDATA[Title]]></string>
-	<string name="_bx_posts_form_entry_input_title"><![CDATA[Title]]></string>
-	<string name="_bx_posts_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
-	<string name="_bx_posts_form_entry_input_sys_cat"><![CDATA[Category]]></string>
-	<string name="_bx_posts_form_entry_input_cat"><![CDATA[Category]]></string>
+    <string name="_bx_posts_form_entry"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_form_entry_display_add"><![CDATA[Add Post]]></string>
+    <string name="_bx_posts_form_entry_display_edit"><![CDATA[Edit Post]]></string>
+    <string name="_bx_posts_form_entry_display_delete"><![CDATA[Delete Post]]></string>
+    <string name="_bx_posts_form_entry_display_view"><![CDATA[View Post]]></string>
+    <string name="_bx_posts_form_entry_input_author"><![CDATA[Author]]></string>
+    <string name="_bx_posts_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_posts_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_posts_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
+    <string name="_bx_posts_form_entry_input_do_publish"><![CDATA[Publish]]></string>
+    <string name="_bx_posts_form_entry_input_sys_title"><![CDATA[Title]]></string>
+    <string name="_bx_posts_form_entry_input_title"><![CDATA[Title]]></string>
+    <string name="_bx_posts_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+    <string name="_bx_posts_form_entry_input_sys_cat"><![CDATA[Category]]></string>
+    <string name="_bx_posts_form_entry_input_cat"><![CDATA[Category]]></string>
     <string name="_bx_posts_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
     <string name="_bx_posts_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
-	<string name="_bx_posts_form_entry_input_sys_text"><![CDATA[Text]]></string>
-	<string name="_bx_posts_form_entry_input_text"><![CDATA[Text]]></string>
-	<string name="_bx_posts_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
-	<string name="_bx_posts_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
-	<string name="_bx_posts_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this post]]></string>
-	<string name="_bx_posts_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
-	<string name="_bx_posts_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the post]]></string>
-	<string name="_bx_posts_form_entry_input_sys_covers"><![CDATA[Header Image]]></string>
-	<string name="_bx_posts_form_entry_input_covers"><![CDATA[Header Image]]></string>
-	<string name="_bx_posts_form_entry_input_covers_uploader_simple_title"><![CDATA[Upload]]></string>
-	<string name="_bx_posts_form_entry_input_covers_uploader_html5_title"><![CDATA[Upload]]></string>
-	<string name="_bx_posts_form_entry_input_sys_pictures"><![CDATA[Pictures]]></string>
-	<string name="_bx_posts_form_entry_input_pictures"><![CDATA[Pictures]]></string>
+    <string name="_bx_posts_form_entry_input_sys_text"><![CDATA[Text]]></string>
+    <string name="_bx_posts_form_entry_input_text"><![CDATA[Text]]></string>
+    <string name="_bx_posts_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
+    <string name="_bx_posts_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+    <string name="_bx_posts_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this post]]></string>
+    <string name="_bx_posts_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+    <string name="_bx_posts_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the post]]></string>
+    <string name="_bx_posts_form_entry_input_sys_covers"><![CDATA[Header Image]]></string>
+    <string name="_bx_posts_form_entry_input_covers"><![CDATA[Header Image]]></string>
+    <string name="_bx_posts_form_entry_input_covers_uploader_simple_title"><![CDATA[Upload]]></string>
+    <string name="_bx_posts_form_entry_input_covers_uploader_html5_title"><![CDATA[Upload]]></string>
+    <string name="_bx_posts_form_entry_input_sys_pictures"><![CDATA[Images]]></string>
+    <string name="_bx_posts_form_entry_input_pictures"><![CDATA[]]></string>
+    <string name="_bx_posts_form_entry_input_sys_videos"><![CDATA[Videos]]></string>
+    <string name="_bx_posts_form_entry_input_videos"><![CDATA[]]></string>
+    <string name="_bx_posts_form_entry_input_sys_polls"><![CDATA[Polls]]></string>
     <string name="_bx_posts_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
     <string name="_bx_posts_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
     <string name="_bx_posts_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
     <string name="_bx_posts_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
     <string name="_bx_posts_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
     <string name="_bx_posts_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
@@ -50,30 +53,45 @@
     <string name="_bx_posts_form_entry_input_sys_date_published"><![CDATA[Publish at]]></string>
     <string name="_bx_posts_form_entry_input_sys_date_published"><![CDATA[Publish at]]></string>
     <string name="_bx_posts_form_entry_input_date_published"><![CDATA[Publish at]]></string>
     <string name="_bx_posts_form_entry_input_date_published"><![CDATA[Publish at]]></string>
     <string name="_bx_posts_form_entry_input_date_published_info"><![CDATA[Leave empty to publish immediately.]]></string>
     <string name="_bx_posts_form_entry_input_date_published_info"><![CDATA[Leave empty to publish immediately.]]></string>
+    <string name="_bx_posts_form_entry_input_sys_attachments"><![CDATA[Attachments]]></string>
 
 
-	<string name="_bx_posts_acl_action_create_entry"><![CDATA[Create Post]]></string>
-	<string name="_bx_posts_acl_action_delete_entry"><![CDATA[Delete Post]]></string>
-	<string name="_bx_posts_acl_action_view_entry"><![CDATA[View Post]]></string>
-	<string name="_bx_posts_acl_action_set_thumb"><![CDATA[Set Post Thumbnail]]></string>
-	<string name="_bx_posts_acl_action_edit_any_entry"><![CDATA[Edit Any Post]]></string>
+    <string name="_bx_posts_form_poll"><![CDATA[Polls]]></string>
+    <string name="_bx_posts_form_poll_display_add"><![CDATA[Add Poll]]></string>
+    <string name="_bx_posts_form_poll_input_sys_text"><![CDATA[Question]]></string>
+    <string name="_bx_posts_form_poll_input_text"><![CDATA[Question]]></string>
+    <string name="_bx_posts_form_poll_input_text_err"><![CDATA[Question is essential. Please, fill in this field]]></string>
+    <string name="_bx_posts_form_poll_input_sys_answers"><![CDATA[Answers]]></string>
+    <string name="_bx_posts_form_poll_input_answers"><![CDATA[Answers]]></string>
+    <string name="_bx_posts_form_poll_input_answers_inf"><![CDATA[Leave text box empty to remove an answer.]]></string>
+    <string name="_bx_posts_form_poll_input_answers_err"><![CDATA[Poll should have at least 2 non-empty answers.]]></string>
+    <string name="_bx_posts_form_poll_input_answers_add"><![CDATA[Add More]]></string>
+    <string name="_bx_posts_form_poll_input_sys_do_submit"><![CDATA[Add]]></string>
+    <string name="_bx_posts_form_poll_input_do_submit"><![CDATA[Add]]></string>
+    <string name="_bx_posts_form_poll_input_do_cancel"><![CDATA[Close]]></string>
 
 
-	<string name="_bx_posts_page_title_sys_create_entry"><![CDATA[New Post]]></string>
-	<string name="_bx_posts_page_title_create_entry"><![CDATA[New Post]]></string>
-	<string name="_bx_posts_page_block_title_create_entry"><![CDATA[New Post]]></string>
-	<string name="_bx_posts_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
-	<string name="_bx_posts_page_title_edit_entry"><![CDATA[Edit]]></string>
-	<string name="_bx_posts_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_posts_acl_action_create_entry"><![CDATA[Create Post]]></string>
+    <string name="_bx_posts_acl_action_delete_entry"><![CDATA[Delete Post]]></string>
+    <string name="_bx_posts_acl_action_view_entry"><![CDATA[View Post]]></string>
+    <string name="_bx_posts_acl_action_set_thumb"><![CDATA[Set Post Thumbnail]]></string>
+    <string name="_bx_posts_acl_action_edit_any_entry"><![CDATA[Edit Any Post]]></string>
+
+    <string name="_bx_posts_page_title_sys_create_entry"><![CDATA[New Post]]></string>
+    <string name="_bx_posts_page_title_create_entry"><![CDATA[New Post]]></string>
+    <string name="_bx_posts_page_block_title_create_entry"><![CDATA[New Post]]></string>
+    <string name="_bx_posts_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_posts_page_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_posts_page_block_title_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_posts_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_posts_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_posts_page_title_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_posts_page_title_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_posts_page_block_title_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_posts_page_block_title_delete_entry"><![CDATA[Delete]]></string>
-	<string name="_bx_posts_page_title_sys_view_entry"><![CDATA[View Post]]></string>
-	<string name="_bx_posts_page_title_view_entry"><![CDATA[{title}]]></string>
-	<string name="_bx_posts_page_block_title_entry_text"><![CDATA[Post Text]]></string>
-	<string name="_bx_posts_page_title_browse"><![CDATA[Posts]]></string>
-	<string name="_bx_posts_page_title_search_results"><![CDATA[Posts matching "{0}"]]></string>
-	<string name="_bx_posts_page_title_browse_by_author"><![CDATA[Posts of {display_name}]]></string>
-	<string name="_bx_posts_page_title_browse_by_context"><![CDATA[Posts in {display_name}]]></string>
-	<string name="_bx_posts_page_title_browse_featured"><![CDATA[Featured Posts]]></string>
+    <string name="_bx_posts_page_title_sys_view_entry"><![CDATA[View Post]]></string>
+    <string name="_bx_posts_page_title_view_entry"><![CDATA[{title}]]></string>
+    <string name="_bx_posts_page_block_title_entry_text"><![CDATA[Post Text]]></string>
+    <string name="_bx_posts_page_title_browse"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_page_title_search_results"><![CDATA[Posts matching "{0}"]]></string>
+    <string name="_bx_posts_page_title_browse_by_author"><![CDATA[Posts of {display_name}]]></string>
+    <string name="_bx_posts_page_title_browse_by_context"><![CDATA[Posts in {display_name}]]></string>
+    <string name="_bx_posts_page_title_browse_featured"><![CDATA[Featured Posts]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Latest Posts]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Latest Posts]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Popular Posts]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Popular Posts]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Updated Posts]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Updated Posts]]></string>
@@ -90,6 +108,7 @@
     <string name="_bx_posts_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_posts_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_posts_page_block_title_entry_location"><![CDATA[Location]]></string>
     <string name="_bx_posts_page_block_title_entry_location"><![CDATA[Location]]></string>
     <string name="_bx_posts_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
     <string name="_bx_posts_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_posts_page_block_title_entry_polls"><![CDATA[Polls]]></string>
     <string name="_bx_posts_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
     <string name="_bx_posts_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
     <string name="_bx_posts_page_title_sys_entries_popular"><![CDATA[Popular Posts]]></string>
     <string name="_bx_posts_page_title_sys_entries_popular"><![CDATA[Popular Posts]]></string>
     <string name="_bx_posts_page_title_entries_popular"><![CDATA[Popular Posts]]></string>
     <string name="_bx_posts_page_title_entries_popular"><![CDATA[Popular Posts]]></string>
@@ -119,24 +138,37 @@
     <string name="_bx_posts_page_block_title_sys_entries_in_context"><![CDATA[Posts in context]]></string>
     <string name="_bx_posts_page_block_title_sys_entries_in_context"><![CDATA[Posts in context]]></string>
     <string name="_bx_posts_page_block_title_entries_actions"><![CDATA[Posts actions]]></string>
     <string name="_bx_posts_page_block_title_entries_actions"><![CDATA[Posts actions]]></string>
     <string name="_bx_posts_page_block_title_browse_cmts"><![CDATA[Posts' Comments]]></string>
     <string name="_bx_posts_page_block_title_browse_cmts"><![CDATA[Posts' Comments]]></string>
-	<string name="_bx_posts_page_title_sys_manage"><![CDATA[Manage Own]]></string>
-	<string name="_bx_posts_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
-	<string name="_bx_posts_page_title_manage"><![CDATA[Manage]]></string>
-	<string name="_bx_posts_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
-	<string name="_bx_posts_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
-	<string name="_bx_posts_page_block_title_manage"><![CDATA[Manage]]></string>    
-	<string name="_bx_posts_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
-	<string name="_bx_posts_page_block_title_cats"><![CDATA[Posts Categories]]></string>
-	<string name="_bx_posts_page_block_title_entry_info"><![CDATA[Info]]></string>
-	<string name="_bx_posts_page_block_title_my_entries"><![CDATA[My Posts]]></string>
-	<string name="_bx_posts_page_block_title_sys_recent_entries_view_showcase"><![CDATA[Latest Posts (Showcase View)]]></string>
-	<string name="_bx_posts_page_block_title_recent_entries_view_showcase"><![CDATA[Latest Posts]]></string>
-	<string name="_bx_posts_page_block_title_sys_popular_entries_view_showcase"><![CDATA[Popular Posts (Showcase View)]]></string>
-	<string name="_bx_posts_page_block_title_popular_entries_view_showcase"><![CDATA[Popular Posts]]></string>
-	<string name="_bx_posts_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured Posts (Showcase View)]]></string>
-	<string name="_bx_posts_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Posts]]></string>
-	<string name="_bx_posts_page_block_title_sys_entry_context"><![CDATA[Posted in]]></string>
-	<string name="_bx_posts_page_block_title_entry_context"><![CDATA[Posted in]]></string>  
+    <string name="_bx_posts_page_title_sys_manage"><![CDATA[Manage Own]]></string>
+    <string name="_bx_posts_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
+    <string name="_bx_posts_page_title_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_posts_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
+    <string name="_bx_posts_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
+    <string name="_bx_posts_page_block_title_manage"><![CDATA[Manage]]></string>    
+    <string name="_bx_posts_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
+    <string name="_bx_posts_page_block_title_cats"><![CDATA[Posts Categories]]></string>
+    <string name="_bx_posts_page_block_title_entry_info"><![CDATA[Info]]></string>
+    <string name="_bx_posts_page_block_title_my_entries"><![CDATA[My Posts]]></string>
+    <string name="_bx_posts_page_block_title_sys_recent_entries_view_showcase"><![CDATA[Latest Posts (Showcase View)]]></string>
+    <string name="_bx_posts_page_block_title_recent_entries_view_showcase"><![CDATA[Latest Posts]]></string>
+    <string name="_bx_posts_page_block_title_sys_popular_entries_view_showcase"><![CDATA[Popular Posts (Showcase View)]]></string>
+    <string name="_bx_posts_page_block_title_popular_entries_view_showcase"><![CDATA[Popular Posts]]></string>
+    <string name="_bx_posts_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured Posts (Showcase View)]]></string>
+    <string name="_bx_posts_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Posts]]></string>
+    <string name="_bx_posts_page_block_title_sys_entry_context"><![CDATA[Posted in]]></string>
+    <string name="_bx_posts_page_block_title_entry_context"><![CDATA[Posted in]]></string>
+
+    <string name="_bx_posts_menu_title_entry_attachments"><![CDATA[Form Attachments]]></string>
+    <string name="_bx_posts_menu_set_title_entry_attachments"><![CDATA[Form Attachments]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_photo_simple"><![CDATA[Add Photo (simple)]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_photo_simple"><![CDATA[Add Photo]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_photo_html5"><![CDATA[Add Photo (html5)]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_photo_html5"><![CDATA[Add Photos]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_video_simple"><![CDATA[Add Video (simple)]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_video_simple"><![CDATA[Add Video]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_video_html5"><![CDATA[Add Video (html5)]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_video_html5"><![CDATA[Add Videos]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_poll"><![CDATA[Add Poll]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_poll"><![CDATA[Add Poll]]></string>
 
 
     <string name="_bx_posts_menu_set_title_view_entry"><![CDATA[Post Actions]]></string>
     <string name="_bx_posts_menu_set_title_view_entry"><![CDATA[Post Actions]]></string>
     <string name="_bx_posts_menu_title_view_entry"><![CDATA[Post Actions]]></string>
     <string name="_bx_posts_menu_title_view_entry"><![CDATA[Post Actions]]></string>
@@ -240,4 +272,12 @@
     <string name="_bx_posts_txt_sample_single_with_article"><![CDATA[a post]]></string>
     <string name="_bx_posts_txt_sample_single_with_article"><![CDATA[a post]]></string>
     <string name="_bx_posts_txt_sample_comment_single"><![CDATA[comment to post]]></string>
     <string name="_bx_posts_txt_sample_comment_single"><![CDATA[comment to post]]></string>
     <string name="_bx_posts_txt_sample_vote_single"><![CDATA[vote to post]]></string>
     <string name="_bx_posts_txt_sample_vote_single"><![CDATA[vote to post]]></string>
+    
+    <string name="_bx_posts_txt_err_cannot_perform_action"><![CDATA[Cannot perform action. Please report.]]></string>
+    
+    <string name="_bx_posts_txt_poll_view_answers"><![CDATA[poll]]></string>
+    <string name="_bx_posts_txt_poll_view_results"><![CDATA[results]]></string>
+    <string name="_bx_posts_txt_poll_answer_vote_do_by"><![CDATA[Voted for]]></string>
+    <string name="_bx_posts_txt_poll_answer_vote_counter"><![CDATA[{0} votes]]></string>
+    <string name="_bx_posts_txt_poll_answer_vote_percent"><![CDATA[({0}%)]]></string>
 </resources>
 </resources>

+ 2 - 2
modules/boonex/posts/install/sql/disable.sql

@@ -13,7 +13,7 @@ DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_posts' OR `object` IN('bx_po
 -- MENU
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_posts';
-DELETE FROM `sys_menu_items` WHERE `module` = 'bx_posts' OR `set_name` IN('bx_posts_view', 'bx_posts_view_actions', 'bx_posts_submenu', 'bx_posts_view_submenu', 'bx_posts_snippet_meta', 'bx_posts_my', 'bx_posts_menu_manage_tools');
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_posts' OR `set_name` IN('bx_posts_create_post_attachments', 'bx_posts_view', 'bx_posts_view_actions', 'bx_posts_submenu', 'bx_posts_view_submenu', 'bx_posts_snippet_meta', 'bx_posts_my', 'bx_posts_menu_manage_tools');
 
 
 -- PRIVACY 
 -- PRIVACY 
 DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_posts_allow_view_to';
 DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_posts_allow_view_to';
@@ -43,7 +43,7 @@ DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_posts_administration', 'bx_
 DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_posts_administration', 'bx_posts_common');
 DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_posts_administration', 'bx_posts_common');
 
 
 -- UPLOADERS
 -- UPLOADERS
-DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_posts_simple', 'bx_posts_html5');
+DELETE FROM `sys_objects_uploader` WHERE `object` LIKE 'bx_posts_%';
 
 
 -- ALERTS
 -- ALERTS
 SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_posts' LIMIT 1);
 SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_posts' LIMIT 1);

+ 20 - 1
modules/boonex/posts/install/sql/enable.sql

@@ -62,6 +62,7 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_posts_view_entry', 4, 'bx_posts', '', '_bx_posts_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0, 0),
 ('bx_posts_view_entry', 4, 'bx_posts', '', '_bx_posts_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0, 0),
 ('bx_posts_view_entry', 4, 'bx_posts', '', '_bx_posts_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 0),
 ('bx_posts_view_entry', 4, 'bx_posts', '', '_bx_posts_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 0),
 ('bx_posts_view_entry', 4, 'bx_posts', '', '_bx_posts_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 0, 0),
 ('bx_posts_view_entry', 4, 'bx_posts', '', '_bx_posts_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 0, 0),
+('bx_posts_view_entry', 4, 'bx_posts', '', '_bx_posts_page_block_title_entry_polls', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:12:\"entity_polls\";}', 0, 0, 0, 0),
 ('bx_posts_view_entry', 2, 'bx_posts', '', '_bx_posts_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 4),
 ('bx_posts_view_entry', 2, 'bx_posts', '', '_bx_posts_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 4),
 ('bx_posts_view_entry', 3, 'bx_posts', '', '_bx_posts_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:8:\"bx_posts\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 3),
 ('bx_posts_view_entry', 3, 'bx_posts', '', '_bx_posts_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:8:\"bx_posts\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 3),
 ('bx_posts_view_entry', 3, 'bx_posts', '', '_bx_posts_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 0, 1, 4);
 ('bx_posts_view_entry', 3, 'bx_posts', '', '_bx_posts_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 0, 1, 4);
@@ -193,6 +194,20 @@ SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 's
 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 
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('sys_add_content_links', 'bx_posts', 'create-post', '_bx_posts_menu_item_title_system_create_entry', '_bx_posts_menu_item_title_create_entry', 'page.php?i=create-post', '', '', 'file-alt col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
 ('sys_add_content_links', 'bx_posts', 'create-post', '_bx_posts_menu_item_title_system_create_entry', '_bx_posts_menu_item_title_create_entry', 'page.php?i=create-post', '', '', 'file-alt col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
 
 
+-- MENU: create post form attachments (link, photo, video, etc)
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_entry_attachments', '_bx_posts_menu_title_entry_attachments', 'bx_posts_entry_attachments', 'bx_posts', 23, 0, 1, 'BxPostsMenuAttachments', 'modules/boonex/posts/classes/BxPostsMenuAttachments.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_posts_entry_attachments', 'bx_posts', '_bx_posts_menu_set_title_entry_attachments', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_posts_entry_attachments', 'bx_posts', 'photo_simple', '_bx_posts_menu_item_title_system_cpa_photo_simple', '_bx_posts_menu_item_title_cpa_photo_simple', 'javascript:void(0)', 'javascript:{js_object_uploader_photos_simple}.showUploaderForm();', '_self', 'camera', '', '', 2147483647, '', 1, 0, 1, 1),
+('bx_posts_entry_attachments', 'bx_posts', 'photo_html5', '_bx_posts_menu_item_title_system_cpa_photo_html5', '_bx_posts_menu_item_title_cpa_photo_html5', 'javascript:void(0)', 'javascript:{js_object_uploader_photos_html5}.showUploaderForm();', '_self', 'camera', '', '', 2147483647, '', 0, 0, 1, 2),
+('bx_posts_entry_attachments', 'bx_posts', 'video_simple', '_bx_posts_menu_item_title_system_cpa_video_simple', '_bx_posts_menu_item_title_cpa_video_simple', 'javascript:void(0)', 'javascript:{js_object_uploader_videos_simple}.showUploaderForm();', '_self', 'video', '', '', 2147483647, '', 1, 0, 1, 3),
+('bx_posts_entry_attachments', 'bx_posts', 'video_html5', '_bx_posts_menu_item_title_system_cpa_video_html5', '_bx_posts_menu_item_title_cpa_video_html5', 'javascript:void(0)', 'javascript:{js_object_uploader_videos_html5}.showUploaderForm();', '_self', 'video', '', '', 2147483647, '', 0, 0, 1, 4),
+('bx_posts_entry_attachments', 'bx_posts', 'poll', '_bx_posts_menu_item_title_system_cpa_poll', '_bx_posts_menu_item_title_cpa_poll', 'javascript:void(0)', 'javascript:{js_object}.showPollForm(this);', '_self', 'tasks', '', '', 2147483647, '', 1, 0, 1, 5);
 
 
 -- MENU: actions menu for view entry 
 -- MENU: actions menu for view entry 
 
 
@@ -444,7 +459,11 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon
 
 
 INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
 INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
 ('bx_posts_simple', 1, 'BxPostsUploaderSimple', 'modules/boonex/posts/classes/BxPostsUploaderSimple.php'),
 ('bx_posts_simple', 1, 'BxPostsUploaderSimple', 'modules/boonex/posts/classes/BxPostsUploaderSimple.php'),
-('bx_posts_html5', 1, 'BxPostsUploaderHTML5', 'modules/boonex/posts/classes/BxPostsUploaderHTML5.php');
+('bx_posts_html5', 1, 'BxPostsUploaderHTML5', 'modules/boonex/posts/classes/BxPostsUploaderHTML5.php'),
+('bx_posts_photos_simple', 1, 'BxPostsUploaderSimple', 'modules/boonex/posts/classes/BxPostsUploaderSimple.php'),
+('bx_posts_photos_html5', 1, 'BxPostsUploaderHTML5', 'modules/boonex/posts/classes/BxPostsUploaderHTML5.php'),
+('bx_posts_videos_simple', 1, 'BxPostsUploaderSimple', 'modules/boonex/posts/classes/BxPostsUploaderSimple.php'),
+('bx_posts_videos_html5', 1, 'BxPostsUploaderHTML5', 'modules/boonex/posts/classes/BxPostsUploaderHTML5.php');
 
 
 -- ALERTS
 -- ALERTS
 
 

+ 135 - 16
modules/boonex/posts/install/sql/install.sql

@@ -75,6 +75,38 @@ CREATE TABLE IF NOT EXISTS `bx_posts_photos_resized` (
   UNIQUE KEY `remote_id` (`remote_id`)
   UNIQUE KEY `remote_id` (`remote_id`)
 );
 );
 
 
+CREATE TABLE IF NOT EXISTS `bx_posts_videos` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_posts_videos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
 -- TABLE: comments
 -- TABLE: comments
 CREATE TABLE IF NOT EXISTS `bx_posts_cmts` (
 CREATE TABLE IF NOT EXISTS `bx_posts_cmts` (
   `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
   `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
@@ -197,14 +229,56 @@ CREATE TABLE IF NOT EXISTS `bx_posts_scores_track` (
   KEY `vote` (`object_id`, `author_nip`)
   KEY `vote` (`object_id`, `author_nip`)
 );
 );
 
 
+-- TABLE: polls
+CREATE TABLE IF NOT EXISTS `bx_posts_polls` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author_id` int(11) NOT NULL default '0',
+  `content_id` int(11) NOT NULL default '0',
+  `text` text NOT NULL,
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `search_fields` (`text`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_posts_polls_answers` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `poll_id` int(11) unsigned NOT NULL default '0',
+  `title` varchar(255) NOT NULL,
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `order` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title` (`title`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_posts_polls_answers_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_posts_polls_answers_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+);
 
 
 -- STORAGES & TRANSCODERS
 -- STORAGES & TRANSCODERS
 SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
 SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
 
 
 INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
 INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
 ('bx_posts_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_files', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
 ('bx_posts_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_files', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+
 ('bx_posts_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
 ('bx_posts_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
-('bx_posts_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+('bx_posts_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+
+('bx_posts_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_videos', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,divx,xvid,3gp,webm,jpg', '', 0, 0, 0, 0, 0, 0),
+('bx_posts_videos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_posts_videos_resized', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,divx,xvid,3gp,webm,jpg', '', 0, 0, 0, 0, 0, 0);
 
 
 INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
 INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
 ('bx_posts_preview', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_posts_files";}', 'no', '1', '2592000', '0'),
 ('bx_posts_preview', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_posts_files";}', 'no', '1', '2592000', '0'),
@@ -212,7 +286,12 @@ INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`,
 ('bx_posts_cover', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_posts_files";}', 'no', '1', '2592000', '0'),
 ('bx_posts_cover', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_posts_files";}', 'no', '1', '2592000', '0'),
 
 
 ('bx_posts_preview_photos', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_photos";}', 'no', '1', '2592000', '0'),
 ('bx_posts_preview_photos', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_photos";}', 'no', '1', '2592000', '0'),
-('bx_posts_gallery_photos', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_photos";}', 'no', '1', '2592000', '0');
+('bx_posts_gallery_photos', 'bx_posts_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_photos";}', 'no', '1', '2592000', '0'),
+
+('bx_posts_videos_poster', 'bx_posts_videos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
+('bx_posts_videos_poster_preview', 'bx_posts_videos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
+('bx_posts_videos_mp4', 'bx_posts_videos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
+('bx_posts_videos_webm', 'bx_posts_videos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_posts_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', '');
 
 
 INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
 INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
 ('bx_posts_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_posts_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
@@ -220,10 +299,16 @@ INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_par
 ('bx_posts_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
 ('bx_posts_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
 
 
 ('bx_posts_preview_photos', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
 ('bx_posts_preview_photos', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
-('bx_posts_gallery_photos', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+('bx_posts_gallery_photos', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
 
 
+('bx_posts_videos_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:13:"square_resize";s:1:"1";}', 10),
+('bx_posts_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
+('bx_posts_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
+('bx_posts_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
+('bx_posts_videos_webm', 'Webm', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:4:"webm";}', 0);
 
 
--- FORMS
+
+-- FORMS: entry (post)
 INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
 INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_posts', 'bx_posts', '_bx_posts_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_posts_posts', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxPostsFormEntry', 'modules/boonex/posts/classes/BxPostsFormEntry.php');
 ('bx_posts', 'bx_posts', '_bx_posts_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_posts_posts', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxPostsFormEntry', 'modules/boonex/posts/classes/BxPostsFormEntry.php');
 
 
@@ -240,13 +325,16 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_posts', 'bx_posts', 'do_submit', '_bx_posts_form_entry_input_do_submit', '', 0, 'submit', '_bx_posts_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'do_submit', '_bx_posts_form_entry_input_do_submit', '', 0, 'submit', '_bx_posts_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'covers', 'a:1:{i:0;s:14:"bx_posts_html5";}', 'a:2:{s:15:"bx_posts_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_posts_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_posts_form_entry_input_sys_covers', '_bx_posts_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'covers', 'a:1:{i:0;s:14:"bx_posts_html5";}', 'a:2:{s:15:"bx_posts_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_posts_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_posts_form_entry_input_sys_covers', '_bx_posts_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_posts', 'bx_posts', 'pictures', 'a:1:{i:0;s:14:"bx_posts_html5";}', 'a:2:{s:15:"bx_posts_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_posts_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_posts_form_entry_input_sys_pictures', '_bx_posts_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_posts', 'bx_posts', 'pictures', 'a:1:{i:0;s:22:"bx_posts_photos_simple";}', 'a:2:{s:22:"bx_posts_photos_simple";s:26:"_sys_uploader_simple_title";s:21:"bx_posts_photos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_posts_form_entry_input_sys_pictures', '_bx_posts_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_posts', 'bx_posts', 'videos', 'a:1:{i:0;s:22:"bx_posts_videos_simple";}', 'a:2:{s:22:"bx_posts_videos_simple";s:26:"_sys_uploader_simple_title";s:21:"bx_posts_videos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_posts_form_entry_input_sys_videos', '_bx_posts_form_entry_input_videos', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_posts', 'bx_posts', 'polls', '', '', 0, 'custom', '_bx_posts_form_entry_input_sys_polls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'text', '', '', 0, 'textarea', '_bx_posts_form_entry_input_sys_text', '_bx_posts_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_posts_form_entry_input_text_err', 'XssHtml', '', 1, 0),
 ('bx_posts', 'bx_posts', 'text', '', '', 0, 'textarea', '_bx_posts_form_entry_input_sys_text', '_bx_posts_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_posts_form_entry_input_text_err', 'XssHtml', '', 1, 0),
 ('bx_posts', 'bx_posts', 'title', '', '', 0, 'text', '_bx_posts_form_entry_input_sys_title', '_bx_posts_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_posts_form_entry_input_title_err', 'Xss', '', 1, 0),
 ('bx_posts', 'bx_posts', 'title', '', '', 0, 'text', '_bx_posts_form_entry_input_sys_title', '_bx_posts_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_posts_form_entry_input_title_err', 'Xss', '', 1, 0),
 ('bx_posts', 'bx_posts', 'cat', '', '#!bx_posts_cats', 0, 'select', '_bx_posts_form_entry_input_sys_cat', '_bx_posts_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_posts_form_entry_input_cat_err', 'Xss', '', 1, 0),
 ('bx_posts', 'bx_posts', 'cat', '', '#!bx_posts_cats', 0, 'select', '_bx_posts_form_entry_input_sys_cat', '_bx_posts_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_posts_form_entry_input_cat_err', 'Xss', '', 1, 0),
 ('bx_posts', 'bx_posts', 'added', '', '', 0, 'datetime', '_bx_posts_form_entry_input_sys_date_added', '_bx_posts_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'added', '', '', 0, 'datetime', '_bx_posts_form_entry_input_sys_date_added', '_bx_posts_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'changed', '', '', 0, 'datetime', '_bx_posts_form_entry_input_sys_date_changed', '_bx_posts_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'changed', '', '', 0, 'datetime', '_bx_posts_form_entry_input_sys_date_changed', '_bx_posts_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'published', '', '', 0, 'datetime', '_bx_posts_form_entry_input_sys_date_published', '_bx_posts_form_entry_input_date_published', '_bx_posts_form_entry_input_date_published_info', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
 ('bx_posts', 'bx_posts', 'published', '', '', 0, 'datetime', '_bx_posts_form_entry_input_sys_date_published', '_bx_posts_form_entry_input_date_published', '_bx_posts_form_entry_input_date_published_info', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
+('bx_posts', 'bx_posts', 'attachments', '', '', 0, 'custom', '_bx_posts_form_entry_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_posts', 'bx_posts', 'anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
 ('bx_posts', 'bx_posts', 'anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
 
 
@@ -256,11 +344,15 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_posts_entry_add', 'title', 2147483647, 1, 2),
 ('bx_posts_entry_add', 'title', 2147483647, 1, 2),
 ('bx_posts_entry_add', 'cat', 2147483647, 1, 3),
 ('bx_posts_entry_add', 'cat', 2147483647, 1, 3),
 ('bx_posts_entry_add', 'text', 2147483647, 1, 4),
 ('bx_posts_entry_add', 'text', 2147483647, 1, 4),
-('bx_posts_entry_add', 'covers', 2147483647, 1, 5),
-('bx_posts_entry_add', 'allow_view_to', 2147483647, 1, 6),
-('bx_posts_entry_add', 'location', 2147483647, 1, 7),
-('bx_posts_entry_add', 'published', 192, 1, 8),
-('bx_posts_entry_add', 'do_publish', 2147483647, 1, 9),
+('bx_posts_entry_add', 'attachments', 2147483647, 1, 5),
+('bx_posts_entry_add', 'pictures', 2147483647, 1, 6),
+('bx_posts_entry_add', 'videos', 2147483647, 1, 7),
+('bx_posts_entry_add', 'polls', 2147483647, 1, 8),
+('bx_posts_entry_add', 'covers', 2147483647, 1, 9),
+('bx_posts_entry_add', 'allow_view_to', 2147483647, 1, 10),
+('bx_posts_entry_add', 'location', 2147483647, 1, 11),
+('bx_posts_entry_add', 'published', 192, 1, 12),
+('bx_posts_entry_add', 'do_publish', 2147483647, 1, 13),
 
 
 ('bx_posts_entry_delete', 'delete_confirm', 2147483647, 1, 1),
 ('bx_posts_entry_delete', 'delete_confirm', 2147483647, 1, 1),
 ('bx_posts_entry_delete', 'do_submit', 2147483647, 1, 2),
 ('bx_posts_entry_delete', 'do_submit', 2147483647, 1, 2),
@@ -270,17 +362,43 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_posts_entry_edit', 'title', 2147483647, 1, 3),
 ('bx_posts_entry_edit', 'title', 2147483647, 1, 3),
 ('bx_posts_entry_edit', 'cat', 2147483647, 1, 4),
 ('bx_posts_entry_edit', 'cat', 2147483647, 1, 4),
 ('bx_posts_entry_edit', 'text', 2147483647, 1, 5),
 ('bx_posts_entry_edit', 'text', 2147483647, 1, 5),
-('bx_posts_entry_edit', 'covers', 2147483647, 1, 6),
-('bx_posts_entry_edit', 'allow_view_to', 2147483647, 1, 7),
-('bx_posts_entry_edit', 'location', 2147483647, 1, 8),
-('bx_posts_entry_edit', 'published', 192, 1, 9),
-('bx_posts_entry_edit', 'do_submit', 2147483647, 1, 10),
+('bx_posts_entry_edit', 'attachments', 2147483647, 1, 6),
+('bx_posts_entry_edit', 'pictures', 2147483647, 1, 7),
+('bx_posts_entry_edit', 'videos', 2147483647, 1, 8),
+('bx_posts_entry_edit', 'polls', 2147483647, 1, 9),
+('bx_posts_entry_edit', 'covers', 2147483647, 1, 10),
+('bx_posts_entry_edit', 'allow_view_to', 2147483647, 1, 11),
+('bx_posts_entry_edit', 'location', 2147483647, 1, 12),
+('bx_posts_entry_edit', 'published', 192, 1, 13),
+('bx_posts_entry_edit', 'do_submit', 2147483647, 1, 14),
 
 
 ('bx_posts_entry_view', 'cat', 2147483647, 1, 1),
 ('bx_posts_entry_view', 'cat', 2147483647, 1, 1),
 ('bx_posts_entry_view', 'added', 2147483647, 1, 2),
 ('bx_posts_entry_view', 'added', 2147483647, 1, 2),
 ('bx_posts_entry_view', 'changed', 2147483647, 1, 3),
 ('bx_posts_entry_view', 'changed', 2147483647, 1, 3),
 ('bx_posts_entry_view', 'published', 192, 1, 4);
 ('bx_posts_entry_view', 'published', 192, 1, 4);
 
 
+-- FORMS: poll
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_posts_poll', 'bx_posts', '_bx_posts_form_poll', '', '', 'do_submit', 'bx_posts_polls', 'id', '', '', 'a:1:{s:14:"checker_helper";s:28:"BxPostsFormPollCheckerHelper";}', 0, 1, 'BxPostsFormPoll', 'modules/boonex/posts/classes/BxPostsFormPoll.php');
+
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('bx_posts_poll_add', 'bx_posts', 'bx_posts_poll', '_bx_posts_form_poll_display_add', 0);
+
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('bx_posts_poll', 'bx_posts', 'text', '', '', 0, 'textarea', '_bx_posts_form_poll_input_sys_text', '_bx_posts_form_poll_input_text', '', 1, 0, 3, '', '', '', 'Avail', '', '_bx_posts_form_poll_input_text_err', 'Xss', '', 1, 0),
+('bx_posts_poll', 'bx_posts', 'answers', '', '', 0, 'custom', '_bx_posts_form_poll_input_sys_answers', '_bx_posts_form_poll_input_answers', '_bx_posts_form_poll_input_answers_inf', 1, 0, 0, '', '', '', 'AvailAnswers', '', '_bx_posts_form_poll_input_answers_err', '', '', 1, 0),
+('bx_posts_poll', 'bx_posts', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_posts_poll', 'bx_posts', 'do_submit', '_bx_posts_form_poll_input_do_submit', '', 0, 'submit', '_bx_posts_form_poll_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_posts_poll', 'bx_posts', 'do_cancel', '_bx_posts_form_poll_input_do_cancel', '', 0, 'button', '_bx_posts_form_poll_input_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('bx_posts_poll_add', 'text', 2147483647, 1, 1),
+('bx_posts_poll_add', 'answers', 2147483647, 1, 2),
+('bx_posts_poll_add', 'controls', 2147483647, 1, 3),
+('bx_posts_poll_add', 'do_submit', 2147483647, 1, 4),
+('bx_posts_poll_add', 'do_cancel', 2147483647, 1, 5);
+
+
 -- PRE-VALUES
 -- PRE-VALUES
 INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
 INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
 ('bx_posts_cats', '_bx_posts_pre_lists_cats', 'bx_posts', '0');
 ('bx_posts_cats', '_bx_posts_pre_lists_cats', 'bx_posts', '0');
@@ -326,7 +444,8 @@ INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `Char
 
 
 -- VOTES
 -- VOTES
 INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
 INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
-('bx_posts', 'bx_posts_votes', 'bx_posts_votes_track', '604800', '1', '1', '0', '1', 'bx_posts_posts', 'id', 'author', 'rate', 'votes', '', '');
+('bx_posts', 'bx_posts_votes', 'bx_posts_votes_track', '604800', '1', '1', '0', '1', 'bx_posts_posts', 'id', 'author', 'rate', 'votes', '', ''),
+('bx_posts_poll_answers', 'bx_posts_polls_answers_votes', 'bx_posts_polls_answers_votes_track', '604800', '1', '1', '0', '1', 'bx_posts_polls_answers', 'id', 'author_id', 'rate', 'votes', 'BxPostsVotePollAnswers', 'modules/boonex/posts/classes/BxPostsVotePollAnswers.php');
 
 
 -- SCORES
 -- SCORES
 INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 
 INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES 

+ 8 - 8
modules/boonex/posts/install/sql/uninstall.sql

@@ -1,20 +1,20 @@
 
 
 -- TABLES
 -- TABLES
-DROP TABLE IF EXISTS `bx_posts_posts`, `bx_posts_files`, `bx_posts_photos`, `bx_posts_photos_resized`, `bx_posts_cmts`, `bx_posts_votes`, `bx_posts_votes_track`, `bx_posts_views_track`, `bx_posts_meta_keywords`, `bx_posts_meta_locations`, `bx_posts_meta_mentions`, `bx_posts_reports`, `bx_posts_reports_track`, `bx_posts_favorites_track`, `bx_posts_scores`, `bx_posts_scores_track`;
+DROP TABLE IF EXISTS `bx_posts_posts`, `bx_posts_files`, `bx_posts_photos`, `bx_posts_photos_resized`, `bx_posts_videos`, `bx_posts_videos_resized`, `bx_posts_cmts`, `bx_posts_votes`, `bx_posts_votes_track`, `bx_posts_views_track`, `bx_posts_meta_keywords`, `bx_posts_meta_locations`, `bx_posts_meta_mentions`, `bx_posts_reports`, `bx_posts_reports_track`, `bx_posts_favorites_track`, `bx_posts_scores`, `bx_posts_scores_track`, `bx_posts_polls`, `bx_posts_polls_answers`, `bx_posts_polls_answers_votes`, `bx_posts_polls_answers_votes_track`;
 
 
 -- STORAGES & TRANSCODERS
 -- STORAGES & TRANSCODERS
-DELETE FROM `sys_objects_storage` WHERE `object` IN ('bx_posts_files', 'bx_posts_photos', 'bx_posts_photos_resized');
-DELETE FROM `sys_storage_tokens` WHERE `object` IN ('bx_posts_files', 'bx_posts_photos', 'bx_posts_photos_resized');
+DELETE FROM `sys_objects_storage` WHERE `object` LIKE 'bx_posts_%';
+DELETE FROM `sys_storage_tokens` WHERE `object` LIKE 'bx_posts_%';
 
 
-DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_posts_preview', 'bx_posts_gallery', 'bx_posts_cover', 'bx_posts_preview_photos', 'bx_posts_gallery_photos');
-DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_posts_preview', 'bx_posts_gallery', 'bx_posts_cover', 'bx_posts_preview_photos', 'bx_posts_gallery_photos');
-DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_posts_preview', 'bx_posts_gallery', 'bx_posts_cover', 'bx_posts_preview_photos', 'bx_posts_gallery_photos');
+DELETE FROM `sys_objects_transcoder` WHERE `object` LIKE 'bx_posts_%';
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` LIKE 'bx_posts_%';
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` LIKE 'bx_posts_%';
 
 
 -- FORMS
 -- FORMS
 DELETE FROM `sys_objects_form` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_objects_form` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_form_displays` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_form_displays` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_posts';
-DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN ('bx_posts_entry_add', 'bx_posts_entry_edit', 'bx_posts_entry_view', 'bx_posts_entry_delete');
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` LIKE 'bx_posts_%';
 
 
 -- PRE-VALUES
 -- PRE-VALUES
 DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_posts';
 DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_posts';
@@ -25,7 +25,7 @@ DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_posts_cats');
 DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_posts';
 DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_posts';
 
 
 -- VOTES
 -- VOTES
-DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_posts';
+DELETE FROM `sys_objects_vote` WHERE `Name` IN ('bx_posts', 'bx_posts_poll_answers');
 
 
 -- SCORES
 -- SCORES
 DELETE FROM `sys_objects_score` WHERE `name` = 'bx_posts';
 DELETE FROM `sys_objects_score` WHERE `name` = 'bx_posts';

+ 206 - 0
modules/boonex/posts/js/polls.js

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

+ 1 - 3
modules/boonex/posts/template/css/forms.css

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ 1 - 0
modules/boonex/posts/template/uploader_button_simple.html

@@ -0,0 +1 @@
+<bx_include_auto:uploader_button_simple_js.html />

+ 91 - 55
modules/boonex/russian/data/langs/bx_posts/ru.xml

@@ -1,45 +1,48 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <resources name="ru" flag="ru" title="Russian">
 <resources name="ru" flag="ru" title="Russian">
 
 
-	<string name="_bx_posts"><![CDATA[Публикации]]></string>
-	<string name="_bx_posts_cmts"><![CDATA[Публикации - Комментарии]]></string>
+    <string name="_bx_posts"><![CDATA[Публикации]]></string>
+    <string name="_bx_posts_cmts"><![CDATA[Публикации - Комментарии]]></string>
 
 
-	<string name="_bx_posts_option_summary_chars"><![CDATA[Количество символов в автогенерируемой сводке к публикациям]]></string>
-	<string name="_bx_posts_option_plain_summary_chars"><![CDATA[Количество символов в описании публикации при отсутствующей картинке публикации]]></string>
+    <string name="_bx_posts_option_summary_chars"><![CDATA[Количество символов в автогенерируемой сводке к публикациям]]></string>
+    <string name="_bx_posts_option_plain_summary_chars"><![CDATA[Количество символов в описании публикации при отсутствующей картинке публикации]]></string>
     <string name="_bx_posts_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
     <string name="_bx_posts_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
     <string name="_bx_posts_option_per_page_profile"><![CDATA[Количество элементов на странице профайла]]></string>
     <string name="_bx_posts_option_per_page_profile"><![CDATA[Количество элементов на странице профайла]]></string>
-	<string name="_bx_posts_option_rss_num"><![CDATA[Количество элементов в ленте RSS]]></string>
-	<string name="_bx_posts_option_searchable_fields"><![CDATA[Поля для поиска по ключевому слову]]></string>
+    <string name="_bx_posts_option_rss_num"><![CDATA[Количество элементов в ленте RSS]]></string>
+    <string name="_bx_posts_option_searchable_fields"><![CDATA[Поля для поиска по ключевому слову]]></string>
 
 
-	<string name="_bx_posts_form_entry"><![CDATA[Публикации]]></string>
-	<string name="_bx_posts_form_entry_display_add"><![CDATA[Добавить публикацию]]></string>
-	<string name="_bx_posts_form_entry_display_edit"><![CDATA[Редактировать публикацию]]></string>
-	<string name="_bx_posts_form_entry_display_delete"><![CDATA[Удалить публикацию]]></string>
-	<string name="_bx_posts_form_entry_display_view"><![CDATA[Просмотреть публикацию]]></string>
-	<string name="_bx_posts_form_entry_input_author"><![CDATA[Автор]]></string>
-	<string name="_bx_posts_form_entry_input_sys_do_submit"><![CDATA[Выполнить]]></string>
-	<string name="_bx_posts_form_entry_input_do_submit"><![CDATA[Выполнить]]></string>
-	<string name="_bx_posts_form_entry_input_sys_do_publish"><![CDATA[Опубликовать]]></string>
-	<string name="_bx_posts_form_entry_input_do_publish"><![CDATA[Опубликовать]]></string>
-	<string name="_bx_posts_form_entry_input_sys_title"><![CDATA[Заголовок]]></string>
-	<string name="_bx_posts_form_entry_input_title"><![CDATA[Заголовок]]></string>
-	<string name="_bx_posts_form_entry_input_title_err"><![CDATA[Заголовок обязателен. Пожалуйста, заполните это поле]]></string>
-	<string name="_bx_posts_form_entry_input_sys_cat"><![CDATA[Категория]]></string>
-	<string name="_bx_posts_form_entry_input_cat"><![CDATA[Категория]]></string>
-	<string name="_bx_posts_form_entry_input_cat_err"><![CDATA[Нужно обязательно выбрать категорию]]></string>
-	<string name="_bx_posts_form_entry_input_sys_text"><![CDATA[Текст]]></string>
-	<string name="_bx_posts_form_entry_input_text"><![CDATA[Текст]]></string>
-	<string name="_bx_posts_form_entry_input_text_err"><![CDATA[Поле для Текста не может быть пустым]]></string>
-	<string name="_bx_posts_form_entry_input_sys_delete_confirm"><![CDATA[Удалить подтверждение]]></string>
-	<string name="_bx_posts_form_entry_input_delete_confirm"><![CDATA[Я уверен(а), что хочу удалить эту публикацию]]></string>
-	<string name="_bx_posts_form_entry_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено]]></string>
-	<string name="_bx_posts_form_entry_input_delete_confirm_error"><![CDATA[Пожалуйста, отметьте этот флажок, если действительно хотите удалить публикацию]]></string>
-        <string name="_bx_posts_form_entry_input_sys_covers"><![CDATA[Изображение заголовка]]></string>
-	<string name="_bx_posts_form_entry_input_covers"><![CDATA[Изображение заголовка]]></string>
-	<string name="_bx_posts_form_entry_input_covers_uploader_simple_title"><![CDATA[Загрузить]]></string>
-	<string name="_bx_posts_form_entry_input_covers_uploader_html5_title"><![CDATA[Загрузить]]></string>
-	<string name="_bx_posts_form_entry_input_sys_pictures"><![CDATA[Картинки]]></string>
-	<string name="_bx_posts_form_entry_input_pictures"><![CDATA[Картинки]]></string>
+    <string name="_bx_posts_form_entry"><![CDATA[Публикации]]></string>
+    <string name="_bx_posts_form_entry_display_add"><![CDATA[Добавить публикацию]]></string>
+    <string name="_bx_posts_form_entry_display_edit"><![CDATA[Редактировать публикацию]]></string>
+    <string name="_bx_posts_form_entry_display_delete"><![CDATA[Удалить публикацию]]></string>
+    <string name="_bx_posts_form_entry_display_view"><![CDATA[Просмотреть публикацию]]></string>
+    <string name="_bx_posts_form_entry_input_author"><![CDATA[Автор]]></string>
+    <string name="_bx_posts_form_entry_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_posts_form_entry_input_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_posts_form_entry_input_sys_do_publish"><![CDATA[Опубликовать]]></string>
+    <string name="_bx_posts_form_entry_input_do_publish"><![CDATA[Опубликовать]]></string>
+    <string name="_bx_posts_form_entry_input_sys_title"><![CDATA[Заголовок]]></string>
+    <string name="_bx_posts_form_entry_input_title"><![CDATA[Заголовок]]></string>
+    <string name="_bx_posts_form_entry_input_title_err"><![CDATA[Заголовок обязателен. Пожалуйста, заполните это поле]]></string>
+    <string name="_bx_posts_form_entry_input_sys_cat"><![CDATA[Категория]]></string>
+    <string name="_bx_posts_form_entry_input_cat"><![CDATA[Категория]]></string>
+    <string name="_bx_posts_form_entry_input_cat_err"><![CDATA[Нужно обязательно выбрать категорию]]></string>
+    <string name="_bx_posts_form_entry_input_sys_text"><![CDATA[Текст]]></string>
+    <string name="_bx_posts_form_entry_input_text"><![CDATA[Текст]]></string>
+    <string name="_bx_posts_form_entry_input_text_err"><![CDATA[Поле для Текста не может быть пустым]]></string>
+    <string name="_bx_posts_form_entry_input_sys_delete_confirm"><![CDATA[Удалить подтверждение]]></string>
+    <string name="_bx_posts_form_entry_input_delete_confirm"><![CDATA[Я уверен(а), что хочу удалить эту публикацию]]></string>
+    <string name="_bx_posts_form_entry_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено]]></string>
+    <string name="_bx_posts_form_entry_input_delete_confirm_error"><![CDATA[Пожалуйста, отметьте этот флажок, если действительно хотите удалить публикацию]]></string>
+    <string name="_bx_posts_form_entry_input_sys_covers"><![CDATA[Изображение заголовка]]></string>
+    <string name="_bx_posts_form_entry_input_covers"><![CDATA[Изображение заголовка]]></string>
+    <string name="_bx_posts_form_entry_input_covers_uploader_simple_title"><![CDATA[Загрузить]]></string>
+    <string name="_bx_posts_form_entry_input_covers_uploader_html5_title"><![CDATA[Загрузить]]></string>
+    <string name="_bx_posts_form_entry_input_sys_pictures"><![CDATA[Изображения]]></string>
+    <string name="_bx_posts_form_entry_input_pictures"><![CDATA[]]></string>
+    <string name="_bx_posts_form_entry_input_sys_videos"><![CDATA[Видео]]></string>
+    <string name="_bx_posts_form_entry_input_videos"><![CDATA[]]></string>
+    <string name="_bx_posts_form_entry_input_sys_polls"><![CDATA[Голосования]]></string>
     <string name="_bx_posts_form_entry_input_sys_allow_view_to"><![CDATA[Видимость]]></string>
     <string name="_bx_posts_form_entry_input_sys_allow_view_to"><![CDATA[Видимость]]></string>
     <string name="_bx_posts_form_entry_input_allow_view_to"><![CDATA[Видимость]]></string>
     <string name="_bx_posts_form_entry_input_allow_view_to"><![CDATA[Видимость]]></string>
     <string name="_bx_posts_form_entry_input_picture_use_as_thumb"><![CDATA[Изображение обложки]]></string>
     <string name="_bx_posts_form_entry_input_picture_use_as_thumb"><![CDATA[Изображение обложки]]></string>
@@ -50,30 +53,45 @@
     <string name="_bx_posts_form_entry_input_sys_date_published"><![CDATA[Опубликовано]]></string>
     <string name="_bx_posts_form_entry_input_sys_date_published"><![CDATA[Опубликовано]]></string>
     <string name="_bx_posts_form_entry_input_date_published"><![CDATA[Опубликовано]]></string>
     <string name="_bx_posts_form_entry_input_date_published"><![CDATA[Опубликовано]]></string>
     <string name="_bx_posts_form_entry_input_date_published_info"><![CDATA[Оставьте пустым, чтобы опубликовать немедленно.]]></string>
     <string name="_bx_posts_form_entry_input_date_published_info"><![CDATA[Оставьте пустым, чтобы опубликовать немедленно.]]></string>
+    <string name="_bx_posts_form_entry_input_sys_attachments"><![CDATA[Вложения]]></string>
 
 
-	<string name="_bx_posts_acl_action_create_entry"><![CDATA[Создать публикацию]]></string>
-	<string name="_bx_posts_acl_action_delete_entry"><![CDATA[Удалить публикацию]]></string>
-	<string name="_bx_posts_acl_action_view_entry"><![CDATA[Просмотреть публикацию]]></string>
-	<string name="_bx_posts_acl_action_set_thumb"><![CDATA[Назначить значок публикации]]></string>
-	<string name="_bx_posts_acl_action_edit_any_entry"><![CDATA[Редактировать любую публикацию]]></string>
+    <string name="_bx_posts_form_poll"><![CDATA[Голосования]]></string>
+    <string name="_bx_posts_form_poll_display_add"><![CDATA[Добавить голосование]]></string>
+    <string name="_bx_posts_form_poll_input_sys_text"><![CDATA[Вопрос]]></string>
+    <string name="_bx_posts_form_poll_input_text"><![CDATA[Вопрос]]></string>
+    <string name="_bx_posts_form_poll_input_text_err"><![CDATA[Вопрос обязателен. Пожалуйста, заполните это поле]]></string>
+    <string name="_bx_posts_form_poll_input_sys_answers"><![CDATA[Ответы]]></string>
+    <string name="_bx_posts_form_poll_input_answers"><![CDATA[Ответы]]></string>
+    <string name="_bx_posts_form_poll_input_answers_inf"><![CDATA[Оставьте текстовое поле пустым, чтобы удалить ответ.]]></string>
+    <string name="_bx_posts_form_poll_input_answers_err"><![CDATA[Голосование должно иметь как минимум 2 не пустых ответа.]]></string>
+    <string name="_bx_posts_form_poll_input_answers_add"><![CDATA[Добавить ещё]]></string>    
+    <string name="_bx_posts_form_poll_input_sys_do_submit"><![CDATA[Добавить]]></string>
+    <string name="_bx_posts_form_poll_input_do_submit"><![CDATA[Добавить]]></string>
+    <string name="_bx_posts_form_poll_input_do_cancel"><![CDATA[Закрыть]]></string>
 
 
-	<string name="_bx_posts_page_title_sys_create_entry"><![CDATA[Новая публикация]]></string>
-	<string name="_bx_posts_page_title_create_entry"><![CDATA[Новая публикация]]></string>
-	<string name="_bx_posts_page_block_title_create_entry"><![CDATA[Новая публикация]]></string>
-	<string name="_bx_posts_page_title_sys_edit_entry"><![CDATA[Редактировать публикацию]]></string>
-	<string name="_bx_posts_page_title_edit_entry"><![CDATA[Редактировать публикацию]]></string>
-	<string name="_bx_posts_page_block_title_edit_entry"><![CDATA[Редактировать публикацию]]></string>
+    <string name="_bx_posts_acl_action_create_entry"><![CDATA[Создать публикацию]]></string>
+    <string name="_bx_posts_acl_action_delete_entry"><![CDATA[Удалить публикацию]]></string>
+    <string name="_bx_posts_acl_action_view_entry"><![CDATA[Просмотреть публикацию]]></string>
+    <string name="_bx_posts_acl_action_set_thumb"><![CDATA[Назначить значок публикации]]></string>
+    <string name="_bx_posts_acl_action_edit_any_entry"><![CDATA[Редактировать любую публикацию]]></string>
+
+    <string name="_bx_posts_page_title_sys_create_entry"><![CDATA[Новая публикация]]></string>
+    <string name="_bx_posts_page_title_create_entry"><![CDATA[Новая публикация]]></string>
+    <string name="_bx_posts_page_block_title_create_entry"><![CDATA[Новая публикация]]></string>
+    <string name="_bx_posts_page_title_sys_edit_entry"><![CDATA[Редактировать публикацию]]></string>
+    <string name="_bx_posts_page_title_edit_entry"><![CDATA[Редактировать публикацию]]></string>
+    <string name="_bx_posts_page_block_title_edit_entry"><![CDATA[Редактировать публикацию]]></string>
     <string name="_bx_posts_page_title_sys_delete_entry"><![CDATA[Удалить публикацию]]></string>
     <string name="_bx_posts_page_title_sys_delete_entry"><![CDATA[Удалить публикацию]]></string>
     <string name="_bx_posts_page_title_delete_entry"><![CDATA[Удалить публикацию]]></string>
     <string name="_bx_posts_page_title_delete_entry"><![CDATA[Удалить публикацию]]></string>
     <string name="_bx_posts_page_block_title_delete_entry"><![CDATA[Удалить публикацию]]></string>
     <string name="_bx_posts_page_block_title_delete_entry"><![CDATA[Удалить публикацию]]></string>
-	<string name="_bx_posts_page_title_sys_view_entry"><![CDATA[Просмотреть публикацию]]></string>
-	<string name="_bx_posts_page_title_view_entry"><![CDATA[{title}]]></string>
-	<string name="_bx_posts_page_block_title_entry_text"><![CDATA[Текст публикации]]></string>
-	<string name="_bx_posts_page_title_browse"><![CDATA[Публикации]]></string>
-	<string name="_bx_posts_page_title_search_results"><![CDATA[Публикации, соответствующие "{0}"]]></string>
-	<string name="_bx_posts_page_title_browse_by_author"><![CDATA[Публикации {display_name}]]></string>
-	<string name="_bx_posts_page_title_browse_by_context"><![CDATA[Публикации в контексте: {display_name}]]></string>
-	<string name="_bx_posts_page_title_browse_featured"><![CDATA[Продвинутые публикации]]></string>
+    <string name="_bx_posts_page_title_sys_view_entry"><![CDATA[Просмотреть публикацию]]></string>
+    <string name="_bx_posts_page_title_view_entry"><![CDATA[{title}]]></string>
+    <string name="_bx_posts_page_block_title_entry_text"><![CDATA[Текст публикации]]></string>
+    <string name="_bx_posts_page_title_browse"><![CDATA[Публикации]]></string>
+    <string name="_bx_posts_page_title_search_results"><![CDATA[Публикации, соответствующие "{0}"]]></string>
+    <string name="_bx_posts_page_title_browse_by_author"><![CDATA[Публикации {display_name}]]></string>
+    <string name="_bx_posts_page_title_browse_by_context"><![CDATA[Публикации в контексте: {display_name}]]></string>
+    <string name="_bx_posts_page_title_browse_featured"><![CDATA[Продвинутые публикации]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Недавние публикации]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Недавние публикации]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Популярные публикации]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Популярные публикации]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Обновлённые публикации]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Обновлённые публикации]]></string>
@@ -90,6 +108,7 @@
     <string name="_bx_posts_page_block_title_entry_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_posts_page_block_title_entry_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_posts_page_block_title_entry_location"><![CDATA[Расположение]]></string>
     <string name="_bx_posts_page_block_title_entry_location"><![CDATA[Расположение]]></string>
     <string name="_bx_posts_page_block_title_entry_attachments"><![CDATA[Прикрепления]]></string>
     <string name="_bx_posts_page_block_title_entry_attachments"><![CDATA[Прикрепления]]></string>
+    <string name="_bx_posts_page_block_title_entry_polls"><![CDATA[Голосования]]></string>
     <string name="_bx_posts_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
     <string name="_bx_posts_page_block_title_entry_all_actions"><![CDATA[Все действия]]></string>
     <string name="_bx_posts_page_title_sys_entries_popular"><![CDATA[Популярные публикации]]></string>
     <string name="_bx_posts_page_title_sys_entries_popular"><![CDATA[Популярные публикации]]></string>
     <string name="_bx_posts_page_title_entries_popular"><![CDATA[Популярные публикации]]></string>
     <string name="_bx_posts_page_title_entries_popular"><![CDATA[Популярные публикации]]></string>
@@ -138,7 +157,16 @@
     <string name="_bx_posts_page_block_title_sys_entry_context"><![CDATA[Опубликовано в]]></string>
     <string name="_bx_posts_page_block_title_sys_entry_context"><![CDATA[Опубликовано в]]></string>
     <string name="_bx_posts_page_block_title_entry_context"><![CDATA[Опубликовано в]]></string>
     <string name="_bx_posts_page_block_title_entry_context"><![CDATA[Опубликовано в]]></string>
 
 
-  <string name="_bx_posts_menu_set_title_view_entry"><![CDATA[Публикация - Действия]]></string>
+    <string name="_bx_posts_menu_title_entry_attachments"><![CDATA[Форма - Прикрепления]]></string>
+    <string name="_bx_posts_menu_set_title_entry_attachments"><![CDATA[Форма - Прикрепления]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_photo"><![CDATA[Добавить фото]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_photo"><![CDATA[Добавить фото]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_video"><![CDATA[Добавить видео]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_video"><![CDATA[Добавить видео]]></string>
+    <string name="_bx_posts_menu_item_title_system_cpa_poll"><![CDATA[Добавить голосование]]></string>
+    <string name="_bx_posts_menu_item_title_cpa_poll"><![CDATA[Добавить голосование]]></string>
+
+    <string name="_bx_posts_menu_set_title_view_entry"><![CDATA[Публикация - Действия]]></string>
     <string name="_bx_posts_menu_title_view_entry"><![CDATA[Публикация - Действия]]></string>
     <string name="_bx_posts_menu_title_view_entry"><![CDATA[Публикация - Действия]]></string>
     <string name="_bx_posts_menu_title_submenu"><![CDATA[Публикации - Подменю]]></string>
     <string name="_bx_posts_menu_title_submenu"><![CDATA[Публикации - Подменю]]></string>
     <string name="_bx_posts_menu_set_title_submenu"><![CDATA[Публикации - Подменю]]></string>
     <string name="_bx_posts_menu_set_title_submenu"><![CDATA[Публикации - Подменю]]></string>
@@ -240,4 +268,12 @@
     <string name="_bx_posts_txt_sample_single_with_article"><![CDATA[публикация]]></string>
     <string name="_bx_posts_txt_sample_single_with_article"><![CDATA[публикация]]></string>
     <string name="_bx_posts_txt_sample_comment_single"><![CDATA[комментарий к публикации]]></string>
     <string name="_bx_posts_txt_sample_comment_single"><![CDATA[комментарий к публикации]]></string>
     <string name="_bx_posts_txt_sample_vote_single"><![CDATA[голос за публикацию]]></string>
     <string name="_bx_posts_txt_sample_vote_single"><![CDATA[голос за публикацию]]></string>
+
+    <string name="_bx_posts_txt_err_cannot_perform_action"><![CDATA[Невозможно выполнить действие. Пожалуйста, оповестите нас об этой проблеме.]]></string>
+
+    <string name="_bx_posts_txt_poll_answers"><![CDATA[опрос]]></string>
+    <string name="_bx_posts_txt_poll_results"><![CDATA[результаты]]></string>
+    <string name="_bx_posts_txt_poll_answer_vote_do_by"><![CDATA[Проголосовали за]]></string>
+    <string name="_bx_posts_txt_poll_answer_vote_counter"><![CDATA[{0} голосов]]></string>
+    <string name="_bx_posts_txt_poll_answer_vote_percent"><![CDATA[({0}%)]]></string>
 </resources>
 </resources>