Explorar el Código

Ticket #2105 - Account thumbnails.

AntonLV hace 7 años
padre
commit
f9f49c9ac0

+ 30 - 3
inc/classes/BxDolAccount.php

@@ -332,10 +332,32 @@ class BxDolAccount extends BxDolFactory implements iBxDolSingleton
      */
      */
     public function getUnit($iAccountId = false, $aParams = array())
     public function getUnit($iAccountId = false, $aParams = array())
     {
     {
-        $sTemplate = 'account_' . (!empty($aParams['template']) ? $aParams['template'] : 'unit') . '.html';
+        
+        $sTemplate = 'unit';
+        $sTemplateSize = false;
+        $aTemplateVars = array();
+        if(!empty($aParams['template'])) {
+            if(is_string($aParams['template']))
+                $sTemplate = $aParams['template'];
+            else if(is_array($aParams['template'])) {
+                if(!empty($aParams['template']['name']))
+                    $sTemplate = $aParams['template']['name'];
+
+                if(!empty($aParams['template']['size']))
+                    $sTemplateSize = $aParams['template']['size'];
+
+                if(!empty($aParams['template']['vars']))
+                    $aTemplateVars = $aParams['template']['vars'];
+            }
+        }
+        $sTemplate = 'account_' . $sTemplate . '.html';
+        if(empty($sTemplateSize))
+            $sTemplateSize = 'thumb';
 
 
         $sTitle = $this->getDisplayName($iAccountId);
         $sTitle = $this->getDisplayName($iAccountId);
-        return BxDolTemplate::getInstance()->parseHtmlByName($sTemplate, array(
+
+        $aTmplVars = array(
+            'size' => $sTemplateSize,
             'color' => implode(', ', BxDolTemplate::getColorCode(($iAccountId ? $iAccountId : $this->_iAccountID), 1.0)),
             'color' => implode(', ', BxDolTemplate::getColorCode(($iAccountId ? $iAccountId : $this->_iAccountID), 1.0)),
             'letter' => mb_strtoupper(mb_substr($sTitle, 0, 1)),
             'letter' => mb_strtoupper(mb_substr($sTitle, 0, 1)),
             'content_url' => $this->getUrl($iAccountId),
             'content_url' => $this->getUrl($iAccountId),
@@ -345,7 +367,12 @@ class BxDolAccount extends BxDolFactory implements iBxDolSingleton
                 'condition' => $this->isOnline($iAccountId),
                 'condition' => $this->isOnline($iAccountId),
                 'content' => array()
                 'content' => array()
             )
             )
-        ));
+        );
+
+        if(!empty($aTemplateVars) && is_array($aTemplateVars))
+            $aTmplVars = array_merge ($aTmplVars, $aTemplateVars);
+
+        return BxDolTemplate::getInstance()->parseHtmlByName($sTemplate, $aTmplVars);
     }
     }
 
 
     /**
     /**

+ 3 - 3
template/account_unit.html

@@ -1,13 +1,13 @@
 <div class="bx-account-unit bx-def-unit absolute bx-def-margin-bottom bx-def-margin-sec-right">
 <div class="bx-account-unit bx-def-unit absolute bx-def-margin-bottom bx-def-margin-sec-right">
-    <div class="bx-def-unit-img bx-def-thumb bx-def-thumb-size">
+    <div class="bx-def-unit-img bx-def-__size__ bx-def-__size__-size">
         <a class="bx-def-font-align-center" href="__content_url__">
         <a class="bx-def-font-align-center" href="__content_url__">
-            <p class="bx-account-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
+            <p class="bx-account-unit-thumb bx-def-__size__ bx-def-__size__-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
         </a>
         </a>
         <bx_if:show_online>
         <bx_if:show_online>
             <div class="bx-account-unit-online"></div>
             <div class="bx-account-unit-online"></div>
         </bx_if:show_online>
         </bx_if:show_online>
     </div>
     </div>
-    <div class="bx-def-unit-info bx-def-thumb-size-min-height bx-def-thumb-size-max-height bx-def-thumb-size-left-indent">
+    <div class="bx-def-unit-info bx-def-__size__-size-min-height bx-def-__size__-size-max-height bx-def-__size__-size-left-indent">
         <div class="bx-def-unit-info-cnt bx-def-box-sizing">
         <div class="bx-def-unit-info-cnt bx-def-box-sizing">
             <div class="bx-def-unit-line">
             <div class="bx-def-unit-line">
                 <a class="bx-def-unit-info-title" href="__content_url__">__title__</a>
                 <a class="bx-def-unit-info-title" href="__content_url__">__title__</a>

+ 3 - 3
template/account_unit_wo_info.html

@@ -1,7 +1,7 @@
-<div class="bx-account-unit-wo-info bx-def-thumb-size bx-def-font-align-center">
-    <div class="bx-def-unit-img bx-def-thumb-size">
+<div class="bx-account-unit-wo-info bx-def-__size__-size bx-def-font-align-center">
+    <div class="bx-def-unit-img bx-def-__size__-size">
         <a class="bx-def-font-align-center" href="__content_url__">
         <a class="bx-def-font-align-center" href="__content_url__">
-            <p class="bx-account-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
+            <p class="bx-account-unit-thumb bx-def-__size__ bx-def-__size__-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
         </a>
         </a>
         <bx_if:show_online>
         <bx_if:show_online>
             <div class="bx-account-unit-online"></div>
             <div class="bx-account-unit-online"></div>

+ 3 - 3
template/account_unit_wo_info_links.html

@@ -1,6 +1,6 @@
-<div class="bx-account-unit-wo-info bx-def-thumb-size bx-def-font-align-center">
-    <div class="bx-def-unit-img bx-def-thumb-size">
-        <p class="bx-account-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
+<div class="bx-account-unit-wo-info bx-def-__size__-size bx-def-font-align-center">
+    <div class="bx-def-unit-img bx-def-__size__-size">
+        <p class="bx-account-unit-thumb bx-def-__size__ bx-def-__size__-size bx-def-border bx-def-box-sizing" style="background-color:rgba(__color__)">__letter__</p>
         <bx_if:show_online>
         <bx_if:show_online>
             <div class="bx-account-unit-online"></div>
             <div class="bx-account-unit-online"></div>
         </bx_if:show_online>
         </bx_if:show_online>

+ 14 - 0
template/css/general.css

@@ -195,6 +195,10 @@ p.bx-account-unit-thumb {
     display: block;
     display: block;
     margin: 0px;
     margin: 0px;
 
 
+    background: #ffffff;
+    background-clip: padding-box;
+    box-shadow: inset 0px 0px 4px rgba(0, 0, 0, 0.2);
+
     line-height: 46px;
     line-height: 46px;
     line-height: 2.9rem;
     line-height: 2.9rem;
 
 
@@ -203,6 +207,16 @@ p.bx-account-unit-thumb {
     font-weight: 700;
     font-weight: 700;
     color: #d0d0d0;
     color: #d0d0d0;
 }
 }
+p.bx-account-unit-thumb.bx-def-icon-size {
+    line-height: 28px;
+    line-height: 1.8125rem;
+    font-size: 24px;
+    font-size: 1.6rem;
+}
+p.bx-account-unit-thumb.bx-def-border {
+    border-width: 2px;
+    border-color: #ffffff;
+}
 div.bx-account-unit-online {
 div.bx-account-unit-online {
     position: absolute;
     position: absolute;
     right: 0;
     right: 0;