Răsfoiți Sursa

Ticket #1630 - Changes in core and Base modules.

AntonLV 7 ani în urmă
părinte
comite
4581c7fc57

+ 202 - 0
modules/base/text/classes/BxBaseModTextFormPoll.php

@@ -0,0 +1,202 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseText Base classes for text modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxBaseModTextFormPoll extends BxTemplFormView
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        parent::__construct($aInfo, $oTemplate);
+        
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+    }
+
+    function initChecker ($aValues = array (), $aSpecificValues = array())
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(isset($this->aInputs[$CNF['FIELD_POLL_ANSWERS']]) && !empty($aValues['id'])) {
+            $aAnswers = $this->_oModule->_oDb->getPollAnswers(array(
+                'type' => 'poll_id_pairs',
+                'poll_id' => $aValues['id']
+            ));
+
+            $this->aInputs[$CNF['FIELD_POLL_ANSWERS']]['value'] = array_values($aAnswers);
+            $this->aInputs[$CNF['FIELD_POLL_ANSWERS']]['value_ids'] = array_keys($aAnswers);
+        }
+
+        return parent::initChecker($aValues, $aSpecificValues);
+    }
+
+    public function insert ($aValsToAdd = array(), $isIgnore = false)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(empty($aValsToAdd[$CNF['FIELD_POLL_AUTHOR_ID']]))
+            $aValsToAdd[$CNF['FIELD_POLL_AUTHOR_ID']] = bx_get_logged_profile_id();
+
+        $iContentId = parent::insert($aValsToAdd, $isIgnore);
+        if(!empty($iContentId))
+            $this->processAnswersAdd($CNF['FIELD_POLL_ANSWERS'], $iContentId);
+
+        return $iContentId;
+    }
+
+    public function update ($iContentId, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $iResult = parent::update($iContentId, $aValsToAdd, $aTrackTextFieldsChanges);
+
+        $this->processAnswersUpdate($CNF['FIELD_POLL_ANSWERS'], $iContentId);
+
+        return $iResult;
+    }
+
+    public function processAnswersAdd ($sField, $iContentId = 0)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(!isset($this->aInputs[$sField]))
+            return true;
+
+        $aAnswers = $this->getCleanValue($sField);
+        if(empty($aAnswers) || !is_array($aAnswers))
+            return true;
+
+        foreach($aAnswers as $iIndex => $sSubentry)
+            if(!empty($sSubentry))
+                $this->_oModule->_oDb->insertPollAnswer(array(
+                    'poll_id' => $iContentId,
+                    'title' => bx_process_input($sSubentry),
+                    'order' => $iIndex
+                ));
+
+        return true;
+    }
+
+    public function processAnswersUpdate($sField, $iContentId = 0)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(!isset($this->aInputs[$sField]))
+            return true;
+
+        $aAnswersIds = $this->getCleanValue($sField . '_ids');
+        $aAnswersValues = $this->getCleanValue($sField);
+
+        //--- Remove deleted
+        $aAnswersDb = $this->_oModule->_oDb->getPollAnswers(array('type' => 'poll_id_pairs', 'poll_id' => $iContentId));
+        $this->_oModule->_oDb->deletePollAnswersByIds(array_diff(array_keys($aAnswersDb), $aAnswersIds));
+
+        //--- Update existed and remove empty
+        foreach($aAnswersIds as $iIndex => $iId)
+            if(!empty($aAnswersValues[$iIndex]))
+                $this->_oModule->_oDb->updatePollAnswers(array('title' => bx_process_input($aAnswersValues[$iIndex])), array('id' => (int)$iId));
+            else 
+                $this->_oModule->_oDb->deletePollAnswers(array('id' => (int)$iId));
+
+        //--- Add new
+        $iAnswersIds = count($aAnswersIds);
+        $iAnswersValues = count($aAnswersValues);
+        if($iAnswersValues > $iAnswersIds) {
+            $iMaxOrder = (int)$this->_oModule->_oDb->getPollAnswers(array('type' => 'poll_id_max_order', 'poll_id' => $iContentId));
+
+            $aAnswersValues = array_slice($aAnswersValues, $iAnswersIds);
+            foreach($aAnswersValues as $sAnswersValue)
+                if(!empty($sAnswersValue))
+                    $this->_oModule->_oDb->insertPollAnswer(array(
+                        'poll_id' => $iContentId,
+                        'title' => bx_process_input($sAnswersValue),
+                        'order' => ++$iMaxOrder
+                    ));
+        }
+
+        return true;
+    }
+
+    protected function genCustomInputAnswers(&$aInput)
+    {
+        $sJsObject = $this->_oModule->_oConfig->getJsObject('poll');
+
+        $aTmplVarsAnswers = array(
+            array('class' => 'bx-fi-answer-blank', 'js_object' => $sJsObject, 'input_text' => $this->genCustomInputAnswersText($aInput, '', true)),
+        );
+
+        if(!empty($aInput['value']) && is_array($aInput['value']))
+            foreach($aInput['value'] as $iKey => $sValue) {
+                $sInput = $this->genCustomInputAnswersText($aInput, $sValue);
+                if(!empty($aInput['value_ids'][$iKey]))
+                    $sInput .= $this->genCustomInputAnswersHidden($aInput, (int)$aInput['value_ids'][$iKey]);
+
+                $aTmplVarsAnswers[] = array('class' => '', 'js_object' => $sJsObject, 'input_text' => $sInput);
+            }
+        else 
+            $aTmplVarsAnswers = array_merge($aTmplVarsAnswers, array(
+                array('class' => '', 'js_object' => $sJsObject, 'input_text' => $this->genCustomInputAnswersText($aInput)),
+                array('class' => '', 'js_object' => $sJsObject, 'input_text' => $this->genCustomInputAnswersText($aInput))
+            ));
+
+        return $this->_oModule->_oTemplate->parseHtmlByName('poll_form_answers.html', array(
+            'bx_repeat:answers' => $aTmplVarsAnswers,
+            'btn_add' => $this->genCustomInputAnswersButton($aInput)
+        ));
+    }
+
+    protected function genCustomInputAnswersText($aInput, $mixedValue = '', $bDisabled = false)
+    {
+        $aInput['type'] = 'text';
+        $aInput['name'] .= '[]';
+        $aInput['value'] = $mixedValue;
+
+        $aInput['attrs']['class'] = 'bx-def-margin-sec-top-auto';
+        if($bDisabled)
+            $aInput['attrs']['disabled'] = 'disabled';
+
+        return $this->genInput($aInput);
+    }
+
+    protected function genCustomInputAnswersHidden($aInput, $mixedValue = '')
+    {
+        $aInput['type'] = 'hidden';
+        $aInput['name'] .= '_ids[]';
+        $aInput['value'] = $mixedValue;
+
+        return $this->genInput($aInput);
+    }
+
+    protected function genCustomInputAnswersButton($aInput)
+    {
+        $sName = $aInput['name'];
+
+        $aInput['type'] = 'button';
+        $aInput['name'] .= '_add';
+        $aInput['value'] = _t('_bx_posts_form_poll_input_answers_add');
+        $aInput['attrs']['class'] = 'bx-def-margin-sec-top';
+        $aInput['attrs']['onclick'] = $this->_oModule->_oConfig->getJsObject('poll') . ".addPollAnswer(this, '" . $sName . "');";
+
+        return $this->genInputButton($aInput);
+    }
+}
+
+class BxBaseModTextFormPollCheckerHelper extends BxDolFormCheckerHelper
+{
+    static public function checkAvailAnswers ($s)
+    {
+        return !self::_isEmptyArray($s) && count($s) >= 2;
+    }
+}
+
+/** @} */

+ 32 - 0
modules/base/text/classes/BxBaseModTextMenuAttachments.php

@@ -0,0 +1,32 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseText Base classes for text modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create\edit entry attachments menu
+ */
+class BxBaseModTextMenuAttachments extends BxTemplMenu
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+ 
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        $this->addMarkers(array(
+            'js_object' => $this->_oModule->_oConfig->getJsObject('poll')
+        ));
+    }
+}
+
+/** @} */

+ 31 - 0
modules/base/text/classes/BxBaseModTextUploaderHTML5.php

@@ -0,0 +1,31 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseText Base classes for text modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxBaseModTextUploaderHTML5 extends BxTemplUploaderHTML5
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $this->_oModule->_oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_ENTRY_ATTACHMENTS'])->addMarkers(array(
+            'js_object_uploader_html5' => $this->getNameJsInstanceUploader()
+        ));
+    }
+}
+
+/** @} */

+ 31 - 0
modules/base/text/classes/BxBaseModTextUploaderSimple.php

@@ -0,0 +1,31 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseText Base classes for text modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxBaseModTextUploaderSimple extends BxTemplUploaderSimple
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $this->_oModule->_oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_ENTRY_ATTACHMENTS'])->addMarkers(array(
+            'js_object_uploader' . str_replace($this->_sModule, '', $this->_aObject['object']) => $this->getNameJsInstanceUploader()
+        ));
+    }
+}
+
+/** @} */

+ 164 - 0
modules/base/text/classes/BxBaseModTextVotePollAnswers.php

@@ -0,0 +1,164 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseText Base classes for text modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxBaseModTextVotePollAnswers extends BxTemplVote
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    protected $_aObjectInfo;
+    protected $_aPollInfo;
+
+    protected $_bHiddenResults;
+    protected $_bAnonymousVoting;
+
+    protected $_sTmplNameElementBlock;
+    protected $_sTmplNameCounterText;
+
+    function __construct($sSystem, $iId, $iInit = 1)
+    {
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct($sSystem, $iId, $iInit, $this->_oModule->_oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $this->_aElementDefaults['likes'] = array_merge($this->_aElementDefaults['likes'], array(
+            'show_do_vote_label' => true,
+            'show_counter' => false
+        ));
+
+        $this->_aObjectInfo = $this->_oModule->_oDb->getPollAnswers(array('type' => 'id', 'id' => $iId));
+        $this->_aPollInfo = $this->_oModule->_oDb->getPolls(array('type' => 'answer_id', 'answer_id' => $iId));
+
+        $this->_bHiddenResults = $CNF['PARAM_POLL_HIDDEN_RESULTS'];
+        $this->_bAnonymousVoting = $CNF['PARAM_POLL_ANONYMOUS_VOTING'];
+
+        $this->_sTmplNameElementBlock = 'poll_answer_ve_block.html';
+        $this->_sTmplNameCounterText = 'poll_answer_vc_text.html';
+    }
+
+    public function getJsClick()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(!$this->isLikeMode())
+            return false;
+
+        $sJsObjectVote = $this->getJsObjectName();
+        $sJsObjectPoll = $this->_oModule->_oConfig->getJsObject('poll');
+
+        return $sJsObjectVote . '.vote(this, ' . $this->getMaxValue() . ', function(oLink, oData) {' . $sJsObjectPoll . '.onPollAnswerVote(oLink, oData, ' . $this->_aPollInfo[$CNF['FIELD_POLL_ID']] . ');})';
+    }
+
+    public function getCounter($aParams = array())
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $bShowInBrackets = !isset($aParams['show_counter_in_brackets']) || $aParams['show_counter_in_brackets'] == true;
+
+        $iObjectId = $this->getId();
+        $iAuthorId = $this->_getAuthorId();
+        if($this->_bHiddenResults)
+            if(!$this->isPerformed($iObjectId, $iAuthorId))
+                return '';
+
+        $sResult = parent::getCounter($aParams);
+        if($bShowInBrackets)
+            $sResult = '(' . $sResult . ')';
+
+        return $sResult;
+    }
+
+    public function getObjectAuthorId($iObjectId = 0)
+    {
+    	if(empty($this->_aSystem['trigger_field_author']))
+            return 0;
+
+        $aPoll = $this->_oModule->_oDb->getPolls(array('type' => 'answer_id', 'answer_id' => $iObjectId ? $iObjectId : $this->getId()));
+        if(empty($aPoll) || !is_array($aPoll))
+            return 0;
+
+        return $aPoll[$this->_aSystem['trigger_field_author']];
+    }
+
+    public function isPerformed($iObjectId, $iAuthorId, $iAuthorIp = 0)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        return $this->_oModule->_oDb->isPollPerformed($this->_aPollInfo[$CNF['FIELD_POLL_ID']], $iAuthorId);
+    }
+
+    /**
+     * Permissions functions
+     */
+    public function isAllowedVote($isPerformAction = false)
+    {
+        if(!parent::isAllowedVote($isPerformAction))
+            return false;
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $iContentId = $this->_aPollInfo[$CNF['FIELD_POLL_CONTENT_ID']];
+        if(empty($iContentId))
+            return true;
+
+        $aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
+        return $this->_oModule->checkAllowedView($aContentInfo) === CHECK_ACTION_RESULT_ALLOWED;
+    }
+
+    /**
+     * Internal functions
+     */
+    protected function _getIconDoLike($bVoted)
+    {
+    	return $bVoted ?  'far dot-circle' : 'far circle';
+    }
+
+    protected function _getTitleDoLike($bVoted)
+    {
+    	return bx_process_output($this->_aObjectInfo['title']);
+    }
+
+    protected function _getTitleDoBy()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+    	return $CNF['T']['txt_poll_answer_vote_do_by'];
+    }
+
+    protected function _getLabelCounter($iCount)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        return _t($CNF['T']['txt_poll_answer_vote_counter'], $iCount);
+    }
+
+    protected function _isShowDoVote($aParams, $isAllowedVote, $bCount)
+    {
+        return !isset($aParams['show_do_vote']) || $aParams['show_do_vote'] == true;
+    }
+
+    protected function _getTmplContentElementBlock()
+    {
+        return $this->_oTemplate->getHtml($this->_sTmplNameElementBlock);
+    }
+
+    protected function _getTmplContentCounter()
+    {
+        if($this->_bAnonymousVoting)
+            return $this->_oTemplate->getHtml($this->_sTmplNameCounterText);
+
+        return self::$_sTmplContentCounter;
+    }
+}
+
+/** @} */

+ 233 - 0
modules/base/text/template/css/polls.css

@@ -0,0 +1,233 @@
+/*-- Poll form: Answers custom element --*/
+.bx-form-input-answer {
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: center;
+    align-items: center;
+}
+.bx-form-input-answer.bx-fi-answer-blank {
+    display: none;
+}
+.bx-form-input-answer-cell.bx-fi-sc-txt {
+    -webkit-flex: 1 1 auto;
+    -ms-flex: 1 1 auto;
+    flex: 1 1 auto;
+}
+.bx-form-input-answer-cell.bx-fi-sc-btn {
+    -webkit-flex: 0 0 auto;
+    -ms-flex: 0 0 auto;
+    flex: 0 0 auto;
+}
+.bx-form-input-answer-add {
+    text-align: right;
+}
+.bx-form-input-answer-add .bx-form-input-button {
+    display: inline-block;
+    float: none;
+}
+
+
+/*--- Polls list ---*/
+.bx-base-text-polls {
+    position: relative;
+
+    display: -webkit-flex;
+    display: flex;
+    -webkit-flex-wrap: wrap;
+    flex-wrap: wrap;
+}
+
+.bx-base-text-polls .bx-base-text-poll {
+    display: -webkit-box;
+    display: -webkit-flex;
+    display: -ms-flexbox;
+    display: flex;
+
+    -webkit-box-flex: 0;
+
+    -webkit-flex: 0 0 100%;
+    -ms-flex: 0 0 100%;
+    flex: 0 0 100%;
+
+    overflow:hidden;
+}
+
+/* Media: phone2 */
+.bx-media-phone2 .bx-layout-column-half .bx-base-text-polls.bx-base-text-autosizing .bx-base-text-poll,
+.bx-media-phone2 .bx-layout-column-thin .bx-base-text-polls.bx-base-text-autosizing .bx-base-text-poll {
+    -webkit-flex: 0 0 49.8%;
+    -ms-flex: 0 0 49.8%;
+    flex: 0 0 49.8%;
+}
+
+/* Media: tablet2 */
+.bx-media-tablet2 .bx-layout-column-wide .bx-base-text-polls.bx-base-text-autosizing .bx-base-text-poll,
+.bx-media-tablet2 .bx-layout-column-fullwidth .bx-base-text-polls.bx-base-text-autosizing .bx-base-text-poll {
+    -webkit-flex: 0 0 49.8%;
+    -ms-flex: 0 0 49.8%;
+    flex: 0 0 49.8%;
+}
+
+/* Media: desktop */
+.bx-media-desktop .bx-layout-column-wide .bx-base-text-polls.bx-base-text-autosizing .bx-base-text-poll {
+    -webkit-flex: 0 0 49.8%;
+    -ms-flex: 0 0 49.8%;
+    flex: 0 0 49.8%;
+}
+.bx-media-desktop .bx-layout-column-fullwidth .bx-base-text-polls.bx-base-text-autosizing .bx-base-text-poll {
+    -webkit-flex: 0 0 33.25%;
+    -ms-flex: 0 0 33.25%;
+    flex: 0 0 33.25%;
+}
+
+
+/*--- Poll item ---*/
+.bx-base-text-poll {
+    position: relative;
+}
+.bx-base-text-poll-cnt {
+    position: relative;
+    width: 100%;
+}
+.bx-base-text-poll-question p {
+    margin: 0;
+    padding: 0;
+}
+
+/*+++ Poll item: Actions +++*/
+.bx-base-text-poll-actions {
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-flex-wrap: nowrap;
+    flex-wrap: nowrap;
+    -webkit-justify-content: flex-end;
+    justify-content: flex-end;
+    -webkit-align-items: center;
+    align-items: center;
+
+    top: 0;
+    right: 0;
+}
+.bx-base-text-poll-action {
+    position: relative;
+    display: block;
+}
+.bx-base-text-poll-actions li.bx-def-color-bg-hl-hover {
+    backgroud-color: transparent;
+}
+.bx-base-text-poll-actions li.bx-menu-inter-act,
+.bx-base-text-poll-actions li.bx-menu-inter-pas {
+    margin-left: 0.5rem;
+}
+.bx-base-text-poll-actions li.bx-menu-inter-act div, 
+.bx-base-text-poll-actions li.bx-menu-inter-pas div{
+    padding: 0;
+}
+.bx-base-text-poll-actions li.bx-menu-inter-div {
+    display: none;
+}
+
+/*+++ Poll item: Results +++*/
+div.bx-base-text-pr-graph {
+	display: table;
+	width: 100%;
+}
+div.bx-base-text-pr-graph .bx-base-text-prg-bar,
+div.bx-base-text-pr-graph .bx-base-text-prg-text {
+	display: table-cell;
+}
+div.bx-base-text-pr-graph .bx-base-text-prg-bar {
+    -webkit-animation-fill-mode: both;
+    -moz-animation-fill-mode: both;
+    -o-animation-fill-mode: both;
+    animation-fill-mode: both;
+
+    -webkit-transform-origin: left;
+    -moz-transform-origin: left;
+    -ms-transform-origin: left;
+    -o-transform-origin: left;
+    transform-origin: left;
+
+    -webkit-animation: bx-base-text-prg-bar-anim 1000ms ease-out;
+    -o-animation: bx-base-text-prg-bar-anim 1000ms ease-out;
+    animation: bx-base-text-prg-bar-anim 1000ms ease-out;
+
+    background: #2196F3;
+    background: -moz-linear-gradient(left,#2196F3 0%,#1976D2 100%);
+    background: -webkit-gradient(linear,left top,right top,color-stop(0%,#2196F3),color-stop(100%,#1976D2));
+    background: -webkit-linear-gradient(left,#2196F3 0%,#1976D2 100%);
+    background: -o-linear-gradient(left,#2196F3 0%,#1976D2 100%);
+    background: -ms-linear-gradient(left,#2196F3 0%,#1976D2 100%);
+    background: linear-gradient(to right,#2196F3 0%,#1976D2 100%);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2196F3',endColorstr='#1976D2',GradientType=1);
+}
+div.bx-base-text-pr-graph .bx-base-text-prg-text {
+	white-space: nowrap;
+}
+
+/*--- Animation ---*/
+@-webkit-keyframes bx-base-text-prg-bar-anim {
+    from {
+        -webkit-transform:scaleX(0);
+        -moz-transform:scaleX(0);
+        -ms-transform:scaleX(0);
+        -o-transform:scaleX(0);
+        transform:scaleX(0)
+    }
+    to {
+        -webkit-transform:scaleX(1);
+        -moz-transform:scaleX(1);
+        -ms-transform:scaleX(1);
+        -o-transform:scaleX(1);
+        transform:scaleX(1)
+    }
+}
+@-moz-keyframes bx-base-text-prg-bar-anim {
+    from {
+        -webkit-transform:scaleX(0);
+        -moz-transform:scaleX(0);
+        -ms-transform:scaleX(0);
+        -o-transform:scaleX(0);
+        transform:scaleX(0)
+    }
+    to {
+        -webkit-transform:scaleX(1);
+        -moz-transform:scaleX(1);
+        -ms-transform:scaleX(1);
+        -o-transform:scaleX(1);
+        transform:scaleX(1)
+    }
+}
+@-ms-keyframes bx-base-text-prg-bar-anim {
+    from {
+        -webkit-transform:scaleX(0);
+        -moz-transform:scaleX(0);
+        -ms-transform:scaleX(0);
+        -o-transform:scaleX(0);
+        transform:scaleX(0)
+    }
+    to {
+        -webkit-transform:scaleX(1);
+        -moz-transform:scaleX(1);
+        -ms-transform:scaleX(1);
+        -o-transform:scaleX(1);
+        transform:scaleX(1)
+    }
+}
+@keyframes bx-base-text-prg-bar-anim {
+    from {
+        -webkit-transform:scaleX(0);
+        -moz-transform:scaleX(0);
+        -ms-transform:scaleX(0);
+        -o-transform:scaleX(0);
+        transform:scaleX(0)
+    }
+    to {
+        -webkit-transform:scaleX(1);
+        -moz-transform:scaleX(1);
+        -ms-transform:scaleX(1);
+        -o-transform:scaleX(1);
+        transform:scaleX(1)
+    }
+}

+ 1 - 0
modules/base/text/template/poll_answer_vc_text.html

@@ -0,0 +1 @@
+<span title="__title__">__content__</span>

+ 12 - 0
modules/base/text/template/poll_answer_ve_block.html

@@ -0,0 +1,12 @@
+<div id="__html_id__" class="__style_prefix__ __class__" bx_vote_data_rate="__rate__" bx_vote_data_count="__count__">
+	<div class="__style_prefix__-do bx-clearfix">
+		<bx_if:show_do_vote>
+			<div class="__style_prefix__-element-holder">__do_vote__</div>
+		</bx_if:show_do_vote>
+		<bx_if:show_counter>
+			<div class="__style_prefix__-counter-holder bx-def-margin-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
+		</bx_if:show_counter>
+	</div>
+	<bx_if:show_legend>__legend__</bx_if:show_legend>
+</div>
+__script__

+ 8 - 0
modules/base/text/template/poll_form.html

@@ -0,0 +1,8 @@
+<div class="bx-base-text-poll-form">
+    __form__
+    <script type="text/javascript">
+        $(document).ready(function () {
+            __js_object__.initPollForm('__form_id__');
+        });
+    </script>
+</div>

+ 11 - 0
modules/base/text/template/poll_form_answers.html

@@ -0,0 +1,11 @@
+<div class="bx-form-input-answers">
+    <bx_repeat:answers>
+        <div class="bx-form-input-answer bx-def-padding-thd-topbottom __class__">
+            <div class="bx-form-input-answer-cell bx-fi-sc-txt">__input_text__</div>
+            <div class="bx-form-input-answer-cell bx-fi-sc-btn bx-def-padding-sec-left">
+                <a class="bx-btn" href="javascript:void(0)" onclick="javascript:__js_object__.deletePollAnswer(this)"><i class="sys-icon times"></i></a>
+            </div>
+        </div>
+    </bx_repeat:answers>
+    <div class="bx-form-input-answer-add">__btn_add__</div>
+</div>

+ 1 - 0
modules/base/text/template/poll_form_field.html

@@ -0,0 +1 @@
+<div id="__html_id__" class="bx-base-text-poll-form-field bx-base-text-polls bx-base-text-autosizing bx-def-margin-sec-leftright-neg">__polls__</div>

+ 15 - 0
modules/base/text/template/poll_item.html

@@ -0,0 +1,15 @@
+<div id="__html_id__" class="bx-base-text-poll bx-def-padding-sec bx-def-box-sizing">
+    <div class="bx-base-text-poll-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-padding bx-def-box-sizing">
+        <div class="bx-base-text-poll-actions bx-def-padding-sec-bottom">
+            __action_menu__
+            <bx_if:show_action_delete>
+                <a class="bx-base-text-poll-action bx-base-text-pa-icon bx-base-text-pa-delete bx-def-margin-sec-left-auto" href="javascript:void(0)" onclick="javascript:__js_object__.deletePoll(this, __id__);" title="<bx_text_attribute:_Delete />"><i class="sys-icon times"></i></a>
+            </bx_if:show_action_delete>
+        </div>
+        <div class="bx-base-text-poll-question bx-def-padding-bottom">__text__</div>
+        __content__
+    </div>
+    <bx_if:show_input_hidden>
+        <input type="hidden" name="__name__[]" value="__id__" />
+    </bx_if:show_input_hidden>
+</div>

+ 5 - 0
modules/base/text/template/poll_item_answers.html

@@ -0,0 +1,5 @@
+<div id="__html_id__" class="bx-base-text-poll-content bx-base-text-poll-answers bx-clearfix">
+    <bx_repeat:answers>
+        <div class="bx-base-text-poll-answer bx-def-margin-top-auto">__answer__</div>
+    </bx_repeat:answers>
+</div>

+ 12 - 0
modules/base/text/template/poll_item_results.html

@@ -0,0 +1,12 @@
+<div id="__html_id__" class="bx-base-text-poll-content bx-base-text-poll-results bx-clearfix">
+    <bx_repeat:answers>
+        <div class="bx-base-text-poll-result bx-def-margin-top-auto">
+            <div class="bx-base-text-pr-into">__title__</div>
+            <div class="bx-base-text-pr-graph bx-def-margin-thd-top">
+                <div class="bx-base-text-prg-bar bx-def-round-corners" style="width:__width__">&nbsp;</div>
+                <div class="bx-base-text-prg-text bx-def-padding-left bx-def-font-middle bx-def-font-grayed">__votes__&nbsp;__percent__</div>
+            </div>
+            __js_code__
+        </div>
+    </bx_repeat:answers>
+</div>

+ 1 - 0
modules/base/text/template/poll_items.html

@@ -0,0 +1 @@
+<div class="bx-base-text-polls<bx_if:show_autosizing> bx-base-text-autosizing</bx_if:show_autosizing> bx-def-margin-sec-leftright-neg">__polls__</div>

+ 6 - 0
template/menu_buttons_icon_hor.html

@@ -0,0 +1,6 @@
+<ul class="bx-menu-btns-icon-hor bx-menu-object-__object__ bx-clearfix">
+    <bx_repeat:menu_items><li class="bx-def-margin-thd-topbottom __class_add__"><a class="bx-btn bx-def-margin-right" href="__link__" target="__target__" onclick="__onclick__" title="__title_attr__">
+        <bx_if:image><img style="background-image:url(__icon_url__)" src="<bx_icon_url:spacer.gif />" /></bx_if:image>
+        <bx_if:icon><i class="sys-icon __icon__"></i></bx_if:icon>
+    </a></li></bx_repeat:menu_items>
+</ul>

+ 5 - 0
template/menu_buttons_icon_hor_item.html

@@ -0,0 +1,5 @@
+<a class="bx-btn bx-def-margin-right" href="__link__" target="__target__" onclick="__onclick__" title="__title_attr__">
+    <bx_if:image><img style="background-image:url(__icon_url__)" src="<bx_icon_url:spacer.gif />" /></bx_if:image>
+    <bx_if:icon><i class="sys-icon __icon__"></i></bx_if:icon>
+    <bx_if:title><u>__title__</u></bx_if:title>
+</a>