Forráskód Böngészése

Ticket #255 - Button height and Button border in Vote, Report and etc actions.

AntonLV 10 éve
szülő
commit
6c7066f5fd

+ 12 - 3
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -339,24 +339,33 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         				'condition' => (int)$aShared['shares'] == 0,
         				'content' => array()
         			),
-                    'counter' => $this->getShareCounter($aShared)
+                    'counter' => $this->getShareCounter($aShared, $aParams)
                 )
             ),
             'script' => $this->getShareJsScript()
         ));
     }
 
-    public function getShareCounter($aEvent)
+    public function getShareCounter($aEvent, $aParams = array())
     {
         $sStylePrefix = $this->_oConfig->getPrefix('style');
         $sJsObject = $this->_oConfig->getJsObject('share');
 
+        $bShowDoShareAsButtonSmall = isset($aParams['show_do_share_as_button_small']) && $aParams['show_do_share_as_button_small'] == true;
+        $bShowDoShareAsButton = !$bShowDoShareAsButtonSmall && isset($aParams['show_do_share_as_button']) && $aParams['show_do_share_as_button'] == true;
+
+        $sClass = $sStylePrefix . '-share-counter';
+        if($bShowDoShareAsButtonSmall)
+            $sClass .= ' bx-btn-small-height';
+        if($bShowDoShareAsButton)
+            $sClass .= ' bx-btn-height';
+
         return $this->parseHtmlByName('share_counter.html', array(
             'href' => 'javascript:void(0)',
             'title' => _t('_bx_timeline_txt_shared_by'),
             'bx_repeat:attrs' => array(
                 array('key' => 'id', 'value' => $this->_oConfig->getHtmlIds('share', 'counter') . $aEvent['id']),
-                array('key' => 'class', 'value' => $sStylePrefix . '-share-counter bx-btn-height'),
+                array('key' => 'class', 'value' => $sClass),
                 array('key' => 'onclick', 'value' => 'javascript:' . $sJsObject . '.toggleByPopup(this, ' . $aEvent['id'] . ')')
             ),
             'content' => !empty($aEvent['shares']) && (int)$aEvent['shares'] > 0 ? $aEvent['shares'] : ''

+ 10 - 2
template/scripts/BxBaseReport.php

@@ -109,14 +109,22 @@ class BxBaseReport extends BxDolReport
     {
         $sJsObject = $this->getJsObjectName();
 
+        $bShowDoReportAsButtonSmall = isset($aParams['show_do_report_as_button_small']) && $aParams['show_do_report_as_button_small'] == true;
+        $bShowDoReportAsButton = !$bShowDoReportAsButtonSmall && isset($aParams['show_do_report_as_button']) && $aParams['show_do_report_as_button'] == true;
+
         $aReport = $this->_oQuery->getReport($this->getId());
+        $sClass = $this->_sStylePrefix . '-counter';
+        if($bShowDoReportAsButtonSmall)
+            $sClass .= ' bx-btn-small-height';
+        if($bShowDoReportAsButton)
+            $sClass .= ' bx-btn-height';
 
         return $this->_oTemplate->parseHtmlByName($this->_sTmplNameCounter, array(
             'href' => 'javascript:void(0)',
             'title' => _t('_report_do_report_by'),
             'bx_repeat:attrs' => array(
                 array('key' => 'id', 'value' => $this->_aHtmlIds['counter']),
-                array('key' => 'class', 'value' => $this->_sStylePrefix . '-counter bx-btn-height'),
+                array('key' => 'class', 'value' => $sClass),
                 array('key' => 'onclick', 'value' => 'javascript:' . $sJsObject . '.toggleByPopup(this)')
             ),
             'content' => (int)$aReport['count'] > 0 ? $this->_getLabelCounter($aReport['count']) : ''
@@ -170,7 +178,7 @@ class BxBaseReport extends BxDolReport
         				'condition' => (int)$aReport['count'] == 0,
         				'content' => array()
         			),
-                    'counter' => $this->getCounter()
+                    'counter' => $this->getCounter($aParams)
                 )
             ),
             'script' => $this->getJsScript($bDynamicMode)

+ 9 - 1
template/scripts/BxBaseVote.php

@@ -122,14 +122,22 @@ class BxBaseVote extends BxDolVote
     {
         $sJsObject = $this->getJsObjectName();
 
+        $bShowDoVoteAsButtonSmall = $this->_bLike && isset($aParams['show_do_vote_as_button_small']) && $aParams['show_do_vote_as_button_small'] == true;
+        $bShowDoVoteAsButton = $this->_bLike && !$bShowDoVoteAsButtonSmall && isset($aParams['show_do_vote_as_button']) && $aParams['show_do_vote_as_button'] == true;
+
         $aVote = $this->_oQuery->getVote($this->getId());
+        $sClass = $this->_sStylePrefix . '-counter';
+        if($bShowDoVoteAsButtonSmall)
+            $sClass .= ' bx-btn-small-height';
+        if($bShowDoVoteAsButton)
+            $sClass .= ' bx-btn-height';
 
         return $this->_oTemplate->parseHtmlByName($this->_sTmplNameCounter, array(
             'href' => 'javascript:void(0)',
             'title' => _t('_vote_do_like_by'),
             'bx_repeat:attrs' => array(
                 array('key' => 'id', 'value' => $this->_aHtmlIds['counter']),
-                array('key' => 'class', 'value' => $this->_sStylePrefix . '-counter bx-btn-height'),
+                array('key' => 'class', 'value' => $sClass),
                 array('key' => 'onclick', 'value' => 'javascript:' . $sJsObject . '.toggleByPopup(this)')
             ),
             'content' => (int)$aVote['count'] > 0 ? $this->_getLabelCounter($aVote['count']) : ''