Quellcode durchsuchen

Merge branch 'master' of github.com:unaio/una

Alex Trofimov vor 9 Jahren
Ursprung
Commit
03ae0bc4c4

+ 30 - 6
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -149,13 +149,12 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
         if (!$oProfile) 
             $oProfile = BxDolProfileUndefined::getInstance();
 
-        // get summary
-        $sLinkMore = ' <a title="' . bx_html_attribute(_t('_sys_read_more', $aData[$CNF['FIELD_TITLE']])) . '" href="' . $sUrl . '"><i class="sys-icon ellipsis-h"></i></a>';
-        $sSummary = strmaxtextlen($aData[$CNF['FIELD_TEXT']], (int)getParam($CNF['PARAM_CHARS_SUMMARY']), $sLinkMore);
+        $sTitle = $this->getTitle($aData);
+        $sText = $this->getText($aData);
+        $sSummary = $this->getSummary($aData, $sTitle, $sText, $sUrl);
         $sSummaryPlain = isset($CNF['PARAM_CHARS_SUMMARY_PLAIN']) && $CNF['PARAM_CHARS_SUMMARY_PLAIN'] ? BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), (int)getParam($CNF['PARAM_CHARS_SUMMARY_PLAIN'])) : '';
 
-        $sText = $aData[$CNF['FIELD_TEXT']];
-        if (!empty($CNF['OBJECT_METATAGS'])) {
+        if(!empty($CNF['OBJECT_METATAGS'])) {
             $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
     
             // keywords
@@ -163,7 +162,7 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
                 $sText = $oMetatags->keywordsParse($aData[$CNF['FIELD_ID']], $sText);
         }
 
-        $sTitle = bx_process_output($aData[$CNF['FIELD_TITLE']]);
+        $sTitle = bx_process_output($sTitle);
 
         // generate html
         return array (
@@ -200,6 +199,31 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
         );
     }
 
+    protected function getTitle($aData)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        return $aData[$CNF['FIELD_TITLE']];
+    }
+
+    protected function getText($aData)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        return $aData[$CNF['FIELD_TEXT']];
+    }
+
+    protected function getSummary($aData, $sTitle = '', $sText = '', $sUrl = '')
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+        if(empty($CNF['PARAM_CHARS_SUMMARY']))
+            return '';
+
+        // get summary
+        $sLinkMore = ' <a title="' . bx_html_attribute(_t('_sys_read_more', $sTitle)) . '" href="' . $sUrl . '"><i class="sys-icon ellipsis-h"></i></a>';
+        return  strmaxtextlen($sText, (int)getParam($CNF['PARAM_CHARS_SUMMARY']), $sLinkMore);
+    }
+
 	protected function getAttachments ($sStorage, $aData)
     {
         $CNF = &$this->getModule()->_oConfig->CNF;

+ 5 - 3
modules/boonex/polls/classes/BxPollsConfig.php

@@ -36,7 +36,7 @@ class BxPollsConfig extends BxBaseModTextConfig
             'FIELD_AUTHOR' => 'author',
             'FIELD_ADDED' => 'added',
             'FIELD_CHANGED' => 'changed',
-            'FIELD_TITLE' => 'title',
+            'FIELD_TITLE' => '',
             'FIELD_TEXT' => 'text',
             'FIELD_TEXT_ID' => 'poll-text',
         	'FIELD_SUBENTRIES' => 'subentries',
@@ -65,8 +65,9 @@ class BxPollsConfig extends BxBaseModTextConfig
         	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=polls-administration',
 
             // some params
-            'PARAM_CHARS_SUMMARY' => 'bx_polls_summary_chars',
-            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_polls_plain_summary_chars',
+            'PARAM_CHARS_TITLE' => 'bx_polls_title_chars',
+            'PARAM_CHARS_SUMMARY' => '',
+            'PARAM_CHARS_SUMMARY_PLAIN' => '',
             'PARAM_NUM_RSS' => 'bx_polls_rss_num',
         	'PARAM_SEARCHABLE_FIELDS' => 'bx_polls_searchable_fields',
 
@@ -148,6 +149,7 @@ class BxPollsConfig extends BxBaseModTextConfig
             'block_menu' => $sHtmlPrefix . '-block-menu',
         	'block_link_subentries' => $sHtmlPrefix . '-block-subentries',
         	'block_link_results' => $sHtmlPrefix . '-block-results',
+            'content' => $sHtmlPrefix . '-content-',
         );
     }
 

+ 10 - 4
modules/boonex/polls/classes/BxPollsFormEntry.php

@@ -31,10 +31,13 @@ class BxPollsFormEntry extends BxBaseModTextFormEntry
         $CNF = &$this->_oModule->_oConfig->CNF;
 
         if(isset($this->aInputs[$CNF['FIELD_SUBENTRIES']]) && !empty($aValues['id'])) {
-            $this->aInputs[$CNF['FIELD_SUBENTRIES']]['values'] = $this->_oModule->_oDb->getSubentries(array(
+            $aSubentries = $this->_oModule->_oDb->getSubentries(array(
                 'type' => 'entry_id_pairs',
                 'entry_id' => $aValues['id']
             ));
+
+            $this->aInputs[$CNF['FIELD_SUBENTRIES']]['value'] = array_values($aSubentries);
+            $this->aInputs[$CNF['FIELD_SUBENTRIES']]['value_ids'] = array_keys($aSubentries);
         }
 
         return parent::initChecker($aValues, $aSpecificValues);
@@ -123,12 +126,15 @@ class BxPollsFormEntry extends BxBaseModTextFormEntry
     {
         $sResult = '';
 
-        if(empty($aInput['values']) || !is_array($aInput['values']))
+        if(empty($aInput['value']) || !is_array($aInput['value'])) {
+            $sResult .= $this->genCustomInputSubentriesText($aInput);
             $sResult .= $this->genCustomInputSubentriesText($aInput);
+        }
         else
-            foreach($aInput['values'] as $iId => $sValue) {
+            foreach($aInput['value'] as $iKey => $sValue) {
                 $sResult .= $this->genCustomInputSubentriesText($aInput, $sValue);
-                $sResult .= $this->genCustomInputSubentriesHidden($aInput, $iId);
+                if(!empty($aInput['value_ids'][$iKey]))
+                    $sResult .= $this->genCustomInputSubentriesHidden($aInput, (int)$aInput['value_ids'][$iKey]);
             }
 
         $sResult .= $this->genCustomInputSubentriesButton($aInput);

+ 15 - 0
modules/boonex/polls/classes/BxPollsModule.php

@@ -40,6 +40,7 @@ class BxPollsModule extends BxBaseModTextModule
         ));
     }
 
+
     /**
      * SERVICE METHODS
      */
@@ -53,6 +54,20 @@ class BxPollsModule extends BxBaseModTextModule
         return $this->_serviceTemplateFunc('entryResults', $iContentId);
     }
 
+
+	/**
+     * INTERNAL METHODS
+     */
+    
+    protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl)
+    {
+        return array();
+    }
+
+    protected function _getContentForTimelinePost($aEvent, $aContentInfo)
+    {
+        return $this->_oTemplate->getContentForTimelinePost($aEvent, $aContentInfo);
+    }
     
 }
 

+ 13 - 3
modules/boonex/polls/classes/BxPollsSearchResult.php

@@ -21,7 +21,7 @@ class BxPollsSearchResult extends BxBaseModTextSearchResult
             'object_metatags' => 'bx_polls',
             'title' => _t('_bx_polls_page_title_browse'),
             'table' => 'bx_polls_entries',
-            'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added'),
+            'ownFields' => array('id', 'text', 'thumb', 'author', 'anonymous', 'hidden_results', 'added'),
             'searchFields' => array(),
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
@@ -37,9 +37,9 @@ class BxPollsSearchResult extends BxBaseModTextSearchResult
                 'fields' => array (
                     'Guid' => 'link',
                     'Link' => 'link',
-                    'Title' => 'title',
+                    'Title' => 'text',
                     'DateTimeUTS' => 'added',
-                    'Desc' => 'text',
+                    'Desc' => '',
                 ),
             ),
             'ident' => 'id',
@@ -105,6 +105,16 @@ class BxPollsSearchResult extends BxBaseModTextSearchResult
         $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
     }
 
+    function addCustomParts ()
+    {
+        $this->oModule->_oTemplate->addJs(array('entry.js'));
+        $this->oModule->_oTemplate->addCss(array('entry.css'));
+
+        return $this->oModule->_oTemplate->getJsCode('entry');
+    }
+    
+    
+        
     function getAlterOrder()
     {
         $aSql = array();

+ 54 - 0
modules/boonex/polls/classes/BxPollsTemplate.php

@@ -50,7 +50,12 @@ class BxPollsTemplate extends BxBaseModTextTemplate
 
     	return array(
             'content' => $this->parseHtmlByName('subentries.html', array(
+    			'html_id' => $this->_oConfig->getHtmlIds('content') . $aData[$CNF['FIELD_ID']],
                 'bx_repeat:subentries' => $aTmplVarsSubentries,
+    	        'bx_if:show_anonymous' => array(
+    	            'condition' => (int)$aData[$CNF['FIELD_ANONYMOUS']] == 1,
+    	            'content' => array()
+    	        )
             )),
             'menu' => $this->_getGetBlockMenu($aData, 'subentries')
         );
@@ -85,12 +90,61 @@ class BxPollsTemplate extends BxBaseModTextTemplate
 
         return array(
             'content' => $this->parseHtmlByName('subentries_results.html', array(
+            	'html_id' => $this->_oConfig->getHtmlIds('content') . $aData[$CNF['FIELD_ID']],
                 'bx_repeat:subentries' => $aTmplVarsSubentries,
             )),
             'menu' => $this->_getGetBlockMenu($aData, 'results')
         );
     }
 
+    public function getContentForTimelinePost($aEvent, $aData)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        $sTitle = $this->getTitle($aData);
+        $sTitleAttr = bx_html_attribute($sTitle);
+        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
+
+        if(!empty($sUrl) && !empty($sTitle))
+            $sTitle = $this->parseHtmlByName('bx_a.html', array(
+                'href' => $sUrl,
+                'title' => $sTitleAttr,
+                'bx_repeat:attrs' => array(
+                    array('key' => 'class', 'value' => 'bx-tl-title')
+                ),
+                'content' => $sTitle
+            ));
+
+        $aBlock = $this->entrySubentries($aData);
+
+        $this->addJs(array('entry.js'));
+        $this->addCss(array('entry.css'));
+        return $this->parseHtmlByName('unit_timeline.html', array(
+            'title' => $sTitle,
+            'content' => $aBlock['content'],
+            'js_code' => $this->getJsCode('entry')
+        ));
+    }
+
+    protected function getTitle($aData)
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        return BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($aData[$CNF['FIELD_TEXT']]), (int)getParam($CNF['PARAM_CHARS_TITLE']));
+    }
+
+    protected function getSummary($aData, $sTitle = '', $sText = '', $sUrl = '')
+    {
+        $aBlock = $this->entrySubentries($aData);
+
+        return $aBlock['content'];
+    }
+
+    protected function getUnitThumbAndGallery ($aData)
+    {
+        return array('', '');
+    }
+
     protected function _getGetBlockMenu($aData, $sSelected = '')
     {
         $CNF = &$this->getModule()->_oConfig->CNF;

+ 6 - 8
modules/boonex/polls/install/langs/en.xml

@@ -4,8 +4,7 @@
 	<string name="_bx_polls"><![CDATA[Polls]]></string>
 	<string name="_bx_polls_cmts"><![CDATA[Polls' Comments]]></string>
 
-	<string name="_bx_polls_option_summary_chars"><![CDATA[Number of characters in auto-cropped poll summary]]></string>
-	<string name="_bx_polls_option_plain_summary_chars"><![CDATA[Number of characters in plain poll description when poll hasn't thumb]]></string>
+	<string name="_bx_polls_option_title_chars"><![CDATA[Number of characters in auto-cropped poll title]]></string>
 	<string name="_bx_polls_option_per_page_browse"><![CDATA[Number of items per page]]></string>
 	<string name="_bx_polls_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
 	<string name="_bx_polls_option_searchable_fields"><![CDATA[Searchable fields]]></string>
@@ -19,15 +18,12 @@
 	<string name="_bx_polls_form_entry_input_do_submit"><![CDATA[Submit]]></string>
 	<string name="_bx_polls_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
 	<string name="_bx_polls_form_entry_input_do_publish"><![CDATA[Publish]]></string>
-	<string name="_bx_polls_form_entry_input_sys_title"><![CDATA[Question]]></string>
-	<string name="_bx_polls_form_entry_input_title"><![CDATA[Question]]></string>
-	<string name="_bx_polls_form_entry_input_title_err"><![CDATA[Question is essential. Please, fill in this field]]></string>
 	<string name="_bx_polls_form_entry_input_sys_cat"><![CDATA[Category]]></string>
 	<string name="_bx_polls_form_entry_input_cat"><![CDATA[Category]]></string>
     <string name="_bx_polls_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
-	<string name="_bx_polls_form_entry_input_sys_text"><![CDATA[Description]]></string>
-	<string name="_bx_polls_form_entry_input_text"><![CDATA[Description]]></string>
-	<string name="_bx_polls_form_entry_input_text_err"><![CDATA[Description field can't be empty]]></string>
+	<string name="_bx_polls_form_entry_input_sys_text"><![CDATA[Question]]></string>
+	<string name="_bx_polls_form_entry_input_text"><![CDATA[Question]]></string>
+	<string name="_bx_polls_form_entry_input_text_err"><![CDATA[Question is essential. Please, fill in this field]]></string>
 	<string name="_bx_polls_form_entry_input_sys_subentries"><![CDATA[Answers]]></string>
     <string name="_bx_polls_form_entry_input_subentries"><![CDATA[Answers]]></string>
     <string name="_bx_polls_form_entry_input_subentries_inf"><![CDATA[Leave text box empty to remove an answer.]]></string>
@@ -40,6 +36,8 @@
 	<string name="_bx_polls_form_entry_input_pictures"><![CDATA[Pictures]]></string>
 	<string name="_bx_polls_form_profile_input_sys_anonymous"><![CDATA[Anonymous]]></string>
     <string name="_bx_polls_form_profile_input_anonymous"><![CDATA[Anonymous vote]]></string>
+    <string name="_bx_polls_form_profile_input_anonymous_info_author"><![CDATA[When Anonymous mode is enabled, a list of voters won't be available to anybody.]]></string>
+    <string name="_bx_polls_form_profile_input_anonymous_info_voter"><![CDATA[Anonymous mode. Your vote will be private.]]></string>
     <string name="_bx_polls_form_profile_input_sys_hidden_results"><![CDATA[Hidden Results]]></string>
     <string name="_bx_polls_form_profile_input_hidden_results"><![CDATA[Hide results until voted]]></string>
     <string name="_bx_polls_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>

+ 2 - 3
modules/boonex/polls/install/sql/enable.sql

@@ -11,11 +11,10 @@ VALUES (@iTypeId, 'bx_polls', '_bx_polls', 1);
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
-('bx_polls_summary_chars', '700', @iCategId, '_bx_polls_option_summary_chars', 'digit', '', '', '', 1),
-('bx_polls_plain_summary_chars', '240', @iCategId, '_bx_polls_option_plain_summary_chars', 'digit', '', '', '', 2),
+('bx_polls_title_chars', '200', @iCategId, '_bx_polls_option_title_chars', 'digit', '', '', '', 1),
 ('bx_polls_per_page_browse', '12', @iCategId, '_bx_polls_option_per_page_browse', 'digit', '', '', '', 10),
 ('bx_polls_rss_num', '10', @iCategId, '_bx_polls_option_rss_num', 'digit', '', '', '', 20),
-('bx_polls_searchable_fields', 'title,text', @iCategId, '_bx_polls_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_polls";s:6:"method";s:21:"get_searchable_fields";}', 30);
+('bx_polls_searchable_fields', 'text', @iCategId, '_bx_polls_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_polls";s:6:"method";s:21:"get_searchable_fields";}', 30);
 
 
 -- PAGE: create entry

+ 17 - 21
modules/boonex/polls/install/sql/install.sql

@@ -8,9 +8,8 @@ CREATE TABLE IF NOT EXISTS `bx_polls_entries` (
   `added` int(11) NOT NULL,
   `changed` int(11) NOT NULL,
   `thumb` int(11) NOT NULL,
-  `title` varchar(255) NOT NULL,
-  `cat` int(11) NOT NULL,
   `text` text NOT NULL,
+  `cat` int(11) NOT NULL,
   `views` int(11) NOT NULL default '0',
   `rate` float NOT NULL default '0',
   `votes` int(11) NOT NULL default '0',
@@ -23,7 +22,7 @@ CREATE TABLE IF NOT EXISTS `bx_polls_entries` (
   `status` enum('active','hidden') NOT NULL DEFAULT 'active',
   `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
   PRIMARY KEY (`id`),
-  FULLTEXT KEY `title_text` (`title`,`text`)
+  FULLTEXT KEY `search_fields` (`text`)
 );
 
 CREATE TABLE IF NOT EXISTS `bx_polls_subentries` (
@@ -216,11 +215,10 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_polls', 'bx_polls', 'do_submit', '_bx_polls_form_entry_input_do_submit', '', 0, 'submit', '_bx_polls_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_polls', 'bx_polls', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_polls', 'bx_polls', 'pictures', 'a:1:{i:0;s:9:"sys_html5";}', 'a:2:{s:10:"sys_simple";s:26:"_sys_uploader_simple_title";s:9:"sys_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_polls_form_entry_input_sys_pictures', '_bx_polls_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_polls', 'bx_polls', 'text', '', '', 0, 'textarea', '_bx_polls_form_entry_input_sys_text', '_bx_polls_form_entry_input_text', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
-('bx_polls', 'bx_polls', 'title', '', '', 0, 'text', '_bx_polls_form_entry_input_sys_title', '_bx_polls_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_polls_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_polls', 'bx_polls', 'text', '', '', 0, 'textarea', '_bx_polls_form_entry_input_sys_text', '_bx_polls_form_entry_input_text', '', 1, 0, 3, '', '', '', 'Avail', '', '_bx_polls_form_entry_input_text_err', 'Xss', '', 1, 0),
 ('bx_polls', 'bx_polls', 'subentries', '', '', 0, 'custom', '_bx_polls_form_entry_input_sys_subentries', '_bx_polls_form_entry_input_subentries', '_bx_polls_form_entry_input_subentries_inf', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_polls', 'bx_polls', 'cat', '', '#!bx_polls_cats', 0, 'select', '_bx_polls_form_entry_input_sys_cat', '_bx_polls_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_polls_form_entry_input_cat_err', 'Xss', '', 1, 0),
-('bx_polls', 'bx_polls', 'anonymous', 1, '', 0, 'switcher', '_bx_polls_form_profile_input_sys_anonymous', '_bx_polls_form_profile_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_polls', 'bx_polls', 'anonymous', 1, '', 1, 'switcher', '_bx_polls_form_profile_input_sys_anonymous', '_bx_polls_form_profile_input_anonymous', '_bx_polls_form_profile_input_anonymous_info_author', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
 ('bx_polls', 'bx_polls', 'hidden_results', 1, '', 0, 'switcher', '_bx_polls_form_profile_input_sys_hidden_results', '_bx_polls_form_profile_input_hidden_results', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
 ('bx_polls', 'bx_polls', 'added', '', '', 0, 'datetime', '_bx_polls_form_entry_input_sys_date_added', '_bx_polls_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_polls', 'bx_polls', 'changed', '', '', 0, 'datetime', '_bx_polls_form_entry_input_sys_date_changed', '_bx_polls_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
@@ -228,28 +226,26 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 
 INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
 ('bx_polls_entry_add', 'cat', 2147483647, 1, 1),
-('bx_polls_entry_add', 'title', 2147483647, 1, 2),
+('bx_polls_entry_add', 'text', 2147483647, 1, 2),
 ('bx_polls_entry_add', 'subentries', 2147483647, 1, 3),
-('bx_polls_entry_add', 'text', 2147483647, 1, 4),
-('bx_polls_entry_add', 'pictures', 2147483647, 1, 5),
-('bx_polls_entry_add', 'allow_view_to', 2147483647, 1, 6),
-('bx_polls_entry_add', 'anonymous', 2147483647, 1, 7),
-('bx_polls_entry_add', 'hidden_results', 2147483647, 1, 8),
-('bx_polls_entry_add', 'location', 2147483647, 1, 9),
-('bx_polls_entry_add', 'do_publish', 2147483647, 1, 10),
+('bx_polls_entry_add', 'pictures', 2147483647, 1, 4),
+('bx_polls_entry_add', 'allow_view_to', 2147483647, 1, 5),
+('bx_polls_entry_add', 'anonymous', 2147483647, 1, 6),
+('bx_polls_entry_add', 'hidden_results', 2147483647, 1, 7),
+('bx_polls_entry_add', 'location', 2147483647, 1, 8),
+('bx_polls_entry_add', 'do_publish', 2147483647, 1, 9),
 
 ('bx_polls_entry_delete', 'delete_confirm', 2147483647, 1, 1),
 ('bx_polls_entry_delete', 'do_submit', 2147483647, 1, 2),
 
 ('bx_polls_entry_edit', 'cat', 2147483647, 1, 1),
-('bx_polls_entry_edit', 'title', 2147483647, 1, 2),
+('bx_polls_entry_edit', 'text', 2147483647, 1, 2),
 ('bx_polls_entry_edit', 'subentries', 2147483647, 1, 3),
-('bx_polls_entry_edit', 'text', 2147483647, 1, 4),
-('bx_polls_entry_edit', 'pictures', 2147483647, 1, 5),
-('bx_polls_entry_edit', 'allow_view_to', 2147483647, 1, 6),
-('bx_polls_entry_edit', 'hidden_results', 2147483647, 1, 7),
-('bx_polls_entry_edit', 'location', 2147483647, 1, 8),
-('bx_polls_entry_edit', 'do_submit', 2147483647, 1, 9),
+('bx_polls_entry_edit', 'pictures', 2147483647, 1, 4),
+('bx_polls_entry_edit', 'allow_view_to', 2147483647, 1, 5),
+('bx_polls_entry_edit', 'hidden_results', 2147483647, 1, 6),
+('bx_polls_entry_edit', 'location', 2147483647, 1, 7),
+('bx_polls_entry_edit', 'do_submit', 2147483647, 1, 8),
 
 ('bx_polls_entry_view', 'cat', 2147483647, 1, 1),
 ('bx_polls_entry_view', 'added', 2147483647, 1, 2),

+ 2 - 2
modules/boonex/polls/js/entry.js

@@ -37,8 +37,8 @@ BxPollsEntry.prototype.changeBlock = function(oLink, sBlock, iContentId) {
         	if(!oData.content)
         		return;
 
-        	$(oLink).parents('.bx-page-block-container:first').find('.bx-db-content').bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
-        		$(this).html(oData.content).show();
+        	$('#' + $this._aHtmlIds['content'] + iContentId).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
+        		$(this).replaceWith(oData.content);
         	});
         },
         'json'

+ 1 - 1
modules/boonex/polls/js/form.js

@@ -22,5 +22,5 @@ function BxPollsForm(oOptions) {
 BxPollsForm.prototype.addMore = function(oButton) {
 	var oButton = $(oButton);
 
-	oButton.before(oButton.siblings('.bx-form-input-text:first').clone());
+	oButton.before(oButton.siblings('.bx-form-input-text:first').clone().val(''));
 };

+ 6 - 1
modules/boonex/polls/template/subentries.html

@@ -1,5 +1,10 @@
-<div class="bx-polls-subentries bx-clearfix">
+<div id="__html_id__" class="bx-polls-content bx-polls-subentries bx-clearfix">
     <bx_repeat:subentries>
         <div class="bx-polls-subentry bx-def-margin-top-auto">__subentry__</div>
     </bx_repeat:subentries>
+    <bx_if:show_anonymous>
+	    <div class="bx-polls-content-info bx-def-margin-top bx-def-font-small bx-def-font-grayed">
+	        <bx_text:_bx_polls_form_profile_input_anonymous_info_voter />
+	    </div>
+    </bx_if:show_anonymous>
 </div>

+ 1 - 1
modules/boonex/polls/template/subentries_results.html

@@ -1,4 +1,4 @@
-<div class="bx-polls-results bx-clearfix">
+<div id="__html_id__" class="bx-polls-content bx-polls-results bx-clearfix">
     <bx_repeat:subentries>
         <div class="bx-polls-result bx-def-margin-top-auto">
             <div class="bx-polls-result-into">__title__</div>

+ 1 - 3
modules/boonex/polls/template/unit.html

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

+ 5 - 0
modules/boonex/polls/template/unit_timeline.html

@@ -0,0 +1,5 @@
+<div class="bx-tl-item-text">
+	<div class="bx-tl-title bx-def-margin-sec-bottom bx-def-font-h3">__title__</div>
+	<div class="bx-tl-content">__content__</div>
+	__js_code__
+</div>

+ 6 - 8
modules/boonex/russian/data/langs/bx_polls/ru.xml

@@ -4,8 +4,7 @@
 	<string name="_bx_polls"><![CDATA[Голосования]]></string>
 	<string name="_bx_polls_cmts"><![CDATA[Голосования - Комментарии]]></string>
 
-	<string name="_bx_polls_option_summary_chars"><![CDATA[Количество символов в автогенерируемой сводке к голосованиям]]></string>
-	<string name="_bx_polls_option_plain_summary_chars"><![CDATA[Количество символов в описании голосования при отсутствующей картинке голосования]]></string>
+	<string name="_bx_polls_option_title_chars"><![CDATA[Количество символов в автогенерируемом заголовке голосования]]></string>
 	<string name="_bx_polls_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
 	<string name="_bx_polls_option_rss_num"><![CDATA[Количество элементов в ленте RSS]]></string>
 	<string name="_bx_polls_option_searchable_fields"><![CDATA[Поля для поиска]]></string>
@@ -19,15 +18,12 @@
 	<string name="_bx_polls_form_entry_input_do_submit"><![CDATA[Выполнить]]></string>
 	<string name="_bx_polls_form_entry_input_sys_do_publish"><![CDATA[Опубликовать]]></string>
 	<string name="_bx_polls_form_entry_input_do_publish"><![CDATA[Опубликовать]]></string>
-	<string name="_bx_polls_form_entry_input_sys_title"><![CDATA[Вопрос]]></string>
-	<string name="_bx_polls_form_entry_input_title"><![CDATA[Вопрос]]></string>
-	<string name="_bx_polls_form_entry_input_title_err"><![CDATA[Вопрос обязателен. Пожалуйста, заполните это поле]]></string>
 	<string name="_bx_polls_form_entry_input_sys_cat"><![CDATA[Категория]]></string>
 	<string name="_bx_polls_form_entry_input_cat"><![CDATA[Категория]]></string>
 	<string name="_bx_polls_form_entry_input_cat_err"><![CDATA[Нужно обязательно выбрать категорию]]></string>
-	<string name="_bx_polls_form_entry_input_sys_text"><![CDATA[Описание]]></string>
-	<string name="_bx_polls_form_entry_input_text"><![CDATA[Описание]]></string>
-	<string name="_bx_polls_form_entry_input_text_err"><![CDATA[Поле для Описания не может быть пустым]]></string>
+	<string name="_bx_polls_form_entry_input_sys_text"><![CDATA[Вопрос]]></string>
+	<string name="_bx_polls_form_entry_input_text"><![CDATA[Вопрос]]></string>
+	<string name="_bx_polls_form_entry_input_text_err"><![CDATA[Вопрос обязателен. Пожалуйста, заполните это поле]]></string>
 	<string name="_bx_polls_form_entry_input_sys_subentries"><![CDATA[Ответы]]></string>
     <string name="_bx_polls_form_entry_input_subentries"><![CDATA[Ответы]]></string>
     <string name="_bx_polls_form_entry_input_subentries_inf"><![CDATA[Оставьте текстовое поле пустым, чтобы удалить ответ.]]></string>
@@ -40,6 +36,8 @@
 	<string name="_bx_polls_form_entry_input_pictures"><![CDATA[Картинки]]></string>
     <string name="_bx_polls_form_profile_input_sys_anonymous"><![CDATA[Анонимный]]></string>
     <string name="_bx_polls_form_profile_input_anonymous"><![CDATA[Анонимное голосование]]></string>
+    <string name="_bx_polls_form_profile_input_anonymous_info_author"><![CDATA[Список проголосовавших не будет доступен в режиме Анонимного голосования.]]></string>
+    <string name="_bx_polls_form_profile_input_anonymous_info_voter"><![CDATA[Анонимное голосование. Ваш голос будет конфиденциален.]]></string>
     <string name="_bx_polls_form_profile_input_sys_hidden_results"><![CDATA[Скрытые результаты]]></string>
     <string name="_bx_polls_form_profile_input_hidden_results"><![CDATA[Скрывать результаты до голосования]]></string>
     <string name="_bx_polls_form_entry_input_sys_allow_view_to"><![CDATA[Видимость]]></string>